/* Design Standard v1 (Nov 2026): the shared foundation. Every other stylesheet sits in the lower "legacy" layer, so the
   rules here win on specificity alone, with no !important. Type scale, three button types, segmented controls and
   tappable edges; see the "aecreconsulting.com Design Standard v1" doc. Check: _checks/capture/check_design.py. */
@layer legacy, foundation;
@layer foundation {
  :root { --edge: #7A8278; --amber-dk: #C9851C; }
  body { font-size: var(--fs-body); }
  :where(main, footer) :is(button, input, select, textarea) { font-family: inherit; font-size: inherit; }  /* page content only: the nav keeps its own sizes */
  h1 { font-size: var(--fs-h1); }
  h1, h2, h3, h4 { text-wrap: balance; }
  /* S39: older heroes follow the v2 phone scale; last pair kept together */
  @media (max-width: 429.98px) { h1.h1-fit { font-size: clamp(28px, 8.6vw, 36px); } h1.h1-fit .h1-pair { white-space: nowrap; } }
  .nw { white-space: nowrap; }  /* hyphenated words in headings stay on one line */

  /* Primary: the page's lead action. Filled amber, ink label, 48 px. */
  .btn, .btn-primary, .guide-cta, .newsletter-btn, .form-submit, .cst-btn, .cpa-btn-amber, .btn-calc,
  .hs-btn.amber, .btn-next, .d179-calc-btn, .ind-cann-link, .ind-other-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em; box-sizing: border-box;
    min-height: 48px; padding: 0 24px; border: 0; border-radius: 10px;
    background: var(--amber); color: var(--ink); text-decoration: none;
    font-size: var(--fs-body); font-weight: 700; line-height: 1.2; text-transform: none; letter-spacing: normal;
    max-width: 100%; white-space: normal; text-align: center;   /* long labels wrap instead of overflowing */
  }
  :is(.btn, .btn-primary, .guide-cta, .newsletter-btn, .form-submit, .cst-btn, .cpa-btn-amber, .btn-calc,
      .hs-btn.amber, .btn-next, .d179-calc-btn, .ind-cann-link, .ind-other-cta):hover { background: var(--amber-dk); color: var(--ink); }

  /* Secondary: outlined in the surrounding text color, so it reads on light and dark panels alike. */
  .btn-o, .g-pdf-btn, .ec-trigger--btn, .cpa-btn-ghost, .cpa-btn-line, .ghost, .add-pc, .hs-btn.ink, .more-link.see-all, .sc-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em; box-sizing: border-box;
    min-height: 48px; padding: 0 22px; border: 2px solid currentColor; border-radius: 10px;
    background: transparent; color: inherit; text-decoration: none;
    font-size: var(--fs-body); font-weight: 700; line-height: 1.2; text-transform: none; letter-spacing: normal;
    max-width: 100%; white-space: normal; text-align: center;   /* long labels wrap instead of overflowing */
  }
  :is(.btn-o, .g-pdf-btn, .ec-trigger--btn, .cpa-btn-ghost, .cpa-btn-line, .ghost, .add-pc, .hs-btn.ink,
      .more-link.see-all, .sc-cta):hover { background: rgba(127, 127, 127, .14); }
  .btn-o.on-dark { color: #FFFFFF; border-color: var(--on-dark); }   /* outlined buttons on dark cards */
  .sc-cta { padding: 0 14px; white-space: nowrap; }   /* calculator sidebar (248 px): keeps "Book a Discovery Call" on one line */

  /* Segmented controls (yes/no, entity, year, filter chips): 44 px, small text, a visible edge. */
  .est-btn, .est-cvd-toggle-btn, .est-entity-btn, .est-pwa-btn, .yr-btn, .st-chip, .chip {
    min-height: 44px; font-size: var(--fs-small); font-weight: 600; text-transform: none; letter-spacing: normal;
    border: 1px solid var(--edge); border-radius: 8px;
  }

  /* Tappable cards, tiles and rows: an edge of at least 3:1 against the page (WCAG 1.4.11). */
  a.tile, a.route, .q-tile, a.gcard, a.quick-card, a.article-card, a.featured-card, a.card.svc-card, a.tbl-link {
    border: 1px solid var(--edge);
  }

  /* Anything the page hides with the hidden attribute stays hidden, whatever its button type. */
  :is(.btn, .btn-primary, .guide-cta, .newsletter-btn, .form-submit, .cst-btn, .cpa-btn-amber, .btn-calc,
      .hs-btn, .btn-next, .btn-o, .g-pdf-btn, .ec-trigger--btn, .cpa-btn-ghost, .cpa-btn-line, .ghost, .add-pc,
      .more-link, .d179-calc-btn, .est-btn, .est-cvd-toggle-btn, .est-entity-btn, .est-pwa-btn, .yr-btn, .st-chip, .chip)[hidden] { display: none; }

  /* Running text in cards, steps, definitions and summaries is body size; notes, sources, captions and fine print stay small. */
  :is(.prong, .glp-item, .step, .scen, .cpa-card, .glt, .cpa-step, .cpa-block, .faq-a-inner)
    p:not([class*="note"]):not([class*="fine"]):not([class*="cap"]):not([class*="src"]):not(.fs),
  p.lu-what, p.excerpt, p.what, p.newsletter-strip-desc { font-size: var(--fs-body); }
  p.sc-body { font-size: 15px; }   /* the cost seg calculator sidebar note: 15 px like the rest of every calculator sidebar (Session 30) */

  /* Other nav buttons stay outlined. The header's booking button is filled amber on every page, as on the shared layout
     (Taylor, Nov 13, 2026: "make the Book a Discovery Call amber everywhere"; it replaces the earlier outlined-in-the-nav rule). */
  :is(nav .btn, nav .nav-btn, header .btn):not(.hdr-cta) {
    background: transparent; color: #FFFFFF; border: 2px solid var(--on-dark); min-height: 44px;
  }
  :is(nav .btn, nav .nav-btn, header .btn):not(.hdr-cta):hover { background: #FFFFFF; color: var(--ink); }
  .hdr .hdr-cta { background: #E09B2D; color: #0D1F14; border: 0; }
  .hdr .hdr-cta:hover { background: #F5C66A; color: #0D1F14; }

  /* Selected toggles are green with white text (amber marks actions, not states). */
  :is(.est-btn, .est-cvd-toggle-btn, .est-entity-btn, .est-pwa-btn, .st-chip).active,
  :is(.yr-btn, .chip)[aria-pressed="true"] {
    background: var(--green); color: #FFFFFF; border-color: var(--on-dark); font-weight: 700;   /* light edge reads on dark panels too */
  }

  /* Amber marks things you can click. Static labels on dark panels are light gray; figures are white. */
  .hero .panel h2, .hero .panel dl.glance dt, .dark .label, .dark .head > .label, .dark .split > div > .label,
  .section-tag.dark { color: var(--on-dark); }
  .hero .panel dl.glance dd b { color: #FFFFFF; }
  .dark .card .label { background: rgba(255, 255, 255, .08); color: var(--on-dark); }
  .yr-btn { white-space: nowrap; }   /* "Pre-2021" stays on one line; other toggles wrap */

  /* Shared rules kept here (Nov 11, 2026 split): the process steps on phones (20 pages), the cost seg and Industries qualifier
     padding on phones, and guide and Law Updates bylines (19 resource pages). Page-only rules live in css/page-*.css. */
  @media (min-width: 361px) and (max-width: 480px) {
    .steps { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px 16px; }
  }
  @media (max-width: 480px) { #qualifier { padding-top: 40px; padding-bottom: 40px; } }
  .hero-meta a.byline { color: var(--white); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .45); text-underline-offset: 3px; }
  .hero-meta a.byline:hover { text-decoration-color: var(--white); }

  /* Phone accordions (site-chrome.js, data-phone-collapse): same component as the industry template */
  @media (max-width: 640px) {
    .ph-acc:not(.open) .ph-body { display: none !important; }
    .ph-acc h2, .ph-acc h3 { margin-bottom: 0; }
    .ph-btn { all: unset; box-sizing: border-box; display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; }
    .ph-btn:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
    .ph-btn svg { flex: none; transition: transform .2s; }
    .ph-acc.open .ph-btn svg { transform: rotate(180deg); }
  }

  /* Resources nav (design pass 3, Nov 2026; approved): the label is a link to /resources, the caret is its own menu button */
  .nav-links .nav-dd { display: inline-flex; align-items: center; }
  .nav-links .nav-dd-link:hover, .nav-links .nav-dd-link.active, .nav-dd.open .nav-dd-link { color: #fff; }
  .nav-links .nav-dd-btn { justify-content: center; width: 28px; min-height: 44px; margin-left: 2px; }
  .nav-links .nav-dd-btn:hover, .nav-dd.open .nav-dd-btn { color: #fff; }

  /* Related-industries links on every industry page (Nov 11, 2026): the stone border measured 1.11:1 against the white
     section; the standard's tappable edge (3:1) makes each link read as a tile. Fill, arrow and hover unchanged. */
  .related-ind .related-ind-list a { border-color: var(--edge); }
  .related-ind .related-ind-list a:hover { border-color: var(--green); }
}
/* Tap targets at least 44 px tall (Step 3, Nov 14, 2026; Taylor's phone-polish list plus the same components found by a 390 px sweep
   of all 48 pages). Inline links: vertical padding only (no layout change). Block links: padding with an equal negative margin. */
.hero-meta a.byline{padding-block:14px}
/* Primary source links (Session 26): always underlined, so a citation link is never told apart by color alone (WCAG 1.4.1) */
@layer foundation{a.cite,main a[href*="law.cornell.edu/uscode"],main a[href*="ecfr.gov"]{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}}
