/* ============================================================
   BAT ORNATE — WORDPRESS BRIDGE
   ------------------------------------------------------------
   Maps WordPress core block markup onto the ported design
   system (styles.css). styles.css is kept byte-identical to the
   static build so future design fixes can be diffed straight
   across; everything WP-specific lives here.
   ============================================================ */

/* ---------- BLOCK LAYOUT RESETS --------------------------- */
figure { margin: 0; }
.wp-block-group { margin-block-start: 0; }
.wp-block-post-content > * + * { margin-block-start: 0; }

/* Admin bar offset for the fixed pill header */
body.admin-bar .header { top: calc(var(--s-3) + 32px); }
@media (max-width: 782px) { body.admin-bar .header { top: calc(var(--s-3) + 46px); } }

/* ---------- HEADER / SITE LOGO ---------------------------- */
.header .wp-block-site-logo img { height: 30px; width: auto; }
.header .wp-block-site-logo { display: flex; align-items: center; }
.header__lockup { display: flex; align-items: center; gap: 0.6em; grid-column: 2; grid-row: 1; }

/* ---------- NAVIGATION BLOCK ------------------------------ */
.header__nav.wp-block-navigation { grid-column: 1; grid-row: 1; }
.header__nav .wp-block-navigation__container { display: flex; gap: var(--s-4); list-style: none; padding: 0; margin: 0; }
.header__nav .wp-block-navigation-item__content,
.header__nav .wp-block-pages-list__item__link {
  position: relative; font-size: var(--t-small); font-weight: 500;
  color: var(--c-ink); padding-block: 4px; text-decoration: none;
}
.header__nav .wp-block-navigation-item__content::after,
.header__nav .wp-block-pages-list__item__link::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--c-accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--d-mid) var(--e-out);
}
.header__nav .wp-block-navigation-item__content:hover::after,
.header__nav .wp-block-pages-list__item__link:hover::after { transform: scaleX(1); transform-origin: left; }
.header__nav .current-menu-item > .wp-block-navigation-item__content,
.header__nav .wp-block-pages-list__item.menu-item-current > .wp-block-pages-list__item__link { color: var(--c-accent); }
.header__nav .current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); transform-origin: left; }

/* ---------- MOBILE HEADER + NAV OVERLAY -------------------
   The static build has a custom .burger + .mobile-menu that is a SIBLING of
   .header. In WP the hamburger and its modal live INSIDE the navigation block,
   i.e. inside .header — and .header has backdrop-filter, which makes it the
   containing block for position:fixed descendants. That is why the overlay
   rendered as a small box glued to the header pill instead of full screen.
   Below 820px we drop the backdrop-filter (solid surface instead) so the
   modal's inset:0 resolves against the viewport again. */

@media (max-width: 820px) {
  .header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--c-surface);
    /* explicit symmetric gutters instead of width+auto-margins, so the pill
       cannot drift off-centre */
    left: var(--gutter); right: var(--gutter);
    width: auto; max-width: none; margin-inline: 0;
    gap: var(--s-2);
    padding: 0.45rem;           /* uniform: matches the Connect Now inset */
  }
  /* hamburger: keeps a 44px tap target, but the icon is left-aligned so it sits
     the same distance from the pill edge as the button does on the right */
  .header__nav .wp-block-navigation__responsive-container-open {
    display: flex; align-items: center; justify-content: flex-start;
    width: 44px; height: 44px; padding: 0; margin: 0;
    color: var(--c-ink); background: none; border: 0;
  }
  /* keep the logo optically centred in the middle column */
  .header__lockup { justify-content: center; }
  .header__nav .wp-block-navigation__responsive-container-open svg { width: 22px; height: 22px; }
  .header__lockup { gap: 0.45em; min-width: 0; }
  .header .wp-block-site-logo img { height: 26px; }
  .header__logo-word { font-size: 1.05rem; white-space: nowrap; }
  .header__right .btn--sm { padding: 0.7em 1.15em; font-size: 0.78rem; white-space: nowrap; }
}
@media (max-width: 560px) {
  .header__logo-word { display: none; }
}

/* The open overlay — full-screen ink panel matching the static build. WP puts
   both is-menu-open and has-modal-open on the container; target both. */
.header__nav .wp-block-navigation__responsive-container.is-menu-open,
.header__nav .wp-block-navigation__responsive-container.has-modal-open {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw; height: 100dvh;
  max-width: none; max-height: none;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--c-ink) !important;
  color: var(--c-on-dark);
  padding: var(--s-8) var(--gutter);
  overflow-y: auto;
  z-index: 100;
}
.header__nav .is-menu-open .wp-block-navigation__responsive-container-content,
.header__nav .has-modal-open .wp-block-navigation__responsive-container-content {
  width: 100%; align-items: flex-start;
}
.header__nav .is-menu-open .wp-block-navigation__container,
.header__nav .has-modal-open .wp-block-navigation__container {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 0; width: 100%;
}
.header__nav .is-menu-open .wp-block-navigation-item__content,
.header__nav .has-modal-open .wp-block-navigation-item__content,
.header__nav .is-menu-open .wp-block-pages-list__item__link,
.header__nav .has-modal-open .wp-block-pages-list__item__link {
  font-family: var(--f-display);
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.2rem);
  line-height: 1.15;
  color: var(--c-on-dark);
  padding-block: 0.22em;
}
.header__nav .is-menu-open .wp-block-navigation-item__content::after,
.header__nav .has-modal-open .wp-block-navigation-item__content::after { display: none; }
.header__nav .is-menu-open .wp-block-navigation-item__content:hover,
.header__nav .has-modal-open .wp-block-navigation-item__content:hover { color: var(--c-accent-light); }

/* close button: top-right, sized like the hamburger */
.header__nav .wp-block-navigation__responsive-container-close {
  position: absolute; top: var(--s-4); right: var(--gutter);
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  color: var(--c-on-dark); background: none; border: 0;
}
.header__nav .wp-block-navigation__responsive-container-close svg { width: 24px; height: 24px; }

.header__nav .wp-block-navigation__responsive-container-open { color: var(--c-ink); }
@media (min-width: 821px) {
  .header__nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none; }
}

/* ---------- CORE BUTTON BLOCKS ---------------------------- */
/* Any button Gary adds in the editor picks up the pill style. */
.wp-block-button__link {
  position: relative; overflow: hidden; z-index: 0;
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 1.05em 2em; border-radius: var(--r-pill);
  font-size: var(--t-small); font-weight: 600; letter-spacing: 0.02em;
  background: var(--c-accent); color: var(--c-on-dark);
  text-decoration: none;
  transition: transform var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.wp-block-button__link:hover { transform: translateY(-3px); box-shadow: var(--sh-md); color: var(--c-on-dark); }

/* ---------- HEADINGS: accent words ------------------------ */
/* In the editor, italicising a word inside a heading produces
   an <em>/<i> — both render as the red script accent, exactly
   like the static build's <em>. */
h1 i, h2 i, h3 i { font-style: normal; color: var(--c-accent-bright); }
.hero__title i, .section--ink i { color: var(--c-accent-light); }
h1 i, h2 i, h3 i, .hero__title i {
  font-family: var(--f-script); font-weight: 600;
  font-size: 1.15em; letter-spacing: 0; line-height: 0.9;
}

/* ---------- DETAILS-BASED FAQ ----------------------------- */
/* The static build used a JS accordion; WP uses native
   <details> blocks so items stay editable. Same look. */
details.faq__item { border-bottom: 1px solid var(--c-line); padding: 0; }
details.faq__item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding-block: var(--s-4);
  font-family: var(--f-display); font-size: var(--t-h3); color: var(--c-ink);
  transition: color var(--d-fast) var(--e-out);
}
details.faq__item summary::-webkit-details-marker { display: none; }
details.faq__item summary:hover { color: var(--c-accent); }
details.faq__item summary::after {
  content: "+"; flex: 0 0 auto;
  width: 34px; height: 34px; border: 1px solid var(--c-line); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-body); font-size: 1.1rem; color: var(--c-accent);
  transition: transform var(--d-mid) var(--e-out), border-color var(--d-fast);
}
details.faq__item[open] summary::after { content: "–"; transform: rotate(180deg); border-color: var(--c-accent); }
details.faq__item > :not(summary) { max-width: var(--w-text); }
details.faq__item p { padding-bottom: var(--s-4); margin: 0; }

/* ---------- QUERY LOOP: SERVICES GRID --------------------- */
.why__grid--cpt { counter-reset: svc; }
.why__grid--cpt .why__card { counter-increment: svc; }
.why__grid--cpt .why__card::before {
  content: counter(svc, decimal-leading-zero);
  font-family: var(--f-display); font-size: var(--t-small);
  color: var(--c-accent); letter-spacing: 0.1em;
}
.why__card .wp-block-post-title { font-size: var(--t-h3); font-weight: 400; color: var(--c-ink); margin-block: var(--s-2) 6px; }
.why__card .wp-block-post-content p { font-size: var(--t-small); margin: 0; }

/* Query loop grid layouts inherit the static grid classes via
   className on the post-template — normalise the ul reset. */
.wp-block-post-template.why__grid,
.wp-block-post-template.why__grid--four,
.wp-block-post-template.gallery,
.wp-block-post-template.post-grid { list-style: none; padding: 0; margin: 0; display: grid; }
.wp-block-post-template.why__grid li,
.wp-block-post-template.gallery li,
.wp-block-post-template.post-grid li { margin: 0; }

/* ---------- QUERY LOOP: PORTFOLIO GALLERY ----------------- */
.gallery .wp-block-post-featured-image { border-radius: var(--r-md); overflow: hidden; }
.gallery .wp-block-post-featured-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* ---------- QUERY LOOP: BLOG CARDS ------------------------ */
.post-card .wp-block-post-featured-image { aspect-ratio: 16/11; overflow: hidden; }
.post-card .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.85s var(--e-out); }
.post-card:hover .wp-block-post-featured-image img { transform: scale(1.06); }
.post-card .wp-block-post-title { font-size: var(--t-h3); font-weight: 400; }
.post-card .wp-block-post-title a { color: var(--c-ink); text-decoration: none; }
.post-card .wp-block-post-excerpt__excerpt { font-size: var(--t-small); margin: 0; }
.post-card .wp-block-post-excerpt__more-link {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-size: var(--t-small); font-weight: 600; color: var(--c-ink);
  margin-top: var(--s-2); text-decoration: none;
}
.post-card .wp-block-post-excerpt__more-link:hover { color: var(--c-accent); }

/* Pagination */
.wp-block-query-pagination { margin-top: var(--s-6); display: flex; gap: var(--s-3); justify-content: center; font-size: var(--t-small); }
.wp-block-query-pagination a { color: var(--c-accent); }

/* ---------- SINGLE POST ----------------------------------- */
.post .wp-block-post-featured-image { border-radius: var(--r-lg); overflow: hidden; }
.post .wp-block-post-featured-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.prose .wp-block-post-content h2 { font-size: var(--t-h3); margin-top: var(--s-5); }
.prose .wp-block-post-content ul { margin-top: var(--s-3); display: grid; gap: var(--s-2); list-style: none; padding: 0; }
.prose .wp-block-post-content li { position: relative; padding-left: 1.5em; }
.prose .wp-block-post-content li::before { content: "\25C6"; color: var(--c-accent); position: absolute; left: 0; top: 0.15em; font-size: 0.7em; }
.prose .wp-block-post-content p { margin-top: var(--s-3); }

/* ---------- FOOTER LISTS ---------------------------------- */
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li a { display: block; font-size: var(--t-small); padding-block: 5px; color: inherit; text-decoration: none; transition: color var(--d-fast), transform var(--d-fast) var(--e-out); }
.footer__col li a:hover { color: var(--c-accent); transform: translateX(4px); }

/* ---------- EDITOR-ONLY NICETIES -------------------------- */
.editor-styles-wrapper .reveal { opacity: 1; }
.editor-styles-wrapper .img-reveal__panel { display: none; }
.editor-styles-wrapper .hero { min-height: 60vh; }

/* single-image category: featured image renders wide (pairs with .gallery--single in styles.css) */
.wp-block-post-template.gallery--single { grid-template-columns: 1fr; }
.gallery--single .wp-block-post-featured-image img { aspect-ratio: 16/9; }
@media (max-width: 720px) { .gallery--single .wp-block-post-featured-image img { aspect-ratio: 4/3; } }

/* two-image category: half/half featured images */
.wp-block-post-template.gallery--duo { grid-template-columns: repeat(2, 1fr); }
.gallery--duo .wp-block-post-featured-image img { aspect-ratio: 3/2; }
@media (max-width: 720px) {
  /* two-image category stays side by side on phone */
  .wp-block-post-template.gallery--duo { grid-template-columns: repeat(2, 1fr); }
  .gallery--duo .wp-block-post-featured-image img { aspect-ratio: 4/3; }
  /* three-image categories show only the first two on phone */
  .wp-block-post-template.gallery > li:nth-child(n+3) { display: none; }
}

/* ---------- FLOATING WHATSAPP BUTTON ---------------------- */
/* z-index 80: above content, below the header (90) and the open
   mobile-menu overlay (89) so the menu covers it when open. */
.wa-float {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: calc(clamp(16px, 3vw, 28px) + env(safe-area-inset-bottom));
  z-index: 80;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: #25d366; border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  transition: transform var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.wa-float:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }
@media (max-width: 720px) {
  .wa-float { width: 52px; height: 52px; }
  .wa-float svg { width: 27px; height: 27px; }
}

/* ---------- NATIVE-BLOCK BRIDGE (Gary-editable sections) --- */
/* Custom HTML sections converted to core blocks keep their look
   via these mappings; spans/bs that became <p> need margin resets
   and, where the original CSS used child selectors, re-targeting. */

/* why cards: number was `.why__card > span`, now p.why-num */
.why__card > .why-num {
  font-family: var(--f-display); font-size: var(--t-small);
  color: var(--c-accent); letter-spacing: 0.1em; margin: 0;
}

/* principles: icon was a span, now p.principle__i */
.principle p.principle__i { font-size: 1.1rem; margin: 0; }

/* service cards: number + enquire link were span/a, now <p>s;
   `.svc p { flex: 1 }` must not stretch them */
.svc p.svc__num { flex: 0 0 auto; margin: 0; }
.svc p.svc__link { flex: 0 0 auto; margin: 0; }

/* contact details: ul/li became groups of labelled paragraphs;
   .contact__details still supplies the grid + gap */
.contact-line {
  display: grid; gap: 2px;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-on-dark-line);
}
.contact-line .cd-label {
  font-size: var(--t-eyebrow); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--c-on-dark-muted); margin: 0;
}
.contact-line .cd-value {
  font-weight: 500; font-size: var(--t-lead);
  color: var(--c-on-dark); margin: 0;
}

/* editor re-bolding writes <strong>; style it like the original <b> */
.principle strong {
  display: block; font-family: var(--f-display); font-size: 1.08rem;
  color: var(--c-ink); margin-block: 6px 4px;
}
.why__card strong {
  display: block; font-family: var(--f-display); font-size: var(--t-h3);
  font-weight: 400; color: var(--c-ink); margin-block: var(--s-2) 6px;
}


/* ---------- EDITOR-ONLY (Gutenberg preview) ---------------- */
/* Theme JS doesn't run inside the editor iframe, so the
   img-reveal cover panels never animate away and reveal
   elements would stay at their pre-animation state. Scoped to
   .editor-styles-wrapper: zero effect on the front-end. */
.editor-styles-wrapper .img-reveal__panel { display: none; }
.editor-styles-wrapper .reveal { opacity: 1; }
.editor-styles-wrapper .hero__veil { display: none; }


/* ---------- BAT CREDIT BAR (theme-level, wp_footer) -------- */
.bat-credit {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #141210; color: #99918a;
  padding: 13px 20px calc(13px + env(safe-area-inset-bottom));
  font-size: 0.78rem; letter-spacing: 0.05em; text-decoration: none;
}
.bat-credit svg { height: 26px; width: auto; color: #efe9e2; opacity: 0.9; }
.bat-credit b { color: #d9d2c9; font-weight: 500; }
.bat-credit:hover b, .bat-credit:hover { color: #fff; }
