/**
 * Creative Living Fabrics
 *
 * Every rule is scoped under .clf-scope so nothing leaks into the theme or
 * Elementor. Colour tokens are injected from plugin settings.
 */

.clf-scope {
	--clf-accent: #BE9661;
	--clf-cta: #075E54;
	--clf-dark: #111111;
	--clf-grey: #666666;
	--clf-line: #ECECEC;
	--clf-surface: #FFFFFF;
	--clf-radius: 18px;
	--clf-gap: 24px;
}

.clf-scope *,
.clf-scope *::before,
.clf-scope *::after {
	box-sizing: border-box;
}

.clf-container {
	max-width: 1400px;
	margin-inline: auto;
	padding: 20px;
}

.clf-scope .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.clf-scope a:focus-visible,
.clf-scope button:focus-visible {
	outline: 3px solid var(--clf-accent);
	outline-offset: 3px;
}

/*
 * Some themes paint a solid background (and border) on every <button>, which
 * bleeds through as a coloured block over our transparent gallery overlay and
 * thumbnail buttons. Re-assert transparency with !important so the plugin
 * renders correctly regardless of the active theme.
 */
.clf-scope .clf-zoom-trigger,
.clf-scope .clf-thumb,
.clf-scope .clf-lightbox-close {
	background: transparent !important;
	box-shadow: none !important;
}

.clf-scope .clf-zoom-trigger {
	border: 0 !important;
}

/*
 * The same themes also force padding, a border and border-radius onto every
 * button, which stretches the thumbnails (huge side padding), squares off the
 * corners and pushes the row wide enough to trigger a scrollbar. Pin our own
 * geometry so the thumbnails stay compact, evenly spaced and square-cornered.
 */
.clf-scope .clf-thumb {
	padding: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	line-height: 0 !important;
	border: 2px solid transparent !important;
	border-radius: 12px !important;
}

.clf-scope .clf-thumb.is-active {
	border-color: var(--clf-accent) !important;
}

/* -------------------------------------------------- Breadcrumb */

.clf-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
	font-size: 14px;
	color: var(--clf-grey);
}

.clf-breadcrumb a {
	color: var(--clf-grey);
	text-decoration: none;
}

.clf-breadcrumb a:hover {
	color: var(--clf-accent);
}

/* -------------------------------------------------- Single layout */

.clf-single-grid {
	display: grid;
	/* Cap the gallery so the taller image column does not leave a large empty
	   gap beside the shorter details column. Details takes the remaining width. */
	grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
	gap: 56px;
	align-items: start;
}

/* -------------------------------------------------- Gallery */

.clf-gallery {
	width: 100%;
	min-width: 0;
}

.clf-main-image {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 20px;
	overflow: hidden;
	background: var(--clf-surface);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.clf-main-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.clf-zoom-trigger {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
}

/* Magnifier lens, created by the script only on pointer-capable devices. */
.clf-zoom-lens {
	position: absolute;
	width: 180px;
	height: 180px;
	border-radius: 50%;
	pointer-events: none;
	background-repeat: no-repeat;
	background-size: 650%;
	border: 2px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
	display: none;
	z-index: 5;
}

.clf-thumbs-scroll {
	margin-top: 20px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.clf-thumbs {
	display: flex;
	gap: 14px;
	margin: 0;
	padding: 0 0 6px;
	list-style: none;
	width: max-content;
}

.clf-thumb {
	display: block;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 12px;
	background: none;
	cursor: pointer;
	overflow: hidden;
	transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
	opacity: 0.7;
}

.clf-thumb img {
	display: block;
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 10px;
}

.clf-thumb:hover,
.clf-thumb:focus-visible {
	opacity: 1;
	transform: translateY(-4px);
}

.clf-thumb.is-active {
	opacity: 1;
	border-color: var(--clf-accent);
}

/* -------------------------------------------------- Details */

.clf-details {
	width: 100%;
	min-width: 0;
}

.clf-title {
	/* Fluid so long titles do not blow up to several lines. Scales with the
	   viewport between 22px and 32px instead of a fixed 42px. */
	font-size: clamp(22px, 1.6vw + 12px, 32px);
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--clf-dark);
	text-wrap: balance;
}

.clf-subtitle-accent {
	color: var(--clf-accent);
	font-weight: 700;
	margin: 0 0 16px;
}

.clf-intro,
.clf-description {
	font-size: 16px;
	line-height: 1.8;
	color: var(--clf-grey);
	margin: 0 0 20px;
}

.clf-description :last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------- Specs */

.clf-specs {
	margin: 0 0 40px;
	padding: 0;
}

.clf-spec-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid #DDDDDD;
	font-size: 15px;
}

.clf-spec-row dt {
	font-weight: 700;
	color: var(--clf-dark);
	margin: 0;
}

.clf-spec-row dt::after {
	content: ":";
}

.clf-spec-row dd {
	margin: 0;
	color: var(--clf-grey);
}

/* -------------------------------------------------- CTA */

.clf-cta-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
}

.clf-cta-button {
	display: inline-block;
	background: var(--clf-cta);
	color: #FFFFFF;
	padding: 16px 36px;
	border: 1px solid transparent;
	border-radius: 50px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	transition: background 0.3s ease, transform 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.clf-cta-button:hover,
.clf-cta-button:focus-visible {
	background: var(--clf-accent);
	color: #FFFFFF;
	transform: translateY(-2px);
}

.clf-cta-arrow {
	margin-left: 8px;
}

/* Secondary "Enquire" button: outlined, links to the contact page. */
.clf-cta-secondary {
	background: transparent;
	color: var(--clf-dark);
	border-color: #D6D6D6;
}

.clf-cta-secondary:hover,
.clf-cta-secondary:focus-visible {
	background: var(--clf-accent);
	color: #FFFFFF;
	border-color: var(--clf-accent);
}

.clf-cta-note {
	font-size: 13px;
	margin: 12px 0 0;
	color: var(--clf-grey);
}

/* -------------------------------------------------- Lightbox */

.clf-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.clf-lightbox[hidden] {
	display: none;
}

.clf-lightbox img {
	max-width: 90%;
	max-height: 90%;
	border-radius: 12px;
}

.clf-lightbox-close {
	position: absolute;
	top: 24px;
	right: 32px;
	width: 48px;
	height: 48px;
	font-size: 36px;
	line-height: 1;
	color: #FFFFFF;
	background: transparent;
	border: 0;
	cursor: pointer;
}

/* -------------------------------------------------- Features */

.clf-features {
	margin-top: 40px;
	padding: 20px 0 0;
	border-top: 1px solid var(--clf-line);
}

.clf-features-heading {
	/* The original rule was font-size: px, which browsers discard silently. */
	font-size: 30px;
	font-weight: 300;
	letter-spacing: 10px;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--clf-dark);
	margin: 0 0 38px;
}

.clf-feature-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--clf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.clf-feature-item {
	display: flex;
	align-items: flex-start;
	gap: 22px;
	padding: 30px;
	border-radius: var(--clf-radius);
	background: linear-gradient(180deg, #FAFAFA 0%, #F5F5F5 100%);
	border: 1px solid var(--clf-line);
	transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.clf-feature-item:hover {
	transform: translateY(-6px);
	border-color: var(--clf-accent);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
}

.clf-feature-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	min-width: 68px;
	border-radius: var(--clf-radius);
	background: var(--clf-surface);
	border: 1px solid var(--clf-line);
}

.clf-feature-icon img {
	width: 34px;
	height: 34px;
	object-fit: contain;
}

.clf-feature-content strong {
	display: block;
	font-size: 20px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--clf-dark);
	margin-bottom: 10px;
}

.clf-feature-content span {
	display: block;
	font-size: 15px;
	line-height: 1.9;
	color: var(--clf-grey);
}

/* -------------------------------------------------- Archive */

.clf-archive-title {
	font-size: 38px;
	margin: 0 0 12px;
	color: var(--clf-dark);
}

.clf-archive-description {
	color: var(--clf-grey);
	max-width: 820px;
	margin: 0 auto 40px;
	text-align: center;
}

.clf-archive-layout {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.clf-tabs ul {
	margin: 0;
	padding: 0;
	list-style: none;
	background: var(--clf-surface);
	border: 1px solid var(--clf-line);
	border-radius: 4px;
	position: sticky;
	top: 100px;
}

.clf-tab {
	display: block;
	padding: 22px 24px;
	font-size: 15px;
	letter-spacing: 2px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--clf-dark);
	border-bottom: 1px solid var(--clf-line);
	transition: color 0.3s ease, background 0.3s ease;
}

.clf-tabs li:last-child .clf-tab {
	border-bottom: 0;
}

.clf-tab:hover,
.clf-tab.is-active {
	color: var(--clf-accent);
}

.clf-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--clf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.clf-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
	border-radius: var(--clf-radius);
	overflow: hidden;
	background: var(--clf-surface);
	border: 1px solid var(--clf-line);
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.clf-card-link:hover {
	transform: translateY(-6px);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.clf-card-media {
	display: block;
	aspect-ratio: 1 / 1;
	background: #F5F5F5;
}

.clf-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.clf-card-body {
	display: block;
	padding: 18px 20px 22px;
}

.clf-card-title {
	display: block;
	font-size: 18px;
	color: var(--clf-dark);
	margin-bottom: 4px;
}

.clf-card-sub {
	display: block;
	font-size: 14px;
	color: var(--clf-accent);
}

.clf-empty {
	color: var(--clf-grey);
	padding: 40px 0;
}

.clf-scope .clf-pagination {
	margin-top: 40px;
}

/* -------------------------------------------------- Category tiles */

.clf-categories {
	display: grid;
	grid-template-columns: repeat(var(--clf-cols, 3), minmax(0, 1fr));
	gap: var(--clf-gap);
}

.clf-cat-tile {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: var(--clf-radius);
	overflow: hidden;
	text-decoration: none;
	background: #EDEDED;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
}

.clf-cat-media {
	position: absolute;
	inset: 0;
	display: block;
}

.clf-cat-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.clf-cat-tile:hover .clf-cat-media img,
.clf-cat-tile:focus-visible .clf-cat-media img {
	transform: scale(1.06);
}

.clf-cat-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 26px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.68) 100%);
	color: #FFFFFF;
}

.clf-cat-name {
	font-size: 22px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.clf-cat-count {
	margin-top: 6px;
	font-size: 13px;
	letter-spacing: 1px;
	opacity: 0.85;
}

@media (max-width: 900px) {

	.clf-categories {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}

	.clf-cat-name {
		font-size: 18px;
	}
}

@media (max-width: 560px) {

	.clf-categories {
		grid-template-columns: 1fr;
	}
}

/* -------------------------------------------------- 1024px */

@media (max-width: 1024px) {

	.clf-single-grid {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.clf-archive-layout {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	/* Tabs become a horizontal strip above the grid. */
	.clf-tabs ul {
		position: static;
		display: flex;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.clf-tab {
		white-space: nowrap;
		padding: 16px 20px;
		border-bottom: 0;
		border-right: 1px solid var(--clf-line);
	}

	.clf-tabs li:last-child .clf-tab {
		border-right: 0;
	}
}

/* -------------------------------------------------- 900px */

@media (max-width: 900px) {

	.clf-container {
		padding: 16px 14px;
	}

	.clf-single-grid {
		gap: 28px;
	}

	.clf-main-image {
		border-radius: 16px;
	}

	/* The magnifier is pointer-only and never shown on touch. */
	.clf-zoom-lens {
		display: none !important;
	}

	.clf-zoom-trigger {
		cursor: pointer;
	}

	.clf-thumbs-scroll {
		margin-top: 12px;
	}

	.clf-thumbs {
		gap: 10px;
	}

	.clf-thumb img {
		width: 62px;
		height: 62px;
	}

	.clf-thumb {
		flex-shrink: 0;
	}

	.clf-intro,
	.clf-description {
		font-size: 14px;
		line-height: 1.7;
	}

	.clf-cta-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.clf-cta-button {
		display: block;
		width: 100%;
		text-align: center;
		padding: 14px 20px;
	}

	.clf-cta-note {
		text-align: center;
	}

	.clf-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.clf-feature-grid {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.clf-features-heading {
		font-size: 24px;
		letter-spacing: 5px;
		margin-bottom: 26px;
	}

	.clf-feature-item {
		gap: 16px;
		padding: 22px;
		border-radius: 14px;
	}

	.clf-feature-icon {
		width: 56px;
		height: 56px;
		min-width: 56px;
		border-radius: 14px;
	}

	.clf-feature-content strong {
		font-size: 17px;
	}

	.clf-feature-content span {
		font-size: 14px;
		line-height: 1.8;
	}
}

/* -------------------------------------------------- 480px */

@media (max-width: 480px) {

	/*
	 * The previous stylesheet set these to width: 80%, which left the gallery
	 * and copy inset from the page edge on small screens. Full width is correct.
	 */
	.clf-main-image,
	.clf-thumbs-scroll,
	.clf-details {
		width: 100%;
	}

	.clf-main-image {
		border-radius: 14px;
	}

	.clf-thumb img {
		width: 56px;
		height: 56px;
	}

	.clf-card-grid {
		grid-template-columns: 1fr;
	}
}

/* -------------------------------------------------- Motion */

@media (prefers-reduced-motion: reduce) {

	.clf-scope *,
	.clf-scope *::before,
	.clf-scope *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}

	.clf-feature-item:hover,
	.clf-card-link:hover,
	.clf-thumb:hover,
	.clf-cta-button:hover {
		transform: none;
	}
}
