/* ============================================================================
   CREDIT CARD MATH - SHARED SITE STYLES
   ============================================================================ */

/* ============================================================================
   01. Brand colors and global defaults
   ============================================================================ */
:root {
    --ccm-navy: #163d66;
    --ccm-blue: #27689e;
    --ccm-pale: #eaf3fa;
    --ccm-text: #223749;
}

body {
    background: #fff;
    color: var(--ccm-text);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.65;
}

.skip-link {
    position: absolute;
    z-index: 1200;
    background: #fff;
    padding: .5rem 1rem;
}

/* ============================================================================
   02. Page Accent Themes
   Set $page['theme'] to blue, green, lavender, or orange.
   A page without a theme uses the default blue palette.

   --page-light:       light surfaces and gradient starts
   --page-accent:      decorative lines, waves, and panel borders
   --page-strong:      readable themed text
   --page-action:      button fills and outlines
   --page-action-text: text on solid action buttons
   ============================================================================ */
body {
    --page-light: #EAF3FA;
    --page-accent: #83BDE6;
    --page-strong: #24689E;
    --page-action: #24689E;
    --page-action-text: #fff;
}

body.theme-blue {
    --page-light: #EAF3FA;
    --page-accent: #83BDE6;
    --page-strong: #24689E;
    --page-action: #24689E;
}

body.theme-green {
    --page-light: #E8F5E9;
    --page-accent: #6DBB80;
    --page-strong: #287A42;
    --page-action: #287A42;
}

body.theme-lavender {
    --page-light: #F0E9FA;
    --page-accent: #A68AD7;
    --page-strong: #7851A9;
    --page-action: #7851A9;
}

body.theme-orange {
    --page-light: #FFF1E4;
    --page-accent: #FFB86B;
    --page-strong: #CF5D00;
    --page-action: #F57707;
}

/* Orange Action remains the vivid #F57707 used in Debt Blaster. */

/* ============================================================================
   03. Header and top navigation
   The Header and TopNav are separate includes but share one visual row.
   ============================================================================ */
.brand-header {
    background: #fff;
    border-bottom: 2px solid var(--page-accent);
}

.brand-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.brand-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .85rem;
    min-width: 0;
    color: #092b60;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-link:hover {
    color: #092b60;
}

.brand-logo {
    display: block;
    width: clamp(205px, 26vw, 350px);
    height: auto;
}

/* Legacy brand-mark support; retained for pages that may still use it. */
.brand-mark {
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    border: 2px solid #a8d4f3;
    border-radius: .3rem;
    padding: .3rem .4rem;
    letter-spacing: -.02em;
}

.brand-mark span {
    color: #91c9ef;
    margin: 0 .12rem;
}

.navigation-bar {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    background: transparent;
    border: 0;
    margin-left: auto;
    padding: 0;
}

.navigation-bar .nav-link {
    padding: .4rem 1rem !important;
    color: #092b60;
    font-weight: 600;
    border-radius: .65rem;
}

.navigation-bar .nav-link:hover:not(.nav-disabled) {
    color: #075b9e;
    background: #edf5fb;
}

.navigation-bar .nav-link.active,
.navigation-bar .nav-link.active:hover {
    color: #fff;
    background: #06457e;
}

.navigation-bar .nav-disabled {
    color: #536a80;
    cursor: default;
}

.navbar-toggler {
    border-color: #bed4e7;
}

.navbar-toggler:focus-visible,
.navigation-bar .nav-link:focus-visible,
.brand-link:focus-visible {
    outline: 3px solid #3389d7;
    outline-offset: 3px;
}

/* ============================================================================
   04. Hero and approved Hero-to-Body wave
   ============================================================================ */
.hero-wave {
    background: var(--page-light);
    overflow: hidden;
}

.hero-wave h1 {
    color: var(--ccm-navy);
    line-height: 1.18;
}

.hero-wave .lead {
    color: #466072;
    max-width: 62ch;
}

.eyebrow {
    color: var(--page-strong);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.hero-content {
    padding-top: 3.5rem;
    padding-bottom: 1.75rem;
}

.hero-transition {
    display: block;
    width: 100%;
    height: clamp(42px, 6.25vw, 90px);
    background: #fff;
}

.hero-transition-fill {
    fill: var(--page-light);
}

.hero-transition-line {
    fill: none;
    stroke: var(--page-accent);
    stroke-width: 5;
    vector-effect: non-scaling-stroke;
}

/* ============================================================================
   05. White Body, section layout, and typography
   ============================================================================ */
main#main-content {
    background: #fff;
}

.section-space {
    padding: 4rem 0;
}

/* Keep all full-width educational sections white. */
.section-muted {
    background: #fff;
}

.narrow-content {
    max-width: 850px;
}

.section-title {
    color: var(--ccm-navy);
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.lead-body {
    font-size: 1.15rem;
}

/* ============================================================================
   06. Lesson cards, math panels, and calculator areas
   ============================================================================ */
.lesson-card {
    position: relative;
    padding: 1.5rem;
    border: 1px solid #dbe5ed;
    border-radius: .8rem;
    background: #fff;
    box-shadow: 0 2px 8px #183f6308;
}

.lesson-card:hover {
    border-color: var(--page-accent);
}

.lesson-card.theme-card-diagonal {
    background: linear-gradient(135deg, var(--page-light), #fff);
}

.theme-card-vertical {
    background: linear-gradient(180deg, var(--page-light), #fff);
}

.math-panel {
    padding: 1.4rem;
    background: var(--page-light);
    border-left: 4px solid var(--page-accent);
    border-radius: .4rem;
    overflow-x: auto;
}

.math-panel code {
    font-size: 1.1rem;
    color: #153d66;
    white-space: normal;
}

.calculator-slot {
    padding: 2rem;
    background: var(--page-light);
    border: 2px dashed var(--page-accent);
    border-radius: .6rem;
}

/* ============================================================================
   07. AI prompt cards and theme utilities
   ============================================================================ */
.prompt-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.2rem;
    border: 1px solid var(--page-accent);
    border-radius: .55rem;
    background: #fff;
}

/* Keep the prompt full-width; the copy action sits at the bottom right. */
.prompt-text {
    margin: 0;
}

.prompt-copy-row {
    display: flex;
    justify-content: flex-end;
}

/* Compact pill, using the approved Action Outline -> Solid effect. */
.copy-prompt.btn-theme-action {
    min-height: 2.25rem;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .875rem;
    line-height: 1.25;
    white-space: nowrap;
}

.copy-prompt-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.copy-prompt .copy-prompt-icon-check {
    display: none;
}

.copy-prompt.is-copied .copy-prompt-icon-copy {
    display: none;
}

.copy-prompt.is-copied .copy-prompt-icon-check {
    display: inline-block;
}

.theme-text {
    color: var(--page-strong);
}

.theme-border {
    border-color: var(--page-accent);
}

/* ============================================================================
   08. FAQ accordion (Bootstrap 5.3)
   Accent color now applies to the outer border and item separators.
   ============================================================================ */
.accordion {
    --bs-accordion-border-color: var(--page-accent);
    --bs-accordion-active-bg: var(--page-light);
    --bs-accordion-active-color: var(--ccm-navy);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 .2rem var(--page-light);
}

.accordion-button:not(.collapsed) {
    border-bottom: 1px solid var(--page-accent);
}

.accordion-button:focus-visible {
    outline: 3px solid var(--page-action);
    outline-offset: -3px;
}

/* ============================================================================
   09. Approved themed buttons
   1. Action Outline -> Solid
   2. Solid -> Outline
   3. Outline -> Soft Fill
   ============================================================================ */
.btn-theme-action,
.btn-theme-solid,
.btn-theme-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 2px solid var(--page-action);
    border-radius: .65rem;
    padding: .65rem 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease,
                border-color .18s ease,
                color .18s ease;
}

/* 1. Action Outline -> Solid */
.btn-theme-action {
    background: #fff;
    color: var(--page-strong);
}

.btn-theme-action:hover,
.btn-theme-action:active {
    background: var(--page-action);
    border-color: var(--page-action);
    color: var(--page-action-text);
}

/* 2. Solid -> Outline */
.btn-theme-solid {
    background: var(--page-action);
    color: var(--page-action-text);
}

.btn-theme-solid:hover,
.btn-theme-solid:active {
    background: #fff;
    color: var(--page-strong);
}

/* 3. Outline -> Soft Fill */
.btn-theme-soft {
    background: #fff;
    color: var(--page-strong);
}

.btn-theme-soft:hover,
.btn-theme-soft:active {
    background: var(--page-light);
    color: var(--page-strong);
}

.btn-theme-action:focus-visible,
.btn-theme-solid:focus-visible,
.btn-theme-soft:focus-visible {
    outline: 3px solid var(--ccm-navy);
    outline-offset: 3px;
}

/* ============================================================================
   10. Approved Body-to-Footer double wave and Footer
   The Footer colors remain fixed, independent of each page's accent theme.
   ============================================================================ */
.site-footer {
    color: #fff;
    position: relative;
}

.site-footer .footer-link,
.site-footer .footer-link:visited {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.site-footer .footer-link:hover,
.site-footer .footer-link:focus-visible {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    text-decoration-skip-ink: auto;
}

.site-footer .footer-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

.footer-transition {
    display: block;
    width: 100%;
    height: clamp(55px, 7vw, 100px);
    background: #fff;
}

.footer-transition-light {
    fill: #75b8e9;
}

.footer-transition-dark {
    fill: var(--ccm-navy);
}

.footer-content {
    background: var(--ccm-navy);
}

.footer-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .35);
    opacity: 1;
}

/* ============================================================================
   11. Responsive adjustments
   ============================================================================ */
@media (max-width: 991.98px) {
    .brand-header-inner {
        gap: .5rem;
    }

    .brand-logo {
        width: clamp(190px, 46vw, 275px);
    }

    /* Allow the expanded mobile navigation to span the entire header. */
    .navigation-bar {
        display: contents;
    }

    .navigation-bar .navbar-toggler {
        margin-left: auto;
    }

    .navigation-bar .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
    }

    .navigation-bar .navbar-nav {
        padding: .5rem 0;
    }

    .navigation-bar .nav-link {
        margin-bottom: .2rem;
    }
}

@media (max-width: 600px) {
    .section-space {
        padding: 2.75rem 0;
    }

    .hero-content {
        padding-top: 2.5rem;
        padding-bottom: 1rem;
    }

}

@media (max-width: 450px) {
    .brand-header-inner {
        padding-top: .5rem;
        padding-bottom: .5rem;
    }

    .brand-logo {
        width: clamp(175px, 59vw, 235px);
    }
}
