/*
Theme Name: Koča v Krnici (Bespoke)
Theme URI: https://kocavkrnici.si
Description: Bespoke theme for Koča v Krnici. Page content is authored as native Gutenberg blocks for genuine wp-admin editability; the design system carries over unchanged from the approved prototype.
Author: Spletni Paketi
Author URI: https://spletnipaketi.si
Version: 1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: koca-gb
*/

/* Koča v Krnici - bespoke prototype
   Archetype: Gostinstvo in turizem (light) - see design-system.md 2.1
   Tone: Prijazen -> Poppins headings / Inter body, standard radius (2.2)
   NOTE: fonts fall back to a system stack in the prototype. Self-hosted
   Poppins + Inter woff2 (latin-ext, font-display:swap) get added at the
   WordPress stage - never hotlinked from Google (GDPR, design-system 2.2). */

:root {
  --color-bg: #FFFDF9;
  --color-bg-alt: #F4EDE2;
  --color-primary: #4A2E1A;
  --color-secondary: #6B5B45;
  --color-accent: #A94F22;
  --color-text: #23281F;
  --color-on-accent: #FFFFFF;
  --color-border: #E4DACA;
  --color-muted: #6E6A5F;
  /* WOOD PALETTE. The client is a timber mountain hut, so the structural
     colour is brown (taken from the logo's ink, #251305 / hue 26deg) rather
     than green. --color-primary above carries every structural use: nav
     active, outline buttons, fact numbers, button hover. Terracotta accent
     stays the single "action" colour so CTAs remain unambiguous. */
  --color-footer: #33210F;        /* deeper than primary - footer band */
  --color-footer-muted: #D8CCBC;  /* warm muted, was a greenish grey */

  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px;
  --space-6:32px; --space-7:48px; --space-8:64px; --space-9:96px; --space-10:128px;

  --container: 1140px;
  --radius: 10px;
  --logo-h: 74px;        /* header logo */
  --logo-h-sm: 60px;     /* header logo under 900px */
  --logo-h-footer: 90px; /* footer logo - deliberately larger than header */
  --logo-h-footer-sm: 72px;

  --font-h: "Poppins", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-b: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-hero: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  --fs-h2:   clamp(1.6rem, 1.25rem + 1.6vw, 2.4rem);
  --fs-h3:   clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-b); font-size: var(--fs-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* height:auto is REQUIRED. We set width/height attributes on every <img> to
   reserve space and stop layout shift - but those attributes also fix the
   rendered height, which silently overrides aspect-ratio (it only applies when
   one dimension is auto). Without this line every framed image renders at its
   intrinsic height and comes out far too tall. */
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }

h1,h2,h3 { font-family: var(--font-h); font-weight: 600; margin: 0 0 var(--space-4); }
h1 { font-size: var(--fs-hero); line-height: 1.15; text-wrap: balance; }
h2 { font-size: var(--fs-h2);  line-height: 1.25; }
h3 { font-size: var(--fs-h3);  line-height: 1.25; }
p  { margin: 0 0 var(--space-4); max-width: 62ch; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }
.section { padding: var(--space-9) 0; }
.section-alt { background: var(--color-bg-alt); }
@media (max-width: 700px) { .section { padding: var(--space-7) 0; } }

/* ---------- buttons: exactly one accent-filled per screenful (2.3) ---------- */
/* One button component everywhere - header, hero, cards, CTA band. Same
   padding, same colours, same hover. Inconsistent CTAs were a review finding. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 14px 34px; border-radius: var(--radius);
  background: var(--color-accent); color: var(--color-on-accent);
  font-family: var(--font-h); font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; border: 2px solid var(--color-accent); cursor: pointer;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
/* NO header button variant. The header CTA is the same .btn as everywhere
   else - identical padding, size and hover. A "slightly tighter" variant is
   how the header button ended up looking cheap and misaligned with the CTA
   directly below it. One button, one set of numbers. */

:where(a,button,input,textarea,select,summary):focus-visible {
  outline: 3px solid var(--color-accent); outline-offset: 2px; border-radius: 4px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--color-primary);
  color: #fff; padding: 10px 16px; z-index: 999;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
/* STATIC header, not sticky. Owner decision 2026-07-22: on a ~700px phone a
   sticky bar costs 80px permanently, and the CTA band + footer already give
   repeated conversion points on every page. Dropping sticky also removes the
   backdrop-filter entirely, which is what created a containing block and
   clipped the fixed mobile nav (gutenberg-wp-gotchas.md #5) - the trap is
   gone rather than worked around. */
.site-header {
  /* relative + z-index so the nav toggle paints ABOVE the full-screen mobile
     nav overlay and doubles as its close button. */
  position: relative; z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 92px; }
.logo img { height: var(--logo-h); width: auto; }
@media (max-width: 900px) { .header-inner { min-height: 80px; } .logo img { height: var(--logo-h-sm); } }
.main-nav { display: flex; align-items: center; gap: var(--space-5); }
/* :not(.btn) is load-bearing. ".main-nav a" is class+element specificity,
   which BEATS the single-class ".btn" - so without this exclusion the nav link
   styles override the button's padding and font and it renders cramped. This
   is what actually made the header CTA look wrong. */
.main-nav a:not(.btn) {
  font-family: var(--font-h); font-weight: 500; font-size: 1.05rem;
  text-decoration: none; color: var(--color-text); padding: 8px 2px;
  border-bottom: 2px solid transparent;
}
/* hover = brown text; active = brown text + brown underline. The underline is
   what separates "current page" from "hovering", so the two never look alike. */
.main-nav a:not(.btn):hover { color: var(--color-primary); }
.main-nav a[aria-current="page"]:not(.btn) { border-bottom-color: var(--color-primary); color: var(--color-primary); }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 2px; background: var(--color-text); margin: 5px 0; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: 0; background: var(--color-bg);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: var(--space-5); overflow-y: auto; transform: translateX(100%);
    transition: transform .25s ease; z-index: 90;
  }
  .main-nav.open { transform: translateX(0); }
  /* full-screen overlay; top padding clears the header so the toggle (which
     sits above it) stays visible and acts as the close control */
  .main-nav { padding-top: 96px; }
  /* :not(.btn) again - the same specificity trap as the desktop rule above.
     Without it the CTA loses its horizontal padding and gains a hairline. */
  .main-nav a:not(.btn) { width: 100%; padding: 16px 0; border-bottom: 1px solid var(--color-border); font-size: 1.1rem; }
  .main-nav .btn { margin-top: var(--space-5); width: 100%; }
}

/* ---------- hero: SPLIT variant (cover image is 1024px - too small for
   full-bleed without upscaling; design-system 2.5) ---------- */
.hero { padding: var(--space-7) 0 var(--space-8); }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: var(--space-7); align-items: center; }
/* image sits in a landscape frame and is capped, so it can never push the
   text column into a wall of empty space or run past the fold */
.hero-img img { aspect-ratio: 3/2; object-fit: cover; width: 100%; max-height: 460px; }
.hero-eyebrow {
  font-family: var(--font-h); font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; font-size: .78rem; color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.hero p.lead { font-size: 1.15rem; color: var(--color-secondary); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.hero-img { border-radius: var(--radius); overflow: hidden; box-shadow: 0 18px 46px rgba(74,46,26,.20); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: var(--space-6); } }

/* ---------- facts strip ---------- */
.facts { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-5); }
.fact { text-align: center; }
.fact strong { display: block; font-family: var(--font-h); font-size: 1.9rem; color: var(--color-primary); line-height: 1.1; }
.fact span { font-size: var(--fs-small); color: var(--color-muted); }
@media (max-width: 700px) { .facts { grid-template-columns: repeat(2,1fr); gap: var(--space-6); } }

/* ---------- cards: 2 services -> two-up, equal height (2.6) ---------- */
/* Cap the measure on the PARAGRAPHS, never on the block - a 62ch cap here is
   measured in the parent's body font, so it also boxes in the heading and
   forces short headlines to wrap. Headings size to the container. */
.section-head { margin-bottom: var(--space-7); }
/* When the section-head IS the section (intro pages), its bottom margin just
   stacks on top of the section padding and leaves a dead gap. */
.section-head:last-child { margin-bottom: 0; }
.section-head h1, .section-head h2 { text-wrap: balance; }
.section-head p { max-width: 62ch; }
.section-head p { color: var(--color-secondary); }
.cards { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-6); }
.card {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
}
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card-body { padding: var(--space-5); display: flex; flex-direction: column; flex: 1; }
.card-body p { flex: 1; }
.card .card-cta { margin-top: var(--space-4); }
/* ---------- CTA band: ONE component, identical wording and look, on every
   page. Review finding: three different CTA treatments across four pages. --- */
.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: var(--space-3); }
.cta-band p { margin: 0 auto var(--space-5); color: var(--color-secondary); max-width: 52ch; }

.note {
  background: var(--color-bg-alt); border-left: 3px solid var(--color-accent);
  padding: var(--space-3) var(--space-4); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-small); color: var(--color-secondary); margin: 0 0 var(--space-4); max-width: none;
}
@media (max-width: 800px) { .cards { grid-template-columns: 1fr; } }

/* ---------- split content ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center; }
/* every content image is framed and capped - never a full-height portrait */
.split img { border-radius: var(--radius); aspect-ratio: 3/2; object-fit: cover; width: 100%; max-height: 420px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: var(--space-6); } }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-3); }
.gallery button { padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius); overflow: hidden; }
.gallery img { aspect-ratio: 4/3; object-fit: cover; width: 100%; transition: transform .3s ease; }
.gallery button:hover img { transform: scale(1.04); }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2,1fr); } }

.lightbox { position: fixed; inset: 0; background: rgba(20,24,18,.94); display: none; align-items: center; justify-content: center; z-index: 200; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: var(--radius); }
.lightbox-cap { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-size: var(--fs-small); }
.lb-btn { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; width: 52px; height: 52px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.lb-prev { left: 3vw; } .lb-next { right: 3vw; } .lb-close { top: 3vh; right: 3vw; width: 46px; height: 46px; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--space-8); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-weight: 600; font-size: var(--fs-small); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; font: inherit; color: inherit;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.req { color: var(--color-accent); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-small); color: var(--color-secondary); }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

/* Key/value list as a 2-column grid on the <dl> itself. max-content sizes the
   key column to that list's OWN longest key, so it never squeezes and never
   wastes space - a fixed min-width was a guess that broke on "Skupna ležišča"
   and was too wide for "1932". Values stay aligned across every row. */
.info-list { display: grid; grid-template-columns: max-content 1fr; column-gap: var(--space-5); margin: 0 0 var(--space-6); }
.info-list dt, .info-list dd { margin: 0; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.info-list dt { font-weight: 600; font-size: var(--fs-small); }
.info-list a { color: var(--color-primary); font-weight: 600; }
.hours dt { font-weight: 600; font-size: var(--fs-small); margin-top: var(--space-3); }
.hours dd { margin: 2px 0 0; color: var(--color-secondary); font-size: var(--fs-small); }
.map { border: 0; width: 100%; height: 340px; border-radius: var(--radius); margin-top: var(--space-6); }

/* ---------- footer ---------- */
/* No margin-top. Every section already carries its own --space-9 padding, so
   a margin here just adds a strip of page background between the last section
   and the footer. Sections own vertical rhythm; the footer never adds to it. */
.site-footer { background: var(--color-footer); color: #EDE9E0; padding: var(--space-8) 0 var(--space-5); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-7); }
/* Footer logo: light recolour of the same mark (dark line art would vanish on
   the green). Sits in column 1 in place of the wordmark heading. */
.footer-logo { display: inline-block; margin-bottom: var(--space-4); }
.footer-logo img { height: var(--logo-h-footer); width: auto; }
@media (max-width: 800px) { .footer-logo img { height: var(--logo-h-footer-sm); } }
.site-footer h3 { color: #fff; font-size: 1rem; }
.site-footer a { color: #EDE9E0; }
.site-footer p { color: var(--color-footer-muted); font-size: var(--fs-small); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; font-size: var(--fs-small); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.16); margin-top: var(--space-7);
  padding-top: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-3);
  justify-content: space-between; font-size: .82rem; color: var(--color-footer-muted);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); } }

/* ---------- cookie banner ---------- */
.cookie {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: #fff; border-top: 2px solid var(--color-primary);
  padding: var(--space-4) var(--space-5); display: none;
  box-shadow: 0 -8px 30px rgba(0,0,0,.10);
}
.cookie.show { display: block; }
.cookie-inner { max-width: var(--container); margin: 0 auto; display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; }
.cookie p { margin: 0; font-size: var(--fs-small); }
.cookie-actions { display: flex; gap: var(--space-3); }
.cookie .btn { min-height: 44px; padding: 10px 20px; font-size: .92rem; }

/* ---------- mobile refinements (checked on a real phone) ---------- */
@media (max-width: 600px) {
  /* 34px side padding pushed the two hero CTAs onto separate rows.
     20px keeps them on one row down to a 360px screen. */
  .btn { padding: 14px 20px; }
  .section-head { margin-bottom: var(--space-5); }
  /* Narrow screens: single column, key sits above its value. The border moves
     to the value so each pair reads as one block. */
  .info-list { grid-template-columns: 1fr; }
  .info-list dt { border-bottom: 0; padding-bottom: 0; }
  .info-list dd { padding-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   GUTENBERG BLOCK BRIDGE
   The prototype CSS above styles semantic classes (.hero, .cards, .split,
   .gallery, .facts, .contact-grid, .btn ...). On the WordPress site the
   header/footer/cookie/lightbox emit that exact markup from PHP, so those
   rules already apply. Page CONTENT is native Gutenberg blocks, whose DOM
   adds wrapper classes and an inner-container div. This layer bridges the
   two so hand-authored blocks reproduce the approved layout pixel-for-pixel
   while staying genuinely editable in wp-admin. Each rule traces to a
   documented gotcha (gutenberg-wp-gotchas.md).
   ===================================================================== */

/* #1 - Group blocks wrap children in an inner-container; make it vanish
   from layout so our flex/grid rules act on the real children. */
.wp-block-group > .wp-block-group__inner-container { display: contents; }

/* #3 - full-bleed section keeps its background edge-to-edge; the nested
   .container caps and centres the content. */
.wp-block-group.alignfull.section { max-width: none; }
.wp-block-group.container { max-width: var(--container); margin-inline: auto; padding: 0 var(--space-5); }

/* Sections author as full-bleed groups; kill core's default block margins
   so the section's own --space-9 padding is the single source of rhythm. */
.section > .wp-block-group__inner-container > * { margin-block: 0; }
main#main > .wp-block-group { margin-block: 0; }

/* ---- Buttons: core button -> prototype .btn / .btn-outline ---- */
.wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 14px 34px; border-radius: var(--radius);
  background: var(--color-accent); color: var(--color-on-accent);
  font-family: var(--font-h); font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; border: 2px solid var(--color-accent); cursor: pointer;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.wp-block-button__link:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
  background: transparent; color: var(--color-primary); border-color: var(--color-primary);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-5) 0 0; }
.wp-block-buttons.is-content-justification-center { justify-content: center; }
.cta-band .wp-block-buttons { justify-content: center; margin-top: 0; }

/* ---- Columns -> the prototype's named grids ---- */
.wp-block-columns { margin-block: 0; gap: var(--space-6); align-items: stretch; }
.wp-block-columns.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: var(--space-7); align-items: center; }
.wp-block-columns.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center; }
.wp-block-columns.cards { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-6); }
.wp-block-columns.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--space-8); align-items: start; }
.wp-block-column { margin: 0; padding: 0; min-width: 0; }
/* flex fallbacks collapse to one column on narrow screens (mirrors prototype) */
@media (max-width: 900px) {
  .wp-block-columns.hero-grid,
  .wp-block-columns.split,
  .wp-block-columns.contact-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}
@media (max-width: 800px) { .wp-block-columns.cards { grid-template-columns: 1fr; } }

/* ---- Image blocks: strip block margins, keep prototype framing ---- */
.wp-block-image { margin: 0; }
.wp-block-image img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
/* hero image column */
.hero-grid .hero-img img,
.hero-grid .wp-block-image img { aspect-ratio: 3/2; object-fit: cover; max-height: 460px; }
.hero-grid .wp-block-column:last-child .wp-block-image { border-radius: var(--radius); overflow: hidden; box-shadow: 0 18px 46px rgba(74,46,26,.20); }
/* split image */
.split .wp-block-image img { aspect-ratio: 3/2; object-fit: cover; max-height: 420px; }
/* card image (4:3, square top corners) */
.card .wp-block-image img { aspect-ratio: 4/3; object-fit: cover; border-radius: 0; }

/* ---- Card = a column with an image + a body group ---- */
.wp-block-column.card {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
}
.card .card-body { padding: var(--space-5); display: flex; flex-direction: column; flex: 1; }
.card .card-body h3 { margin-bottom: var(--space-3); }
.card .card-body p { flex: 0 0 auto; }
.card .card-body p.note { flex: 0 0 auto; }
.card .card-body .wp-block-buttons { margin-top: auto; }
.card .card-body > .wp-block-group__inner-container { display: flex; flex-direction: column; flex: 1; }

/* ---- Facts strip: group.facts (grid) of group.fact ---- */
.wp-block-group.facts { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-5); }
.wp-block-group.fact { text-align: center; }
.fact .fact-num { display: block; font-family: var(--font-h); font-size: 1.9rem; color: var(--color-primary); line-height: 1.1; margin: 0; font-weight: 600; }
.fact .fact-label { font-size: var(--fs-small); color: var(--color-muted); margin: 0; max-width: none; }
@media (max-width: 700px) { .wp-block-group.facts { grid-template-columns: repeat(2,1fr); gap: var(--space-6); } }

/* ---- Native Gallery block -> prototype gallery grid (#2 width fix) ---- */
.wp-block-gallery.gallery-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-3);
  margin: 0;
}
.wp-block-gallery.gallery-grid figure.wp-block-image,
.wp-block-gallery.gallery-grid .wp-block-image {
  width: 100% !important; margin: 0 !important; border-radius: var(--radius); overflow: hidden;
}
.wp-block-gallery.gallery-grid .wp-block-image a,
.wp-block-gallery.gallery-grid .wp-block-image img { display: block; width: 100%; }
.wp-block-gallery.gallery-grid img { aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); transition: transform .3s ease; cursor: pointer; }
.wp-block-gallery.gallery-grid .wp-block-image:hover img { transform: scale(1.04); }
@media (max-width: 900px) { .wp-block-gallery.gallery-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 600px) { .wp-block-gallery.gallery-grid { grid-template-columns: repeat(2,1fr); } }

/* ---- Structured info lists / hours / map come through core/html and
   already carry the prototype .info-list/.hours/.map classes, so no bridge
   needed beyond letting them sit full width in their column. ---- */
.wp-block-html { margin: 0; }

/* ---- Headings inside blocks keep prototype scale (tag rules already apply);
   just clear core's .wp-block-heading top margin at section starts. ---- */
.section-head { margin-bottom: var(--space-7); }
.section-head:last-child { margin-bottom: 0; }

/* ---- CF7 form fields inherit the prototype .field styling; scope the
   generated markup so inputs match the approved contact form. ---- */
.wpcf7 .cf7-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 600px) { .wpcf7 .cf7-row { grid-template-columns: 1fr; } }
.wpcf7 p { margin: 0 0 var(--space-4); max-width: none; }
.wpcf7 label { display: block; font-weight: 600; font-size: var(--fs-small); margin-bottom: 6px; }
.wpcf7 input.wpcf7-form-control:not([type=submit]):not([type=checkbox]),
.wpcf7 textarea, .wpcf7 select {
  width: 100%; padding: 12px 14px; font: inherit; color: inherit;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
}
.wpcf7 .wpcf7-list-item { margin: 0; }
/* Consent: checkbox pinned left, the label text (incl. the privacy link and
   the required asterisk) flows as normal inline text beside it. Flex split the
   pieces apart, so use absolute positioning instead. */
.wpcf7 .cf7-consent { display: block; position: relative; padding-left: 30px; font-size: var(--fs-small); color: var(--color-secondary); line-height: 1.5; }
.wpcf7 .cf7-consent .wpcf7-form-control-wrap { position: absolute; left: 0; top: 1px; }
.wpcf7 .cf7-consent input { width: 20px; height: 20px; }
.wpcf7 .cf7-consent a { color: var(--color-primary); font-weight: 600; }
.wpcf7 input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 34px; border-radius: var(--radius);
  background: var(--color-accent); color: var(--color-on-accent);
  font-family: var(--font-h); font-weight: 600; font-size: 1rem;
  border: 2px solid var(--color-accent); cursor: pointer; margin-top: var(--space-2);
}
.wpcf7 input[type=submit]:hover { background: var(--color-primary); border-color: var(--color-primary); }
.wpcf7-response-output { border-radius: var(--radius); margin: var(--space-4) 0 0 !important; }

/* Privacy-policy / plain content pages: constrain measure inside container. */
.page-narrow .container { max-width: 820px; }
