/* =============================================
   Layout CSS - Main Structure & Grid
============================================= */

html {
    scroll-padding-top: calc(var(--header-height-desktop) + var(--admin-bar-offset) + 20px);
}

#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

main {
    flex-grow: 1;
    margin-top: calc(var(--header-height-desktop) + var(--admin-bar-offset));
    min-height: calc(100vh - var(--header-height-desktop) - var(--admin-bar-offset));
    background: var(--color-bg-folder);
    padding: 12px 10%;
    position: relative;
    animation: fadeInUp 0.35s ease forwards;
}

main::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(10% - 28px);
    width: 1px;
    background: var(--color-margin-line);
    pointer-events: none;
}

/* If a full static document gets pasted into a normal WordPress page,
   neutralize the nested <main> so spacing is not applied twice. */
.page-section > main {
    margin-top: 0;
    min-height: auto;
    padding: 0;
    background: transparent;
    animation: none;
}

.page-section > main::before {
    display: none;
}

/* Front page safety net: ensure hero starts at the same vertical origin. */
body.home > #page > main#primary.site-main {
    padding-top: 12px;
}

body.home .page-section > .wp-block-spacer:first-child,
body.home .page-section > p:empty:first-child {
    display: none !important;
}

body.home .page-section > *:first-child {
    margin-top: 0 !important;
}

/* Typography */

h1 {
    font-family: var(--font-legal);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 40px 0 32px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-ink);
    max-width: none;
    border-top: 2px solid var(--color-text-ink);
    border-bottom: 2px solid var(--color-text-ink);
    padding: 24px 0;
    display: block;
    text-align: center;
}

h2 {
    font-family: var(--font-legal);
    font-size: 1.36rem;
    font-weight: 700;
    margin: 52px 0 18px;
    line-height: 1.34;
    color: var(--color-accent);
    border-bottom: 3px solid var(--color-border);
    padding-bottom: 10px;
    letter-spacing: 0.01em;
    text-transform: none;
    max-width: none;
}

h3 {
    font-family: var(--font-legal);
    font-size: 1.05rem;
    margin-bottom: 15px;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-accent);
    font-weight: 700;
}

h4 {
    font-family: var(--font-legal);
    font-size: 0.93rem;
    margin-bottom: 10px;
    text-transform: none;
    letter-spacing: 0.01em;
    color: var(--color-accent);
    font-weight: 700;
}

p {
    font-size: 1.04rem;
    line-height: 1.82;
    margin-bottom: 22px;
    max-width: none;
}

ul {
    margin: 0 0 32px 28px;
    font-size: 1rem;
    line-height: 1.76;
    max-width: none;
}

li { margin-bottom: 10px; }

.lead {
    font-family: var(--font-legal);
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.65;
    color: var(--color-accent);
    margin-bottom: 26px;
    max-width: none;
}

.eyebrow {
    font-family: var(--font-legal);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-stamp-red);
    margin-bottom: 16px;
}

.small-note {
    font-family: var(--font-legal);
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--color-text-gray);
    max-width: none;
}

.hero-sheet {
    position: relative;
    background: #FFFFFF;
    border: 4px solid var(--color-accent);
    padding: 48px;
    margin-bottom: 56px;
}

.hero-sheet .eyebrow {
    margin-bottom: 14px;
}

.hero-brief {
    display: block;
    width: 100%;
    text-align: left;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-top: 4px solid var(--color-text-ink);
    border-bottom: 4px solid var(--color-text-ink);
    padding: 32px 0;
    margin: 48px 0;
    line-height: 1.4;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: calc(var(--header-height-mobile) + var(--admin-bar-offset) + var(--mobile-top-inset, max(env(safe-area-inset-top, 0px), 24px)) + 16px);
    }
}

@media (min-width: 981px) {
    .path-card {
        display: grid;
        grid-template-columns: 80px 150px 1fr 180px;
        align-items: center;
        gap: 24px;
        padding: 16px 24px;
    }
    .path-card .path-label { margin-bottom: 0; }
    .path-card h3 { margin: 0; }
    .path-card p { margin: 0; max-width: none; }
    .path-card .cta-row { margin-top: 0; justify-content: flex-end; }
}
