/* =====================================================================
   PINNACLE AUDIOLOGY — EDITORIAL LUXURY COMPOSITION LAYER
   Presentation-only treatment for repeated service, resource and location
   templates. Warm Pinnacle orange, cream, black and warm gray only.
   ===================================================================== */

:root{
  --pae-orange:#F08647;
  --pae-orange-deep:#B65320;
  --pae-ink:#181511;
  --pae-ink-soft:#4F473E;
  --pae-cream:#F8F3EA;
  --pae-paper:#FFFDF9;
  --pae-line:#DED4C4;
  --pae-muted:#746B60;
  --pae-radius:22px;
  --pae-shadow:0 30px 70px -48px rgba(42,29,16,.52);
}

body.pa-editorial-system main{
  min-width:0;
  isolation:isolate;
}

body.pa-editorial-system main :where(h1,h2,h3,.display,.h-xl,.h-lg,.h-md){
  text-wrap:balance;
}

body.pa-editorial-system main :where(p,.lede,.intro,li){
  text-wrap:pretty;
}

body.pa-editorial-system main :where(img,video,iframe){
  max-width:100%;
}

/* Editorial first screen for content-led pages without photography. */
body.pa-editorial-system.pa-no-content-media:not(.pa-route-family-video):not(.pa-route-family-journal)
  main > :is(.page-hero,.hero):first-child{
  background:
    radial-gradient(circle at 88% 22%,rgba(240,134,71,.19),transparent 28%),
    linear-gradient(rgba(92,72,49,.055) 1px,transparent 1px),
    linear-gradient(90deg,rgba(92,72,49,.055) 1px,transparent 1px),
    linear-gradient(145deg,#fffdfa 0%,#f6efe5 100%) !important;
  background-size:auto,58px 58px,58px 58px,auto !important;
  border-bottom:1px solid var(--pae-line) !important;
}

body.pa-editorial-system.pa-no-content-media:not(.pa-route-family-video):not(.pa-route-family-journal)
  main > :is(.page-hero,.hero):first-child :where(.ph-image,.hero-media,.hero-image):empty{
  min-height:clamp(280px,34vw,470px);
  border:1px solid rgba(181,83,32,.26);
  border-radius:clamp(18px,3vw,34px);
  background:
    radial-gradient(circle at 50% 50%,transparent 0 18%,rgba(240,134,71,.20) 18.3% 18.7%,transparent 19% 32%,rgba(240,134,71,.15) 32.3% 32.7%,transparent 33% 46%,rgba(240,134,71,.10) 46.3% 46.7%,transparent 47%),
    linear-gradient(145deg,rgba(255,253,249,.9),rgba(244,235,223,.86));
}

/* Repair the previously under-specified card-grid component. */
body.pa-editorial-system main .card-grid{
  --pae-card-gap:clamp(12px,1.5vw,20px);
  display:grid !important;
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  gap:var(--pae-card-gap) !important;
  align-items:stretch;
  counter-reset:pae-card;
  margin-top:clamp(26px,4vw,48px);
}

body.pa-editorial-system main .card-grid > .card{
  grid-column:span 4;
  min-width:0;
  min-height:clamp(210px,18vw,280px);
  position:relative;
  overflow:hidden;
  counter-increment:pae-card;
  border:1px solid var(--pae-line) !important;
  border-radius:var(--pae-radius) !important;
  background:linear-gradient(145deg,var(--pae-paper),#F7F0E6) !important;
  box-shadow:var(--pae-shadow) !important;
  transition:transform .28s cubic-bezier(.22,1,.36,1),border-color .28s,box-shadow .28s;
}

body.pa-editorial-system main .card-grid > .card::after{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:42%;
  height:3px;
  background:linear-gradient(90deg,var(--pae-orange),transparent);
  pointer-events:none;
}

body.pa-editorial-system main .card-grid > .card .card-body{
  display:flex;
  min-height:100%;
  flex-direction:column;
  padding:clamp(24px,3vw,38px) !important;
}

body.pa-editorial-system main .card-grid > .card .card-body::before{
  content:"0" counter(pae-card);
  display:block;
  margin:0 0 clamp(28px,5vw,54px);
  color:var(--pae-orange-deep);
  font-family:'JetBrains Mono',ui-monospace,monospace;
  font-size:11px;
  font-weight:700;
  letter-spacing:.18em;
}

body.pa-editorial-system main .card-grid > .card :where(h3,.h-md){
  margin-top:0;
  font-family:'Barlow Condensed',sans-serif;
  font-size:clamp(27px,2.6vw,39px);
  font-weight:750;
  line-height:.98;
  letter-spacing:-.015em;
  text-transform:uppercase;
}

body.pa-editorial-system main .card-grid > .card p{
  margin-bottom:0;
  color:var(--pae-ink-soft);
  line-height:1.62;
}

body.pa-editorial-system main .card-grid > .card :where(.card-link,a:not(.btn)){
  color:var(--pae-orange-deep);
  text-decoration-thickness:1px;
  text-underline-offset:3px;
}

/* Exact-count compositions keep rows intentional instead of leaving orphans. */
body.pa-editorial-system main .card-grid:has(> :nth-child(1):last-child) > .card{grid-column:1/-1;min-height:0}
body.pa-editorial-system main .card-grid:has(> :nth-child(2):last-child) > .card{grid-column:span 6}
body.pa-editorial-system main .card-grid:has(> :nth-child(4):last-child) > .card{grid-column:span 6}
body.pa-editorial-system main .card-grid:has(> :nth-child(5):last-child) > .card:nth-child(-n+2){grid-column:span 6}

@media(hover:hover){
  body.pa-editorial-system main .card-grid > .card:hover{
    transform:translateY(-5px);
    border-color:rgba(181,83,32,.48) !important;
    box-shadow:0 32px 76px -42px rgba(42,29,16,.6) !important;
  }
}

/* Tile-heavy pages get section rhythm and one restrained dark editorial beat. */
body.pa-editorial-system.pa-tile-heavy main > .section:nth-of-type(even):not(.faq):not(.related-services),
body.pa-editorial-system.pa-tile-heavy main > .pad:nth-of-type(even):not(.cta){
  background:
    linear-gradient(90deg,rgba(102,79,51,.045) 1px,transparent 1px),
    linear-gradient(rgba(102,79,51,.045) 1px,transparent 1px),
    var(--pae-cream) !important;
  background-size:64px 64px !important;
}

body.pa-editorial-system.pa-tile-heavy main > :is(.section,.pad):nth-of-type(4n+3)
  .card-grid > .card:first-child{
  background:linear-gradient(145deg,#171411,#2B211A) !important;
  border-color:#171411 !important;
  color:#FFF9F0;
}

body.pa-editorial-system.pa-tile-heavy main > :is(.section,.pad):nth-of-type(4n+3)
  .card-grid > .card:first-child :where(h3,.h-md,p,a,.eyebrow){
  color:inherit !important;
}

/* Existing cov grids retain their page-specific layout, but no longer look flat. */
body.pa-editorial-system.pa-tile-heavy main .cov-grid > .cov{
  position:relative;
  overflow:hidden;
  border-color:var(--pae-line) !important;
  border-radius:clamp(16px,2vw,24px) !important;
  background:linear-gradient(145deg,#fff,var(--pae-cream)) !important;
  box-shadow:var(--pae-shadow) !important;
}

body.pa-editorial-system.pa-tile-heavy main .cov-grid > .cov::after{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:3px;
  background:linear-gradient(180deg,var(--pae-orange),transparent 72%);
  pointer-events:none;
}

/* Process lists become a confident editorial timeline. */
body.pa-editorial-system main .steps{
  position:relative;
  counter-reset:pae-step;
}

body.pa-editorial-system main .steps > li{
  counter-increment:pae-step;
  border-color:var(--pae-line) !important;
}

body.pa-editorial-system main .steps > li :where(.step-n,.sn){
  border-color:rgba(240,134,71,.55) !important;
  color:var(--pae-orange-deep) !important;
}

/* Long prose sections should read like a magazine, not a CMS dump. */
body.pa-editorial-system.pa-tile-heavy main .prose{
  max-width:76ch;
  padding-left:clamp(18px,3vw,38px);
  border-left:2px solid var(--pae-orange);
}

body.pa-editorial-system main :where(.accordion,.faqx){
  border-top:1px solid var(--pae-line);
  border-bottom:1px solid var(--pae-line);
}

body.pa-editorial-system main :where(.acc-item,details){
  border-color:var(--pae-line) !important;
}

body.pa-editorial-system:is(.pa-tile-heavy,.pa-no-content-media):not(.pa-route-family-journal):not(.pa-route-family-video)
  main :where(.cta-banner,.cta,.midcta){
  background:
    radial-gradient(circle at 50% 0,rgba(240,134,71,.20),transparent 38%),
    linear-gradient(145deg,#181511,#2A2019) !important;
  color:#FFF9F0;
}

body.pa-editorial-system:is(.pa-tile-heavy,.pa-no-content-media):not(.pa-route-family-journal):not(.pa-route-family-video)
  main :where(.cta-banner,.cta,.midcta) :where(h2,p,.eyebrow){
  color:inherit !important;
}

body.pa-editorial-system:is(.pa-tile-heavy,.pa-no-content-media):not(.pa-route-family-journal):not(.pa-route-family-video)
  main :where(.cta-banner,.cta,.midcta) .btn.ghost{
  color:#FFF9F0 !important;
  border-color:rgba(255,249,240,.42) !important;
}

/* Location pages receive a slightly more hospitable, less clinical cadence. */
body.pa-editorial-system.pa-route-family-location main .cov-grid > .cov:first-child{
  background:linear-gradient(145deg,#181511,#2B211A) !important;
  color:#FFF9F0;
}

body.pa-editorial-system.pa-route-family-location main .cov-grid > .cov:first-child :where(h3,p,a,.sec-label){
  color:inherit !important;
}

@media(max-width:900px){
  body.pa-editorial-system main .card-grid > .card,
  body.pa-editorial-system main .card-grid:has(> :nth-child(2):last-child) > .card,
  body.pa-editorial-system main .card-grid:has(> :nth-child(4):last-child) > .card,
  body.pa-editorial-system main .card-grid:has(> :nth-child(5):last-child) > .card:nth-child(-n+2){
    grid-column:span 6;
  }
}

@media(max-width:680px){
  body.pa-editorial-system main .card-grid{
    grid-template-columns:1fr !important;
    gap:12px !important;
    margin-top:24px;
  }

  body.pa-editorial-system main .card-grid > .card,
  body.pa-editorial-system main .card-grid:has(> :nth-child(1):last-child) > .card,
  body.pa-editorial-system main .card-grid:has(> :nth-child(2):last-child) > .card,
  body.pa-editorial-system main .card-grid:has(> :nth-child(4):last-child) > .card,
  body.pa-editorial-system main .card-grid:has(> :nth-child(5):last-child) > .card:nth-child(-n+2){
    grid-column:1 !important;
    min-height:0;
    border-radius:17px !important;
  }

  body.pa-editorial-system main .card-grid > .card .card-body{
    padding:24px !important;
  }

  body.pa-editorial-system main .card-grid > .card .card-body::before{
    margin-bottom:22px;
  }

  body.pa-editorial-system main .card-grid > .card :where(h3,.h-md){
    font-size:30px;
  }

  body.pa-editorial-system.pa-tile-heavy main > .section:nth-of-type(even):not(.faq):not(.related-services),
  body.pa-editorial-system.pa-tile-heavy main > .pad:nth-of-type(even):not(.cta){
    background-size:42px 42px !important;
  }

  body.pa-editorial-system main :where(.section-head,.mfr-head,.shead){
    margin-bottom:clamp(28px,8vw,44px);
  }

  body.pa-editorial-system main :where(.cta-ctas,.cta-actions,.hero-ctas,.hero-cta){
    width:100%;
  }

  body.pa-editorial-system main :where(.cta-ctas,.cta-actions,.hero-ctas,.hero-cta) > :where(a,button){
    width:100%;
    min-height:54px;
    justify-content:center;
    text-align:center;
  }
}

@media(prefers-reduced-motion:reduce){
  body.pa-editorial-system main .card-grid > .card{
    transition:none !important;
  }
}

@media print{
  body.pa-editorial-system main .card-grid > .card,
  body.pa-editorial-system.pa-tile-heavy main .cov-grid > .cov{
    box-shadow:none !important;
  }
}
