/**
 * Casa Noce content pages: policy pages, the generic page, single posts,
 * and the 404.
 */

/* ------------------------------------------------------- generic page -- */

.cn-page__title {
	margin: 0 0 24px;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(32px, 3.33vw, 48px);
	font-weight: 400;
	letter-spacing: -0.01em;
	line-height: 1.1;
}

.cn-page__feature {
	margin: 0 0 32px;
}

.cn-page__feature img {
	width: 100%;
	border-radius: 0;
}

.cn-post__meta {
	gap: 16px;
	margin-bottom: 28px;
	color: var(--wp--preset--color--ink-muted);
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.cn-post__nav {
	margin-top: 56px;
	padding-top: 24px;
	border-top: var(--cn-rule);
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* --------------------------------------------------------- policy page - */

/* Policy copy wants a narrow, readable measure. The header spans the page,
   the body is capped so lines never run past a comfortable length. */
.cn-policy {
	padding-bottom: var(--wp--preset--spacing--80);
}

.cn-policy__head {
	padding: 64px var(--cn-gutter) 0;
	margin-bottom: 40px;
	border-bottom: var(--cn-rule);
}

.cn-policy__head > * {
	max-width: 720px;
	margin-inline: auto;
}

.cn-policy__title {
	margin: 0 0 12px;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(32px, 3.61vw, 52px);
	font-weight: 400;
	letter-spacing: -0.01em;
	line-height: 1.1;
}

.cn-policy__updated {
	margin: 0 0 40px;
}

.cn-policy__body {
	max-width: 720px;
	margin-inline: auto;
	padding-inline: var(--cn-gutter);
}

.cn-policy__body > * {
	max-width: 720px;
}

.cn-policy__body h2 {
	margin: 44px 0 14px;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(22px, 2vw, 28px);
	font-weight: 400;
}

.cn-policy__body h3 {
	margin: 32px 0 10px;
	font-size: 18px;
	letter-spacing: 0.02em;
}

.cn-policy__body p {
	margin: 0 0 18px;
	color: var(--wp--preset--color--ink-soft);
	font-size: 16px;
	line-height: 1.7;
}

.cn-policy__body ul,
.cn-policy__body ol {
	margin: 0 0 18px;
	padding-left: 20px;
	color: var(--wp--preset--color--ink-soft);
	line-height: 1.7;
}

.cn-policy__body li {
	margin-bottom: 8px;
}

.cn-policy__body a {
	border-bottom: 1px solid var(--wp--preset--color--honey-brass);
}

.cn-policy__body strong {
	font-weight: 600;
}

/* --------------------------------------------------------- about page -- */

.cn-about__lede {
	max-width: 760px;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(22px, 2.5vw, 30px);
	font-style: italic;
	line-height: 1.4;
}

/* ------------------------------------------------------- contact page -- */

.cn-contact {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 64px;
	align-items: start;
}

.cn-contact__aside address {
	font-style: normal;
	font-size: 16px;
	line-height: 1.8;
}

.cn-contact__aside a {
	border-bottom: 1px solid var(--wp--preset--color--honey-brass);
}

@media (max-width: 1023px) {
	.cn-contact {
		grid-template-columns: 1fr;
		gap: 40px;
	}
}

/* -------------------------------------------------------- themed forms - */

.cn-form__row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 20px;
}

.cn-form__label {
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-muted);
}

.cn-form__opt {
	text-transform: none;
	letter-spacing: 0;
}

.cn-form__input {
	height: 52px;
	padding: 0 16px;
	border: 1px solid var(--wp--preset--color--greige);
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--warm-ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
}

.cn-form__textarea {
	height: auto;
	padding: 14px 16px;
	line-height: 1.6;
	resize: vertical;
}

.cn-form__input:focus {
	outline: var(--cn-focus);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--warm-ink);
}

.cn-form__submit {
	height: 54px;
	padding: 0 34px;
	border: none;
	background: var(--wp--preset--color--honey-brass);
	color: var(--wp--preset--color--ivory);
	font-family: var(--wp--preset--font-family--body);
	font-size: 14px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background var(--cn-ease);
}

.cn-form__submit:hover {
	background: var(--wp--preset--color--brass-deep);
}

/* The honeypot is removed from layout and from assistive tech. */
.cn-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cn-turnstile,
.cn-news__turnstile {
	margin: 18px 0;
}

/* Form notices, in the same flat filled language as the store notices. */
.cn-formnotice {
	margin-bottom: 24px;
	padding: 14px 18px;
	border: var(--cn-rule);
	background: var(--wp--preset--color--oat-deep);
	color: var(--wp--preset--color--warm-ink);
	font-size: 14px;
}

.cn-formnotice--ok {
	border-color: var(--wp--preset--color--muted-olive);
}

.cn-formnotice--error {
	border-color: #9B3D2E;
}

/* ------------------------------------------------------------- 404 ----- */

.cn-404 {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	padding: 96px var(--cn-gutter);
	text-align: center;
}

.cn-404__inner {
	max-width: 520px;
}

.cn-404__code {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(72px, 12vw, 140px);
	font-style: italic;
	line-height: 1;
	color: var(--wp--preset--color--greige);
}

.cn-404__title {
	margin: 8px 0 16px;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(28px, 3vw, 42px);
	font-weight: 400;
}

.cn-404__text {
	margin: 0 0 32px;
	color: var(--wp--preset--color--ink-muted);
	font-size: 16px;
	line-height: 1.6;
}

.cn-404__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
}

.cn-404__cta {
	display: inline-block;
	padding: 16px 34px;
	background: var(--wp--preset--color--honey-brass);
	color: var(--wp--preset--color--ivory);
	font-size: 14px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transition: background var(--cn-ease);
}

.cn-404__cta:hover {
	background: var(--wp--preset--color--brass-deep);
	color: var(--wp--preset--color--ivory);
}

/* ================================================ favourites (saved) ==== */

.cn-favourites {
	min-height: 38vh;
}

/* The empty state is the default; ui.js swaps to loading, then to the grid. */
.cn-favourites__loading,
.cn-favourites__grid {
	display: none;
}

.cn-favourites.is-loading .cn-favourites__empty,
.cn-favourites.is-populated .cn-favourites__empty {
	display: none;
}

.cn-favourites.is-loading .cn-favourites__loading {
	display: block;
	padding: 40px 0;
	color: var(--wp--preset--color--ink-muted);
	text-align: center;
}

.cn-favourites.is-populated .cn-favourites__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: clamp(20px, 2.5vw, 36px);
}

.cn-favourites__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: clamp(32px, 6vw, 72px) 0;
	text-align: center;
}

.cn-favourites__empty-icon svg {
	width: 42px;
	height: 42px;
	fill: none;
	stroke: var(--wp--preset--color--honey-brass);
	stroke-width: 1.4;
}

.cn-favourites__empty-title {
	margin: 20px 0 10px;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 400;
}

.cn-favourites__empty-lead {
	max-width: 42ch;
	margin: 0 0 28px;
	color: var(--wp--preset--color--ink-muted);
	font-size: 16px;
	line-height: 1.6;
}

/* Favourite card. */
.cn-fav-card {
	display: flex;
	flex-direction: column;
}

.cn-fav-card__figure {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--wp--preset--color--oat-shade);
}

.cn-fav-card__media {
	display: block;
	width: 100%;
	height: 100%;
}

.cn-fav-card__name {
	margin-top: 12px;
	color: inherit;
	font-family: var(--wp--preset--font-family--display);
	font-size: 17px;
	line-height: 1.25;
}

.cn-fav-card__price {
	margin-top: 4px;
	color: var(--wp--preset--color--ink-muted);
	font-size: 14px;
}

@media (max-width: 1023px) {
	.cn-favourites.is-populated .cn-favourites__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 640px) {
	.cn-favourites.is-populated .cn-favourites__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}
}

/* ============================================ category / room collection == */

/* The banner reuses .cn-hero (so it inherits the transparent, pin-then-fill
   header) but sits at a category-page height with a centred title.

   It carries the stills' own 1915x821 ratio so the whole frame shows: a wider
   band would have `cover` trim ~18% of the height, which cut the taller pieces
   (the Outdoor pod, the Lighting lamp) off at the top or foot. Bounded so the
   banner cannot swallow a very wide or very short viewport; below ~890px the
   min-height wins and the crop becomes horizontal instead. */
.cn-hero--collection {
	/* Width stays explicit: with `width: auto` the ratio resolves the width from
	   the min-height instead, which blows the banner past the viewport on phones. */
	width: 100%;
	height: auto;
	aspect-ratio: 1915 / 821;
	min-height: 380px;
	max-height: 82vh;
}

/* Scoped to .cn-hero so it outweighs WooCommerce's `.woocommerce img {height:auto}`,
   which otherwise leaves the still at its intrinsic height inside the banner. */
.cn-hero .cn-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Per-category crop. The stills are 2.33:1 and the banner is wider than that,
   so cover trims the height; these shift which band survives for subjects that
   do not sit dead centre. */
.cn-hero--storage .cn-hero__img {
	object-position: 50% 86%;
}

.cn-hero__scrim--center {
	background: linear-gradient(
		180deg,
		rgba(41, 36, 32, 0.5) 0%,
		rgba(41, 36, 32, 0.28) 42%,
		rgba(41, 36, 32, 0.5) 100%
	);
}

/* Vertically centre the title/intro rather than anchoring to the bottom. */
.cn-hero__body--center {
	top: 0;
	bottom: 0;
	justify-content: center;
}

.cn-hero__sub--collection {
	max-width: 60ch;
	margin: 0 auto;
}

/* ------------------------------------------------------------- shell ----- */

.cn-collection {
	position: relative;
	padding: 0 var(--cn-gutter) 96px;
}

.cn-collection__bar {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 26px 0 22px;
	border-bottom: var(--cn-rule);
}

.cn-collection__count {
	margin: 0;
	color: var(--wp--preset--color--ink-muted);
	font-size: 13.5px;
	letter-spacing: 0.03em;
}

.cn-collection__sort {
	margin-left: auto;
}

.cn-collection__sort select {
	height: 44px;
	padding: 0 38px 0 16px;
	border: 1px solid var(--wp--preset--color--warm-ink);
	border-radius: 0;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23292420' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 15px center;
	color: var(--wp--preset--color--warm-ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	appearance: none;
	cursor: pointer;
}

/* Mobile-only trigger for the filter drawer. */
.cn-collection__filter-toggle {
	display: none;
	align-items: center;
	gap: 9px;
	height: 44px;
	padding: 0 18px;
	border: 1px solid var(--wp--preset--color--warm-ink);
	background: transparent;
	color: var(--wp--preset--color--warm-ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
}

.cn-collection__filter-toggle svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
}

.cn-collection__filter-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--wp--preset--color--honey-brass);
	color: var(--wp--preset--color--ivory);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0;
}

.cn-collection__layout {
	display: grid;
	grid-template-columns: 244px minmax(0, 1fr);
	gap: 44px;
	align-items: start;
	padding-top: 34px;
}

/* ------------------------------------------------------------ filters ---- */

.cn-filters {
	position: sticky;
	top: 100px;
	display: flex;
	flex-direction: column;
}

.cn-filters__head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 4px;
}

.cn-filters__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: 20px;
}

.cn-filters__clear {
	margin-left: auto;
	color: var(--wp--preset--color--ink-muted);
	font-size: 12.5px;
	letter-spacing: 0.04em;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.cn-filters__clear:hover {
	color: var(--wp--preset--color--honey-brass);
}

.cn-filters__close {
	display: none;
	margin-left: auto;
	padding: 0 4px;
	border: none;
	background: none;
	color: var(--wp--preset--color--warm-ink);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.cn-filter {
	border-bottom: var(--cn-rule);
}

.cn-filter__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	color: var(--wp--preset--color--warm-ink);
	font-size: 12.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	list-style: none;
	cursor: pointer;
}

.cn-filter__summary::-webkit-details-marker {
	display: none;
}

.cn-filter__chevron {
	width: 9px;
	height: 9px;
	border-right: 1.4px solid var(--wp--preset--color--warm-ink);
	border-bottom: 1.4px solid var(--wp--preset--color--warm-ink);
	transform: rotate(45deg);
	transition: transform var(--cn-ease);
}

.cn-filter[open] .cn-filter__chevron {
	transform: rotate(-135deg);
}

.cn-filter__opts {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 2px 0 20px;
}

.cn-filter__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--wp--preset--color--ink-soft);
	font-size: 14.5px;
	cursor: pointer;
}

.cn-filter__opt input {
	width: 17px;
	height: 17px;
	margin: 0;
	accent-color: var(--wp--preset--color--honey-brass);
	cursor: pointer;
}

.cn-filter__dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid var(--cn-hairline);
	background: var(--cn-swatch, var(--wp--preset--color--greige));
}

.cn-filter__opt-name {
	line-height: 1.2;
}

.cn-filter__price {
	flex-direction: row;
	align-items: center;
	gap: 10px;
}

.cn-filter__price-field {
	display: flex;
	align-items: center;
	flex: 1;
	border: 1px solid var(--wp--preset--color--greige);
}

.cn-filter__price-affix {
	padding-left: 12px;
	color: var(--wp--preset--color--ink-muted);
	font-size: 14px;
}

.cn-filter__price-field input {
	width: 100%;
	height: 42px;
	padding: 0 10px;
	border: none;
	background: transparent;
	color: var(--wp--preset--color--warm-ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 14px;
}

.cn-filter__price-field input:focus {
	outline: none;
}

.cn-filter__price-field:focus-within {
	border-color: var(--wp--preset--color--warm-ink);
}

.cn-filter__price-sep {
	color: var(--wp--preset--color--ink-muted);
}

.cn-filters__foot {
	display: none;
}

.cn-filters__apply {
	width: 100%;
	height: 52px;
	border: none;
	background: var(--wp--preset--color--honey-brass);
	color: var(--wp--preset--color--ivory);
	font-family: var(--wp--preset--font-family--body);
	font-size: 13px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
}

/* --------------------------------------------------------- product grid -- */

.cn-collection__results {
	min-height: 320px;
}

.cn-collection__results.is-loading {
	opacity: 0.45;
	transition: opacity var(--cn-ease);
	pointer-events: none;
}

.cn-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px 24px;
}

.cn-product {
	display: flex;
	flex-direction: column;
}

.cn-product__media {
	position: relative;
	aspect-ratio: 4 / 5;
	background: var(--wp--preset--color--oat-shade);
	overflow: hidden;
}

.cn-product__media > a {
	display: block;
	width: 100%;
	height: 100%;
}

.cn-product__media img,
.cn-product__media .cn-media {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cn-product__name {
	margin: 14px 0 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.25;
}

.cn-product__name a:hover {
	color: var(--wp--preset--color--honey-brass);
}

.cn-product__mat {
	margin-top: 4px;
	color: var(--wp--preset--color--ink-muted);
	font-size: 13px;
}

.cn-product__price {
	margin-top: 5px;
	font-size: 14.5px;
}

.cn-collection__empty {
	padding: 40px 0 60px;
	color: var(--wp--preset--color--ink-muted);
}

.cn-collection__empty-lead {
	margin: 0 0 6px;
	color: var(--wp--preset--color--warm-ink);
	font-family: var(--wp--preset--font-family--display);
	font-size: 22px;
}

/* ---------------------------------------------------------- pagination --- */

.cn-pagination {
	display: flex;
	gap: 8px;
	justify-content: center;
	padding: 56px 0 0;
	font-size: 13px;
	letter-spacing: 0.06em;
}

.cn-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--wp--preset--color--greige);
	color: var(--wp--preset--color--warm-ink);
}

.cn-pagination .page-numbers.current,
.cn-pagination a.page-numbers:hover {
	border-color: var(--wp--preset--color--warm-ink);
	background: var(--wp--preset--color--warm-ink);
	color: var(--wp--preset--color--oat);
}

/* --------------------------------------------------------- 1279 and down - */

@media (max-width: 1279px) {
	.cn-collection__layout {
		grid-template-columns: 216px minmax(0, 1fr);
		gap: 32px;
	}

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

/* --------------------------------------------------- tablet / mobile ----- */

@media (max-width: 1023px) {
	.cn-collection__filter-toggle {
		display: inline-flex;
	}

	.cn-collection__layout {
		display: block;
		padding-top: 22px;
	}

	/* The filter panel becomes an off-canvas drawer. */
	.cn-filters {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 210;
		width: min(86vw, 360px);
		padding: 24px var(--cn-gutter) 96px;
		background: var(--wp--preset--color--oat);
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
		box-shadow: 8px 0 40px rgba(41, 36, 32, 0.16);
	}

	.cn-filters.is-open {
		transform: none;
	}

	.cn-filters__close {
		display: block;
	}

	.cn-filters__foot {
		display: block;
		position: sticky;
		bottom: 0;
		margin: 12px calc(-1 * var(--cn-gutter)) -96px;
		padding: 14px var(--cn-gutter);
		background: var(--wp--preset--color--oat);
		border-top: var(--cn-rule);
	}

	.cn-collection__scrim {
		position: fixed;
		inset: 0;
		z-index: 205;
		background: rgba(41, 36, 32, 0.5);
	}

	.cn-collection__scrim[hidden] {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cn-filters {
		transition: none;
	}
}

@media (max-width: 560px) {
	.cn-grid {
		gap: 22px 14px;
	}

	.cn-product__name {
		margin-top: 10px;
		font-size: 15px;
	}
}
