/* ============================================================
   Kimberlee Herbic — ministry site
   Palette: cream + sage + warm gold. Serif display + clean sans body.
   Rebrand quickly by editing the CSS variables below.
   ============================================================ */

:root {
    --cream:        #F7F5EF;  /* page background */
    --cream-deep:   #EFEAE0;  /* alternating sections */
    --sage:         #8A9A80;  /* primary accent */
    --sage-deep:    #6E7D66;  /* hover / darker sage */
    --gold:         #C9A24B;  /* highlight */
    --gold-deep:    #A9863A;
    --ink:          #34382F;  /* body text (olive-charcoal) */
    --ink-soft:     #5C6155;
    --line:         #E0DACE;  /* borders */
    --white:        #FFFFFF;
    --error:        #B4522E;
    --success:      #5E7A52;

    --max: 1140px;
    --radius: 4px;
    --serif: Georgia, "Times New Roman", "Cormorant Garamond", serif;
    --sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.7;
    font-size: 17px;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 760px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--ink); line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.3rem; }

a { color: var(--sage-deep); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--gold-deep); }

.eyebrow {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold-deep);
    margin: 0 0 0.75rem;
}

/* ---- Buttons ---- */
.btn, button {
    display: inline-block;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    padding: 0.8rem 1.7rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary, button[type="submit"] { background: var(--sage); color: #fff; }
.btn-primary:hover, button[type="submit"]:hover { background: var(--sage-deep); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--sage);
    color: var(--sage-deep);
}
.btn-outline:hover { background: var(--sage); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-deep); color: #fff; }

/* ============================================================
   Public header / nav / footer
   ============================================================ */
.site-header {
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
}
.brand {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.02em;
    line-height: 1.1;
}
.brand small {
    display: block;
    font-family: var(--sans);
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-top: 0.28rem;
    font-weight: 600;
}
.site-nav ul {
    display: flex;
    gap: 1.9rem;
    list-style: none;
    margin: 0; padding: 0;
    align-items: center;
}
.site-nav a {
    font-family: var(--sans);
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ink-soft);
}
.site-nav a:hover, .site-nav a.active { color: var(--gold-deep); }

.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--ink); padding: 0; }

/* Nav dropdown (Events → Speaking / Webinars) */
.site-nav .has-dropdown { position: relative; }
.site-nav .caret { font-size: 0.6rem; }
/* Invisible bridge spanning the gap between the link and the menu, so moving
   the pointer down onto the menu never drops :hover and closes it. */
.site-nav .has-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.9rem;
}
.site-nav .subnav {
    display: none;
    position: absolute;
    top: 100%;
    left: -0.9rem;
    min-width: 190px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 26px rgba(52,56,47,0.14);
    padding: 0.4rem 0;
    margin: 0.6rem 0 0;
    list-style: none;
    flex-direction: column;
    gap: 0;
    z-index: 40;
}
.site-nav .has-dropdown:hover .subnav,
.site-nav .has-dropdown:focus-within .subnav,
.site-nav .has-dropdown.open .subnav { display: flex; }
.site-nav .subnav li { width: 100%; }
.site-nav .subnav a {
    display: block;
    padding: 0.6rem 1.1rem;
    letter-spacing: 0.08em;
    color: var(--ink);
}
.site-nav .subnav a:hover { background: var(--cream); color: var(--gold-deep); }

.site-footer {
    background: var(--ink);
    color: #D8DAD0;
    margin-top: 4rem;
    padding: 3rem 0 1.5rem;
}
.site-footer a { color: #C9CFBE; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.footer-brand { font-family: var(--serif); font-size: 1.4rem; color: #fff; }
.footer-blurb { max-width: 340px; color: #B7BCAC; margin-top: 0.5rem; }
.footer-links { display: flex; flex-flow: row wrap; gap: 1.5rem; align-items: center; }
.footer-social { display: flex; gap: 1rem; margin-top: 0.75rem; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 2rem; padding-top: 1.25rem;
    font-size: 0.8rem; color: #9AA090;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.footer-legal { display: flex; gap: 1.25rem; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 4rem 0; }
.section.alt { background: var(--cream-deep); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-head p { color: var(--ink-soft); }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
    padding: 5rem 0;
}
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.hero-copy h1 { margin: 0 0 1rem; }
.hero-copy .lead { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 1.75rem; }
.hero-photo {
    aspect-ratio: 4 / 5;
    background: var(--sage);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(52,56,47,0.18);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo.placeholder {
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.85); font-family: var(--serif); font-size: 1.1rem; text-align: center; padding: 2rem;
    background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
}

/* ---- Book grid ---- */
.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.book-card { text-align: center; }
.book-cover {
    aspect-ratio: 2 / 3;
    background: var(--cream-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.1rem;
    box-shadow: 0 12px 28px rgba(52,56,47,0.12);
    display: flex; align-items: center; justify-content: center;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover.placeholder { color: var(--ink-soft); font-family: var(--serif); padding: 1.5rem; text-align: center; }
.book-card h3 { margin: 0 0 0.25rem; }
.book-card .subtitle { color: var(--gold-deep); font-style: italic; font-size: 0.95rem; margin-bottom: 0.6rem; }
.book-card p { color: var(--ink-soft); font-size: 0.95rem; }

/* Featured book (home hero-adjacent) */
.featured-book { display: grid; grid-template-columns: 300px 1fr; gap: 3rem; align-items: center; }
.featured-book .book-cover { margin: 0; }
@media (max-width: 760px) { .featured-book { grid-template-columns: 1fr; } }

/* ---- Events ---- */
.event-list { list-style: none; margin: 0; padding: 0; }
.event-item {
    display: flex; gap: 1.5rem; align-items: flex-start;
    padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.event-date {
    flex: 0 0 88px; text-align: center;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 0.6rem 0.4rem;
}
.event-date .mon { display: block; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; font-weight: 700; color: var(--gold-deep); }
.event-date .day { display: block; font-family: var(--serif); font-size: 1.8rem; line-height: 1; color: var(--ink); }
.event-date .yr  { display: block; font-size: 0.72rem; color: var(--ink-soft); }
.event-body h3 { margin: 0 0 0.2rem; }
.event-body .where { color: var(--ink-soft); font-size: 0.95rem; }
.event-body .desc { color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.4rem; }

/* View toggle */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.view-toggle button {
    background: var(--white); color: var(--ink-soft); border: none; padding: 0.5rem 1.1rem;
    font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 0;
}
.view-toggle button.active { background: var(--sage); color: #fff; }

/* Calendar */
.calendar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.2rem; background: var(--cream-deep); }
.cal-head h3 { margin: 0; }
.cal-nav { display: flex; gap: 0.5rem; }
.cal-nav button { padding: 0.35rem 0.9rem; background: var(--sage); color:#fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-grid .dow { text-align: center; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); padding: 0.6rem 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.cal-cell { min-height: 92px; border: 0.5px solid var(--line); padding: 0.4rem; font-size: 0.8rem; }
.cal-cell .num { color: var(--ink-soft); font-weight: 600; }
.cal-cell.other { background: var(--cream); color: #bbb; }
.cal-cell.today .num { background: var(--gold); color:#fff; border-radius: 50%; padding: 0 0.35rem; }
.cal-event { display:block; margin-top: 0.25rem; background: var(--sage); color:#fff; border-radius: 3px; padding: 0.15rem 0.35rem; font-size: 0.7rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-event:hover { background: var(--sage-deep); color:#fff; }
.hidden { display: none; }

/* ---- Devotions ---- */
.devotion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.devotion-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.6rem; display: flex; flex-direction: column;
}
.devotion-card .ref { color: var(--gold-deep); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.devotion-card h3 { margin: 0.4rem 0 0.6rem; }
.devotion-card .date { color: var(--ink-soft); font-size: 0.82rem; margin-bottom: 0.6rem; }
.devotion-card p { color: var(--ink-soft); font-size: 0.95rem; flex: 1; }
.devotion-card .read { margin-top: 0.9rem; font-weight: 600; font-size: 0.9rem; }

.devotion-article { max-width: 720px; margin: 0 auto; }
.devotion-article .ref { color: var(--gold-deep); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; font-weight: 600; }
.devotion-article .date { color: var(--ink-soft); }
.devotion-article p { font-size: 1.1rem; }
blockquote { border-left: 3px solid var(--gold); margin: 1.5rem 0; padding: 0.4rem 0 0.4rem 1.3rem; font-family: var(--serif); font-style: italic; color: var(--ink); font-size: 1.15rem; }

/* ---- Webinars (members only) ---- */
.member-login {
    max-width: 420px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 14px 34px rgba(52,56,47,0.10);
}
.member-login form.stack { max-width: none; }

.member-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--cream-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 1.1rem;
    margin-bottom: 2rem;
    font-size: 0.92rem;
    color: var(--ink-soft);
}
.member-bar form { margin: 0; }

.webinar-card {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 2rem;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.webinar-body h2 { margin: 0 0 0.3rem; font-size: 1.5rem; }
.webinar-body p { color: var(--ink-soft); }

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
}
.video-frame iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%; border: 0;
}
.video-frame.placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--sage), var(--sage-deep));
    color: rgba(255,255,255,0.9);
    font-family: var(--serif);
}
@media (max-width: 860px) { .webinar-card { grid-template-columns: 1fr; } }

/* Bible study extras */
.lock-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.6rem;
    background: var(--gold);
    color: #fff;
    font-family: var(--sans);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
}
.study-notes { margin: 0.5rem 0 1rem; }
.study-notes p { color: var(--ink-soft); font-size: 0.95rem; }
.video-frame.placeholder i { font-style: normal; font-size: 1.8rem; }
.locked-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Sign-in modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(52,56,47,0.55);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.30);
}
.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.7rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.modal-close:hover { color: var(--ink); }

/* ---- About ---- */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 3rem; align-items: start; }
.about-photo { aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; box-shadow: 0 16px 36px rgba(52,56,47,0.16); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo.placeholder { display:flex; align-items:center; justify-content:center; background: linear-gradient(135deg, var(--sage), var(--sage-deep)); color: rgba(255,255,255,0.85); font-family: var(--serif); padding: 2rem; text-align:center; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* ---- Forms ---- */
form.stack { max-width: 560px; display: flex; flex-direction: column; gap: 1.1rem; }
label { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 600; font-size: 0.92rem; }
input, textarea, select {
    font: inherit; font-size: 1rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--white); width: 100%; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(138,154,128,0.18); }

/* ---- Flash ---- */
.flash { padding: 0.85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.5rem; background: var(--cream-deep); border: 1px solid var(--line); }
.flash.success { background: #E9F0E4; border-color: var(--success); color: #3F5636; }
.flash.error   { background: #F6E6DF; border-color: var(--error); color: var(--error); }

.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.muted { color: var(--ink-soft); font-size: 0.9rem; }

/* ============================================================
   Admin area  (functional, cream-tinted)
   ============================================================ */
body.admin { background: var(--cream-deep); font-size: 16px; }
.admin-banner { background: var(--ink); color: #fff; padding: 0.8rem 0; }
.admin-banner .container { display: flex; justify-content: space-between; align-items: center; }
.admin-banner .brand { color: #fff; font-size: 1.15rem; }
.admin-nav { display: flex; align-items: center; gap: 1.25rem; }
.admin-nav a { color: #CDD2C3; font-family: var(--sans); font-size: 0.9rem; }
.admin-nav a:hover { color: var(--gold); }
.admin-nav .who { color: #99A08C; font-size: 0.85rem; }
.admin-nav .logout { color: #E0A58C; }

.dropdown { position: relative; }
.dropdown-toggle { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.35); padding: 0.4rem 0.85rem; font-size: 0.9rem; }
.dropdown-menu { display: none; position: absolute; top: 115%; left: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 22px rgba(0,0,0,0.14); min-width: 190px; z-index: 40; }
.dropdown-menu a { display: block; padding: 0.6rem 1rem; color: var(--ink); }
.dropdown-menu a:hover { background: var(--cream); }
.dropdown.open .dropdown-menu { display: block; }

.admin-main { padding: 2rem 1.5rem; }
.admin-main h1 { font-size: 1.9rem; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
table.grid th, table.grid td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid th { background: var(--cream); font-family: var(--sans); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.btn-danger { background: var(--error); color: #fff; padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.row-actions { display: flex; gap: 0.5rem; }
.checkline { flex-direction: row; align-items: center; gap: 0.5rem; }
.checkline input { width: auto; }

body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%); }
.login-card { background: #fff; padding: 2.25rem; border-radius: var(--radius); width: 360px; box-shadow: 0 18px 50px rgba(0,0,0,0.28); }
.login-card h1 { margin-top: 0; font-size: 1.5rem; }

.dashboard-tiles { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.tile { flex: 1 1 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.tile h3 { margin: 0 0 0.4rem; }
.tile .count { font-family: var(--serif); font-size: 2rem; color: var(--sage-deep); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
    .hero .container { grid-template-columns: 1fr; text-align: center; }
    .hero-photo { max-width: 360px; margin: 0 auto; }
    .book-grid, .devotion-grid { grid-template-columns: 1fr 1fr; }
    .featured-book { grid-template-columns: 1fr; text-align: center; }
    .featured-book .book-cover { max-width: 240px; margin: 0 auto; }
}
@media (max-width: 640px) {
    .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--cream); border-bottom: 1px solid var(--line); }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0; padding: 0.5rem 1.5rem 1rem; }
    .site-nav li { width: 100%; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
    .nav-toggle { display: block; }
    .site-header .container { position: relative; }
    /* On mobile the dropdown flattens into an indented sub-list */
    .site-nav .subnav {
        display: flex; position: static; box-shadow: none; border: none;
        background: transparent; padding: 0.4rem 0 0; margin: 0;
        min-width: 0;
    }
    .site-nav .subnav a { padding: 0.45rem 0 0.45rem 1rem; font-size: 0.78rem; color: var(--ink-soft); }
    .site-nav .caret { display: none; }
    .book-grid, .devotion-grid { grid-template-columns: 1fr; }
    .cal-cell { min-height: 60px; }
}