/* =========================================================
   EMERGE — Gutenberg bridge
   Reconciles the wrapper markup core blocks emit (figure, wp-block-button__link,
   block-gap spacing) with the approved emerge.css design system. emerge.css is
   kept byte-identical to the static site; this sheet is the only place where
   Gutenberg-specific wrappers are adapted. Loaded on BOTH front end and editor.
   ========================================================= */

/* ---- Full-bleed sections butt together: kill inherited block-gap so
        .section-pad alone controls vertical rhythm (as on the static site). ---- */
.wp-site-blocks, main.wp-block-group { --wp--style--block-gap: 0px; }
main.wp-block-group > *, .entry-content > * { margin-block: 0 !important; }

/* A module root is a full-width group carrying its own section band. */
.wp-block-group.alignfull.section-light,
.wp-block-group.alignfull.section-dark,
.wp-block-group.alignfull.section-deep { margin-block: 0; }

/* ---- Buttons: core/buttons → core/button. The variant class (.btn-primary /
        .btn-ghost) rides on the .wp-block-button wrapper; we restyle the inner
        .wp-block-button__link to the approved .btn look so buttons stay fully
        editable (label + URL) yet identical to the static site. ---- */
/* Button rows: core already lays these out; let the design classes (.hero-cta,
   .finale-cta, .case-foot …) own their spacing. Do NOT force margin:0 here — it
   would override the component margins. block-gap is already neutralised above. */
.wp-block-buttons { gap: 15px; }
.wp-block-button { margin: 0; }
.wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  font-family: inherit; font-weight: 600; font-size: .92rem;
  padding: .9em 1.6em; border-radius: 100px; border: 1.5px solid transparent;
  white-space: nowrap; text-decoration: none; background: transparent; color: var(--warm);
  transition: transform .4s var(--ease), background .4s, color .4s, box-shadow .4s, border-color .4s;
}
.wp-block-button.btn-primary .wp-block-button__link { background: var(--gold); color: var(--ink); }
.wp-block-button.btn-primary .wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 16px 42px -12px rgba(248,157,36,.6); }
.wp-block-button.btn-ghost .wp-block-button__link { background: transparent; color: var(--warm); border-color: var(--line); }
.wp-block-button.btn-ghost .wp-block-button__link:hover { border-color: var(--gold); color: var(--gold); }
.section-light .wp-block-button.btn-ghost .wp-block-button__link { color: var(--ink); border-color: var(--line-dark); }
.section-light .wp-block-button.btn-ghost .wp-block-button__link:hover { border-color: var(--gold); color: var(--gold-deep); }

/* ---- Images: core/image wraps <img> in <figure class="wp-block-image">.
        The approved layouts position a bare <img> inside a relative frame, so
        make the figure the positioned layer and strip its default margins. ---- */
.hero-media .wp-block-image,
.cap-media .wp-block-image,
.case-visual .wp-block-image,
.finale-media .wp-block-image,
.icard .top .wp-block-image {
  position: absolute; inset: 0; margin: 0; height: 100%; width: 100%;
}
.hero-media .wp-block-image img,
.cap-media .wp-block-image img,
.case-visual .wp-block-image img,
.finale-media .wp-block-image img,
.icard .top .wp-block-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
figure.wp-block-image { margin: 0; }

/* (Removed: a blanket `.wp-block-group.wrap > p/heading { max-width:none }` rule
   used to live here. Its specificity (0,2,0) overrode component widths such as
   `.finale .lede{max-width:54ch}`, widening copy and compressing sections. The
   component CSS already sets the correct widths; the .wrap groups are not in a
   constrained layout, so core adds no max-width to constrain in the first place.) */

/* ---- Group layout: emerge uses its own CSS grids (.chal-list, .out-grid,
        .why-grid, .cap, .insights-grid). Ensure grouped children don't inherit
        flex/gap from core group layout where an emerge grid is in charge. ---- */
.chal-list.wp-block-group,
.out-grid.wp-block-group,
.why-grid.wp-block-group,
.insights-grid.wp-block-group { display: grid; }
.chal-list.wp-block-group > *,
.out-grid.wp-block-group > *,
.why-grid.wp-block-group > * { margin: 0; }

/* (Removed: `.wp-block-group.wrap { max-width: var(--maxw) }`. Its specificity
   (0,2,0) overrode per-section width overrides like `.finale-inner{max-width:940px}`.
   emerge.css already sets `.wrap{max-width:var(--maxw);margin:0 auto}`, and
   component overrides must be free to win. .wrap groups sit inside full-width
   (default-layout) sections, so core never constrains them.) */

/* =========================================================
   Release A — accessibility, footer blocks, 404
   ========================================================= */

/* Skip link: visually hidden until focused (keyboard accessibility). */
.emerge-skip {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 8px;
  font-weight: 600; text-decoration: none; transition: top .2s;
}
.emerge-skip:focus { top: 12px; }

/* Visible focus states for keyboard users (doesn't affect mouse clicks). */
a:focus-visible, button:focus-visible,
.wp-block-button__link:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

/* Footer: contact list + social links rendered by the Emerge global blocks. */
.footer .ft-contact { list-style: none; }
.footer .footer-social {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px;
}
.footer .footer-social a { font-size: .9rem; }

/* 404: give the core search block the Emerge field look. */
.section-dark .wp-block-search__input {
  background: var(--panel, #0e1b14); border: 1px solid var(--line, rgba(246,245,241,.14));
  color: var(--warm); border-radius: 100px; padding: .8em 1.2em;
}
.section-dark .wp-block-search__button {
  background: var(--gold); color: var(--ink); border: 0; border-radius: 100px;
  padding: .8em 1.4em; font-weight: 600; margin-left: 8px;
}
.wp-block-search { max-width: 460px; margin: 10px 0 22px; }

/* =========================================================
   Insights (native posts) — archive grid, empty state, article
   ========================================================= */
.insights-grid{list-style:none;display:grid;grid-template-columns:repeat(3,1fr);gap:28px;margin:40px 0 0;padding:0}
.insights-grid > li{background:#fff;border:1px solid rgba(9,20,15,.1);border-radius:16px;overflow:hidden;display:flex;flex-direction:column}
.insights-grid .wp-block-post-featured-image{margin:0;aspect-ratio:16/10;overflow:hidden}
.insights-grid .wp-block-post-featured-image a,.insights-grid .wp-block-post-featured-image img{display:block;width:100%;height:100%;object-fit:cover}
.insights-grid .wp-block-post-terms,.insights-grid .wp-block-post-title,.insights-grid .wp-block-post-date,.insights-grid .wp-block-post-excerpt{margin:0;padding:0 22px}
.insights-grid .wp-block-post-terms{padding-top:20px;font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;font-weight:700;color:var(--gold-deep,#E08A18)}
.insights-grid .wp-block-post-title{margin-top:8px;font-size:1.2rem;line-height:1.25;letter-spacing:-0.02em}
.insights-grid .wp-block-post-title a{color:var(--ink);text-decoration:none}
.insights-grid .wp-block-post-title a:hover{color:var(--gold-deep,#E08A18)}
.insights-grid .wp-block-post-date{margin-top:8px;font-size:.78rem;color:var(--slate,#68706C)}
.insights-grid .wp-block-post-excerpt{margin-top:10px;padding-bottom:22px;font-size:.92rem;line-height:1.6;color:rgba(9,20,15,.72)}
.insights-grid .wp-block-post-excerpt__more-link{color:var(--gold-deep,#E08A18);font-weight:600;text-decoration:none}
.insights-empty{max-width:640px;margin:40px auto 0;text-align:center}
.insights-empty .wp-block-buttons{justify-content:center;margin-top:28px}
.insights-pagination{margin-top:44px;display:flex;gap:14px;align-items:center;justify-content:center;flex-wrap:wrap}
.insights-pagination a,.insights-pagination .current{color:var(--ink);text-decoration:none;font-weight:600;padding:.4em .8em;border-radius:8px}
.insights-pagination .current{background:var(--ink);color:var(--warm)}
/* Article (single post) */
.insight-single .art-head{padding:clamp(90px,12vh,150px) 0 clamp(28px,4vw,44px)}
.insight-single .art-meta{gap:14px;color:rgba(246,245,241,.7);font-size:.85rem;margin-top:18px}
.insight-single .art-hero img{width:100%;max-height:60vh;object-fit:cover;display:block}
.insight-single .art-body{max-width:760px}
.insight-single .art-body p{margin:1.1em 0;line-height:1.75}
@media(max-width:900px){ .insights-grid{grid-template-columns:1fr 1fr} }
@media(max-width:600px){ .insights-grid{grid-template-columns:1fr} }
