/**
 * Casa Noce base layer.
 *
 * Tokens, page rhythm, shared primitives and the block style variations
 * registered in inc/block-styles.php.
 */

:root {
	/* The design gutter: 64px at the 1440 frame, 20px at the 390 frame. */
	--cn-gutter: clamp(20px, 4.444vw, 64px);
	--cn-rule: 1px solid var(--wp--preset--color--greige);
	--cn-ease: 0.25s ease;
	--cn-ease-slow: 0.5s ease;
	--cn-focus: 2px solid var(--wp--preset--color--honey-brass);
	--cn-scrim-soft: rgba(41, 36, 32, 0.45);
	--cn-scrim-hard: rgba(41, 36, 32, 0.85);
	--cn-hairline: rgba(41, 36, 32, 0.25);
}

/* ---------------------------------------------------------------- reset */

/* WordPress sets border-box per block rather than globally, so the theme's
   own classes need it declared or padding pushes them past their container. */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: rgba(169, 123, 60, 0.2);
}

img,
video {
	max-width: 100%;
	height: auto;
}

/* Everything focusable gets the same brass ring, once. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--cn-focus);
	outline-offset: 2px;
}

/* ------------------------------------------------------------- utilities */

/* Horizontal page padding that tracks the design frames. */
.cn-pad {
	padding-inline: var(--cn-gutter);
}

/* Visually hidden but read by assistive technology. */
.cn-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Skip link. */
.cn-skip-link {
	position: absolute;
	left: -9999px;
	z-index: 999;
	padding: 12px 20px;
	background: var(--wp--preset--color--warm-ink);
	color: var(--wp--preset--color--oat);
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cn-skip-link:focus {
	left: 12px;
	top: 12px;
}

/* A media frame that crops rather than letterboxes, used everywhere. */
.cn-media,
.cn-media img,
.cn-media video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The oat-shade plate behind every product image, so a missing image still
   reads as an intentional block rather than a hole in the layout. */
.cn-plate {
	position: relative;
	overflow: hidden;
	background: var(--wp--preset--color--oat-shade);
}

.cn-plate > .wp-block-image,
.cn-plate > .wp-block-image img,
.cn-plate > .wp-block-cover {
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

/* An image slot awaiting real photography. Mirrors the export's own
   placeholders: a tinted plate captioned with the shot it is waiting for.
   Remove alongside inc/showcase.php once the catalogue is imported. */
.cn-slot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 16px;
	background: var(--wp--preset--color--oat-shade);
	background-image: linear-gradient(135deg, rgba(41, 36, 32, 0.03) 25%, transparent 25%, transparent 50%, rgba(41, 36, 32, 0.03) 50%, rgba(41, 36, 32, 0.03) 75%, transparent 75%);
	background-size: 16px 16px;
}

.cn-slot__label {
	max-width: 260px;
	color: var(--wp--preset--color--ink-muted);
	font-size: 12px;
	letter-spacing: 0.06em;
	line-height: 1.5;
	text-align: center;
	text-transform: uppercase;
}

/* On a dark scrim the caption needs to lift off the plate. */
.cn-hero .cn-slot,
.cn-band .cn-slot,
.cn-room .cn-slot {
	background-color: #CFC3AA;
}

/* ----------------------------------------------------------- typography */

.cn-eyebrow {
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.22em;
	line-height: 1.4;
	text-transform: uppercase;
}

.cn-meta {
	color: var(--wp--preset--color--ink-muted);
	font-size: 13.5px;
	line-height: 1.5;
}

.cn-label {
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Fraunces italic accents inside headings. The design leans on these, so
   they need to hold weight rather than inherit a synthesised slant. */
.wp-block-heading em,
.wp-block-post-title em,
h1 em, h2 em, h3 em {
	font-style: italic;
	font-weight: inherit;
}

/* --------------------------------------------------- block style: button */

.wp-block-button.is-style-casanoce-outline .wp-block-button__link {
	background: transparent;
	border: 1px solid var(--wp--preset--color--warm-ink);
	color: var(--wp--preset--color--warm-ink);
	padding: 0 20px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	font-size: 13px;
	letter-spacing: 0.06em;
}

.wp-block-button.is-style-casanoce-outline .wp-block-button__link:hover,
.wp-block-button.is-style-casanoce-outline .wp-block-button__link:focus {
	background: var(--wp--preset--color--warm-ink);
	color: var(--wp--preset--color--oat);
}

.wp-block-button.is-style-casanoce-quiet .wp-block-button__link {
	background: var(--cn-scrim-hard);
	color: var(--wp--preset--color--oat);
	font-size: 12px;
}

.wp-block-button.is-style-casanoce-quiet .wp-block-button__link:hover,
.wp-block-button.is-style-casanoce-quiet .wp-block-button__link:focus {
	background: var(--wp--preset--color--warm-ink);
	color: var(--wp--preset--color--oat);
}

/* ------------------------------------------- block style: underline link */

.is-style-casanoce-underline-link a,
a.cn-underline-link {
	display: inline-block;
	border-bottom: 1.5px solid var(--wp--preset--color--honey-brass);
	padding-bottom: 6px;
	font-size: 14px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.is-style-casanoce-underline-link a:hover,
a.cn-underline-link:hover {
	color: var(--wp--preset--color--honey-brass);
}

/* --------------------------------------------- block style: eyebrow text */

.is-style-casanoce-eyebrow {
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

/* ------------------------------------------------------ block style: rail */

.wp-block-group.is-style-casanoce-rail {
	border-top: var(--cn-rule);
	border-bottom: var(--cn-rule);
}

/* -------------------------------------------------------------- animation */

@keyframes cn-fade-up {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes cn-marquee-left {
	to {
		transform: translateX(-50%);
	}
}

@keyframes cn-floaty {
	from {
		transform: translateY(8px);
	}
	to {
		transform: translateY(-14px);
	}
}

@keyframes cn-spin {
	to {
		transform: rotate(360deg);
	}
}

.cn-fade-up {
	animation: cn-fade-up 0.6s ease both;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
