/* ==========================================================================
   Merryman Ministries — modern design system
   Deep-burgundy heritage palette, warm paper surfaces, gold accents.
   Serif display type (Playfair Display) over a humanist sans (Source Sans 3).
   ========================================================================== */

:root {
    /* Brand color */
    --maroon-950: #2c090d;
    --maroon-900: #3d0c11;
    --maroon-800: #4d1016;
    --maroon-700: #5e1a1f;
    --maroon-600: #7a2830;
    --maroon-500: #93343d;

    --gold-500: #c9a227;
    --gold-400: #d8b64a;
    --gold-300: #e3c96b;
    --gold-100: #f4e8c1;

    --cream-50: #fdfbf6;
    --cream-100: #f7f2e9;
    --cream-200: #efe6d7;
    --cream-300: #e2d4bf;

    --ink-900: #241d19;
    --ink-700: #453a33;
    --ink-600: #6b5f57;
    --ink-400: #998c82;

    /* Semantic aliases */
    --color-bg: var(--cream-100);
    --color-surface: var(--cream-50);
    --color-text: var(--ink-900);
    --color-text-muted: var(--ink-600);
    --color-primary: var(--maroon-700);
    --color-primary-strong: var(--maroon-800);
    --color-accent: var(--gold-500);
    --color-border: var(--cream-200);

    --color-link: #7a2830;
    --color-link-hover: #93343d;

    /* Type */
    --font-serif: "Playfair Display", "Book Antiqua", Palatino, Georgia, serif;
    --font-sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;

    --text-base: 1.0625rem;   /* 17px */
    --leading-base: 1.65;

    /* Rhythm */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(44, 9, 13, 0.06), 0 1px 3px rgba(44, 9, 13, 0.08);
    --shadow-md: 0 4px 12px rgba(44, 9, 13, 0.08), 0 2px 4px rgba(44, 9, 13, 0.05);
    --shadow-lg: 0 12px 32px rgba(44, 9, 13, 0.14);

    --sidebar-width: 300px;
    --shell-max: 1240px;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--color-bg);
    background-image:
        radial-gradient(ellipse at top, rgba(201, 162, 39, 0.05), transparent 55%),
        linear-gradient(180deg, var(--cream-100) 0%, var(--cream-100) 100%);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-base);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; border: 0; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.25;
    color: var(--maroon-900);
    margin: 0 0 var(--space-4);
}

h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 var(--space-4); }

a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-color: rgba(122, 40, 48, 0.3);
    text-underline-offset: 3px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration-color: var(--gold-500);
}

:focus-visible {
    outline: 3px solid var(--gold-400);
    outline-offset: 2px;
    border-radius: 2px;
}

hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cream-300), transparent);
    margin: var(--space-6) 0;
}

blockquote {
    margin: var(--space-5) 0;
    padding: var(--space-4) var(--space-5);
    border-left: 4px solid var(--gold-500);
    background: var(--cream-50);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.1em;
    color: var(--ink-700);
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--maroon-900);
    color: #fff;
    padding: var(--space-3) var(--space-5);
    border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Header / hero band
   -------------------------------------------------------------------------- */

.site-header {
    background:
        radial-gradient(ellipse 120% 160% at 85% -40%, rgba(201, 162, 39, 0.22), transparent 60%),
        radial-gradient(ellipse 90% 130% at 10% 130%, rgba(147, 52, 61, 0.5), transparent 65%),
        linear-gradient(150deg, var(--maroon-900) 0%, var(--maroon-800) 55%, var(--maroon-950) 100%);
    color: var(--cream-50);
    border-bottom: 3px solid var(--gold-500);
}

.site-header__inner {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: var(--space-6) var(--space-5) var(--space-5);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.site-brand { text-decoration: none; color: inherit; }
.site-brand:hover { color: inherit; text-decoration: none; }

.site-brand__title {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 4.5vw, 2.9rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.1;
    margin: 0;
    color: var(--cream-50);
}

.site-brand__title em {
    font-style: normal;
    color: var(--gold-300);
}

.site-brand__tagline {
    margin: var(--space-2) 0 0;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(253, 251, 246, 0.82);
}

.site-header__verse {
    max-width: 34ch;
    text-align: right;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 1.5;
    color: var(--gold-100);
    margin: 0;
}

.site-header__verse cite {
    display: block;
    margin-top: var(--space-1);
    font-style: normal;
    font-size: 0.85em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(244, 232, 193, 0.75);
}

/* Slim utility bar under the hero, holds the mobile menu button */
.site-topbar {
    background: rgba(44, 9, 13, 0.35);
    border-top: 1px solid rgba(253, 251, 246, 0.08);
    display: none;
}

.site-topbar__inner {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: var(--space-2) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: transparent;
    color: var(--cream-50);
    border: 1px solid rgba(253, 251, 246, 0.35);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-4);
    font: 600 0.95rem var(--font-sans);
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-toggle:hover {
    background: rgba(253, 251, 246, 0.1);
    border-color: var(--gold-400);
}

.nav-toggle__bars {
    display: inline-block;
    width: 18px;
    height: 2px;
    background: currentColor;
    position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

/* --------------------------------------------------------------------------
   Shell layout: sidebar + content
   -------------------------------------------------------------------------- */

.site-shell {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: var(--space-6) var(--space-5) var(--space-8);
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
}

/* --------------------------------------------------------------------------
   Sidebar navigation
   -------------------------------------------------------------------------- */

.site-nav {
    position: sticky;
    top: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    max-height: calc(100vh - var(--space-6));
    overflow: hidden;
}

.nav-group {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.nav-group__title {
    margin: 0;
    padding: var(--space-4) var(--space-5) var(--space-3);
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--maroon-800);
    border-bottom: 2px solid var(--gold-500);
    background: linear-gradient(180deg, var(--cream-50), var(--cream-100));
}

.nav-group__list {
    list-style: none;
    margin: 0;
    padding: var(--space-2);
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--cream-300) transparent;
}

.nav-group__list::-webkit-scrollbar { width: 8px; }
.nav-group__list::-webkit-scrollbar-thumb {
    background: var(--cream-300);
    border-radius: 4px;
}

.nav-group__list a {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--ink-700);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease, padding-left 0.12s ease;
}

.nav-group__list a:hover {
    background: var(--cream-100);
    color: var(--maroon-700);
    padding-left: var(--space-4);
}

.nav-group__list a.is-active {
    background: var(--maroon-700);
    color: var(--cream-50);
    font-weight: 600;
}

.nav-group--messages { flex: 1 1 auto; min-height: 0; }

.nav-filter {
    padding: var(--space-3) var(--space-3) var(--space-2);
}

.nav-filter input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-sm);
    background: #fff;
    font: 0.95rem var(--font-sans);
    color: var(--ink-900);
}

.nav-filter input::placeholder { color: var(--ink-400); }

.nav-filter input:focus {
    outline: 2px solid var(--gold-400);
    outline-offset: 1px;
    border-color: var(--gold-500);
}

.nav-group__empty {
    display: none;
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Main content area
   -------------------------------------------------------------------------- */

.site-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(var(--space-5), 4vw, var(--space-7));
    min-width: 0;
    overflow-wrap: break-word;
}

/* Standard page heading block */
.page-header {
    text-align: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.page-header::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    width: 72px;
    height: 3px;
    background: var(--gold-500);
    border-radius: 2px;
}

.page-title {
    margin-bottom: var(--space-2);
}

.page-subtitle {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--ink-600);
    margin: 0;
}

.page-kicker {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-500);
    margin-bottom: var(--space-2);
}

/* Long-form reading */
.prose {
    max-width: 72ch;
    margin-left: auto;
    margin-right: auto;
}

.prose p { margin-bottom: var(--space-4); }

.prose ul, .prose ol {
    margin: 0 0 var(--space-4);
    padding-left: 1.4em;
}

.prose li { margin-bottom: var(--space-2); }

.lead {
    font-size: 1.18rem;
    line-height: 1.7;
    color: var(--ink-700);
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

/* Address / contact block */
.address-card {
    display: inline-block;
    text-align: center;
    padding: var(--space-5) var(--space-7);
    background: var(--cream-100);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-style: normal;
    line-height: 1.8;
}

.address-card strong {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--maroon-800);
    margin-bottom: var(--space-1);
}

/* Cards & callouts */
.card {
    background: var(--cream-50);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.callout {
    background: var(--gold-100);
    border: 1px solid var(--gold-300);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-5) 0;
}

.callout--maroon {
    background: var(--maroon-800);
    border-color: var(--maroon-700);
    color: var(--cream-50);
}

.callout--maroon a { color: var(--gold-300); }

/* Buttons (also styles legacy asp:Button inputs given the class) */
.btn,
input[type="submit"].btn,
input[type="button"].btn {
    display: inline-block;
    background: var(--maroon-700);
    color: var(--cream-50);
    border: 0;
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-6);
    font: 600 1rem var(--font-sans);
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:hover,
input[type="submit"].btn:hover,
input[type="button"].btn:hover {
    background: var(--maroon-600);
    color: #fff;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn--gold {
    background: var(--gold-500);
    color: var(--maroon-950);
}

.btn--gold:hover {
    background: var(--gold-400);
    color: var(--maroon-950);
}

.btn--outline {
    background: transparent;
    color: var(--maroon-700);
    box-shadow: inset 0 0 0 2px var(--maroon-700);
}

.btn--outline:hover {
    background: var(--maroon-700);
    color: var(--cream-50);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
select,
textarea {
    font: 1rem var(--font-sans);
    color: var(--ink-900);
    background: #fff;
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    max-width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--gold-400);
    outline-offset: 1px;
    border-color: var(--gold-500);
}

/* Tables — includes those generated by the code-behind */
.site-content table {
    border-collapse: collapse;
    max-width: 100%;
}

.table-wrap {
    overflow-x: auto;
    margin-bottom: var(--space-5);
}

.data-table {
    width: 100%;
}

.data-table th {
    background: var(--maroon-800);
    color: var(--cream-50);
    font-family: var(--font-sans);
    font-weight: 600;
    text-align: left;
    padding: var(--space-3) var(--space-4);
}

.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.data-table tr:nth-child(even) td { background: var(--cream-100); }

/* --------------------------------------------------------------------------
   Series / message pages (content is generated server-side as bare tables
   and links, so style by container class placed in the .aspx wrapper)
   -------------------------------------------------------------------------- */

.series-header { text-align: center; margin-bottom: var(--space-5); }

.series-speaker {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-500);
    margin-bottom: var(--space-2);
}

.series-title {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--maroon-900);
    line-height: 1.25;
}

.series-handout a,
.series-handout {
    font-weight: 600;
}

/* The generated list of message/video links */
.media-list table {
    margin: 0 auto;
    width: auto;
}

.media-list td {
    padding: 0;
}

.media-list a {
    display: block;
    padding: var(--space-2) var(--space-4);
    margin: var(--space-1) 0;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    color: var(--maroon-700);
    transition: background 0.12s ease, padding-left 0.12s ease;
}

.media-list a:hover {
    background: var(--cream-100);
    padding-left: var(--space-5);
    color: var(--maroon-600);
}

.media-footer {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.media-footer table { margin: 0 auto; }

/* Audio player block on Message.aspx */
.player-wrap {
    margin: var(--space-5) auto;
    max-width: 720px;
}

.player-wrap audio { width: 100%; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    background: linear-gradient(160deg, var(--maroon-900), var(--maroon-950));
    border-top: 3px solid var(--gold-500);
    color: rgba(253, 251, 246, 0.85);
    margin-top: var(--space-6);
}

.site-footer__inner {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: var(--space-6) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.site-footer__brand {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cream-50);
    margin: 0;
}

.site-footer__verse {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--gold-100);
    margin: 0;
}

.site-footer__copyright {
    font-size: 0.9rem;
    color: rgba(253, 251, 246, 0.6);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Legacy content taming: neutralize Word-export leftovers that may remain
   anywhere in page content so everything inherits the design system.
   -------------------------------------------------------------------------- */

.site-content p[class^="Mso"],
.site-content p[class*=" Mso"],
.site-content span[class^="Mso"],
.site-content li[class^="Mso"] {
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    margin: 0 0 var(--space-4) !important;
}

.site-content p[class^="Mso"] span,
.site-content p[class*=" Mso"] span {
    font-family: inherit !important;
    font-size: inherit !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
    .site-topbar { display: block; }

    .site-shell {
        grid-template-columns: 1fr;
        padding-top: var(--space-5);
    }

    .site-nav {
        position: fixed;
        inset: 0;
        z-index: 100;
        max-height: none;
        background: rgba(44, 9, 13, 0.55);
        padding: var(--space-5);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .site-nav.is-open {
        opacity: 1;
        visibility: visible;
    }

    .site-nav .nav-group { box-shadow: var(--shadow-lg); }

    .nav-group__list { max-height: 40vh; }

    .nav-close {
        appearance: none;
        align-self: flex-end;
        background: var(--cream-50);
        color: var(--maroon-800);
        border: 0;
        border-radius: var(--radius-sm);
        padding: var(--space-2) var(--space-4);
        font: 600 0.95rem var(--font-sans);
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }

    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .site-header__verse {
        text-align: left;
        max-width: none;
    }

    .site-footer__inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (min-width: 961px) {
    .nav-close { display: none; }
    .site-nav { visibility: visible; opacity: 1; }
}

@media (max-width: 560px) {
    .site-shell { padding-left: var(--space-3); padding-right: var(--space-3); }
    .site-content { padding: var(--space-5) var(--space-4); }
    .address-card { padding: var(--space-4) var(--space-5); display: block; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
    .site-header, .site-footer, .site-nav, .site-topbar { display: none; }
    .site-shell { display: block; padding: 0; max-width: none; }
    .site-content { box-shadow: none; border: 0; padding: 0; }
    body { background: #fff; }
}
