/*
 * GTM Diligence — Provider Intelligence for Private Equity
 * Authoritative editorial / research publication
 * Navy + cream + copper/gold
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy-900: #0D1B2A;
    --navy-800: #1B2A4A;
    --navy-700: #243B63;
    --navy-600: #2D4A7A;
    --cream: #FAF7F2;
    --cream-dark: #F0EBE1;
    --warm-100: #F5F0E8;
    --copper: #B8860B;
    --copper-light: #D4A843;
    --copper-muted: rgba(184,134,11,0.12);
    --text-primary: #1A1A1A;
    --text-secondary: #3D3D3D;
    --text-muted: #6B6B6B;
    --border: #D6CFC3;
    --white: #FFFFFF;
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

/* === MASTHEAD === */

.masthead {
    background: var(--navy-900);
    padding: 1.75rem 1.5rem 0.75rem;
    text-align: center;
    border-bottom: 3px solid var(--copper);
}

.masthead-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.masthead-brand {
    text-decoration: none;
    display: inline-block;
}

.brand-mark {
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--copper);
    letter-spacing: 0.08em;
}

.brand-name {
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    font-size: 1.75rem;
    color: var(--white);
    margin-left: 0.15em;
}

.masthead-tagline {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 0.25rem;
    font-weight: 600;
}

/* === NAVIGATION === */

.site-nav {
    background: var(--navy-800);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-nav .nav-inner {
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
}

.site-nav .nav-links {
    display: flex;
    list-style: none;
    gap: 0;
}

.site-nav .nav-links li a {
    display: block;
    padding: 0.7rem 1.25rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.15s;
    border-bottom: 2px solid transparent;
}

.site-nav .nav-links li a:hover {
    color: var(--white);
    border-bottom-color: var(--copper);
}

.site-nav .nav-links li.active a {
    color: var(--white);
    border-bottom-color: var(--copper);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0.5rem auto;
}

/* === EDITORIAL HERO === */

.editorial-hero {
    background: var(--cream) url("../img/hero.png") center center / cover no-repeat;
    padding: 3.5rem 1.5rem 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.editorial-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(250,247,242,0.82);
}

.editorial-hero .hero-inner {
    position: relative;
    z-index: 1;
}

.editorial-hero .hero-inner {
    max-width: 38rem;
    margin: 0 auto;
}

.hero-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--copper);
    margin-bottom: 0.75rem;
}

.editorial-hero h1 {
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--navy-900);
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.hero-deck {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 32rem;
    margin: 0 auto;
}

.hero-rule {
    border: none;
    height: 2px;
    background: var(--copper);
    width: 3rem;
    margin: 2rem auto 0;
}

/* === CONTENT === */

.content-wrap {
    max-width: 44rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.content {
    /* No card — editorial pages sit directly on cream background */
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.content .article-hero-img {
    width: 100%;
    margin: 0 0 2rem;
    border-radius: 0;
    border: none;
    border-bottom: 2px solid var(--copper);
}

/* === TYPOGRAPHY === */

.content h1 {
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--navy-900);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.content h2 {
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy-800);
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.content h3 {
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-800);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.content a {
    color: var(--navy-700);
    text-decoration: underline;
    text-decoration-color: var(--copper-light);
    text-underline-offset: 2px;
    font-weight: 600;
}

.content a:hover {
    color: var(--copper);
}

.content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2.5rem 0;
}

/* === LISTS === */

.content ul, .content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.25rem;
}

.content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.content li strong {
    color: var(--text-primary);
}

/* === TABLES === */

.content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    display: block;
}

.content thead th {
    background: var(--navy-800);
    color: var(--white);
    font-weight: 700;
    padding: 0.7rem 0.9rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    font-family: 'Source Sans 3', sans-serif;
}

.content tbody td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--cream-dark);
    vertical-align: top;
    background: var(--white);
}

.content tbody tr:hover td {
    background: var(--copper-muted);
}

.content tbody tr:last-child td {
    border-bottom: 2px solid var(--navy-800);
}

.content tbody td:first-child {
    font-weight: 700;
    color: var(--navy-800);
}

/* Harvey ball alignment */
.content td:not(:first-child),
.content th:not(:first-child) {
    text-align: center;
}

/* === HARVEY BALL SPRITE === */
/* SVG sprite strip: 5 balls at 24px cells = 120x24 */
/* Navy stroke (#1B2A4A), copper fill (#B8860B) */

.hb {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAxMjAgMjQiPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjRkZGRkZGIi8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzFCMkE0QSIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iMzYiIGN5PSIxMiIgcj0iMTAiIGZpbGw9IiNGRkZGRkYiLz48cGF0aCBkPSJNMzYsMTIgTDM2LDIgQTEwLDEwIDAgMCwxIDQ2LDEyIFoiIGZpbGw9IiNCODg2MEIiLz48Y2lyY2xlIGN4PSIzNiIgY3k9IjEyIiByPSIxMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMUIyQTRBIiBzdHJva2Utd2lkdGg9IjIiLz48Y2lyY2xlIGN4PSI2MCIgY3k9IjEyIiByPSIxMCIgZmlsbD0iI0ZGRkZGRiIvPjxwYXRoIGQ9Ik02MCwxMiBMNjAsMiBBMTAsMTAgMCAwLDEgNjAsMjIgWiIgZmlsbD0iI0I4ODYwQiIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iMTIiIHI9IjEwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxQjJBNEEiIHN0cm9rZS13aWR0aD0iMiIvPjxjaXJjbGUgY3g9Ijg0IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjRkZGRkZGIi8+PHBhdGggZD0iTTg0LDEyIEw4NCwyIEExMCwxMCAwIDEsMSA3NCwxMiBaIiBmaWxsPSIjQjg4NjBCIi8+PGNpcmNsZSBjeD0iODQiIGN5PSIxMiIgcj0iMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzFCMkE0QSIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iMTA4IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjQjg4NjBCIi8+PGNpcmNsZSBjeD0iMTA4IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxQjJBNEEiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPgo=");
    background-repeat: no-repeat;
    background-size: 110px 22px;
    vertical-align: middle;
    position: relative;
}

.hb-1 { background-position: 0 0; }
.hb-2 { background-position: -22px 0; }
.hb-3 { background-position: -44px 0; }
.hb-4 { background-position: -66px 0; }
.hb-5 { background-position: -88px 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* === BLOCKQUOTES === */

.content blockquote {
    border-left: 3px solid var(--copper);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--warm-100);
    color: var(--text-secondary);
    font-style: italic;
}

.content blockquote p:last-child {
    margin-bottom: 0;
}

.content blockquote strong {
    font-style: normal;
}

/* === CODE === */

.content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.83em;
    background: var(--cream-dark);
    padding: 0.15em 0.4em;
    border-radius: 0.2rem;
    color: var(--text-primary);
}

.content pre {
    background: var(--navy-900);
    color: #C9D1D9;
    padding: 1.25rem 1.5rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--navy-800);
}

.content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* === FOOTER === */

.site-footer {
    background: var(--navy-900);
    color: rgba(255,255,255,0.45);
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-top: 3px solid var(--copper);
}

.footer-inner {
    max-width: 44rem;
    margin: 0 auto;
}

.footer-brand {
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.footer-brand .brand-mark {
    font-size: 1rem;
}

.footer-disclosure {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
}

.footer-copy {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    html { font-size: 16px; }

    .nav-toggle { display: block; }

    .site-nav .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-bottom: 0.5rem;
    }

    .site-nav .nav-links.open { display: flex; }

    .site-nav .nav-inner {
        flex-direction: column;
    }

    .site-nav .nav-links li a {
        text-align: center;
        padding: 0.5rem 1rem;
    }

    .masthead { padding: 1.25rem 1rem 0.5rem; }
    .brand-mark, .brand-name { font-size: 1.4rem; }

    .editorial-hero { padding: 2rem 1rem 1.5rem; }
    .editorial-hero h1 { font-size: 1.75rem; }

    .content-wrap { padding: 1.5rem 1rem 3rem; }
}

@media (max-width: 480px) {
    .editorial-hero h1 { font-size: 1.5rem; }
    .hero-deck { font-size: 0.95rem; }
    .content h1 { font-size: 1.5rem; }
    .content h2 { font-size: 1.15rem; }
}

/* --- Enhanced Image Constraints --- */
.content-wrap img, .content img, article img {
    max-width: 80% !important;
    display: block !important;
    margin: 32px auto !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .content-wrap img, .content img, article img {
        max-width: 100% !important;
    }
}

/* --- Global Image Size Fix --- */
.content img, .content-wrap img, article img, main img {
    max-width: 80% !important;
    width: 80% !important;
    height: auto !important;
    display: block !important;
    margin: 40px auto !important;
}

@media (max-width: 768px) {
    .content img, .content-wrap img, article img, main img {
        max-width: 100% !important;
        width: 100% !important;
    }
}
