/* Waterford theme glue: bridges core blocks and the design-system components.
   Keep this small. Component styles live in components.css (from the design system). */

/* Custom-markup blocks wrap their output in .wf so component resets stay scoped
   (never put .wf on <body>: its `p { margin: 0 }` would flatten core block spacing). */

/* Headings: balanced wrapping like the design system */
:where(h1, h2, h3, h4) { text-wrap: balance; }

/* Section style variations also set the semantic tokens (see tokens.css),
   so wf-* components inside a styled Group pick up the right ground. */
.is-style-section-stone, .is-style-section-navy, .is-style-section-blue { background: var(--bg); color: var(--ink); }

/* Logo inside core layouts */
.wf-site-logo { display: block; line-height: 0; }
.wf-site-logo .wf-logo { height: 28px; width: auto; }

/* Header and footer template parts hold the site-header / site-info blocks.
   Sticky goes on the part's <header> wrapper (a sticky child of a same-height wrapper never sticks). */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 10; }
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 0px); }
.wp-site-blocks > header.wp-block-template-part .wf-header { position: relative; top: auto; }
.wp-site-blocks > footer.wp-block-template-part { margin-block-start: 0; }
/* Short pages (legal) keep the footer at the bottom of the window */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100dvh; }
.admin-bar .wp-site-blocks { min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); }
.wp-site-blocks > main { flex: 1 0 auto; }
.wf-nav summary, .wf-drawer summary { -webkit-tap-highlight-color: transparent; }

/* Section underline: About Us on History, Whiskey on a whiskey single */
.wf-nav summary.is-current, .wf-nav > ul > li > a.is-current { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.wf-nav details[open] > summary::after { transform: rotate(-135deg); vertical-align: 0; }

/* Mobile drawer: full height under the bar, on the stone ground */
.wf-header__drawer { position: absolute; top: 100%; left: 0; right: 0; overflow-y: auto; background: var(--bg);
  height: calc(100dvh - 64px - var(--wp-admin--admin-bar--height, 0px)); border-top: 1px solid var(--line); }
.wf-drawer__action { margin-top: var(--space-5); }
.wf-drawer-open, .wf-drawer-open body { overflow: hidden; }
@media (min-width: 900px) { .wf-header__drawer { display: none; } }
/* components.css hides `.wf-header__actions .wf-btn` below 900px, which outranks
   `.wf-header__toggle { display: inline-flex }` and hides the Menu button too. */
@media (max-width: 899px) { .wf-header__actions .wf-header__toggle { display: inline-flex; } }

/* Footer */
.wf-footer__brand { display: grid; gap: var(--space-5); align-content: start; }
.wf-footer__brand p { max-width: 300px; }
.wf-responsible a { text-decoration: underline; text-underline-offset: 3px; }
.wf-footer__signup { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-5); border-top: 1px solid var(--line-strong); padding-top: var(--space-6); }
.wf-footer__signup-intro { flex: 1 1 260px; display: grid; gap: var(--space-2); }
.wf-footer__signup-intro h2 { margin: 0; }
.wf-footer__signup-form { flex: 1 1 360px; }

/* ---------- Core blocks in page content (patterns, build-pages) ---------- */

/* Sections: core Columns add a bottom margin that would stack on the section padding */
[class*="is-style-section-"] .wp-block-columns { margin-bottom: 0; }
.wp-block-columns.are-vertically-aligned-bottom { align-items: flex-end; }

/* Section with a rule instead of a ground change (two stone sections in a row) */
.wf-section--ruled.wf-section--ruled { padding-top: 0 !important; }
.wf-section--ruled > :first-child { border-top: 1px solid var(--line); padding-top: var(--wp--preset--spacing--9); }

/* Narrow section (one archive photo at reading width); flush section (full-bleed photo band) */
.wf-section--narrow > * { max-width: var(--width-measure); }
.wf-section--flush .wp-block-image { margin-block: 0; }

/* Legal pages: reading width, aligned with the page header */
.wf-legal > * { max-width: var(--width-measure); }
.wf-section--flush .wp-element-caption { margin-bottom: 0; }

/* Muted captions (Merchant's Note label, image captions) */
.is-style-caption, .wp-element-caption { color: var(--ink-muted); }
.wp-element-caption { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; text-transform: uppercase; text-align: left; margin-top: var(--space-3); }

/* Button: text link with an arrow (design-system .wf-link) */
.wp-block-button.is-style-link .wp-block-button__link { background: none; border: 0; padding: 0; color: var(--ink);
  font-family: var(--font-sans); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.wp-block-button.is-style-link .wp-block-button__link::after { content: " \2192"; }
.wp-block-button.is-style-link .wp-block-button__link[target="_blank"]::after { content: " \2197"; }
.wp-block-button.is-style-link .wp-block-button__link:hover { color: var(--link); background: none; }
.wp-block-buttons { gap: var(--space-5); align-items: center; }

/* Images */
.wp-block-image.is-style-archive img { filter: grayscale(1); }
.wp-block-image.is-style-band img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.wp-block-image.is-style-band.alignfull .wp-element-caption { max-width: var(--width-wide); margin-inline: auto; padding-inline: var(--space-5); }
@media (max-width: 699px) { .wp-block-image.is-style-band img { aspect-ratio: 4 / 3; } }

/* Pull quote (design-system Quote) */
.wp-block-pullquote { margin: 0 auto; padding: 0; max-width: 820px; text-align: center; }
.wp-block-pullquote blockquote { margin: 0; }
.wp-block-pullquote p { font-size: inherit; line-height: inherit; text-wrap: balance; }
.wp-block-pullquote cite { display: block; margin-top: var(--space-4); font-family: var(--font-mono); font-size: 12px; font-style: normal;
  letter-spacing: 0; text-transform: uppercase; color: var(--ink-muted); }
@media (max-width: 599px) { .wp-block-pullquote { font-size: 22px; } }

/* Merchant's Note as a core Group (flow layout gives the spacing) */
.wp-block-group.wf-note { display: block; }

/* Ruled list ("What's included") */
.wf-list { list-style: none; padding: 0; border-top: 1px solid var(--line-strong); font-size: 15px; }
.wf-list li { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }

/* Closing row: lead text and buttons, rule above */
.wf-closing { border-top: 1px solid var(--line); padding-top: var(--space-6); justify-content: space-between; gap: var(--space-5); }
.wf-closing > p { flex: 1 1 420px; }

/* Booking panel (waterford/booking-panel; .wf-panel kept for older page content) */
.wf-panel, .wf-booking { background: var(--surface); border: 1px solid var(--line-strong); padding: var(--space-6); }
.wf-booking { display: grid; gap: var(--space-5); }
.wf-booking .wf-facts { margin: 0; }
@media (max-width: 599px) { .wf-panel, .wf-booking { padding: var(--space-5); } }

/* Booking status while tours and tastings are not bookable (Site Settings → Shop & bookings) */
.wf-status { display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--line-strong); }
.wf-status p { margin: 0; }
.wf-status .data { text-transform: uppercase; letter-spacing: 0.1em; }

/* Placeholder marker from the mockups must never ship */
.wf-tbc { outline: 2px solid red; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.wf-booking .wf-status { padding-top: 0; border-top: 0; }
