/* ============================================================
   Don't Cage Me In — Site Styles (clean rewrite)
   ============================================================ */

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, sans-serif;
    line-height: 1.6;
    color: #e9eef7;
    background: #0f1115;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

/* Links */
a {
    color: #69d2ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Wrappers */
.wrap {
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: 4vw;
}

/* Utilities */
.small {
    font-size: .9rem;
}

.muted {
    color: #9fb0c2;
}

.visually-hidden {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0;
    border: 0;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Skip link */
.skip-link {
    position: fixed;
    left: 1rem;
    top: 1rem;
    transform: translateY(-150%);
    transition: transform .2s ease;
    background: #000;
    color: #fff;
    padding: .5rem .75rem;
    border-radius: 8px;
    z-index: 9999;
}

.skip-link:focus {
    transform: translateY(0);
}

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(160%) blur(10px);
    background: linear-gradient(180deg, rgba(15, 17, 21, .95), rgba(15, 17, 21, .7));
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.header-bar {
    display: grid;
    align-items: center;
    gap: 1rem;
    grid-template-columns: 1fr auto auto;
    padding-block: .9rem;
}

.logo {
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

/* Primary nav */
.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

.nav a {
    color: #e9eef7;
    opacity: .9;
}

.nav a:hover {
    opacity: 1;
}

/* Header actions (search + donate) */
.header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* Search */
.search-form {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.search-form input[type="search"] {
    background: #1b2030;
    color: #e9eef7;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: .55rem .9rem;
    min-width: 16ch;
}

.search-form button {
    background: #2a3a5a;
    color: #e9eef7;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: .55rem .9rem;
    cursor: pointer;
}

.search-form button:hover {
    filter: brightness(1.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: .6rem .9rem;
    border: 1px solid rgba(255, 255, 255, .14);
    background: #e8f3ff;
    color: #0b3d91;
    font-weight: 600;
}

.btn:hover {
    background: #dff0ff;
}

.donate-btn {
    background: #7ef7b4;
    color: #0c3a2a;
    border-color: #86f4bf;
}

.donate-btn:hover {
    filter: brightness(1.05);
}

/* Mobile nav toggle (visual only; JS handles expand/collapse) */
.menu-toggle {
    display: none;
    /* shown at <= 800px */
    background: #1b2030;
    color: #e9eef7;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    padding: .5rem .75rem;
}

/* ---------- Main / Article ---------- */
.site-main {
    padding-block: 1.25rem 2rem;
}

.article-content {
    padding-block: .25rem;
}

/* Hero (default: no cropping) */
.hero {
    padding: 1.5rem 0 0;
}

.hero h1 {
    margin: 0 0 .5rem 0;
    font-size: clamp(1.8rem, 3vw + 1rem, 3.2rem);
    line-height: 1.15;
}

.hero .disclosure {
    font-size: .9em;
    color: #9fb0c2;
    margin: .25rem 0 1rem 0;
}

.hero-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Optional BANNER hero (only when you WANT cropping) */
.hero--banner {
    position: relative;
    min-height: 48vh;
}

.hero--banner .hero-img {
    height: 48vh;
    object-fit: cover;
    filter: brightness(.72) saturate(115%);
}

.hero--banner .hero-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem;
    color: #fff;
}

.hero--banner .hero-text h1 {
    margin-bottom: .5rem;
}

/* Breadcrumbs */
.breadcrumbs {
    margin: 1rem 0 1.25rem;
    font-size: .95rem;
}

.breadcrumbs ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.breadcrumbs li {
    color: #9fb0c2;
}

.breadcrumbs li+li::before {
    content: "›";
    opacity: .6;
    margin: 0 .4rem;
}

.breadcrumbs a {
    color: #cfe6ff;
}

/* Table of contents */
.table-of-contents {
    background: #151923;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.table-of-contents h2 {
    margin: 0 0 .75rem 0;
    font-size: 1.1rem;
}

.table-of-contents ol {
    margin: 0;
    padding-left: 1.25rem;
}

.table-of-contents a {
    color: #9fd2ff;
}

/* Typography */
.article-content h2 {
    font-size: clamp(1.4rem, 1.25vw + 1rem, 2rem);
    margin-top: 2rem;
    margin-bottom: .5rem;
}

.article-content h3 {
    font-size: 1.2rem;
    margin-top: 1.25rem;
}

.article-content p {
    margin: .7rem 0;
}

.article-content ul,
.article-content ol {
    padding-left: 1.25rem;
}

.article-content li {
    margin: .35rem 0;
}

.article-content blockquote {
    margin: 1rem 0;
    padding: .75rem 1rem;
    border-left: 4px solid #69d2ff;
    background: #121720;
    color: #dbe8f7;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.article-content th,
.article-content td {
    border: 1px solid rgba(255, 255, 255, .12);
    padding: .6rem .5rem;
    text-align: left;
}

.article-content tr:nth-child(even) {
    background: rgba(255, 255, 255, .03);
}

/* Figures */
figure {
    margin: 1.25rem 0;
}

figcaption {
    color: #9fb0c2;
    font-size: .9rem;
    margin-top: .4rem;
}

/* Notes / footnotes */
.note {
    background: #121720;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: .9rem 1rem;
}

/* Code */
code,
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

pre {
    background: #0f151e;
    color: #e9eef7;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 1rem;
    overflow: auto;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, .07);
    background: #0f141c;
}

.site-footer .wrap {
    padding-block: 1.2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.site-footer nav ul {
    list-style: none;
    display: flex;
    gap: .9rem;
    margin: 0;
    padding: 0;
}

.site-footer nav a {
    color: #cfe6ff;
}

/* ---------- Forms (generic) ---------- */
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
    background: #151923;
    color: #e9eef7;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    padding: .6rem .75rem;
    width: 100%;
}

textarea {
    min-height: 140px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .header-bar {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo actions"
            "nav nav";
    }

    .logo {
        grid-area: logo;
    }

    .header-actions {
        grid-area: actions;
    }

    .nav {
        grid-area: nav;
    }
}

@media (max-width: 800px) {
    .menu-toggle {
        display: inline-flex;
    }

    .nav ul {
        flex-wrap: wrap;
        gap: .65rem .9rem;
    }

    .search-form input[type="search"] {
        min-width: 12ch;
    }

    .hero {
        padding-top: 1rem;
    }

    .site-footer .wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem;
    }
}

/* ---------- Optional helpers ---------- */
.pill {
    border-radius: 999px;
    padding: .25rem .6rem;
    background: #151923;
    border: 1px solid rgba(255, 255, 255, .08);
}

.badge {
    font-size: .85rem;
    padding: .2rem .5rem;
    background: #1b2030;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
}
