@font-face {
    font-family: "Lora";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/assets/fonts/lora-400.woff2") format("woff2");
}

@font-face {
    font-family: "Lora";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/lora-400-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Playfair Display";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/fonts/playfair-display-700.woff2") format("woff2");
}

@font-face {
    font-family: "Parisienne";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/parisienne-400.woff2") format("woff2");
}

:root {
    --navy: #0f2d6b;
    --navy-deep: #091b3e;
    --ink: #141617;
    --heading: #212326;
    --muted: #4a4e57;
    --gold: #b8966a;
    --cream: #faf7f4;
    --cream-2: #f2ede8;
    --bar: #212326;
    --white: #fff;
    --line: rgba(15, 45, 107, 0.16);
    --success-bg: #e7f3ea;
    --success-fg: #1d5c32;
    --error-bg: #f8e8e6;
    --error-fg: #8d2b22;
    --info-bg: #e8eef8;
    --info-fg: #0f2d6b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Lora, "Iowan Old Style", Baskerville, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--cream);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: var(--white);
    color: var(--navy);
    padding: 0.5rem 0.8rem;
    z-index: 20;
}

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

.script {
    font-family: Parisienne, cursive;
    color: var(--gold);
    font-size: 1.35em;
    line-height: 1;
}

.topbar {
    background: var(--navy);
    color: var(--cream);
    text-align: center;
    padding: 0.85rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.topbar p { margin: 0; }

.topbar a {
    color: var(--gold);
    text-decoration: none;
}

.topbar a:hover { text-decoration: underline; }

.site-header-bar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.1rem 1.75rem;
    background: var(--cream);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.09);
    position: relative;
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--heading);
    line-height: 1.05;
    flex: 0 0 auto;
}

.brand-name {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
}

.brand-tag {
    font-family: Parisienne, cursive;
    color: var(--gold);
    font-size: 1.35rem;
    margin-top: 0.1rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    min-width: 0;
}

.nav ul {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.85rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav ul > li { flex: 0 0 auto; }

.nav a {
    color: var(--heading);
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav a:hover,
.nav li:hover > a,
.nav li:focus-within > a,
.nav a[aria-current="page"] {
    color: var(--navy);
}

.nav a[aria-current="page"] { font-weight: 700; }

.nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.menu-button {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    margin-left: auto;
    border: 0;
    background: var(--white);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 1.15rem;
    height: 2px;
    background: var(--heading);
}

.btn,
button,
.button-link {
    display: inline-block;
    padding: 0.7rem 1.25rem;
    white-space: nowrap;
    font-family: Lora, serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.3;
    color: var(--white);
    background: var(--navy);
    border: 1px solid var(--navy);
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover,
button:hover { background: var(--navy-deep); }

button:disabled {
    opacity: 0.55;
    cursor: default;
}

button:disabled:hover { background: var(--navy); }

.button-link {
    background: transparent;
    color: var(--navy);
    margin-left: 0.6rem;
}

.button-link:hover { background: var(--cream-2); }

.container {
    max-width: 46rem;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.container-wide { max-width: 72rem; }

.container-admin {
    margin-left: 0;
    margin-right: auto;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin: 0 0 1.25rem;
    border-bottom: 2px solid var(--line);
}

.admin-tablist {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.25rem;
}

.admin-tablist a {
    display: inline-block;
    margin-bottom: -2px;
    padding: 0.55rem 0.95rem;
    color: var(--heading);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: 0;
}

.admin-tablist a[aria-current="page"] {
    font-weight: 700;
    color: var(--navy);
    background: var(--white);
    border-color: var(--line);
}

.admin-tabs form { margin: 0 0 0.35rem auto; }

.admin-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

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

table.subscribers {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

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

table.subscribers th {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
}

table.subscribers form { margin: 0; }

table.subscribers td.actions {
    text-align: right;
    white-space: nowrap;
}

table.subscribers td.actions form { display: inline-block; }

.browser-link { word-break: break-all; }

table.subscribers td.browser-link { font-size: 0.85rem; max-width: 24rem; }

a.edit {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.35rem 0.7rem;
    font-family: Lora, serif;
    font-size: 0.85rem;
    line-height: 1.3;
    color: var(--navy);
    background: transparent;
    border: 1px solid var(--navy);
    text-decoration: none;
    text-align: center;
}

a.edit:hover,
button.download:hover { background: var(--cream-2); }

button.download {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    color: var(--navy);
    background: transparent;
    border-color: var(--navy);
}

form.restore {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

form.restore input[type="file"] {
    max-width: 100%;
    font-family: Lora, serif;
    font-size: 0.95rem;
}

table.subscribers td.actions form + form { margin-left: 0.4rem; }

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

button.flag {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    color: var(--muted);
    background: transparent;
    border-color: var(--line);
}

button.flag.is-on {
    color: var(--navy-deep);
    background: #f4e7d4;
    border-color: var(--gold);
    font-weight: 700;
}

button.flag:hover { background: var(--cream-2); }

button.flag.is-on:hover { background: #ead8bc; }

button.delete {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    color: var(--error-fg);
    background: transparent;
    border-color: var(--error-fg);
}

button.delete:hover {
    color: var(--error-fg);
    background: var(--error-bg);
}

.status {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    font-size: 0.82rem;
    background: var(--cream-2);
}

.status-confirmed { background: var(--success-bg); color: var(--success-fg); }
.status-pending { background: var(--info-bg); color: var(--info-fg); }
.status-unsubscribed { background: var(--error-bg); color: var(--error-fg); }

h1, h2, h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.2;
}

h1 { font-size: 2.6rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.7rem; margin: 2.2rem 0 0.6rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 0.4rem; }

.lead { font-size: 1.15rem; }

a { color: var(--navy); }

.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.required { color: var(--error-fg); }

.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }

.field input[type="email"],
.field input[type="text"],
.field input[type="password"],
.field textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    font: inherit;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--white);
}

.field input:focus,
.field textarea:focus,
.editor:focus {
    outline: 2px solid var(--navy);
    outline-offset: 1px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.editor-toolbar button {
    min-width: 2.5rem;
    padding: 0.35rem 0.7rem;
    font-weight: 700;
    color: var(--navy);
    background: var(--white);
}

.editor-toolbar button.is-on {
    color: var(--white);
    background: var(--navy);
}

.editor-toolbar button.editor-image { font-weight: 400; }

.editor {
    min-height: 22rem;
    padding: 0.7rem 0.8rem;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
}

.editor p { margin: 0 0 0.9rem; }
.editor img { max-width: 100%; height: auto; }

.field-checkbox {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: start;
}

.field-checkbox input { margin-top: 0.35rem; width: 1.1rem; height: 1.1rem; }
.field-checkbox label { font-weight: 400; }

.notice {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--info-bg);
    color: var(--info-fg);
}

.notice h2 { margin-top: 0; color: inherit; }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice-success { background: var(--success-bg); color: var(--success-fg); }
.notice-error   { background: var(--error-bg); color: var(--error-fg); }
.notice-info    { background: var(--info-bg); color: var(--info-fg); }

.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.site-footer {
    background: var(--navy-deep);
    color: var(--cream);
}

.footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2.5rem 1.75rem;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
}

.footer-col h2 {
    color: var(--cream);
    font-size: 1.15rem;
    margin: 0 0 0.7rem;
}

.footer-col p { margin: 0; font-size: 0.95rem; line-height: 1.6; }

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li + li { margin-top: 0.35rem; }

.footer-col a {
    color: var(--cream);
    text-decoration: none;
    font-size: 0.95rem;
}

.footer-col a:hover { color: var(--gold); }

.copyright {
    margin: 0;
    padding: 0.9rem 1.75rem;
    background: var(--bar);
    color: var(--cream);
    text-align: center;
    font-size: 0.85rem;
}

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

    .nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        margin: 0;
        padding: 0.5rem 1.25rem 1.25rem;
        background: var(--cream);
        box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
        z-index: 4;
    }

    .nav-toggle:checked ~ .nav { display: flex; }

    .nav ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: static;
        min-width: 0;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    h1 { font-size: 2.1rem; }
}

@media (max-width: 720px) {
    .footer-inner { grid-template-columns: 1fr; padding: 2rem 1.25rem; }
    .site-header-bar { padding: 1rem 1.1rem; }
    .container { padding: 2rem 1.1rem 3rem; }
}
