/* ============================================================
   SFGA Bylaws – Multi‑Card Layout
   ============================================================ */

:root {
    /* Canvas + cards */
    --bg: #eef1f4;
    --article-bg: #fdfefe;
    --section-bg: #f7f9fb;

    /* Borders */
    --border: #cfd6dd;
    --soft-border: #e1e6eb;

    /* Accent + text */
    --accent: #0f766e;
    --accent-hover: #0c5d56; /* darker shade for hover */
    --text: #111827;
    --muted: #4b5563;

    /* Radius */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Shadows */
    --shadow-article: 0 6px 18px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
    --shadow-section: 0 1px 0 rgba(0, 0, 0, 0.03);

    /* Layout */
    --max-width: 980px;
    --line-height: 1.55;

    --appendix-bg: #e8f1f6; /* subtle differentiation */
    --appendix-art-bg: #f4f7f9;
}

/* ---------- Base ---------- */
* {
    box-sizing: border-box;
}

body * {
    box-sizing: border-box;
}

body {
    padding: 4px;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: var(--line-height);
}

header {
    max-width: var(--max-width);
    margin: 0 auto 40px;
    padding: 24px 20px;

    background: var(--article-bg);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-article);

    text-align: center; /* center the text block */
}

header h1 {
    margin: 0 0 12px;
    font-size: 1.8rem; /* larger headline */
    font-weight: 700;
    color: var(--text-strong); /* darker text color */
    letter-spacing: 0.5px; /* subtle spacing for gravitas */
    text-transform: uppercase; /* emphasize authority */
}

header cite {
    display: block;
    font-size: 1rem;
    font-style: normal; /* keep clean, not italic */
    color: var(--accent); /* highlight with accent color */
    font-weight: 600;
}

header button#print-btn {
    margin-top: 12px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff; /* text stays visible */
    background: var(--accent); /* base background */
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-article);
    transition: background 0.2s ease, color 0.2s ease;
}

header button#print-btn:hover {
    background: var(--accent-hover); /* darker accent on hover */
    color: #fff; /* force text to remain visible */
}

/* ---------- Main container ---------- */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 28px 16px 56px;
}

/* ============================================================
   ARTICLE = PRIMARY CARD
   ============================================================ */

article {
    background: var(--article-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-article);
    padding: 10px 12px; /*26px 24px*/
    margin: 10px auto; /*32px auto*/
    max-width: var(--max-width);
}

/* Article title anchors the card */
article > h1 {
    margin: 0 0 20px;
    padding-bottom: 12px;
    font-size: 1.45rem;
    border-bottom: 3px solid var(--accent);
    letter-spacing: 0.4px;
}

/* Article title anchors the card */
main > article > h1 {
    margin: 0 0 20px;
    padding-bottom: 12px;
    font-size: 1.45rem;
    border-bottom: 3px solid var(--accent);
    letter-spacing: 0.4px;
}

/* ============================================================
   SECTION = SUB‑CARD
   ============================================================ */

article > section {
    background: var(--section-bg);
    border: 1px solid var(--soft-border);
    border-radius: var(--radius-md);
    padding: 5px 8px; /*14px 16px*/
    margin-bottom: 10px; /*14px*/
    box-shadow: var(--shadow-section);
}

article > section:last-child {
    margin-bottom: 0;
}

/* Section headings */
section > h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
}

/* Paragraph spacing */
p {
    margin: 0 0 10px;
}

p:last-child {
    margin-bottom: 0;
}

/* Lists */
ul,
ol {
    margin: 8px 0 10px 22px;
}

li {
    margin: 6px 0;
}

/* ============================================================
   APPENDIX B – NESTED ARTICLE CARDS
   ============================================================ */

#appendix-b > article {
    background: var(--appendix-art-bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-top: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#appendix-b > article > h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    color: #065f46;
}

/* ============================================================
   LINKS & EMPHASIS
   ============================================================ */

a {
    color: #1d4ed8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

strong {
    font-weight: 700;
}

/* ============================================================
   NAVIGATION – DOCUMENT CARD
   ============================================================ */

nav {
    max-width: var(--max-width);
    margin: 24px auto 32px;
    padding: 18px 20px;

    background: var(--article-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-article);
}

nav ul {
    list-style: none;
    margin: 0 auto;
    padding: 0;

    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 6px 14px;

    width: fit-content;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 6px 8px;

    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;

    border-radius: var(--radius-sm);
}

nav a:hover {
    background: var(--section-bg);
    text-decoration: none;
}

nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

nav a span {
    display: block; /* put synopsis on its own line */
    font-size: 0.85rem; /* smaller than the article title */
    font-weight: 400; /* lighter weight for contrast */
    color: var(--muted); /* use your muted text color */
    margin-top: 2px; /* subtle spacing from the title */
    line-height: 1.4; /* improve readability */
}

nav > h2 {
    border-bottom: 3px solid var(--accent);
}

/* ============================================================
   APPENDIX – PARENT CARD DIFFERENTIATION
   ============================================================ */

article[id^="appendix-"] {
    background: var(--appendix-bg);
}

a[href="#top"] {
    display: block;
    width: fit-content;
    margin: 5px auto;
    padding: 2px;
    border-radius: 5px;
}

#searchContainer {
    width: 100%;
    display: flex;
    justify-content: center; /* centers horizontally */
    margin: 20px 0 30px; /* spacing above/below */
}

#searchBox {
    width: 260px; /* comfortable width */
    padding: 10px 14px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-section);
    transition: all 0.2s ease;
}

#searchBox::placeholder {
    color: var(--muted);
}

#searchBox:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.25); /* subtle accent glow */
}

#disclaimer {
    max-width: var(--max-width);
    margin: 40px auto 20px;
    padding: 16px 20px;
    background: var(--section-bg);
    border: 1px solid var(--soft-border);
    border-radius: var(--radius-md);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: var(--shadow-section);
}

#disclaimer p {
    margin: 0;
}

#disclaimer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

#disclaimer a:hover {
    text-decoration: underline;
}

/* ============================================================
   PRINT STYLES – Optimized for Bylaws
   ============================================================ */

@media print {
    header button#print-btn {
        display: none; /* hide button in print output */
    }
}

@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
        line-height: 1.4; /* improve readability */
        margin: 0; /* remove browser print margins */
    }

    header,
    nav,
    main,
    article,
    section {
        box-shadow: none !important; /* strip all shadows */
        background: #fff !important; /* force white background */
    }

    header {
        border-bottom: 2px solid #000; /* strong divider for title */
        padding-bottom: 12px;
        margin-bottom: 20px;
        text-align: center;
    }

    header h1 {
        font-size: 14pt; /* slightly larger for print */
        font-weight: 700;
        margin: 0 0 6px;
    }

    header cite {
        font-size: 10pt;
        font-style: normal;
        color: #000;
    }

    nav {
        border: 1px solid #000;
        border-radius: 0;
        margin: 0 0 20px;
        padding: 10px;
        page-break-after: avoid; /* keep TOC together */
    }

    nav h2 {
        font-size: 12pt;
        margin: 0 0 8px;
        text-align: center;
    }

    nav ul {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    nav li {
        margin: 2px 0;
    }

    nav a {
        color: #000;
        text-decoration: none;
        font-size: 10pt;
    }

    main {
        padding: 0;
    }

    /* Outer articles: no border */
    main > article {
        border: none !important;
        margin-bottom: 20px;
        padding: 16px;
        page-break-inside: avoid; /* keep articles intact */
    }

    article > h1 {
        font-size: 12pt;
        font-weight: 700;
        margin: 0 0 10px;
        border-bottom: 1px solid #000;
        padding-bottom: 4px;
    }

    /* Inner sections: keep borders */
    article > section {
        border: 1px solid #000;
        margin-bottom: 12px;
        padding: 10px;
        page-break-inside: avoid; /* keep sections intact */
    }

    section > h2 {
        font-size: 11pt;
        font-weight: 700;
        margin: 0 0 6px;
    }

    p,
    li {
        font-size: 10pt;
        margin: 0 0 6px;
    }

    /* Ensure each article starts on a new page if needed */
    article {
        page-break-before: auto;
        page-break-after: auto;
    }
}

.show {
    display: block;
}
.hide {
    display: none;
}
