:root {
    --ink: #1d1613;
    --paper: #f2eadc;
    --paper-soft: #fff9ed;
    --night: #151313;
    --night-2: #231b1a;
    --carmine: #8c2633;
    --gold: #c59a52;
    --moss: #53684f;
    --line: rgba(62, 43, 31, .18);
    --shadow: 0 18px 45px rgba(12, 7, 5, .22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(197, 154, 82, .13), transparent 30rem),
        linear-gradient(180deg, #221918 0, #3a2c25 24rem, var(--paper) 24rem);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.55;
}

main {
    flex: 1 0 auto;
}

a {
    color: inherit;
}

input,
select,
textarea,
button {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem clamp(1rem, 4vw, 3rem);
    color: var(--paper-soft);
    background: rgba(21, 19, 19, .92);
    border-bottom: 1px solid rgba(197, 154, 82, .28);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    color: var(--night);
    background: var(--gold);
    border: 2px solid #f4dca8;
    border-radius: 50%;
    font-weight: 800;
}

.brand > span:last-child {
    min-width: 0;
}

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

.brand small {
    color: rgba(255, 249, 237, .68);
    font-size: .78rem;
}

.main-nav,
.admin-actions,
.row-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.main-nav {
    margin-left: auto;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: rgba(255, 249, 237, .8);
    text-decoration: none;
    font-size: .96rem;
}

.main-nav a span {
    line-height: 1;
}

.main-nav a:hover {
    color: var(--gold);
}

.search-form,
.hero-search {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.search-form {
    margin-left: 0;
}

.search-form input,
.hero-search input {
    min-width: 0;
}

.search-form input {
    width: min(16rem, 32vw);
    color: var(--paper-soft);
    background: rgba(255, 249, 237, .08);
    border-color: rgba(255, 249, 237, .16);
}

.search-form input::placeholder {
    color: rgba(255, 249, 237, .62);
}

.menu-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .32rem;
    margin-left: auto;
    color: var(--paper-soft);
    background: rgba(255, 249, 237, .08);
    border: 1px solid rgba(197, 154, 82, .34);
    border-radius: 6px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 1.25rem;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform .18s ease, opacity .18s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(.43rem) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-.43rem) rotate(-45deg);
}

.hero {
    min-height: 24rem;
    display: flex;
    align-items: end;
    padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem);
    color: var(--paper-soft);
    background:
        linear-gradient(90deg, rgba(21, 19, 19, .95), rgba(21, 19, 19, .42)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='500' viewBox='0 0 900 500'%3E%3Crect width='900' height='500' fill='%23231b1a'/%3E%3Cg fill='none' stroke='%23c59a52' stroke-opacity='.24'%3E%3Cpath d='M50 390 C190 260 270 430 410 270 S690 120 850 230'/%3E%3Cpath d='M90 120 H810 M150 170 H720 M220 220 H780 M110 320 H660'/%3E%3Ccircle cx='675' cy='165' r='70'/%3E%3Cpath d='M640 165 h70 M675 130 v70'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.hero-inner,
.content-band,
.page-title,
.article-page,
.admin-shell {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.hero h1,
.page-title h1,
.article-header h1,
.admin-topbar h1 {
    margin: 0;
    line-height: 1.08;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
}

.hero p {
    max-width: 38rem;
    font-size: 1.2rem;
}

.hero-search {
    width: min(36rem, 100%);
    margin-top: 1.25rem;
}

.hero-search input {
    flex: 1;
    background: rgba(255, 249, 237, .94);
}

.eyebrow {
    margin: 0 0 .45rem;
    color: var(--gold);
    font-family: Arial, sans-serif;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.content-band,
.page-title,
.admin-shell {
    padding: clamp(2rem, 5vw, 4rem) 0;
}

.article-page {
    padding: 0;
}

.section-heading {
    margin-bottom: 1.25rem;
}

.section-heading h2,
.page-title h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.entry-card,
.panel,
.auth-panel,
.table-wrap {
    background: rgba(255, 249, 237, .88);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.entry-card {
    overflow: hidden;
}

.entry-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.entry-card div {
    padding: 1rem;
}

.entry-card h3 {
    margin: .55rem 0 .5rem;
    font-size: 1.35rem;
}

.entry-card h3 a {
    text-decoration: none;
}

.entry-meta {
    margin: .35rem 0 .65rem;
    color: #6f5548;
    font-size: .9rem;
}

.entry-card p:last-child {
    margin-bottom: 0;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: .1rem 0 .25rem;
    padding: .22rem .55rem;
    color: #fff9ed;
    background: var(--moss);
    border: 1px solid rgba(255, 249, 237, .2);
    border-radius: 999px;
    font-family: Arial, sans-serif;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}

.category-pill:hover {
    background: var(--carmine);
}

.article-hero {
    position: relative;
    min-height: 16rem;
    display: flex;
    align-items: end;
    padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem);
    color: var(--paper-soft);
    isolation: isolate;
}

.article-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 50%;
    width: 100vw;
    margin-left: -50vw;
    background:
        radial-gradient(circle at 15% 18%, rgba(197, 154, 82, .15), transparent 18rem),
        linear-gradient(135deg, #221918, #392720);
}

.article-header {
    max-width: 820px;
}

.article-header h1 {
    color: var(--paper-soft);
    font-size: clamp(2.35rem, 6vw, 4.8rem);
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.article-header > p:not(.eyebrow) {
    max-width: 46rem;
    margin: 1rem 0 0;
    color: rgba(255, 249, 237, .78);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.article-meta {
    margin: .9rem 0 0;
    color: rgba(255, 249, 237, .82);
}

.article-pill {
    margin-top: 1rem;
}

.article-body {
    position: relative;
    padding: clamp(2rem, 5vw, 4rem) 0;
    isolation: isolate;
}

.article-body::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 50%;
    width: 100vw;
    margin-left: -50vw;
    background: var(--paper);
}

.article-image {
    display: block;
    width: min(920px, 100%);
    max-height: 30rem;
    margin: 0 auto 1.5rem;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.rich-text {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2rem);
    background: rgba(255, 249, 237, .82);
    border: 1px solid rgba(62, 43, 31, .12);
    border-left: 4px solid var(--carmine);
    box-shadow: 0 12px 30px rgba(62, 43, 31, .08);
}

.rich-text img {
    max-width: 100%;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(rgba(21, 19, 19, .75), rgba(21, 19, 19, .9)),
        var(--night);
}

.auth-panel {
    width: min(420px, 100%);
    padding: 1.5rem;
}

.auth-brand {
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.auth-brand small {
    color: var(--moss);
}

.stack {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: .35rem;
    color: #4c3830;
    font-family: Arial, sans-serif;
    font-size: .92rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: .72rem .78rem;
    color: var(--ink);
    background: #fffdf7;
    border: 1px solid rgba(62, 43, 31, .28);
    border-radius: 6px;
}

textarea {
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: .55rem .9rem;
    border: 1px solid rgba(62, 43, 31, .24);
    border-radius: 6px;
    color: var(--ink);
    background: #fff9ed;
    text-decoration: none;
    cursor: pointer;
}

.button.primary {
    color: #fff9ed;
    background: var(--carmine);
    border-color: #6f1d28;
}

.button.ghost {
    color: var(--paper-soft);
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .18);
}

.button.danger {
    color: #fff9ed;
    background: #6f1d28;
}

.button.compact {
    min-height: 2rem;
    padding: .35rem .6rem;
    font-size: .9rem;
}

.admin-shell .button,
.editor-form .button {
    color: var(--paper-soft);
    background: var(--night-2);
    border-color: rgba(255, 249, 237, .16);
}

.admin-shell .button:hover,
.editor-form .button:hover {
    background: #342826;
}

.admin-shell .button.primary,
.editor-form .button.primary {
    background: #30201f;
    border-color: rgba(197, 154, 82, .42);
    box-shadow: inset 0 0 0 1px rgba(197, 154, 82, .18);
}

.admin-shell .button.danger,
.editor-form .button.danger {
    background: #4e171f;
    border-color: rgba(255, 249, 237, .14);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.admin-topbar h1 {
    color: var(--paper-soft);
    font-size: clamp(2rem, 4vw, 3rem);
}

.admin-menu {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-bottom: 1rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    font-family: Arial, sans-serif;
    font-size: .78rem;
    text-transform: uppercase;
    color: #6f5548;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.panel h2 {
    margin: 0;
    font-size: 1.45rem;
}

code {
    font-family: Consolas, Monaco, monospace;
}

.status {
    display: inline-block;
    padding: .18rem .45rem;
    border-radius: 999px;
    font-family: Arial, sans-serif;
    font-size: .78rem;
    background: #dfd5c5;
}

.status.published {
    color: #173d2a;
    background: #cce5d4;
}

.status.draft {
    color: #5a3313;
    background: #ead7b8;
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
    align-items: start;
}

.panel {
    padding: 1rem;
}

.role-help {
    color: #4c3830;
    background: rgba(255, 249, 237, .7);
}

.settings-panel {
    margin-bottom: 1rem;
}

.settings-divider {
    width: 100%;
    height: 1px;
    margin: .25rem 0;
    background: var(--line);
    border: 0;
}

.site-footer {
    position: relative;
    margin-top: auto;
    color: var(--paper-soft);
    isolation: isolate;
}

.site-footer::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 50%;
    width: 100vw;
    margin-left: -50vw;
    background:
        radial-gradient(circle at 80% 20%, rgba(197, 154, 82, .16), transparent 20rem),
        linear-gradient(180deg, #221918, #151313);
    border-top: 1px solid rgba(197, 154, 82, .2);
}

.site-footer-inner {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
    padding: clamp(2rem, 5vw, 3rem) 0;
}

.site-footer h2 {
    margin: 0 0 .65rem;
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.site-footer p {
    max-width: 52rem;
    margin: 0;
    color: rgba(255, 249, 237, .78);
}

.thumb {
    width: 100%;
    border-radius: 6px;
}

.alert {
    padding: .75rem .9rem;
    color: #fff9ed;
    background: var(--carmine);
    border-radius: 6px;
}

.ck-editor__editable {
    min-height: 420px;
}

@media (max-width: 1180px) {
    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: .75rem;
    }

    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-menu {
        align-items: stretch;
    }

    .admin-menu .button,
    .admin-menu form,
    .admin-menu button {
        width: 100%;
    }

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

    .main-nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        margin-left: 0;
        padding-top: .65rem;
        border-top: 1px solid rgba(197, 154, 82, .18);
    }

    .search-form {
        grid-column: 1 / -1;
        margin-left: 0;
        width: 100%;
    }

    .search-form input,
    .hero-search input {
        width: 100%;
    }

    .brand small {
        display: none;
    }

    .nav-open .main-nav {
        display: grid;
        gap: .45rem;
    }

    .main-nav a {
        width: 100%;
        min-height: 2.8rem;
        padding: .65rem .75rem;
        color: var(--paper-soft);
        background: rgba(255, 249, 237, .07);
        border: 1px solid rgba(255, 249, 237, .1);
        border-radius: 6px;
        font-size: 1rem;
    }

    .main-nav a span {
        width: 1.45rem;
        text-align: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        width: min(1120px, calc(100% - 1rem));
    }

    .admin-topbar h1 {
        font-size: clamp(1.8rem, 5vw, 2.4rem);
    }

    .admin-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-menu .button,
    .admin-menu form,
    .admin-menu button {
        width: 100%;
    }

    .admin-actions {
        width: 100%;
        align-items: stretch;
    }

    .admin-actions .button,
    .admin-actions form,
    .admin-actions button {
        width: 100%;
    }

    .table-wrap {
        overflow: visible;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table th,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .responsive-table tr {
        margin-bottom: .85rem;
        padding: .85rem;
        background: rgba(255, 249, 237, .9);
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: 0 10px 24px rgba(12, 7, 5, .14);
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: 7.5rem minmax(0, 1fr);
        gap: .75rem;
        padding: .48rem 0;
        font-size: .96rem;
        overflow-wrap: anywhere;
        border-bottom: 1px solid rgba(62, 43, 31, .1);
    }

    .responsive-table td[colspan] {
        display: block;
        padding: 0;
        border-bottom: 0;
    }

    .responsive-table td[colspan]::before {
        display: none;
    }

    .responsive-table td::before {
        content: attr(data-label);
        color: #6f5548;
        font-family: Arial, sans-serif;
        font-size: .74rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
    }

    .responsive-table .row-actions {
        display: flex;
        grid-template-columns: none;
        flex-wrap: wrap;
        gap: .5rem;
        padding-top: .75rem;
    }

    .responsive-table .row-actions::before {
        display: none;
    }

    .responsive-table .row-actions .button,
    .responsive-table .row-actions form,
    .responsive-table .row-actions button {
        flex: 1;
        width: 100%;
    }

    .editor-form .panel,
    .admin-grid .panel {
        padding: 1rem;
    }

    .role-help {
        font-size: .95rem;
        line-height: 1.6;
    }

    .ck-editor__editable {
        min-height: 280px;
    }
}

@media (max-width: 760px) {
    .admin-menu {
        grid-template-columns: 1fr;
    }

    .responsive-table td {
        grid-template-columns: 1fr;
        gap: .2rem;
    }

    .responsive-table .row-actions {
        padding-top: .4rem;
    }
}

.page-title {
    position: relative;
    min-height: 13rem;
    color: var(--paper-soft);
}

.page-title::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 50%;
    width: 100vw;
    margin-left: -50vw;
    background:
        radial-gradient(circle at 12% 18%, rgba(197, 154, 82, .16), transparent 20rem),
        linear-gradient(135deg, #221918, #392720);
}

.page-title h1 {
    color: var(--paper-soft);
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.section-subtitle {
    max-width: 42rem;
    margin: .85rem 0 0;
    color: rgba(255, 249, 237, .76);
    font-size: 1.08rem;
}

.content-band {
    position: relative;
    color: var(--ink);
}

.content-band::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 50%;
    width: 100vw;
    margin-left: -50vw;
    background: var(--paper);
}

.page-title,
.content-band {
    isolation: isolate;
}
