/**
 * An Nam: tokens, type, layout and shared components.
 *
 * Breakpoints match Elementor's defaults: tablet <= 1024px, mobile <= 767px.
 * Figma frames: desktop 1440, tablet 834, mobile 390.
 * The Figma file has no local styles or variables (its text styles come from a library the
 * plugin cannot read); every token below was read from the frames (PLAN.md B4.1f). Sizes the
 * design writes without a text style are tokens too, as drawn (B4 Q12).
 * Section styles live in assets/css/parts/<widget>.css and use these tokens. Hover and motion
 * are not in the frames: the resting state here is the Figma one; Step 4 adds the movement.
 */

/* ------------------------------------------------------------------ */
/* Tokens                                                             */
/* ------------------------------------------------------------------ */

/*
 * Colours and fonts follow Elementor's global colours and fonts (Site Settings), so changing
 * them in Elementor restyles every section. Elementor prints those variables on the kit class
 * of <body>, so these tokens are declared on body; the hex values are the Figma colours, used
 * when Elementor is off or a global is missing. The demo importer writes the same values into
 * the kit: system colours primary/secondary/text/accent and the custom colours below.
 */
body {
	--an-c-ink: var(--e-global-color-primary, #173b32);              /* text, logo, links; footer; overlay base */
	--an-c-muted: var(--e-global-color-secondary, #455d4f);          /* secondary text, labels, captions, hairlines */
	--an-c-text: var(--e-global-color-text, #173b32);                /* body text */
	--an-c-cream: var(--e-global-color-accent, #f4e9d8);             /* page and most sections, fields; text on dark */
	--an-c-sand: var(--e-global-color-ansand, #e9d8bb);              /* alternate sections, people cards, tables */
	--an-c-line: var(--e-global-color-anline, #cccaba);              /* figure rules, dish rows, timeline rows */
	--an-c-red: var(--e-global-color-anred, #9d2e26);                /* primary buttons, selected chips; error text */
	--an-c-error-line: var(--e-global-color-anerror, #b3342c);       /* error borders */
	--an-c-input-line: var(--e-global-color-aninputline, #596e61);   /* field borders */

	/* Headings, figures, dish names: Elementor "Primary" font; text: Elementor "Text" font. */
	--an-serif: var(--e-global-typography-primary-font-family, "Newsreader"), Georgia, "Times New Roman", serif;
	--an-sans: var(--e-global-typography-text-font-family, "Be Vietnam Pro"), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root {
	/* "Overlay · flat N%" on photos (#0f1f1a; Hero 40%, Band and Story header 38%, Menu header 42%). */
	--an-overlay-rgb: 15 31 26;
	--an-overlay: rgb(var(--an-overlay-rgb) / 0.4);

	--an-max: 1200px;
	--an-gutter: 120px;
	--an-section-pad: 80px;
	--an-radius: 12px;
	--an-radius-bar: 16px;
	--an-radius-control: 8px;
	--an-button: 40px;
	--an-control: 48px;

	/* Text styles (library, px): display 64/70, h1 52/58, h2 40/48, h3 28/34, body-lg 18/28,
	   body 16/24, small 14/20, label 12/16, button Medium 15/24. */
	--an-fs-display: 64px;
	--an-lh-display: 70px;
	--an-fs-h1: 52px;
	--an-lh-h1: 58px;
	--an-fs-h2: 40px;
	--an-lh-h2: 48px;
	--an-fs-h3: 28px;
	--an-lh-h3: 34px;
	--an-fs-body-lg: 18px;
	--an-lh-body-lg: 28px;
	--an-fs-body: 16px;
	--an-lh-body: 24px;
	--an-fs-small: 14px;
	--an-lh-small: 20px;
	--an-fs-label: 12px;
	--an-lh-label: 16px;
	--an-fs-button: 15px;
	--an-lh-button: 24px;

	/* Sizes the design writes without a text style (B4 Q12): line-heights as drawn. */
	--an-lh-tight: 1.1;   /* Newsreader titles: page titles, menu groups and dishes, steps */
	--an-lh-text: 1.5;    /* Be Vietnam Pro 20, 17, 15, 13, 12, 11 */
	--an-fs-faq: 22px;    /* FAQ question, 22 / 125% */
	--an-lh-faq: 1.25;
	--an-fs-faq-answer: 17px;
}

/* Between the frames: keep the 1200 container while it fits, with tablet gutters. */
@media (max-width: 1439px) {
	:root {
		--an-gutter: 32px;
	}
}

/* Tablet: the 834 frames. */
@media (max-width: 1024px) {
	:root {
		--an-section-pad: 56px;
	}
}

/* Phone: the 390 frames. */
@media (max-width: 767px) {
	:root {
		--an-gutter: 20px;
		--an-section-pad: 32px;
	}
}

/* Palettes: cream (#f4e9d8), sand (#e9d8bb), ink (dark). Elementor colour controls override them per widget. */
.an--cream,
.an--sand,
.an--ink {
	--an-heading: var(--an-c-ink);
	--an-text: var(--an-c-text);
	--an-muted: var(--an-c-muted);
	--an-line: var(--an-c-line);
	--an-accent: var(--an-c-red);
	--an-on-accent: var(--an-c-cream);
}

.an--cream {
	--an-bg: var(--an-c-cream);
}

.an--sand {
	--an-bg: var(--an-c-sand);
}

.an--ink {
	--an-bg: var(--an-c-ink);
	--an-heading: var(--an-c-cream);
	--an-text: var(--an-c-cream);
	--an-muted: var(--an-c-cream);
}

/* ------------------------------------------------------------------ */
/* Base                                                               */
/* ------------------------------------------------------------------ */

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

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

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

body {
	margin: 0;
	background: var(--an-c-cream);
	color: var(--an-c-text);
	font-family: var(--an-sans);
	font-size: var(--an-fs-body);
	line-height: var(--an-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

a {
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--an-c-ink);
	outline-offset: 2px;
}

.an--ink :focus-visible {
	outline-color: var(--an-c-cream);
}

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

.an-skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 1000;
	padding: 8px 16px;
	border-radius: var(--an-radius-control);
	background: var(--an-c-red);
	color: var(--an-c-cream);
	text-decoration: none;
}

.an-skip-link:focus {
	top: 16px;
}

/* A section rendered by an An Nam widget. */
.an {
	/* Reset, so a section placed inside a narrow column (e.g. inside a post) keeps its 1200 container. */
	--an-max: 1200px;
	position: relative;
	background: var(--an-bg);
	color: var(--an-text);
	font-family: var(--an-sans);
	font-size: var(--an-fs-body);
	line-height: var(--an-lh-body);
}

/* Zero specificity, so a section's own margins (".an-heading__text { margin-top }") always win. */
:where(.an) :where(h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd) {
	margin: 0;
}

:where(.an) :where(ul, ol) {
	list-style: none;
	padding: 0;
}

/* Vertical rhythm (Figma section padding 80 / 56 / 32): Elementor "Padding" controls override it. */
.an-pad {
	padding-top: var(--an-pad-t, var(--an-section-pad));
	padding-bottom: var(--an-pad-b, var(--an-section-pad));
}

.an-container {
	width: min(var(--an-max), 100% - 2 * var(--an-gutter));
	margin-inline: auto;
}

/* Text measure of the plain-page templates (not in Figma: 8 of 12 columns). */
.an-container--narrow {
	--an-max: 792px;
}

/* Dark photo overlay (hero, band, page headers): put it inside the photo's positioned wrapper. */
.an-overlay {
	position: absolute;
	inset: 0;
	/* Sections set --an-overlay-opacity (Hero 40%, Band and Story header 38%, Menu header 42%);
	   an Elementor slider writes the same variable ("--an-overlay-opacity: {{SIZE}}%"). */
	background: rgb(var(--an-overlay-rgb) / var(--an-overlay-opacity, 0.4));
	pointer-events: none;
}

/* Full-bleed photo filling its positioned wrapper. */
.an-cover,
.an .an-cover {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* ------------------------------------------------------------------ */
/* Type                                                               */
/* ------------------------------------------------------------------ */

/* Newsreader at the optical size the design uses (opsz 18). */
.an-display,
.an-h1,
.an-h2,
.an-h3,
.an-serif {
	font-family: var(--an-serif);
	font-weight: 400;
	font-variation-settings: "opsz" 18;
	color: var(--an-heading, var(--an-c-ink));
	letter-spacing: 0;
}

.an-display {
	font-size: var(--an-fs-display);
	line-height: var(--an-lh-display);
}

.an-h1 {
	font-size: var(--an-fs-h1);
	line-height: var(--an-lh-h1);
}

.an-h2 {
	font-size: var(--an-fs-h2);
	line-height: var(--an-lh-h2);
}

.an-h3 {
	font-size: var(--an-fs-h3);
	line-height: var(--an-lh-h3);
}

.an-body-lg {
	font-size: var(--an-fs-body-lg);
	line-height: var(--an-lh-body-lg);
}

.an-body {
	font-size: var(--an-fs-body);
	line-height: var(--an-lh-body);
}

.an-small {
	font-size: var(--an-fs-small);
	line-height: var(--an-lh-small);
}

/* Section labels ("Family trays", "THE ROOM"): written as the copy writes them. */
.an-label {
	font-family: var(--an-sans);
	font-size: var(--an-fs-label);
	line-height: var(--an-lh-label);
	font-weight: 400;
}

.an-muted {
	color: var(--an-muted, var(--an-c-muted));
}

.an-eyebrow {
	color: var(--an-muted);
}

/* Section heading: label, 16 under it the title (h2 40/48), 16 under it a body-lg line, muted. */
.an-heading .an-eyebrow {
	margin-bottom: 16px;
}

.an-heading__text {
	margin-top: 16px;
	color: var(--an-muted);
}

/* ------------------------------------------------------------------ */
/* Buttons and links                                                  */
/* ------------------------------------------------------------------ */

/* Figma "Action / …", "AN NAM/Button": 40 high, padding 8 16, radius 8, Medium 15/24, as wide as
   the label (390: full column, set by the section). No hover state in the design. */
.an-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: var(--an-button);
	padding: 8px 16px;
	border: 1px solid transparent;
	border-radius: var(--an-radius-control);
	font-family: var(--an-sans);
	font-size: var(--an-fs-button);
	line-height: var(--an-lh-button);
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

/* Primary: red, cream text. */
.an .an-btn--primary,
.an-btn--primary {
	background: var(--an-accent, var(--an-c-red));
	color: var(--an-on-accent, var(--an-c-cream));
}

/* Outline (phone menu, "Use example details"): ink rule and text, no fill; cream on dark. */
.an .an-btn--outline,
.an-btn--outline {
	background: transparent;
	border-color: var(--an-heading, var(--an-c-ink));
	color: var(--an-heading, var(--an-c-ink));
}

.an-btn--block {
	width: 100%;
}

/* Figma "Link / …": underlined, ink, 16/24 in content; 44px tall hit area. */
.an .an-link,
.an-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--an-heading, var(--an-c-ink));
	font-size: var(--an-fs-body);
	line-height: var(--an-lh-body);
	font-weight: 400;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.an-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

/* ------------------------------------------------------------------ */
/* Form fields (reservation, newsletter)                              */
/* ------------------------------------------------------------------ */

/* Field: label 13 / 150% ink, 8 above the control; error line 12 / 150% red, 8 under it. */
.an-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.an-field__label {
	color: var(--an-c-ink);
	font-size: 13px;
	line-height: var(--an-lh-text);
}

/* Figma "AN NAM/Input": 48 high, cream, field line, radius 8, padding 0 16, body 16/24. */
.an-input {
	width: 100%;
	min-height: var(--an-control);
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--an-c-input-line);
	border-radius: var(--an-radius-control);
	background: var(--an-c-cream);
	color: var(--an-c-ink);
	font-family: var(--an-sans);
	font-size: var(--an-fs-body);
	line-height: var(--an-lh-body);
}

/* Figma "AN NAM/Input · multiline": 112 high, padding 12 16. */
textarea.an-input {
	min-height: 112px;
	padding: 12px 16px;
	resize: vertical;
}

/* Placeholder: ink at 45%. */
.an-input::placeholder {
	color: rgb(23 59 50 / 0.45);
	opacity: 1;
}

.an-input:focus {
	outline: 0;
	border-color: var(--an-c-ink);
}

.an-input[aria-invalid="true"] {
	border-color: var(--an-c-error-line);
}

.an-field__error {
	color: var(--an-c-red);
	font-size: var(--an-fs-label);
	line-height: var(--an-lh-text);
}

/* Error summary at the top of a form: error line, radius 8, padding 16 20; first line 16 / 150%
   ink, the lines under it 12 / 150% red, 8 apart. */
.an-error-summary {
	padding: 16px 20px;
	border: 1px solid var(--an-c-error-line);
	border-radius: var(--an-radius-control);
	color: var(--an-c-ink);
	font-size: var(--an-fs-body);
	line-height: var(--an-lh-text);
}

.an-error-summary ul,
.an-error-summary p + p {
	margin-top: 8px;
	color: var(--an-c-red);
	font-size: var(--an-fs-label);
}

/* Chips (party size, date, time): 48 high, padding 0 16, radius 8, Medium 15/24.
   Default: ink 40% rule; selected: red; full: ink 15% rule, ink 45% text. */
.an-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--an-control);
	padding: 0 16px;
	border: 1px solid rgb(23 59 50 / 0.4);
	border-radius: var(--an-radius-control);
	background: transparent;
	color: var(--an-c-ink);
	font-family: var(--an-sans);
	font-size: var(--an-fs-button);
	line-height: var(--an-lh-button);
	font-weight: 500;
	cursor: pointer;
}

.an-chip.is-selected,
.an-chip[aria-pressed="true"],
input:checked + .an-chip {
	border-color: var(--an-c-red);
	background: var(--an-c-red);
	color: var(--an-c-cream);
}

.an-chip.is-full,
.an-chip:disabled,
input:disabled + .an-chip {
	border-color: rgb(23 59 50 / 0.15);
	background: transparent;
	color: rgb(23 59 50 / 0.45);
}

input:focus-visible + .an-chip {
	outline: 2px solid var(--an-c-ink);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* FAQ accordion (Figma "FaqItem")                                    */
/* ------------------------------------------------------------------ */

/* Row: muted 50% rule, padding 20 0; question Newsreader 22 / 125%; plus 24 (open: minus,
   B4 Q5c); answer 17 / 150% muted. */
.an-faq__item {
	border-top: 1px solid rgb(69 93 79 / 0.5);
}

.an-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 20px 0;
	list-style: none;
	cursor: pointer;
}

.an-faq__q::-webkit-details-marker {
	display: none;
}

.an-faq__question {
	color: var(--an-heading);
	font-family: var(--an-serif);
	font-variation-settings: "opsz" 18;
	font-size: var(--an-fs-faq);
	line-height: var(--an-lh-faq);
}

.an-faq__icon {
	flex: none;
	color: var(--an-heading);
}

.an-faq__icon--close,
.an-faq__item[open] .an-faq__icon--open {
	display: none;
}

.an-faq__item[open] .an-faq__icon--close {
	display: block;
}

.an-faq__a {
	padding-bottom: 20px;
	color: var(--an-muted);
	font-size: var(--an-fs-faq-answer);
	line-height: var(--an-lh-text);
}

.an-faq__a p + p {
	margin-top: 12px;
}

/* ------------------------------------------------------------------ */
/* Photos with captions                                               */
/* ------------------------------------------------------------------ */

.an-figure {
	margin: 0;
	min-width: 0;
}

/* Photos: radius 12 (hero, band, page photo and the reservation photo are square, set there). */
.an-figure__media {
	overflow: hidden;
	border-radius: var(--an-radius);
	background: var(--an-c-sand);
}

/* Focal point of a cropped photo: an_media_image() prints it as --an-focus and, when phones crop
   it differently, --an-focus-phone. */
img[style*="--an-focus"] {
	object-position: var(--an-focus, 50% 50%);
}

@media (max-width: 767px) {
	img[style*="--an-focus"] {
		object-position: var(--an-focus-phone, var(--an-focus, 50% 50%));
	}
}

.an-figure--square .an-figure__media {
	border-radius: 0;
}

.an .an-figure__media img,
.an-figure__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* Caption: small 14/20 muted, 12 under the photo. */
.an-figure__caption {
	margin-top: 12px;
	color: var(--an-muted);
	font-size: var(--an-fs-small);
	line-height: var(--an-lh-small);
}

/* Horizontal scroll rows (where the design scrolls). */
.an-scroll {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--an-gutter);
	scrollbar-width: none;
}

.an-scroll::-webkit-scrollbar {
	display: none;
}

.an-scroll > * {
	flex: none;
	scroll-snap-align: start;
}

/* Bleeds a scroll row to the viewport edge while its first item lines up with the container. */
.an-bleed {
	margin-inline: calc(-1 * var(--an-gutter));
	padding-inline: var(--an-gutter);
}

/* ------------------------------------------------------------------ */
/* Elementor integration                                              */
/* ------------------------------------------------------------------ */

/* An Nam widgets bring their own spacing; remove wrapper gaps around them. */
.elementor-widget[class*="elementor-widget-an-"],
.elementor-widget[class*="elementor-widget-an-"] > .elementor-widget-container {
	margin: 0;
	padding: 0;
}
