/* ============================================================
   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 overlay: restyle the nav block's responsive container
   to match the static build's ink full-screen menu. */
.header__nav .wp-block-navigation__responsive-container.has-modal-open {
  background: var(--c-ink) !important; color: var(--c-on-dark);
  padding: var(--s-8) var(--gutter);
}
.header__nav .has-modal-open .wp-block-navigation-item__content,
.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);
  color: var(--c-on-dark); padding-block: 0.22em;
}
.header__nav .has-modal-open .wp-block-navigation-item__content:hover { color: var(--c-accent-light); }
.header__nav .has-modal-open .wp-block-navigation__responsive-container-close { color: var(--c-on-dark); }
.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; }
