:root {
    color-scheme: light;
    --religion-red: #be202e;
    --franciscan-tan: #c2b59b;
    --beard-brown: #603a17;
    --altar-white: #ffffff;
    --ink: #25170c;
    --muted: #725d48;
    --bg: #f7f1e5;
    --panel: #fffdf8;
    --line: #d9cbb5;
    --gold: #d8b35d;
    --shadow: 0 18px 45px rgba(96, 58, 23, .14);
    --display-font: "American Typewriter", "Courier New", Courier, serif;
    --body-font: Georgia, "Times New Roman", serif;
    --ui-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .64), rgba(247, 241, 229, .94) 24rem),
        radial-gradient(circle at 16% 0%, rgba(216, 179, 93, .2), transparent 34rem),
        var(--bg);
    color: var(--ink);
    font-family: var(--body-font);
    font-size: 18px;
    line-height: 1.65;
}

a {
    color: var(--religion-red);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
th,
.button,
button,
.site-nav,
.admin-bar,
label {
    font-family: var(--display-font);
}

h1,
h2,
h3 {
    color: var(--beard-brown);
    line-height: 1.12;
    letter-spacing: 0;
}

h1 {
    margin: 0 0 1rem;
    color: var(--religion-red);
    font-size: clamp(2.1rem, 4vw, 4.2rem);
}

h2 {
    margin-top: 2rem;
    font-size: 1.65rem;
}

p {
    margin: 0 0 1.1rem;
}

.wrap {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    background: var(--beard-brown);
    color: var(--altar-white);
    border-bottom: 5px solid var(--religion-red);
}

.parish-hero {
    min-height: clamp(220px, 33vw, 430px);
    background-image: url("../images/holy-cross-header.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.site-nav {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: .7rem 1rem;
    background:
        linear-gradient(90deg, rgba(96, 58, 23, .96), rgba(54, 32, 12, .98)),
        var(--beard-brown);
    box-shadow: 0 8px 24px rgba(37, 23, 12, .24);
}

.primary-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.primary-nav a,
.admin-bar a {
    color: var(--altar-white);
    text-decoration: none;
}

.primary-nav a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    padding: .45rem .8rem;
    color: #fff6e7;
    font-size: .98rem;
    font-weight: 700;
    text-transform: uppercase;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    background: rgba(190, 32, 46, .85);
    color: var(--altar-white);
}

.page {
    padding: 2rem 0 4rem;
}

.public-page {
    padding-top: clamp(1.5rem, 4vw, 3rem);
}

.content-panel {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, .97), rgba(255, 249, 237, .98)),
        var(--panel);
    border: 1px solid var(--line);
    border-top: 8px solid var(--religion-red);
    box-shadow: var(--shadow);
    padding: clamp(1.25rem, 4vw, 3rem);
}

.content-panel::after {
    content: "";
    position: absolute;
    right: clamp(1rem, 4vw, 2rem);
    bottom: clamp(1rem, 4vw, 2rem);
    width: clamp(70px, 13vw, 140px);
    aspect-ratio: 1;
    background: url("../images/holy-cross-logo.png") center / contain no-repeat;
    opacity: .08;
    pointer-events: none;
}

.content-panel > * {
    position: relative;
}

.content-panel p {
    max-width: 74ch;
}

.content-panel blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 5px solid var(--gold);
    background: rgba(194, 181, 155, .16);
    color: var(--beard-brown);
}

.site-footer {
    padding: 2rem 0;
    background: linear-gradient(90deg, #2e1b0a, var(--beard-brown));
    color: #fff6e7;
    text-align: center;
    border-top: 5px solid var(--religion-red);
    font-family: var(--display-font);
}

.site-footer a {
    color: var(--altar-white);
}

.site-footer p {
    margin: .5rem 0 0;
}

.footer-admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: .3rem .65rem;
    border-radius: 4px;
    color: var(--altar-white);
    font-weight: 700;
    text-decoration: none;
}

.footer-admin-link:hover,
.footer-admin-link:focus-visible {
    background: rgba(255, 255, 255, .14);
}

.admin-bar {
    background: linear-gradient(90deg, var(--beard-brown), #2e1b0a);
    color: var(--altar-white);
    padding: .75rem 0;
    border-bottom: 4px solid var(--religion-red);
}

.admin-bar .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    color: var(--altar-white);
    text-decoration: none;
}

.admin-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--altar-white);
    border: 1px solid rgba(216, 179, 93, .7);
}

.admin-brand strong {
    overflow-wrap: anywhere;
}

.admin-bar nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    flex-wrap: wrap;
}

.admin-bar nav a {
    border-radius: 4px;
    padding: .4rem .65rem;
    font-size: .92rem;
    font-weight: 700;
}

.admin-bar nav a:hover,
.admin-bar nav a:focus-visible {
    background: rgba(255, 255, 255, .14);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(96, 58, 23, .08);
    padding: 1.25rem;
    margin: 1rem 0;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(96, 58, 23, .08);
}

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

th {
    color: var(--beard-brown);
    background: rgba(194, 181, 155, .28);
}

label {
    display: block;
    color: var(--beard-brown);
    font-weight: 700;
    margin: 1rem 0 .35rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #b9a88e;
    border-radius: 4px;
    padding: .7rem .75rem;
    background: var(--altar-white);
    color: var(--ink);
    font: 1rem/1.45 var(--ui-font);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--religion-red);
    box-shadow: 0 0 0 3px rgba(190, 32, 46, .16);
    outline: 0;
}

textarea {
    min-height: 320px;
    resize: vertical;
}

.contact-form {
    max-width: 760px;
}

.contact-form textarea {
    min-height: 220px;
}

.settings-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    padding: .5rem;
    margin: 0 0 .45rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(194, 181, 155, .18);
}

.editor-toolbar button {
    min-width: 40px;
    min-height: 36px;
    padding: .35rem .55rem;
    background: var(--altar-white);
    color: var(--beard-brown);
    border: 1px solid #b9a88e;
    font-family: var(--ui-font);
    font-weight: 700;
}

.editor-toolbar button:hover,
.editor-toolbar button:focus-visible {
    background: var(--religion-red);
    color: var(--altar-white);
    border-color: var(--religion-red);
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 4px;
    background: var(--religion-red);
    color: var(--altar-white);
    font-weight: 700;
    text-decoration: none;
    padding: .65rem .95rem;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: #9f1b27;
}

.button.secondary {
    background: var(--beard-brown);
}

.button.secondary:hover {
    background: #44280f;
}

.button.danger,
button.danger {
    background: #8e2d24;
}

.notice {
    border-left: 4px solid var(--religion-red);
    background: #fff7e8;
    padding: .8rem 1rem;
}

.error {
    border-left-color: #8e2d24;
    background: #fff0ef;
}

.muted {
    color: var(--muted);
}

.actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .site-nav,
    .admin-bar .wrap {
        align-items: center;
        flex-direction: column;
    }

    .parish-hero {
        min-height: 210px;
        background-position: center top;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 17px;
    }

    .primary-nav {
        width: 100%;
    }

    .primary-nav a {
        justify-content: center;
        flex: 1 1 44%;
        text-align: center;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    td {
        border-bottom: 0;
    }

    tr {
        border-bottom: 1px solid var(--line);
        padding: .75rem 0;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

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

@media (max-width: 480px) {
    .wrap {
        width: min(100% - 1rem, 1120px);
    }

    .parish-hero {
        min-height: 170px;
    }

    .primary-nav a {
        flex-basis: 100%;
    }
}
