:root {
    --ink: #17212b;
    --muted: #5d6974;
    --line: #d8dee4;
    --paper: #ffffff;
    --soft: #f3f6f8;
    --navy: #173b57;
    --navy-dark: #102b40;
    --teal: #267a78;
    --danger: #a63030;
    --success: #246a43;
    --radius: 8px;
    --shadow: 0 10px 30px rgba(18, 43, 62, 0.08);
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.65;
}

a {
    color: var(--navy);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--teal);
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--navy-dark);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.18;
}

h1 {
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(1.55rem, 3vw, 2.25rem);
}

p {
    margin-top: 0;
}

.container {
    width: min(calc(100% - 2rem), var(--max));
    margin-inline: auto;
}

.narrow {
    max-width: 820px;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 1000;
    padding: 0.6rem 0.9rem;
    color: #fff;
    background: var(--navy);
}

.skip-link:focus {
    top: 1rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--navy-dark);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--navy);
    font-family: Georgia, serif;
    font-size: 1.5rem;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
}

.brand small {
    max-width: 290px;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.2;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.primary-nav a {
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    color: var(--ink);
    font-size: 0.94rem;
    text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a.active {
    color: var(--navy);
    background: var(--soft);
}

.nav-toggle {
    display: none;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font: inherit;
}

.hero {
    padding: clamp(4rem, 9vw, 8rem) 0;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(23, 59, 87, 0.06) 1px, transparent 1px),
        linear-gradient(rgba(23, 59, 87, 0.06) 1px, transparent 1px),
        #fbfcfd;
    background-size: 42px 42px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
    align-items: start;
    gap: clamp(2rem, 7vw, 6rem);
}

.hero h1 {
    max-width: 900px;
    margin-bottom: 1.4rem;
}

.lead {
    max-width: 760px;
    color: #344450;
    font-size: clamp(1.12rem, 2vw, 1.35rem);
    line-height: 1.65;
}

.eyebrow {
    margin-bottom: 0.65rem;
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero-note {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--teal);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.hero-note h2 {
    font-size: 1.3rem;
}

.hero-note ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0.68rem 1.05rem;
    border: 1px solid var(--navy);
    border-radius: 6px;
    color: #fff;
    background: var(--navy);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    color: #fff;
    background: var(--navy-dark);
}

.button-secondary {
    color: var(--navy);
    background: #fff;
}

.button-secondary:hover {
    color: var(--navy-dark);
    background: var(--soft);
}

.section {
    padding: clamp(3.5rem, 7vw, 6rem) 0;
}

.section-muted {
    border-block: 1px solid var(--line);
    background: var(--soft);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.section-heading h2 {
    margin-bottom: 0;
}

.text-link {
    font-weight: 700;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.3rem;
}

.content-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.content-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid var(--line);
}

.card-body {
    padding: 1.4rem;
}

.card-body h2 {
    margin-bottom: 0.65rem;
    font-size: 1.42rem;
}

.card-body h2 a {
    color: inherit;
    text-decoration: none;
}

.card-body h2 a:hover {
    color: var(--teal);
}

.meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.page-header {
    padding: clamp(3.5rem, 8vw, 7rem) 0;
    border-bottom: 1px solid var(--line);
    background: #f8fafb;
}

.page-header h1 {
    margin-bottom: 1.2rem;
    font-size: clamp(2.3rem, 5vw, 4rem);
}

.prose {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    line-height: 1.85;
}

.prose h2 {
    margin-top: 2.5rem;
}

.article-header {
    padding-bottom: 3.5rem;
}

.article-header .eyebrow a {
    color: inherit;
}

.article-image {
    margin-top: 3rem;
}

.article-image img {
    width: 100%;
    max-height: 540px;
    object-fit: cover;
    border-radius: var(--radius);
}

.article-body {
    white-space: normal;
}

.empty-state {
    padding: 2rem;
    border: 1px dashed #aeb8c0;
    border-radius: var(--radius);
    text-align: center;
    background: #fff;
}

.empty-state h2 {
    margin-bottom: 0.3rem;
}

.site-footer {
    padding: 3rem 0 1.2rem;
    color: #e8eef2;
    background: var(--navy-dark);
}

.site-footer a {
    color: #fff;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.footer-grid p {
    max-width: 620px;
    color: #c4d0d8;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    color: #c4d0d8;
    font-size: 0.9rem;
}

/* Forms and admin */
input,
textarea,
select {
    width: 100%;
    padding: 0.72rem 0.8rem;
    border: 1px solid #b9c2c9;
    border-radius: 6px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(38, 122, 120, 0.2);
    border-color: var(--teal);
}

label {
    display: grid;
    gap: 0.45rem;
    font-weight: 700;
}

label small {
    color: var(--muted);
    font-weight: 400;
}

.form-stack,
.admin-form {
    display: grid;
    gap: 1.25rem;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
    background: var(--soft);
}

.login-card {
    width: min(100%, 470px);
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin-top: 1.8rem;
    font-size: 2rem;
}

.login-brand {
    width: fit-content;
}

.alert {
    margin-bottom: 1.2rem;
    padding: 0.9rem 1rem;
    border-radius: 6px;
}

.alert.error {
    border: 1px solid #e3b4b4;
    color: #6e1f1f;
    background: #fff1f1;
}

.alert.success {
    border: 1px solid #a9d4bb;
    color: #174a2f;
    background: #edf9f2;
}

.admin-body {
    background: #f5f7f8;
}

.admin-header {
    color: #fff;
    background: var(--navy-dark);
}

.admin-header-inner {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-header a {
    color: #fff;
    text-decoration: none;
}

.admin-header nav {
    display: flex;
    gap: 1rem;
}

.admin-brand {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2rem;
    padding-block: 2rem 4rem;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    align-self: start;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.admin-sidebar a {
    padding: 0.65rem 0.7rem;
    border-radius: 5px;
    color: var(--ink);
    text-decoration: none;
}

.admin-sidebar a:hover {
    background: var(--soft);
}

.admin-main {
    min-width: 0;
    padding: 1.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.admin-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.admin-page-heading h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card {
    display: grid;
    gap: 0.3rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
}

.stat-card:hover {
    border-color: var(--teal);
}

.stat-card strong {
    color: var(--navy);
    font-size: 2rem;
    line-height: 1;
}

.admin-section {
    margin-top: 2.2rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

th,
td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.actions {
    white-space: nowrap;
}

.actions form {
    display: inline;
}

.actions a,
.link-button {
    margin-right: 0.6rem;
}

.link-button {
    padding: 0;
    border: 0;
    color: var(--navy);
    background: none;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.link-button.danger {
    color: var(--danger);
}

.status {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.status.published {
    color: #174a2f;
    background: #e6f5ec;
}

.status.draft {
    color: #67510c;
    background: #fff4cf;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.narrow-form {
    max-width: 620px;
}

@media (max-width: 900px) {
    .brand small {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .primary-nav {
        position: absolute;
        top: 72px;
        right: 1rem;
        left: 1rem;
        display: none;
        padding: 0.7rem;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: var(--shadow);
    }

    .primary-nav.open {
        display: grid;
    }

    .hero-grid,
    .footer-grid,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .card-grid,
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    body {
        font-size: 16px;
    }

    .card-grid,
    .stat-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .section-heading,
    .admin-page-heading,
    .admin-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-header nav {
        flex-wrap: wrap;
    }

    .admin-main {
        padding: 1rem;
    }

    .actions {
        white-space: normal;
    }
}
