:root {
    /* Brand palette. The logo was recolored to use these same deepened
       gold/blue tones (see assets/logo.png vs. assets/logo-pale-original.png
       for the original pale version) so the logo and site accents match
       exactly. --gold-soft/--blue-soft are the original pale tones, kept
       for subtle decorative use (e.g. badges) against the dark --navy
       header, where they still read clearly. */
    --navy: #1c1e2b;
    --navy-text: #f5f1e6;
    --gold: #8a6d1e;
    --gold-soft: #eee6b9;
    --blue: #3e6683;
    --blue-soft: #d4e7f6;
    --bg: #faf7f2;
    --text: #2b2b2b;
}
*, *::before, *::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: Georgia, 'Times New Roman', serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 20px;
    width: 100%;
}
.container.narrow {
    max-width: 600px;
}
.container.story-view {
    width: 66%;
    max-width: 1100px;
}
.container.center {
    text-align: center;
    padding-top: 80px;
}
h1, h2, h3 {
    font-weight: normal;
}
img { max-width: 100%; height: auto; }

/* ---- Site header (every page) ---- */
.site-header {
    background: var(--navy);
    color: var(--navy-text);
}
.site-header-inner {
    padding: 6px 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px 20px;
}
.site-logo {
    display: flex;
    align-items: center;
}
.site-logo img {
    height: 44px;
    width: auto;
    display: block;
}
.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
}
.site-nav a {
    color: var(--navy-text);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
}
.site-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}
.site-nav .badge-count {
    background: var(--gold-soft);
    color: var(--navy);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    margin-left: 3px;
}
.fb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(245, 241, 230, 0.12);
    flex-shrink: 0;
}
.fb-icon svg { width: 17px; height: 17px; display: block; }
.fb-icon:hover { background: rgba(245, 241, 230, 0.22); }

/* ---- Site footer (every page) ---- */
.site-footer {
    background: var(--navy);
    color: var(--navy-text);
    text-align: center;
    padding: 8px 20px;
    margin-top: auto;
    font-size: 13px;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--gold-soft); }
.site-main { flex: 1; width: 100%; }

.topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 25px;
}
.topbar h1 {
    margin: 0;
    font-size: 1.6em;
}
.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 15px;
}
.topbar nav a {
    margin-left: 0;
}
a { color: var(--blue); word-break: break-word; }
.btn {
    display: inline-block;
    background: var(--gold);
    color: #fff;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none;
    margin: 5px;
}
.btn.secondary {
    background: #fff;
    color: var(--gold);
    border: 1px solid var(--gold);
}
form label {
    display: block;
    margin-bottom: 15px;
    font-size: 14px;
    color: #555;
}
form input, form textarea, form select {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px; /* 16px avoids iOS auto-zoom on focus */
    box-sizing: border-box;
}
button {
    background: var(--gold);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    max-width: 100%;
}
.error { color: #a33; background: #fdecec; padding: 10px; border-radius: 4px; word-break: break-word; }
.success { color: #2a6b2a; background: #eafcea; padding: 10px; border-radius: 4px; word-break: break-word; }
.muted { color: #888; font-size: 13px; }
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.story-card {
    border: 1px solid #e2dccf;
    border-radius: 6px;
    padding: 15px;
    background: #fff;
    min-width: 0; /* lets grid items shrink instead of overflowing */
}
.story-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}
.story-card-noimage {
    width: 100%;
    height: 220px;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #f3efe6;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.story-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.story-actions a { margin-right: 0; font-size: 13px; }
.preview { max-width: 200px; width: 100%; display: block; margin-top: 10px; border-radius: 4px; }
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.reader-table { width: 100%; min-width: 480px; border-collapse: collapse; margin-top: 10px; }
.reader-table th, .reader-table td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; }
.checkbox-row { display: block; font-weight: normal; }
.checkbox-row input { display: inline; width: auto; margin-right: 8px; }
.personal-message {
    font-style: italic;
    border-left: 3px solid var(--gold);
    padding: 10px 15px;
    background: #fff8ee;
}
.cta-banner {
    margin-top: 30px;
    padding: 22px;
    background: #fff8ee;
    border: 1px solid var(--gold-soft);
    border-radius: 8px;
    text-align: center;
}
.cta-banner h3 { margin: 0 0 8px; }
.cta-banner p { margin: 0 0 15px; color: #555; }
.cta-banner.inline {
    padding: 14px 18px;
    text-align: left;
}
.cta-banner.inline p { margin: 0; }
.story-body { overflow: hidden; } /* clearfix so this box contains the floated image */
.story-content {
    /* Scales smoothly between ~17px and ~23px as the container grows, instead
       of jumping at a fixed breakpoint - stays readable at any width and still
       respects the browser/user's base font size (rem-based). */
    font-size: clamp(1.06rem, 0.9rem + 0.8vw, 1.45rem);
    line-height: 1.8;
    margin-top: 20px;
    white-space: normal;
    word-wrap: break-word;
}
.story-image {
    float: right;
    width: 320px;
    height: 220px; /* same fixed size + crop as the dashboard preview thumbnail (.story-card img) */
    object-fit: cover;
    margin: 4px 0 20px 24px;
    border-radius: 6px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin: 15px 0 30px;
}
.stat-card {
    border: 1px solid #e2dccf;
    border-radius: 6px;
    padding: 15px;
    background: #fff;
    text-align: center;
}
.stat-card .stat-number {
    display: block;
    font-size: 1.8em;
    color: var(--gold);
}
.stat-card .stat-label {
    font-size: 13px;
    color: #666;
}
.badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eee;
    color: #555;
}
.badge.active { background: #eafcea; color: #2a6b2a; }
.badge.inactive { background: #fdecec; color: #a33; }
.badge.cancelled { background: #f0f0f0; color: #777; }

/* ---- Responsive breakpoints ---- */

/* A 320px fixed-size floated image needs real room to wrap text next to it.
   Below this, drop the float so the image sits above full-width text
   instead of squeezing it into a cramped column - independent of the
   .container.story-view width change below, which kicks in later. */
@media (max-width: 900px) {
    .story-image {
        float: none;
        width: 100%;
        max-width: 320px;
        margin: 0 0 15px 0;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }
    .container.center {
        padding-top: 50px;
    }
    .container.story-view {
        width: 100%;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn, button {
        width: 100%;
        max-width: none;
        margin: 5px 0;
        text-align: center;
    }
    .story-grid {
        grid-template-columns: 1fr;
    }
    .story-image {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 15px 0;
    }
    .reader-table th, .reader-table td {
        padding: 6px;
        font-size: 14px;
    }
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav {
        width: 100%;
    }
}

@media (max-width: 400px) {
    h1 { font-size: 1.5em; }
    h2 { font-size: 1.25em; }
}
