/* ──────────────────────────────────────────────────────────────────
   WSM ServiceManager — Public-facing styles
   Aesthetic: WSM Connect Card (teal field, cream cards, colored
   left-stripes, bold compressed display type). Plus print styles
   for both guides — landscape student guide and portrait volunteer
   guide.
   ────────────────────────────────────────────────────────────────── */

:root {
    --teal:        #3eb5a6;
    --teal-deep:   #1a3a3f;
    --teal-darker: #144347;
    --teal-band:   #6dc7b8;   /* soft teal used on guide section bands */
    --teal-band-2: #c2e6df;   /* even softer teal for alternating bands */
    --cream:       #f5ecd2;
    --cream-deep:  #e8dcb5;
    --ink:         #1a3a3f;
    --muted:       #5d7a7e;
    --paper:       #ffffff;
    --paper-gray:  #ececec;

    /* Accent strips (left edges of cards) — drives data-accent="" */
    --accent-red:    #c64545;
    --accent-orange: #e89a3c;
    --accent-green:  #5fa05a;
    --accent-purple: #a06cf0;
    --accent-blue:   #5d9cec;
    --accent-yellow: #ffc832;
    --accent-pink:   #f06d9e;

    --radius: 14px;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0a0a;
    color: #f0f0f0;
    line-height: 1.55;
    overflow-x: hidden;
}

/* Subtle "WSM" repeating pattern */
.bg-pattern {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        repeating-linear-gradient(135deg,
            rgba(255, 255, 255, 0.04) 0 22px,
            transparent 22px 44px),
        radial-gradient(ellipse at top, rgba(255, 255, 255, 0.06), transparent 60%);
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

@media (min-width: 640px) {
    .shell {
        padding: 32px 24px;
    }
}

/* ─── Masthead ──────────────────────────────────────────────── */
.masthead {
    padding: 18px 8px 22px;
    text-align: left;
}
.logo {
    font-family: 'Anton', 'Impact', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    margin: 0;
    line-height: 0.9;
    letter-spacing: 1.5px;
    color: var(--teal-deep);
    font-size: clamp(2.4rem, 9vw, 3.8rem);
}
.logo-a { color: var(--teal-deep); }
.logo-b { color: var(--cream); margin-left: 0.25em; }
.masthead-sub {
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    margin: 4px 0 0;
    font-weight: 800;
}

/* ─── Section header (cream pill with title) ──────────────── */
.section-header {
    padding: 10px 14px;
    background: var(--cream);
    border-radius: var(--radius) var(--radius) 0 0;
    color: var(--ink);
    border-bottom: 2px dashed var(--cream-deep);
}
.section-header h2 {
    margin: 0;
    font-family: 'Anton', 'Impact', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.4rem;
}

/* ─── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 7px;
    background: var(--accent, var(--teal-deep));
}
.card[data-accent="red"]    { --accent: var(--accent-red); }
.card[data-accent="orange"] { --accent: var(--accent-orange); }
.card[data-accent="green"]  { --accent: var(--accent-green); }
.card[data-accent="purple"] { --accent: var(--accent-purple); }
.card[data-accent="blue"]   { --accent: var(--accent-blue); }
.card[data-accent="yellow"] { --accent: var(--accent-yellow); }
.card[data-accent="pink"]   { --accent: var(--accent-pink); }
.card[data-accent="teal"]   { --accent: var(--teal-deep); }
/* Cards can also drive their stripe from an inline CSS var: style="--accent: #xyz" */

.card-pad { padding-left: 20px; } /* a bit more room past the stripe */

/* ─── Public lesson list ──────────────────────────────────── */
.lesson-card {
    padding-left: 20px;
}
.lesson-card .lesson-series {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
    color: var(--teal-deep);
    margin: 0 0 6px;
}
.lesson-card .lesson-title {
    font-family: 'Anton', 'Impact', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px;
    font-size: clamp(1.4rem, 5vw, 1.7rem);
    line-height: 1.1;
    color: var(--ink);
}
.lesson-card .lesson-meta {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 0 0 8px;
}
.lesson-card .lesson-meta strong { color: var(--ink); }
.lesson-card .lesson-idea {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
}

.lessons-empty {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 36px 18px;
    text-align: center;
    color: var(--muted);
}

/* ─── Footer (public) ────────────────────────────────────── */
.public-foot {
    margin-top: 24px;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

/* ─── Buttons / links (public) ───────────────────────────── */
.btn-link {
    color: var(--teal-deep);
    text-decoration: underline;
    font-weight: 600;
}

/* ═════════════════════════════════════════════════════════════
   GUIDE STYLES — shared by both volunteer and student.
   The "guide" is the printable artifact. On screen it's just
   centered on the teal field; @media print sizes the page.
   ═════════════════════════════════════════════════════════════ */

.guide {
    background: #fff;
    color: #1a3a3f;
    font-family: 'Nunito Sans', sans-serif;
    line-height: 1.45;
}
.guide-frame {
    /* Web frame around the guide so it looks like a printable on screen */
    max-width: 880px;
    margin: 20px auto;
    box-shadow: 0 16px 60px rgba(0,0,0,0.25);
}

/* Print preview controls — sticky bar above the guide on screen,
   hidden when printing. */
.print-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #111111;
    color: #f0f0f0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}
.print-bar a, .print-bar button {
    background: rgba(255,255,255,.08);
    color: #f0f0f0;
    border: 1px solid rgba(255,255,255,.12);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 6px;
}
.print-bar a:hover {
    background: rgba(255,255,255,.16);
    color: #fff;
}
.print-bar button {
    background: #52c1af;
    color: #0a0a0a;
    border-color: #52c1af;
}
.print-bar button:hover {
    background: #6dd0bf;
}
.print-bar a:hover, .print-bar button:hover { background: #fff; }
.print-bar .print-bar-title { font-weight: 700; }

/* ═════════════════════════════════════════════════════════════
   VOLUNTEER GUIDE (portrait, two pages)
   Page 1 — Lesson content with icons in left-column banner
   Page 2 — DEBRIEF form
   ═════════════════════════════════════════════════════════════ */

.volunteer-guide .vg-page {
    width: 8.5in;
    min-height: 11in;
    padding: 0.4in 0.5in;
    background: #fff;
    box-sizing: border-box;
    page-break-after: always;
    position: relative;
    display: flex;
    flex-direction: column;
}
.volunteer-guide .vg-page:last-child { page-break-after: auto; }

/* Top series banner */
.vg-banner {
    background: var(--teal-band);
    color: #fff;
    padding: 14px 22px;
    font-family: 'Anton', 'Impact', sans-serif;
    font-size: 2rem;
    text-transform: capitalize;
    border-radius: 4px;
    display: inline-block;
    max-width: 60%;
    line-height: 1.05;
}

.vg-title {
    font-size: 1.55rem;
    font-weight: 600;
    margin: 10px 0 2px;
    color: var(--ink);
    line-height: 1.2;
}
.vg-byline {
    font-size: 0.9rem;
    color: #444;
    margin: 0 0 14px;
}

/* The lesson grid — left column has the icon + label, right has content. */
.vg-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    border-collapse: separate;
    flex: 1;
}
.vg-row {
    display: contents;
}
.vg-cell-left,
.vg-cell-right {
    padding: 12px 16px;
    min-height: 70px;
}
.vg-cell-left {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--paper-gray);
    border-right: 3px solid var(--teal-band);
    font-weight: 700;
    font-size: 1.05rem;
}
.vg-cell-left .vg-icon {
    width: 48px; height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.7rem; line-height: 1;
    flex-shrink: 0;
}
.vg-cell-right {
    background: #fff;
    font-size: 0.95rem;
    line-height: 1.45;
}
.vg-cell-right.scripture-ref {
    color: var(--teal-band);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Alternating row tints to match the source template */
.vg-row.tint-band .vg-cell-right { background: var(--teal-band-2); }
.vg-row.divider-top .vg-cell-left,
.vg-row.divider-top .vg-cell-right {
    border-top: 2px dashed var(--teal-band);
}
.vg-row .point-title {
    font-weight: 800;
    margin: 0 0 4px;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.vg-row .point-body {
    margin: 0;
    font-style: italic;
    color: #2a3f44;
}
.vg-row .response-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    font-style: italic;
}
.vg-row .response-list li { margin-bottom: 4px; }

/* Footer band per page */
.vg-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    gap: 16px;
}
.vg-foot .vg-foot-tag {
    background: var(--teal-band);
    color: #fff;
    padding: 10px 24px;
    font-family: 'Anton', 'Impact', sans-serif;
    font-size: 1.7rem;
    border-radius: 3px;
    line-height: 1;
    text-transform: capitalize;
}
.vg-foot .vg-foot-copy {
    color: #555;
    font-size: 0.85rem;
    font-style: italic;
}
.vg-pageno {
    text-align: center;
    color: #777;
    font-size: 0.85rem;
    margin: 6px 0 0;
}

/* DEBRIEF page */
.vg-debrief-head {
    display: grid;
    grid-template-columns: 200px 1fr;
    margin-bottom: 16px;
}
.vg-debrief-head .vg-cell-left {
    padding: 18px 16px;
    min-height: auto;
    background: var(--paper-gray);
    font-family: 'Anton', 'Impact', sans-serif;
    font-size: 2.2rem;
    color: var(--teal-band);
    letter-spacing: 0.5px;
    border-right: 3px solid var(--teal-band);
}
.vg-debrief-head .vg-cell-right {
    background: #fff;
    font-style: italic;
    font-size: 0.95rem;
    padding: 18px 16px;
    color: #2a3f44;
}
.vg-debrief-head .vg-cell-right .verse-ref {
    color: #777;
    font-size: 0.78rem;
    font-style: italic;
    display: block;
    margin-top: 2px;
}

.vg-debrief-section { margin-bottom: 14px; }
.vg-debrief-section .vg-debrief-label {
    background: var(--teal-band);
    color: #fff;
    padding: 6px 14px;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-top: 2px solid var(--teal-band);
    border-bottom: 2px solid var(--teal-band);
}
/* "What went well" etc keep a tint */
.vg-debrief-section.tint .vg-debrief-label {
    background: var(--teal-band-2);
    color: var(--ink);
    border-color: var(--teal-band);
}
.vg-debrief-lines {
    background: var(--paper-gray);
    padding: 10px 14px;
    /* dashed writing lines */
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0 26px,
        rgba(0,0,0,0.18) 26px 27px
    );
    min-height: 110px;
}
.vg-debrief-lines.short { min-height: 60px; }
.vg-debrief-lines.numbered {
    background-image: none;
    counter-reset: announce;
}
.vg-debrief-lines.numbered .num-line {
    counter-increment: announce;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.2);
    font-weight: 700;
    color: var(--ink);
}
.vg-debrief-lines.numbered .num-line:last-child { border-bottom: none; }
.vg-debrief-lines.numbered .num-line::before {
    content: counter(announce) ".";
    margin-right: 8px;
}

/* ═════════════════════════════════════════════════════════════
   STUDENT GUIDE (landscape, two pages)
   Page 1 — Notes column + lesson content with fill-in-blanks
   Page 2 — Series art + upcoming events
   ═════════════════════════════════════════════════════════════ */

.student-guide .sg-page {
    width: 11in;
    height: 8.5in;
    padding: 0;
    background: #fff;
    page-break-after: always;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    position: relative;
}
.student-guide .sg-page:last-child { page-break-after: auto; }

/* ─── Page 1 — lesson content ─── */
.sg-notes {
    padding: 0.4in 0.35in;
    border-right: 3px solid var(--teal-band);
    position: relative;
}
.sg-notes-title {
    font-family: 'Anton', 'Impact', sans-serif;
    font-size: 1.6rem;
    color: var(--teal-band);
    margin: 0 0 16px;
    letter-spacing: 0.5px;
}
.sg-notes-lines {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0 26px,
        rgba(0,0,0,0.15) 26px 27px
    );
    min-height: 6.5in;
}

.sg-content {
    padding: 0.35in;
    display: flex;
    flex-direction: column;
}
.sg-lesson-head {
    text-align: center;
    margin-bottom: 12px;
}
.sg-lesson-head h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.sg-lesson-head .sg-subtitle {
    font-size: 1.05rem;
    color: #555;
    margin: 4px 0 0;
}

.sg-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    flex: 1;
}
.sg-row { display: contents; }
.sg-cell-left, .sg-cell-right {
    padding: 8px 10px;
    border-top: 1px solid var(--teal-band);
    min-height: 56px;
}
.sg-cell-left {
    background: var(--paper-gray);
    display: flex;
    align-items: center;
    gap: 6px;
    border-right: 3px solid var(--teal-band);
    font-weight: 700;
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.1;
}
.sg-cell-left .sg-icon {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; line-height: 1;
    flex-shrink: 0;
}
.sg-cell-right {
    background: #fff;
    font-size: 0.82rem;
}
.sg-cell-right.scripture-ref {
    color: var(--ink);
    font-weight: 700;
    font-size: 0.85rem;
}
.sg-cell-right.scripture-ref div { margin-bottom: 2px; }
.sg-row.tint-band .sg-cell-right { background: var(--teal-band-2); }
.sg-row.tint-band .sg-cell-right.fillin {
    color: var(--teal-band);
    font-weight: 700;
    font-size: 0.9rem;
}
.sg-row .fillin-blank {
    display: inline-block;
    min-width: 90px;
    border-bottom: 1.5px solid #333;
    margin: 0 4px;
    height: 1em;
    vertical-align: bottom;
}

/* ─── Page 2 — series art + upcoming events ─── */
.sg-events {
    background: var(--paper-gray);
    padding: 0.3in 0.3in 0.2in;
    display: flex;
    flex-direction: column;
    position: relative;
    background-image:
        repeating-linear-gradient(135deg,
            rgba(0,0,0,0.025) 0 16px,
            transparent 16px 32px);
}
.sg-events-head {
    font-family: 'Anton', 'Impact', sans-serif;
    color: var(--teal-band);
    line-height: 1;
    margin-bottom: 4px;
}
.sg-events-head .sg-events-title { font-size: 1.5rem; }
.sg-events-head .sg-events-sub {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 600;
    display: block;
    margin-top: 2px;
}
.sg-events-list { flex: 1; }
.sg-event {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 2px dashed var(--teal-band);
}
.sg-event:last-of-type { border-bottom: none; }
.sg-event-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal-band, currentColor);
}
.sg-event-icon svg { width: 32px; height: 32px; }
.sg-event-body { font-size: 0.78rem; line-height: 1.35; }
.sg-event-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 0 4px;
    color: var(--ink);
}
.sg-event-when {
    display: grid;
    grid-template-columns: 70px 100px 1fr;
    gap: 4px;
    font-size: 0.74rem;
    color: var(--ink);
    margin-bottom: 4px;
}
.sg-event-when em { color: var(--ink); font-style: italic; font-weight: 700; font-style: italic; }
.sg-event-desc { font-size: 0.74rem; color: #2a3f44; margin: 0; }

.sg-contact {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 10px;
    border-top: 2px solid var(--teal-band);
}
.sg-contact-logo {
    font-family: 'Anton', 'Impact', sans-serif;
    background: #fff;
    border: 3px solid var(--ink);
    padding: 6px 12px;
    font-size: 1.8rem;
    color: var(--ink);
    line-height: 1;
}
.sg-contact-info {
    font-size: 0.78rem;
    color: var(--ink);
    line-height: 1.35;
}
.sg-contact-info strong { color: var(--ink); font-weight: 800; }

/* The series-art half (right) */
.sg-art {
    background: var(--ink);
    color: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.sg-art-bg {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(255,255,255,0.18), transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(255,255,255,0.08), transparent 70%);
    background-color: #1a1a1a;
    background-size: cover;
}
.sg-art-title {
    position: relative;
    background: var(--ink);
    margin: 1in 0 0;
    padding: 18px 24px;
}
.sg-art-title h1 {
    font-family: 'Anton', 'Impact', sans-serif;
    margin: 0;
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    line-height: 1.05;
}
.sg-art-title .sg-art-sub {
    display: block;
    font-family: 'Anton', 'Impact', sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
    color: #fff;
    margin-top: 6px;
    text-transform: uppercase;
}
.sg-art-foot {
    position: relative;
    text-align: right;
    padding: 16px 24px;
    border-top: 2px solid #fff;
    margin-left: 30%;
}
.sg-art-foot-tag {
    font-family: 'Anton', 'Impact', sans-serif;
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    line-height: 1;
}
.sg-art-foot-sub {
    display: block;
    font-family: 'Anton', 'Impact', sans-serif;
    font-size: 0.95rem;
    color: #fff;
    margin-top: 4px;
}

/* ═════════════════════════════════════════════════════════════
   PRINT MEDIA — page sizing + cleanup
   ═════════════════════════════════════════════════════════════ */

/* Volunteer guide: portrait letter */
@media print {
    body { background: #fff !important; }
    .bg-pattern, .print-bar, .public-foot, .guide-frame {
        display: none !important;
        box-shadow: none !important;
    }
    .guide-frame {
        max-width: none;
        margin: 0;
        box-shadow: none;
        display: block !important;
    }
    /* Restore the .guide-frame as just a passthrough during print */
}

@media print {
    .volunteer-guide-page { /* the <body class> */ }
    @page volunteer { size: letter portrait; margin: 0; }
    .volunteer-guide-page .guide-frame, .volunteer-guide-page .vg-page {
        page: volunteer;
    }
    .student-guide-page .guide-frame, .student-guide-page .sg-page {
        page: student;
    }
    @page student { size: letter landscape; margin: 0; }
}

/* Make sure each page actually fills letter when printing */
@media print {
    .vg-page { box-shadow: none; margin: 0; }
    .sg-page { box-shadow: none; margin: 0; }
    .guide-frame { display: block; }
}

/* ═════════════════════════════════════════════════════════════
   Screen-only helpers
   ═════════════════════════════════════════════════════════════ */

@media screen and (max-width: 900px) {
    .vg-page, .sg-page {
        width: 100%;
        min-height: 0;
        height: auto;
    }
    .student-guide .sg-page { grid-template-columns: 1fr; }
}
