
/* ---------------------------------------------------------------------------
   Commercial roofing case study page.
   Loads AFTER /css/commercial-roofing-project-library.css and reuses its
   --pl-* tokens, .pl-hero, .pl-eyebrow and scroll-reveal utilities so both
   pages read as one system. Only case-study components live here.
   --------------------------------------------------------------------------- */

/* maintenance-agreement.css sets #main-wrap { max-width:1240px; margin:40px auto 28px;
   padding:0 20px }. Same neutralisation the library page needs - id specificity. */
#main-wrap.cs-page { max-width: none; margin: 0; padding: 0; }

.cs-page { color: var(--pl-ink); }
.cs-page p { line-height: 1.72; }
/* Drop the shared sheet's red heading bar - the .pl-eyebrow already carries the accent. */
.cs-page .section-heading { border-left: 0; padding-left: 0; margin-top: 0; font-size: clamp(24px, 2.2vw, 31px); line-height: 1.18; margin-bottom: 20px; }

/* Hero reuses .pl-hero wholesale; only the photograph layer changes per project. */
.cs-hero {
    background-image:
        radial-gradient(118% 88% at 50% 16%, rgba(13, 58, 99, .5) 0%, rgba(6, 24, 41, 0) 60%),
        linear-gradient(112deg, rgba(5, 22, 38, .95) 0%, rgba(8, 44, 75, .88) 46%, rgba(46, 27, 56, .86) 100%),
        url('/img/federal/federal-roofing-hero.jpg');
}
.cs-hero .pl-hero-inner { text-align: left; }
.cs-hero .hero-cta-row { justify-content: flex-start; }
.cs-hero .pl-hero-lead { margin-left: 0; }

.cs-section { padding: 74px 0; }
.cs-section-soft { background: var(--pl-soft); border-top: 1px solid var(--pl-line); border-bottom: 1px solid var(--pl-line); }
.cs-lede { max-width: 820px; font-size: 18px; line-height: 1.75; color: var(--pl-navy); }
.cs-note { margin: 22px 0 0; padding: 14px 18px; border-left: 4px solid #f0b429; background: #fffaf0; border-radius: 0 8px 8px 0; color: #6b5200; font-size: 14px; line-height: 1.6; }

/* --- Sticky section nav ---------------------------------------------------- */
.cs-subnav { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .93); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--pl-line); box-shadow: 0 2px 14px rgba(8, 44, 75, .06); }
.cs-subnav-inner { display: flex; gap: 6px; align-items: center; overflow-x: auto; padding: 12px 0; scrollbar-width: thin; }
.cs-subnav a { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; color: var(--pl-muted); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 12.5px; font-weight: 600; letter-spacing: .8px; text-decoration: none; text-transform: uppercase; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.cs-subnav a:hover, .cs-subnav a:focus-visible { background: var(--pl-soft); color: var(--pl-navy); }
.cs-subnav a.is-active { background: var(--pl-navy); color: var(--pl-white); }
/* Anchor targets clear the sticky bar. */
.cs-page [id] { scroll-margin-top: 84px; }

/* --- Key facts: the primary machine-readable summary ------------------------ */
.cs-keyfacts { position: relative; margin: 0; background: var(--pl-white); border: 1px solid var(--pl-line); border-top: 5px solid var(--pl-red); border-radius: var(--pl-radius); box-shadow: var(--pl-shadow); overflow: hidden; }
.cs-keyfacts-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: baseline; justify-content: space-between; padding: 22px 26px 18px; border-bottom: 1px solid var(--pl-line); background: linear-gradient(180deg, #fbfcfd 0%, var(--pl-white) 100%); }
.cs-keyfacts-head h2 { margin: 0; color: var(--pl-navy); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 17px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; }
.cs-keyfacts-ref { color: var(--pl-muted); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; }
.cs-keyfacts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.cs-keyfacts-grid > div { padding: 18px 24px; border-right: 1px solid var(--pl-line); border-bottom: 1px solid var(--pl-line); }
.cs-keyfacts-grid > div:nth-child(4n) { border-right: 0; }
.cs-keyfacts-grid dt { color: var(--pl-red); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 10.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
.cs-keyfacts-grid dd { margin: 6px 0 0; color: var(--pl-navy); font-size: 16px; font-weight: 600; line-height: 1.4; }

/* --- Executive summary ------------------------------------------------------ */
.cs-summary { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 48px; align-items: start; }
.cs-summary-body > p:first-of-type { font-size: 19px; line-height: 1.7; color: var(--pl-navy); font-weight: 500; }
.cs-answer { padding: 24px 26px; background: var(--pl-soft); border-left: 5px solid var(--pl-red); border-radius: 0 12px 12px 0; }
.cs-answer h3 { margin: 0 0 10px; color: var(--pl-navy); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 14px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.cs-answer p { margin: 0; font-size: 15.5px; }

/* --- Data tables ------------------------------------------------------------ */
.cs-table-wrap { overflow-x: auto; margin: 24px 0 0; border: 1px solid var(--pl-line); border-radius: 12px; background: var(--pl-white); }
.cs-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14.5px; }
.cs-table caption { caption-side: top; padding: 16px 20px; color: var(--pl-navy); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 13px; font-weight: 600; letter-spacing: 1.1px; text-align: left; text-transform: uppercase; border-bottom: 1px solid var(--pl-line); }
.cs-table th, .cs-table td { padding: 13px 20px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--pl-line); }
.cs-table thead th { background: var(--pl-navy); color: var(--pl-white); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 11.5px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; border-bottom: 0; }
.cs-table tbody tr:last-child th, .cs-table tbody tr:last-child td { border-bottom: 0; }
.cs-table tbody tr:nth-child(even) { background: #fafbfc; }
.cs-table tbody th { color: var(--pl-navy); font-weight: 600; }
.cs-table td { color: var(--pl-muted); }
.cs-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; white-space: nowrap; }
.cs-tag-selected { background: rgba(238, 33, 43, .1); color: var(--pl-red); }
.cs-tag-rejected { background: rgba(91, 107, 122, .12); color: var(--pl-muted); }
.cs-tag-pass { background: rgba(16, 122, 76, .1); color: #107a4c; }

/* --- Timeline --------------------------------------------------------------- */
.cs-timeline { counter-reset: cs-phase; margin: 28px 0 0; padding: 0; list-style: none; }
.cs-timeline li { counter-increment: cs-phase; position: relative; padding: 0 0 30px 62px; }
.cs-timeline li::before { content: counter(cs-phase, decimal-leading-zero); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--pl-navy); color: var(--pl-white); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 13px; font-weight: 700; }
.cs-timeline li::after { content: ''; position: absolute; left: 19px; top: 46px; bottom: 6px; width: 2px; background: var(--pl-line); }
.cs-timeline li:last-child { padding-bottom: 0; }
.cs-timeline li:last-child::after { display: none; }
.cs-timeline h3 { margin: 8px 0 4px; color: var(--pl-navy); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 16px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.cs-timeline .cs-timeline-meta { display: block; margin-bottom: 8px; color: var(--pl-red); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 11.5px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; }
.cs-timeline p { margin: 0; color: var(--pl-muted); font-size: 15px; }

/* --- Result metrics --------------------------------------------------------- */
.cs-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.cs-metric { position: relative; padding: 26px 22px; background: var(--pl-white); border: 1px solid var(--pl-line); border-top: 4px solid var(--pl-red); border-radius: 11px; box-shadow: 0 7px 22px rgba(8, 44, 75, .06); }
.cs-metric-value { display: block; color: var(--pl-navy); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: clamp(26px, 2.4vw, 34px); font-weight: 700; line-height: 1.05; }
.cs-metric-label { display: block; margin-top: 9px; color: var(--pl-ink); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.cs-metric-note { display: block; margin-top: 8px; color: var(--pl-muted); font-size: 13px; line-height: 1.5; }

/* --- Verification panel ----------------------------------------------------- */
.cs-verify { position: relative; overflow: hidden; padding: 34px 36px; border-radius: 18px; background: linear-gradient(158deg, #0e3f6c 0%, #082c4b 52%, #061c31 100%); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 28px 64px rgba(6, 28, 49, .3); }
.cs-verify::before { content: ''; position: absolute; top: -110px; right: -90px; width: 300px; height: 300px; pointer-events: none; background: radial-gradient(circle, rgba(238, 33, 43, .4) 0%, rgba(238, 33, 43, 0) 68%); }
.cs-verify h2 { position: relative; margin: 0 0 6px; color: var(--pl-white); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 20px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.cs-verify > p { position: relative; margin: 0 0 22px; color: #a8c4dc; font-size: 15px; max-width: 780px; }
.cs-verify-list { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 34px; margin: 0; padding: 0; list-style: none; }
.cs-verify-list li { position: relative; padding: 13px 0 13px 30px; border-bottom: 1px solid rgba(255, 255, 255, .09); color: #d3e0ea; font-size: 15px; line-height: 1.55; }
.cs-verify-list li::before { content: '\2713'; position: absolute; left: 0; top: 13px; color: var(--pl-red); font-weight: 900; }
.cs-verify-list strong { color: var(--pl-white); font-weight: 600; }
.cs-verify-foot { position: relative; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); color: #9fc0dc; font-size: 13.5px; line-height: 1.6; }

/* --- Evidence gallery ------------------------------------------------------- */
.cs-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 28px 0 0; }
.cs-gallery figure { position: relative; margin: 0; border-radius: 13px; overflow: hidden; background: var(--pl-navy); box-shadow: 0 8px 24px rgba(8, 44, 75, .1); }
.cs-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s cubic-bezier(.22, .61, .36, 1); }
.cs-gallery figure:hover img { transform: scale(1.05); }
.cs-gallery figcaption { position: absolute; inset: auto 0 0 0; padding: 42px 18px 16px; background: linear-gradient(to top, rgba(4, 20, 35, .93) 0%, rgba(4, 20, 35, 0) 100%); color: #d7e5f0; font-size: 13.5px; line-height: 1.5; }
.cs-gallery figcaption b { display: block; margin-bottom: 4px; color: var(--pl-white); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 11px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.cs-gallery-stage { position: absolute; top: 14px; left: 14px; z-index: 1; padding: 5px 11px; border-radius: 4px; background: var(--pl-red); color: var(--pl-white); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 10.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }

/* --- FAQ -------------------------------------------------------------------- */
.cs-faq { margin-top: 26px; }
.cs-faq details { margin-bottom: 12px; border: 1px solid var(--pl-line); border-radius: 10px; background: var(--pl-white); overflow: hidden; }
.cs-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 22px; cursor: pointer; color: var(--pl-navy); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 15.5px; font-weight: 600; letter-spacing: .3px; list-style: none; }
.cs-faq summary::-webkit-details-marker { display: none; }
.cs-faq summary::after { content: '+'; flex: 0 0 auto; color: var(--pl-red); font-size: 22px; font-weight: 400; line-height: 1; }
.cs-faq details[open] summary { border-bottom: 1px solid var(--pl-line); }
.cs-faq details[open] summary::after { content: '\2013'; }
.cs-faq summary:hover { background: var(--pl-soft); }
.cs-faq-body { padding: 18px 22px 4px; }
.cs-faq-body p { color: var(--pl-muted); font-size: 15px; }

/* --- Project team ----------------------------------------------------------- */
.cs-team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.cs-team > div { padding: 24px; background: var(--pl-white); border: 1px solid var(--pl-line); border-left: 4px solid var(--pl-red); border-radius: 10px; }
.cs-team h3 { margin: 0 0 8px; color: var(--pl-navy); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 14px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; }
.cs-team p { margin: 0; color: var(--pl-muted); font-size: 14.5px; }

/* --- Prev / next ------------------------------------------------------------ */
.cs-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 30px; }
.cs-pager a { display: block; padding: 22px 24px; background: var(--pl-white); border: 1px solid var(--pl-line); border-radius: 11px; color: var(--pl-navy); text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.cs-pager a:hover { border-color: var(--pl-red); box-shadow: var(--pl-shadow); transform: translateY(-2px); }
.cs-pager span { display: block; margin-bottom: 7px; color: var(--pl-red); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 11px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.cs-pager strong { font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 16px; font-weight: 600; line-height: 1.3; }
.cs-pager a:last-child { text-align: right; }

@media (max-width: 1199px) {
    .cs-keyfacts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cs-keyfacts-grid > div:nth-child(4n) { border-right: 1px solid var(--pl-line); }
    .cs-keyfacts-grid > div:nth-child(3n) { border-right: 0; }
    .cs-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
    .cs-summary { grid-template-columns: 1fr; gap: 30px; }
    .cs-gallery, .cs-team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-verify-list { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .cs-section { padding: 50px 0; }
    .cs-keyfacts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-keyfacts-grid > div:nth-child(3n) { border-right: 1px solid var(--pl-line); }
    .cs-keyfacts-grid > div:nth-child(2n) { border-right: 0; }
    .cs-keyfacts-head { padding: 20px; }
    .cs-metrics, .cs-gallery, .cs-team, .cs-pager { grid-template-columns: 1fr; }
    .cs-pager a:last-child { text-align: left; }
    .cs-verify { padding: 26px 22px; }
    .cs-lede { font-size: 17px; }
    .cs-page [id] { scroll-margin-top: 70px; }
}

@media (prefers-reduced-motion: reduce) {
    .cs-gallery img, .cs-pager a, .cs-subnav a { transition: none; }
    .cs-gallery figure:hover img { transform: none; }
    .cs-pager a:hover { transform: none; }
}

/* --- Mobile: stacked card layout for data tables ---------------------------- */
/* Gated on .cs-table--stacked, which commercial-roofing-case-study.js adds only
   after it has copied each column heading onto its cells as data-label. Without
   JS the wrapper keeps its horizontally scrollable table rather than stacking
   into unlabelled cells. */
@media (max-width: 767px) {
    .cs-table-wrap.cs-table--stacked { overflow-x: visible; }
    .cs-table-wrap.cs-table--stacked .cs-table { display: block; width: 100%; min-width: 0; font-size: 14px; }
    .cs-table-wrap.cs-table--stacked .cs-table caption { display: block; padding: 14px 18px; }
    .cs-table-wrap.cs-table--stacked .cs-table tbody { display: block; }
    .cs-table-wrap.cs-table--stacked .cs-table tbody tr { display: block; padding: 2px 0 10px; border-bottom: 1px solid var(--pl-line); }
    .cs-table-wrap.cs-table--stacked .cs-table tbody tr:last-child { border-bottom: 0; }
    .cs-table-wrap.cs-table--stacked .cs-table tbody th,
    .cs-table-wrap.cs-table--stacked .cs-table tbody td { display: block; padding: 5px 18px; border-bottom: 0; }
    .cs-table-wrap.cs-table--stacked .cs-table tbody th { padding-top: 14px; font-size: 15.5px; }
    .cs-table-wrap.cs-table--stacked .cs-table tbody td::before { content: attr(data-label); display: block; margin-bottom: 1px; color: var(--pl-navy); font-family: var(--font-heading, 'Oswald', sans-serif); font-size: 10.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; opacity: .7; }
    /* thead is redundant once every cell carries its own label, but it stays in
       the accessibility tree for screen readers. */
    .cs-table-wrap.cs-table--stacked .cs-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
}
