/* ==========================================================================
   FHC Learning Portal — "Growing Together in Faith"
   Warm editorial direction: deep plum + gold accent on soft parchment,
   generous type scale, one strong hero, numbered pilgrimage timeline.
   Scoped under .cmfhc so the Bootscore theme is untouched.
   ========================================================================== */

.cmfhc {
    --fhc-plum: #522578;
    --fhc-plum-deep: #371854;
    --fhc-plum-soft: #ede5f7;
    --fhc-gold: #c9962e;          /* decorative accents only — never body text */
    --fhc-gold-text: #7d5a0e;     /* WCAG AA text-safe gold on white/paper */
    --fhc-gold-soft: #f7edd8;
    --fhc-ink: #1f1a26;
    --fhc-ink-soft: #56505e;
    --fhc-paper: #faf7f2;
    --fhc-card: #ffffff;
    --fhc-line: #e7e0d6;
    --fhc-green: #2e7d4f;
    --fhc-green-soft: #e2f2e8;
    --fhc-red: #b3402e;
    --fhc-red-soft: #fbe9e5;
    --fhc-radius: 18px;
    --fhc-radius-sm: 10px;
    --fhc-shadow: 0 1px 2px rgba(36, 30, 43, 0.06), 0 8px 28px rgba(36, 30, 43, 0.08);
    --fhc-ease: cubic-bezier(0.16, 1, 0.3, 1);

    color: var(--fhc-ink);
    font-size: 1.0625rem;
    line-height: 1.6;
    max-width: 62rem;
    margin-inline: auto;
}

.cmfhc *,
.cmfhc *::before,
.cmfhc *::after {
    box-sizing: border-box;
}

/* --- Type ---------------------------------------------------------------- */

.cmfhc-eyebrow {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fhc-gold-text);
    margin: 0 0 0.5rem;
}

/* Visible focus for every interactive element in the portal. */
.cmfhc a:focus-visible,
.cmfhc button:focus-visible,
.cmfhc input:focus-visible,
.cmfhc textarea:focus-visible,
.cmfhc .cmfhc-file:focus-within {
    outline: 3px solid var(--fhc-plum);
    outline-offset: 2px;
    border-radius: 4px;
}

.cmfhc-hero a:focus-visible,
.cmfhc-hero button:focus-visible {
    outline-color: #fff;
}

.cmfhc-section-title {
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 1.25rem;
    color: var(--fhc-plum-deep);
}

/* --- Hero ---------------------------------------------------------------- */

.cmfhc-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: stretch;
    justify-content: space-between;
    background:
        radial-gradient(120% 180% at 100% 0%, rgba(201, 150, 46, 0.18) 0%, transparent 45%),
        linear-gradient(135deg, var(--fhc-plum-deep) 0%, var(--fhc-plum) 70%);
    color: #fff;
    border-radius: var(--fhc-radius);
    padding: clamp(1.75rem, 4vw, 3rem);
    margin-bottom: 2rem;
    box-shadow: var(--fhc-shadow);
}

.cmfhc-hero--gate {
    display: block;
    text-align: center;
    padding-block: clamp(3rem, 8vw, 5rem);
}

.cmfhc-hero .cmfhc-eyebrow {
    color: #ecc776;
}

.cmfhc-hero-title {
    font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 0.5rem;
    color: #fff;
}

.cmfhc-hero-sub {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.93);
    margin: 0;
    max-width: 34rem;
}

.cmfhc-hero-links {
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
}

.cmfhc-hero-links a {
    color: #f2d492;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cmfhc-hero-links a:hover {
    color: #fff;
}

.cmfhc-gate-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cmfhc-btn--ghost {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.75);
}

.cmfhc-btn--ghost:hover,
.cmfhc-btn--ghost:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    border-color: #fff;
    color: #fff;
}

.cmfhc-hero--gate .cmfhc-hero-sub {
    margin-inline: auto;
    margin-bottom: 1.75rem;
}

.cmfhc-hero-note {
    margin: 1.25rem 0 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Next-lesson callout inside hero */

.cmfhc-next {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-width: 15rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--fhc-radius-sm);
    padding: 1.1rem 1.35rem;
    text-decoration: none;
    color: #fff;
    transition: background 250ms var(--fhc-ease), transform 250ms var(--fhc-ease);
}

.cmfhc-next:hover,
.cmfhc-next:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    color: #fff;
}

.cmfhc-next-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ecc776;
}

.cmfhc-next-date {
    font-size: 1.35rem;
    font-weight: 800;
}

.cmfhc-next-title {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

.cmfhc-next-cta {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #ecc776;
}

/* --- Cards / children row ------------------------------------------------ */

.cmfhc-card {
    background: var(--fhc-card);
    border: 1px solid var(--fhc-line);
    border-radius: var(--fhc-radius);
    box-shadow: var(--fhc-shadow);
}

.cmfhc-children {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.cmfhc-child {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 1.25rem;
}

.cmfhc-child-avatar {
    flex: 0 0 auto;
    inline-size: 3.25rem;
    block-size: 3.25rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--fhc-plum);
    background: var(--fhc-plum-soft);
}

.cmfhc-child-body {
    flex: 1 1 auto;
    min-width: 0;
}

.cmfhc-child-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
}

.cmfhc-child-meta {
    font-size: 0.8125rem;
    color: var(--fhc-ink-soft);
    margin: 0.35rem 0 0;
}

.cmfhc-progress {
    block-size: 0.5rem;
    border-radius: 999px;
    background: var(--fhc-plum-soft);
    overflow: hidden;
}

.cmfhc-progress-bar {
    block-size: 100%;
    inline-size: var(--pct, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--fhc-plum) 0%, var(--fhc-gold) 130%);
    transition: inline-size 600ms var(--fhc-ease);
}

/* --- Timeline ------------------------------------------------------------ */

.cmfhc-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.cmfhc-timeline::before {
    content: "";
    position: absolute;
    inset-block: 1.4rem;
    inset-inline-start: 1.45rem;
    inline-size: 2px;
    background: linear-gradient(var(--fhc-plum-soft), var(--fhc-gold-soft));
}

.cmfhc-step {
    position: relative;
    margin: 0 0 0.65rem;
}

.cmfhc-step-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 0.9rem 1.15rem 0.9rem 0.5rem;
    border-radius: var(--fhc-radius-sm);
    text-decoration: none;
    color: inherit;
    transition: background 200ms var(--fhc-ease), transform 200ms var(--fhc-ease), box-shadow 200ms var(--fhc-ease);
}

.cmfhc-step-link:hover,
.cmfhc-step-link:focus-visible {
    background: var(--fhc-card);
    box-shadow: var(--fhc-shadow);
    transform: translateX(4px);
    color: inherit;
}

.cmfhc-step-marker {
    flex: 0 0 auto;
    inline-size: 2rem;
    block-size: 2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    font-weight: 800;
    background: var(--fhc-card);
    border: 2px solid var(--fhc-plum-soft);
    color: var(--fhc-plum);
    z-index: 1;
}

.cmfhc-step--past .cmfhc-step-marker {
    background: var(--fhc-plum);
    border-color: var(--fhc-plum);
    color: #fff;
}

.cmfhc-step--current .cmfhc-step-link {
    background: var(--fhc-card);
    box-shadow: var(--fhc-shadow);
    border-inline-start: 4px solid var(--fhc-gold);
}

.cmfhc-step--current .cmfhc-step-marker {
    background: var(--fhc-gold);
    border-color: var(--fhc-gold);
    color: #fff;
    box-shadow: 0 0 0 5px var(--fhc-gold-soft);
}

.cmfhc-step--future .cmfhc-step-link {
    opacity: 1;
}

.cmfhc-step-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.cmfhc-step-date {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fhc-ink-soft);
}

.cmfhc-step-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--fhc-plum-deep);
}

.cmfhc-step-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.3rem;
}

.cmfhc-step-arrow {
    margin-inline-start: auto;
    color: var(--fhc-gold);
    font-weight: 700;
    opacity: 0;
    transition: opacity 200ms var(--fhc-ease);
}

.cmfhc-step-link:hover .cmfhc-step-arrow,
.cmfhc-step-link:focus-visible .cmfhc-step-arrow {
    opacity: 1;
}

/* --- Chips --------------------------------------------------------------- */

.cmfhc-chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    background: var(--fhc-plum-soft);
    color: var(--fhc-plum);
    white-space: nowrap;
}

.cmfhc-chip--done {
    background: var(--fhc-green-soft);
    color: var(--fhc-green);
}

.cmfhc-chip--due {
    background: var(--fhc-gold-soft);
    color: #6f500c;
}

.cmfhc-chip--needswork,
.cmfhc-chip--draft {
    background: var(--fhc-red-soft);
    color: var(--fhc-red);
}

.cmfhc-chip--meeting {
    background: #e3ecf9;
    color: #244c8d;
}

/* --- Lesson page --------------------------------------------------------- */

.cmfhc-breadcrumb {
    margin-bottom: 1.25rem;
}

.cmfhc-breadcrumb a {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--fhc-plum);
    text-decoration: none;
}

.cmfhc-breadcrumb a:hover {
    text-decoration: underline;
}

.cmfhc-lesson-head {
    margin-bottom: 1.75rem;
}

.cmfhc-lesson-title {
    font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--fhc-plum-deep);
    margin: 0 0 0.75rem;
}

.cmfhc-keymsg {
    margin: 0;
    padding: 0.9rem 1.25rem;
    border-inline-start: 4px solid var(--fhc-gold);
    background: var(--fhc-gold-soft);
    border-radius: 0 var(--fhc-radius-sm) var(--fhc-radius-sm) 0;
    font-size: 1.1rem;
    font-style: italic;
    color: #5c3f09;
}

.cmfhc-panel {
    padding: clamp(1.25rem, 3vw, 1.9rem);
    margin-bottom: 1.25rem;
}

.cmfhc-panel-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--fhc-plum-deep);
    margin: 0 0 0.75rem;
}

.cmfhc-panel-headrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cmfhc-panel-headrow .cmfhc-panel-title {
    margin: 0;
}

.cmfhc-panel--prework {
    border-inline-start: 4px solid var(--fhc-plum);
}

.cmfhc-panel--homework {
    border-inline-start: 4px solid var(--fhc-gold);
}

.cmfhc-pages {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0.75rem 0 0;
}

/* --- Videos -------------------------------------------------------------- */

.cmfhc-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
    gap: 1rem;
}

.cmfhc-video {
    margin: 0;
}

.cmfhc-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--fhc-radius-sm);
    overflow: hidden;
    background: var(--fhc-ink);
}

.cmfhc-video-frame iframe {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    border: 0;
}

.cmfhc-video figcaption {
    font-size: 0.85rem;
    color: var(--fhc-ink-soft);
    margin-top: 0.4rem;
}

/* --- Homework ------------------------------------------------------------ */

.cmfhc-hw {
    border-top: 1px solid var(--fhc-line);
    padding-top: 1.1rem;
    margin-top: 1.1rem;
}

.cmfhc-hw-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.cmfhc-hw-child {
    font-weight: 800;
    font-size: 1rem;
}

.cmfhc-hw-feedback {
    background: var(--fhc-plum-soft);
    border-radius: var(--fhc-radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    margin: 0 0 0.75rem;
}

.cmfhc-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fhc-ink-soft);
    margin-bottom: 0.35rem;
}

.cmfhc-textarea {
    inline-size: 100%;
    border: 1px solid var(--fhc-line);
    border-radius: var(--fhc-radius-sm);
    padding: 0.7rem 0.9rem;
    font: inherit;
    resize: vertical;
    background: var(--fhc-paper);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.cmfhc-textarea:focus {
    outline: none;
    border-color: var(--fhc-plum);
    box-shadow: 0 0 0 3px var(--fhc-plum-soft);
}

.cmfhc-hw-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.cmfhc-file {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--fhc-plum);
    cursor: pointer;
    padding: 0.5rem 0.9rem;
    border: 1.5px dashed var(--fhc-plum-soft);
    border-radius: var(--fhc-radius-sm);
    transition: border-color 150ms ease, background 150ms ease;
}

.cmfhc-file:hover {
    border-color: var(--fhc-plum);
    background: var(--fhc-plum-soft);
}

.cmfhc-file input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.cmfhc-file.is-filled {
    border-style: solid;
    border-color: var(--fhc-green);
    color: var(--fhc-green);
    background: var(--fhc-green-soft);
}

.cmfhc-hw-file {
    font-size: 0.85rem;
    color: var(--fhc-ink-soft);
    margin: 0.6rem 0 0;
}

/* --- Buttons ------------------------------------------------------------- */

.cmfhc-btn {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform 200ms var(--fhc-ease), box-shadow 200ms var(--fhc-ease), background 200ms ease;
}

.cmfhc-btn--primary {
    background: var(--fhc-plum);
    color: #fff;
    box-shadow: 0 4px 14px rgba(91, 42, 134, 0.35);
}

.cmfhc-btn--primary:hover,
.cmfhc-btn--primary:focus-visible {
    background: var(--fhc-plum-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(91, 42, 134, 0.4);
}

/* --- Flash + notices ----------------------------------------------------- */

.cmfhc-flash {
    padding: 0.85rem 1.2rem;
    border-radius: var(--fhc-radius-sm);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.cmfhc-flash--success {
    background: var(--fhc-green-soft);
    color: var(--fhc-green);
    border: 1px solid rgba(46, 125, 79, 0.25);
}

.cmfhc-flash--error {
    background: var(--fhc-red-soft);
    color: var(--fhc-red);
    border: 1px solid rgba(179, 64, 46, 0.25);
}

.cmfhc-notice {
    padding: 1.5rem;
    color: var(--fhc-ink-soft);
}

/* --- Motion safety ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .cmfhc *,
    .cmfhc *::before,
    .cmfhc *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* --- Small screens ------------------------------------------------------- */

@media (max-width: 640px) {
    .cmfhc-hero {
        flex-direction: column;
        gap: 1.25rem;
    }

    .cmfhc-next {
        inline-size: 100%;
    }

    .cmfhc-hw-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cmfhc-hw-actions .cmfhc-btn {
        text-align: center;
    }
}


/* --- Gate contrast (2026-08-29) ------------------------------------------
   The primary button was plum-on-plum on the gate hero, and the guide link
   was nearly invisible. White primary, defined ghost, gold link. --- */
.cmfhc-hero--gate .cmfhc-btn--primary{background:#fff;color:var(--fhc-plum);box-shadow:0 4px 14px rgba(0,0,0,0.28)}
.cmfhc-hero--gate .cmfhc-btn--primary:hover,
.cmfhc-hero--gate .cmfhc-btn--primary:focus-visible{background:#f2eaf6;color:var(--fhc-plum-deep);transform:translateY(-1px)}
.cmfhc-hero--gate .cmfhc-btn--ghost{border-color:#fff;background:rgba(255,255,255,0.12)}
.cmfhc-hero--gate .cmfhc-btn--ghost:hover,
.cmfhc-hero--gate .cmfhc-btn--ghost:focus-visible{background:rgba(255,255,255,0.24)}
.cmfhc-hero-note{color:rgba(255,255,255,0.95)}
.cmfhc-hero-note a{color:#f2d488;font-weight:600;text-decoration:underline;text-underline-offset:2px}
.cmfhc-hero-note a:hover,
.cmfhc-hero-note a:focus-visible{color:#fff}
.cmfhc-hw-locked{font-style:italic;color:#6c757d;margin:0.5rem 0 0}
