/* =========================================================================
   Patient Stories (patient-stories.html + patient-stories-*.html case pages)
   Loaded AFTER styles.css. Everything is scoped under .ps- classes so it
   can't affect the rest of the site.

   Fonts: Barlow and Barlow Condensed (latin subset), self-hosted.
   Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow)
   Licensed under the SIL Open Font License 1.1 (https://openfontlicense.org)
   ========================================================================= */

@font-face { font-family: "Barlow"; src: url('../fonts/Barlow-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url('../fonts/Barlow-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url('../fonts/Barlow-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url('../fonts/BarlowCondensed-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url('../fonts/BarlowCondensed-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url('../fonts/BarlowCondensed-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url('../fonts/BarlowCondensed-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

.ps-scope {
    --ps-navy: var(--blue, #0b2347);
    --ps-ink: #0d203e;
    --ps-gold: var(--gold, #f1b82d);
    --ps-gold-text: #5a4210;   /* dark gold for small labels on light backgrounds */
    --ps-cream: #f2f1ed;
    --ps-photo-bg: #e7e4dc;
    --ps-line: #e2dfd7;
    --ps-muted: #3e4a5e;
    --ps-on-navy: #c8d0df;
    --ps-condensed: "Barlow Condensed", "Arial Narrow", sans-serif;
    font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ps-ink);
}

.ps-scope a { color: var(--ps-navy); }

/* ---------- Containers (sit inside the site's gold .page-shell) ---------- */
.ps-card {
    max-width: 1240px;
    margin: 0 auto;
    background: var(--ps-cream);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 56px 48px 56px;
}

.ps-band {
    max-width: 1240px;
    margin: 32px auto 0;
    background: var(--ps-navy);
    color: #fff;
    border-radius: 24px;
    border-top: 6px solid var(--ps-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 48px;
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: center;
    justify-content: space-between;
}

/* ---------- Shared type ---------- */
.ps-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--ps-condensed);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ps-ink);
}

.ps-eyebrow::before {
    content: "";
    width: 40px;
    height: 3px;
    background: var(--ps-gold);
    flex: none;
}

.ps-title {
    margin: 10px 0 16px;
    font-family: var(--ps-condensed);
    font-weight: 800;
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--ps-ink);
    text-align: left;
}

.ps-lead {
    margin: 0;
    max-width: 620px;
    font-size: 19px;
    line-height: 1.55;
    color: var(--ps-muted);
}

.ps-tag {
    font-family: var(--ps-condensed);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ps-gold-text);
}

.ps-btn {
    display: inline-block;
    background: var(--ps-navy);
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 17px;
    padding: 14px 22px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ps-btn:hover,
.ps-btn:focus-visible { background: #1d3d78; }

.ps-btn--gold {
    background: var(--ps-gold);
    color: var(--ps-ink) !important;
}

.ps-btn--gold:hover,
.ps-btn--gold:focus-visible { background: #fff; }

.ps-badge {
    display: inline-block;
    font-family: var(--ps-condensed);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 3px;
    background: var(--ps-navy);
    color: #fff;
}

.ps-badge--after {
    background: var(--ps-gold);
    color: var(--ps-ink);
}

/* ---------- Gallery page ---------- */
.ps-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 36px;
}

.ps-filter {
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: var(--ps-ink);
    border: 1px solid #cfcac0;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ps-filter:hover { border-color: var(--ps-navy); }

.ps-filter[aria-pressed="true"] {
    background: var(--ps-navy);
    color: #fff;
    border-color: var(--ps-navy);
}

.ps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.ps-case-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--ps-ink) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ps-case-card:hover,
.ps-case-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(11, 35, 71, 0.18);
}

.ps-case-card[hidden] { display: none; }

.ps-case-photo {
    position: relative;
    aspect-ratio: 4 / 3.4;
    overflow: hidden;
    background: var(--ps-photo-bg);
}

.ps-case-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

.ps-case-photo .ps-badge {
    position: absolute;
    left: 14px;
    top: 14px;
}

.ps-case-rule {
    height: 4px;
    background: var(--ps-gold);
}

.ps-case-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ps-case-title {
    font-family: var(--ps-condensed);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.05;
}

.ps-case-team {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ps-muted);
}

.ps-case-more {
    margin-top: 6px;
    font-weight: 600;
    font-size: 16px;
    color: var(--ps-navy);
}

.ps-cta-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    background: var(--ps-navy);
    color: #fff;
    border-radius: 8px;
    border-top: 4px solid var(--ps-gold);
    padding: 32px 28px;
}

.ps-cta-card .ps-tag { color: var(--ps-gold); }

.ps-cta-title {
    font-family: var(--ps-condensed);
    font-weight: 700;
    font-size: 34px;
    line-height: 1.05;
    margin-top: 12px;
}

.ps-scope .ps-cta-card p {
    margin: 12px 0 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ps-on-navy);
}

.ps-cta-card .ps-btn { align-self: flex-start; }

.ps-empty {
    margin-top: 24px;
    font-size: 17px;
    color: var(--ps-muted);
}

/* ---------- Case detail pages ---------- */
.ps-breadcrumb {
    font-size: 15px;
    color: var(--ps-muted);
    margin-bottom: 24px;
}

.ps-breadcrumb a { font-weight: 600; }

.ps-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

.ps-viewer {
    flex: 999 1 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ps-stage {
    position: relative;
    height: 560px;
    background: var(--ps-photo-bg);
    border-radius: 8px;
    overflow: hidden;
}

.ps-stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ps-stage .ps-badge {
    position: absolute;
    left: 18px;
    bottom: 18px;
    font-size: 20px;
    padding: 6px 14px;
}

.ps-thumbs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ps-thumb {
    padding: 6px;
    background: #fff;
    border: 3px solid var(--ps-line);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    color: var(--ps-ink);
    text-align: left;
    transition: border-color 0.2s ease;
}

.ps-thumb:hover { border-color: #cfcac0; }

.ps-thumb[aria-pressed="true"] { border-color: var(--ps-gold); }

.ps-thumb img {
    width: 100%;
    height: 96px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.ps-thumb span {
    display: block;
    padding: 8px 4px 2px;
    font-family: var(--ps-condensed);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ps-aside {
    flex: 1 1 340px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ps-aside .ps-eyebrow { font-size: 17px; }

.ps-aside .ps-title {
    margin: 0;
    font-size: clamp(2.6rem, 5vw, 3.5rem);
}

.ps-scope .ps-aside p {
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ps-muted);
}

.ps-team {
    background: #fff;
    border: 1px solid var(--ps-line);
    border-radius: 8px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ps-team-member {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ps-team-member + .ps-team-member {
    border-top: 1px solid var(--ps-line);
    padding-top: 18px;
}

.ps-team-name {
    font-family: var(--ps-condensed);
    font-weight: 700;
    font-size: 24px;
    text-decoration: none;
    color: var(--ps-ink) !important;
}

a.ps-team-name:hover { text-decoration: underline; }

.ps-team-role {
    font-size: 15px;
    line-height: 1.45;
    color: var(--ps-muted);
}

.ps-aside .ps-btn { text-align: center; padding: 16px 22px; }

/* "More patient stories" band */
.ps-band-text {
    flex: 1 1 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ps-band .ps-tag { color: var(--ps-gold); }

.ps-band-title {
    font-family: var(--ps-condensed);
    font-weight: 800;
    font-size: 44px;
    line-height: 1;
    text-transform: uppercase;
}

.ps-next {
    flex: 0 1 380px;
    display: flex;
    gap: 16px;
    align-items: center;
    background: #fff;
    color: var(--ps-ink) !important;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s ease;
}

.ps-next:hover,
.ps-next:focus-visible { transform: translateY(-3px); }

.ps-next img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    object-position: center 30%;
    display: block;
    flex: none;
}

.ps-next-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px 12px 0;
}

.ps-next-text .ps-tag { color: var(--ps-gold-text); font-size: 14px; }

.ps-next-title {
    font-family: var(--ps-condensed);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.05;
}

.ps-next-more {
    font-weight: 600;
    font-size: 15px;
    color: var(--ps-navy);
}

/* ---------- Tablet / phone ---------- */
@media screen and (max-width: 900px) {
    .ps-stage { height: 460px; }
}

@media screen and (max-width: 768px) {
    .ps-card { padding: 36px 20px 40px; border-radius: 18px; }
    .ps-band { padding: 32px 20px; border-radius: 18px; margin-top: 24px; }
    .ps-band-title { font-size: 34px; }
    .ps-lead { font-size: 17px; }
    .ps-grid { grid-template-columns: 1fr; }
    .ps-stage { height: auto; aspect-ratio: 4 / 4.2; }
    .ps-thumb img { height: 72px; }
    .ps-thumb span { font-size: 14px; letter-spacing: 0.08em; }
    .ps-detail { gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .ps-case-card,
    .ps-case-card:hover,
    .ps-next,
    .ps-next:hover { transition: none; transform: none; }
}

/* styles.css makes links inside paragraphs white; keep them readable here */
.ps-scope p a,
.ps-scope p a:visited { color: var(--ps-navy); font-weight: 600; }
.ps-band p a,
.ps-cta-card p a { color: var(--ps-gold); }

/* Closing line on a case write-up ("Two doctors. One shared goal. ...") */
.ps-scope .ps-aside .ps-tagline {
    border-left: 4px solid var(--ps-gold);
    padding: 4px 0 4px 16px;
    font-family: var(--ps-condensed);
    font-weight: 700;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ps-ink);
}
