/* ==========================================================================
   Sinc — WordPress adaptations.
   Loaded after tokens.css and site.css.

   site.css was authored for hand-written markup. This file maps that design
   onto the markup WordPress and Elementor actually emit:
     1. wp_nav_menu() <ul>/<li>/<ul.sub-menu>  ->  the .nav-links dropdown design
     2. Restores typography inside editable content (site.css zeroes p/h margins
        and link colour, which is right for composed sections but wrong for prose)
     3. Footer widget areas  ->  the .foot-map column design
     4. Admin bar + Elementor container harmony
   ========================================================================== */

/* ── 1. Navigation ──────────────────────────────────────────────────────── */
.nav-links ul { list-style: none; margin: 0; padding: 0; }
.nav-links > ul { display: flex; align-items: center; gap: 30px; }
.nav-links li { position: relative; }
.nav-links a { font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-primary); transition: color var(--dur-fast); }
.nav-links a:hover { color: var(--text-brand); }

/* Current page — WP adds these classes automatically */
.nav-links .current-menu-item > a,
.nav-links .current-menu-ancestor > a,
.nav-links .current_page_item > a { color: var(--text-brand); }

/* Parent items get the chevron */
.nav-links .menu-item-has-children > a::after { content: ""; display: inline-block;
  width: 5px; height: 5px; margin-left: 6px; border: solid currentColor;
  border-width: 0 1.3px 1.3px 0; transform: translateY(-2px) rotate(45deg); opacity: .5; }

/* Dropdown panel */
.nav-links .sub-menu { position: absolute; top: calc(100% + 14px); left: 50%;
  transform: translateX(-50%) translateY(-6px); min-width: 230px; display: block;
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; z-index: 60;
  transition: opacity var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard),
              visibility var(--dur-fast); }
.nav-links li:hover > .sub-menu,
.nav-links li:focus-within > .sub-menu { opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0); }
.nav-links .sub-menu a { display: block; padding: 9px 12px; border-radius: var(--radius-xs);
  font-size: var(--text-sm); color: var(--text-primary); white-space: nowrap; }
.nav-links .sub-menu a:hover { background: var(--surface-brand-soft); color: var(--magenta-700); }
/* Bridge the gap so the pointer can travel into the panel */
.nav-links .menu-item-has-children::after { content: ""; position: absolute;
  top: 100%; left: 0; right: 0; height: 16px; }

/* Desktop: the panel dissolves, so .nav-links and .nav-cta remain direct flex
   children of .bar and lay out exactly as they did before the wrapper existed. */
.nav-panel { display: contents; }
/* site.css sets flex:none via `.bar > .btn`, which no longer matches now that the
   button sits inside .nav-panel — the > combinator follows the DOM, not the
   display:contents layout tree. Restore it so the button never shrinks. */
.nav-cta { flex: none; }

/* Mobile: the panel becomes the collapsible dropdown and carries the CTA button
   inside it, so the bar is reduced to logo + hamburger. */
@media (max-width: 1024px) {
  .nav-panel { display: none; position: absolute; top: calc(100% + 12px);
    left: 0; right: 0; flex-direction: column; gap: 4px;
    background: var(--surface); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 10px; }
  .nav-toggle-input:checked ~ .nav-panel { display: flex; }

  /* site.css hides .nav-links below 1024px; inside the panel it must show */
  .nav-panel .nav-links { display: block; }
  .nav-panel .nav-links > ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-panel .nav-links li { position: static; }
  .nav-panel .nav-links .menu-item-has-children > a::after,
  .nav-panel .nav-links .menu-item-has-children::after { display: none; }
  .nav-panel .nav-links .sub-menu { position: static; opacity: 1; visibility: visible;
    transform: none; box-shadow: none; border: none; background: transparent;
    padding: 0 0 6px 12px; min-width: 0; }
  .nav-panel .nav-links a { display: block; padding: 11px 12px;
    border-radius: var(--radius-xs); font-size: var(--text-base); }
  .nav-panel .nav-links a:hover { background: var(--surface-brand-soft);
    color: var(--magenta-700); }

  /* Full-width button, visually separated from the links above it */
  .nav-cta { width: 100%; justify-content: center; font-size: var(--text-md);
    padding: 13px 20px; margin-top: 6px; }
}

/* ── 2. Editable content typography ─────────────────────────────────────── */
/* site.css sets p{margin:0} and a{color:inherit} — correct for composed
   sections, wrong for prose people type. Restore it where content lives. */
.entry-content p,
.elementor-widget-text-editor p { margin: 0 0 1.15em; line-height: var(--leading-relaxed); }
.entry-content p:last-child,
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5 { margin: 1.6em 0 .5em; color: var(--magenta-600); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content a:not(.btn),
.elementor-widget-text-editor a:not(.btn) { color: var(--magenta-600); text-decoration: underline;
  text-underline-offset: 2px; }
.entry-content a:not(.btn):hover,
.elementor-widget-text-editor a:not(.btn):hover { color: var(--magenta-700); }
.entry-content ul, .entry-content ol { margin: 0 0 1.15em; padding-left: 20px; }
.entry-content li { line-height: var(--leading-relaxed); padding: 3px 0; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--magenta-400); color: var(--text-secondary); }

/* ── 3. Footer widget areas ─────────────────────────────────────────────── */
.site-footer .widget { margin: 0; }
.site-footer .widget-title,
.site-footer .widget h2, .site-footer .widget h5 { font-size: var(--text-sm);
  font-weight: var(--weight-semibold); color: var(--text-primary);
  margin: 0 0 14px; letter-spacing: 0; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget a { display: block; font-size: var(--text-sm);
  color: var(--text-secondary); padding: 5px 0; }
.site-footer .widget a:hover { color: var(--text-brand); }
.site-footer .widget p { font-size: var(--text-sm); color: var(--text-secondary);
  line-height: var(--leading-relaxed); }

/* ── 4. Admin bar + Elementor harmony ───────────────────────────────────── */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* Elementor wraps sections in its own containers. Let our section classes
   (.split, .tiles, .cta-band, .steps …) work when applied to a container. */
.elementor-element.split, .elementor-element.tiles,
.elementor-element.cards3, .elementor-element.cards2 { display: grid; }
.elementor-element.cta-band > .elementor-widget-wrap,
.elementor-element.cta-band > .e-con-inner { position: relative; z-index: 1; }

/* Elementor's editor injects inline padding on containers; our .block sections
   supply their own vertical rhythm, so neutralise the double spacing. */
.elementor-element.block > .e-con-inner { padding-top: 0; padding-bottom: 0; }

/* Buttons rendered by Elementor or form plugins pick up our button design */
.wpforms-submit, .fluentform .ff-btn-submit, .wpcf7-submit {
  font-family: inherit; font-weight: var(--weight-medium); border: none; cursor: pointer;
  border-radius: var(--radius-sm); background: var(--primary); color: #fff;
  font-size: var(--text-md); padding: 15px 28px;
  transition: background var(--dur-fast) var(--ease-standard), box-shadow var(--dur-normal); }
.wpforms-submit:hover, .fluentform .ff-btn-submit:hover, .wpcf7-submit:hover {
  background: var(--primary-hover); box-shadow: var(--shadow-brand); }

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--surface); color: var(--text-primary); padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0; box-shadow: var(--shadow-md); }
.skip-link:focus { left: 0; }

/* ── 5. Theme template chrome ───────────────────────────────────────────── */
.site-main { display: block; }
.foot-col { min-width: 0; }
.foot-empty { font-size: var(--text-sm); color: var(--text-tertiary);
  font-style: italic; line-height: var(--leading-relaxed); }
.foot-brand .foot-logo { display: inline-flex; }

/* Prose column for pages/posts not built in Elementor */
.sinc-prose { padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem); }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-default); font-size: var(--text-sm);
  font-weight: var(--weight-medium); color: var(--text-secondary); }
.pagination .page-numbers:hover { border-color: var(--border-strong); color: var(--text-primary); }
.pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Elementor strips list styling inside text widgets; keep ours readable */
.elementor-widget-text-editor ul,
.elementor-widget-text-editor ol { margin: 0 0 1.15em; padding-left: 20px; }
.elementor-widget-text-editor li { line-height: var(--leading-relaxed); padding: 3px 0; }

/* ── 6. Elementor container <-> Sinc component bridge ───────────────────── */
/* Elementor renders every container as div.e-con { display:flex; flex-direction:
   column } and clamps width via --width. Two consequences for our components:

     1. `section.block { padding: ... }` in site.css cannot match a div container.
     2. The flex-column default overrides our grid and block layouts.

   Both are re-asserted below at .e-con.<class> specificity (0,2,0), which beats
   Elementor's .e-con (0,1,0) regardless of stylesheet load order.
   This block is generated — see import/to_elementor.py. */
.e-con.case { display: block; }
.e-con.nav-panel { display: contents; }
.e-con.brand,
.e-con.foot-bottom,
.e-con.logos,
.e-con.mband,
.e-con.mock-top,
.e-con.nav-links,
.e-con.pill-row,
.e-con.split-media,
.e-con.svc-media,
.e-con.taglist { display: flex; }
.e-con.beats,
.e-con.cards2,
.e-con.cards3,
.e-con.checks,
.e-con.contact-cards,
.e-con.dashm,
.e-con.flowd,
.e-con.foot-grid,
.e-con.foot-map,
.e-con.mock-body,
.e-con.mock-main,
.e-con.modgrid,
.e-con.proc,
.e-con.qlist,
.e-con.split,
.e-con.stack,
.e-con.stage,
.e-con.stat-row,
.e-con.steps,
.e-con.svc,
.e-con.svc-item,
.e-con.svc-list,
.e-con.tiles,
.e-con.two { display: grid; }
.e-con.btn { display: inline-flex; }
.e-con.mock-side,
.e-con.nav-menu-toggle { display: none; }

/* section.block cannot match a div; restore its vertical rhythm and the widths
   that components set for themselves. */
.e-con.block { padding: var(--section-gap) 0; }
.e-con.wrap { max-width: var(--container-max); margin-inline: auto; }
.e-con.wrap-narrow { max-width: 820px; margin-inline: auto; }
.e-con.section-head { max-width: 42ch; margin-inline: auto; }
.e-con.hero, .e-con.casehero, .e-con.subnav, .e-con.page-head { display: block; }

/* Widget wrappers must not add a box of their own inside our grids */
.e-con > .elementor-widget { width: 100%; }
.elementor-widget-container > :first-child { margin-top: 0; }

/* ── 7. Elementor global-kit overrides ──────────────────────────────────── */
/* Elementor's default kit paints headings with --e-global-color-primary
   (#6EC1E4) and buttons with --e-global-color-accent (#61CE70), via rules at
   (0,2,0) that outrank our component CSS. Rather than fight every rule, point
   Elementor's own global variables at the Sinc palette: anything the team later
   builds in the editor then picks up brand colours automatically.

   body[class*="elementor-kit-"] is (0,2,0) and beats Elementor's own
   .elementor-kit-N definition at (0,1,0). */
body[class*="elementor-kit-"] {
  --e-global-color-primary:   var(--magenta-600);
  --e-global-color-secondary: var(--ink-900);
  --e-global-color-text:      var(--ink-600);
  --e-global-color-accent:    var(--magenta-600);
}

/* Headings: mirror each component's colour onto .elementor-heading-title.
   Generated from site.css / pages.css. */
.section-head .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.page-head .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.feature .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.cta-band .elementor-widget-heading .elementor-heading-title { color: #fff; }
.foot-grid .elementor-widget-heading .elementor-heading-title { color: var(--text-primary); }
.foot-map .elementor-widget-heading .elementor-heading-title { color: var(--text-primary); }
.split .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.prose .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.prose .elementor-widget-heading .elementor-heading-title { color: var(--text-primary); }
.tile .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.case .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.svc .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.casehero .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.contact-cards .elementor-widget-heading .elementor-heading-title { color: var(--text-tertiary); }
.faqgroup .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.stage .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.hero .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.svc-item .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.legal .elementor-widget-heading .elementor-heading-title { color: var(--magenta-600); }
.legal .elementor-widget-heading .elementor-heading-title { color: var(--text-primary); }

/* Buttons.
   The button widget applies CSS classes to its outer .elementor-widget-button,
   not the inner <a class="elementor-button"> — so our .btn classes styled a
   wrapper box instead of the button. Neutralise the wrapper, style the real
   button per variant.

   Every rule is prefixed with `body` (specificity 0,3,1). Without it these tie
   at (0,3,0) with Elementor's kit CSS, which is enqueued later and wins the tie
   — that is why secondary buttons kept a magenta fill. */
.elementor-widget-button.btn { display: block; background: none; box-shadow: none;
  border-radius: 0; padding: 0; font-size: inherit; }

body .elementor-widget-button .elementor-button {
  font-family: inherit; font-weight: var(--weight-medium);
  border-radius: var(--radius-full); display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard), box-shadow var(--dur-normal); }
/* Elementor wraps label text in its own span, which inherits the underline */
body .elementor-widget-button .elementor-button .elementor-button-text,
body .elementor-widget-button .elementor-button:hover,
body .elementor-widget-button .elementor-button:focus { text-decoration: none; }

body .elementor-widget-button.btn-primary .elementor-button { background: var(--primary); color: #fff; }
body .elementor-widget-button.btn-primary .elementor-button:hover { background: var(--primary-hover); box-shadow: var(--shadow-brand); }
body .elementor-widget-button.btn-secondary .elementor-button { background: var(--surface);
  color: var(--text-primary); box-shadow: inset 0 0 0 1.5px var(--border-strong); border-radius: var(--radius-sm); }
body .elementor-widget-button.btn-secondary .elementor-button:hover { box-shadow: inset 0 0 0 1.5px var(--ink-900); }
body .elementor-widget-button.btn-ghost-dark .elementor-button { background: rgba(255,255,255,.1); color: #fff; border-radius: var(--radius-sm); }
body .elementor-widget-button.btn-ghost-dark .elementor-button:hover { background: rgba(255,255,255,.18); }
body .elementor-widget-button.btn-sm .elementor-button { font-size: var(--text-sm); padding: 10px 20px; }
body .elementor-widget-button.btn-lg .elementor-button { font-size: var(--text-md); padding: 15px 28px; border-radius: var(--radius-sm); }

/* Text inside the dark CTA band */
.cta-band .elementor-widget-text-editor, .cta-band .elementor-widget-text-editor p { color: rgba(255,255,255,.7); }

