/* SLBJA Financial Literacy — frontend styles
   All colors / fonts use CSS custom properties so the active theme
   (or a child theme) can override the defaults without editing this file. */

:root {
    --slbja-color-primary:    #402977;   /* SLB brand purple */
    --slbja-color-primary-dk: #2e1d56;
    --slbja-color-heading:    #05173D;
    --slbja-color-text:       #333333;
    --slbja-color-muted:      #6b7280;
    --slbja-color-surface:    #F3F1F9;
    --slbja-color-border:     #e1e4e8;
    --slbja-color-card-bg:    #ffffff;
    --slbja-font-body:        "Roboto", "Source Sans Pro", "Segoe UI", Arial, sans-serif;
    --slbja-font-heading:     "Roboto Slab", Georgia, "Times New Roman", serif;
    --slbja-radius:           6px;
}

/* Container width matches the Outreach plugin so both pages line up.
   Override --slbja-fl-container in your child theme to change. */
:root { --slbja-fl-container: 1280px; }

.slbja-fl-page {
    max-width: var(--slbja-fl-container);
    margin: 0 auto;
    padding: 1.5rem 20px;
    color: var(--slbja-color-text);
}
.slbja-fl-page h1,
.slbja-fl-page h2,
.slbja-fl-page h3 {
    color: var(--slbja-color-heading);
    line-height: 1.25;
}
.slbja-fl-page h1 {
    font-size: 2.2rem;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--slbja-color-primary);
    display: inline-block;
}
.slbja-fl-page h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

/* ---------- Section tabs -------------------------------------------- */
.slbja-fl-tabs {
    margin: 1.5rem 0 2rem;
}
.slbja-fl-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid var(--slbja-color-border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.slbja-fl-tabs-nav .slbja-fl-tab {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0.85rem 1.25rem !important;
    font-family: var(--slbja-font-heading) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--slbja-color-muted) !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    outline: 0 !important;
    transition: color 0.15s, border-color 0.15s;
    position: relative;
    top: 2px;  /* sit on the nav border */
}
.slbja-fl-tabs-nav .slbja-fl-tab:hover,
.slbja-fl-tabs-nav .slbja-fl-tab:focus-visible {
    color: var(--slbja-color-heading) !important;
    border-bottom-color: var(--slbja-color-border) !important;
}
.slbja-fl-tabs-nav .slbja-fl-tab.is-active {
    color: var(--slbja-color-primary) !important;
    border-bottom-color: var(--slbja-color-primary) !important;
}
.slbja-fl-tabs-nav .slbja-fl-tab::before,
.slbja-fl-tabs-nav .slbja-fl-tab::after { content: none !important; display: none !important; }

.slbja-fl-tab-panel { animation: slbja-fl-fade 0.2s ease-out; }
.slbja-fl-tab-panel[hidden] { display: none; }
@keyframes slbja-fl-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0);   }
}

@media (max-width: 540px) {
    .slbja-fl-tabs-nav .slbja-fl-tab { padding: 0.75rem 0.95rem !important; font-size: 0.95rem !important; }
}

/* ---------- Page banner --------------------------------------------- */
.slbja-fl-banner {
    position: relative;
    width: 100%;
    margin: 0 0 2rem;
    border-radius: var(--slbja-radius);
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.slbja-fl-banner-small  { min-height: 240px; }
.slbja-fl-banner-medium { min-height: 380px; }
.slbja-fl-banner-large  { min-height: 520px; }

.slbja-fl-banner-inner {
    max-width: 760px;
    padding: 2rem 1.5rem;
}
.slbja-fl-banner-heading {
    font-family: var(--slbja-font-heading) !important;
    color: #fff !important;
    font-size: 2.6rem !important;
    line-height: 1.15 !important;
    margin: 0 0 0.5rem !important;
    border: 0 !important;
    padding: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.slbja-fl-banner-heading::before,
.slbja-fl-banner-heading::after { content: none !important; display: none !important; }
.slbja-fl-banner-subheading {
    font-size: 1.15rem;
    margin: 0 0 1.25rem;
    color: rgba(255, 255, 255, 0.92);
}
.slbja-fl-banner-cta {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    background: var(--slbja-color-primary);
    color: #fff !important;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.15s, transform 0.15s;
}
.slbja-fl-banner-cta:hover,
.slbja-fl-banner-cta:focus {
    background: var(--slbja-color-primary-dk);
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

@media (max-width: 720px) {
    .slbja-fl-banner-small  { min-height: 200px; }
    .slbja-fl-banner-medium { min-height: 280px; }
    .slbja-fl-banner-large  { min-height: 360px; }
    .slbja-fl-banner-heading { font-size: 1.75rem !important; }
    .slbja-fl-banner-subheading { font-size: 1rem; }
}

/* Scope so we don't leak into theme defaults */
.slbja-fl-lead,
.slbja-fl-grid,
.slbja-fl-card,
.slbja-fl-glossary,
.slbja-fl-video-embed,
.slbja-fl-media,
.slbja-fl-video {
    color: var(--slbja-color-text);
}

.slbja-fl-lead {
    font-size: 1.05rem;
    color: var(--slbja-color-muted);
    margin: 0 0 1.25rem;
}

.slbja-fl-grid { display: grid; gap: 1.25rem; margin-bottom: 1.5rem; }
.slbja-fl-cols-2 { grid-template-columns: repeat(2, 1fr); }
.slbja-fl-cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
    .slbja-fl-cols-2, .slbja-fl-cols-3 { grid-template-columns: 1fr; }
}

.slbja-fl-card {
    background: var(--slbja-color-card-bg);
    border: 1px solid var(--slbja-color-border);
    border-top: 3px solid var(--slbja-color-primary);
    border-radius: var(--slbja-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.slbja-fl-card-image {
    background: var(--slbja-color-surface);
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.slbja-fl-card-image .slbja-fl-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.slbja-fl-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.slbja-fl-card-title {
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
    color: var(--slbja-color-heading);
    line-height: 1.25;
}
.slbja-fl-card-body { flex: 1; }
.slbja-fl-card-body p:last-child { margin-bottom: 0; }
.slbja-fl-card-more {
    align-self: flex-start;
    margin-top: 1rem;
    background: none;
    border: 0;
    padding: 0;
    color: var(--slbja-color-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
}
.slbja-fl-card-more:hover { color: var(--slbja-color-primary-dk); text-decoration: underline; }

/* PDF action button on a card. Shows alongside (or instead of) Read More. */
.slbja-fl-card-pdf {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-right: 0.75rem;
    padding: 0.55rem 1rem;
    background: var(--slbja-color-primary);
    color: #fff !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: background 0.15s;
}
.slbja-fl-card-pdf:hover,
.slbja-fl-card-pdf:focus {
    background: var(--slbja-color-primary-dk);
    color: #fff !important;
    text-decoration: none !important;
}
.slbja-fl-card-pdf-icon {
    background: #fff;
    color: var(--slbja-color-primary);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
}
/* When both buttons exist, sit them side by side and reset card-more's margin so they align. */
.slbja-fl-card-has-pdf .slbja-fl-card-more { margin-top: 1.1rem; }

/* Books section — DearFlip flipbook cards */
.slbja-fl-card-book .slbja-fl-card-image { aspect-ratio: 3 / 4; }
.slbja-fl-card-flipbook { margin-top: 1rem; }
/* Style the link DearFlip's [dflip type=link] shortcode renders so it
   matches our other CTA buttons (purple pill, white text, arrow). */
.slbja-fl-card-flipbook a,
.slbja-fl-card-flipbook .df-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem !important;
    background: var(--slbja-color-primary) !important;
    color: #fff !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(64, 41, 119, 0.18);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    border: 0 !important;
}
.slbja-fl-card-flipbook a:hover,
.slbja-fl-card-flipbook .df-link:hover,
.slbja-fl-card-flipbook a:focus,
.slbja-fl-card-flipbook .df-link:focus {
    background: var(--slbja-color-primary-dk) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(64, 41, 119, 0.28);
    text-decoration: none !important;
}
.slbja-fl-card-flipbook-warning {
    margin: 1rem 0 0;
    padding: 0.6rem 0.85rem;
    background: #fff7e6;
    border-left: 3px solid #d97706;
    color: #7c4a03;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
}

/* ---------- Image gallery (standalone, no titles) -------------------- */
.slbja-fl-gallery { margin-bottom: 2rem; }
.slbja-fl-gallery-item {
    margin: 0;
    background: var(--slbja-color-card-bg);
    border: 1px solid var(--slbja-color-border);
    border-radius: var(--slbja-radius);
    overflow: hidden;
}
.slbja-fl-gallery-item .slbja-fl-card-image {
    background: var(--slbja-color-surface);
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.slbja-fl-gallery-caption {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--slbja-color-text);
    line-height: 1.45;
}

/* Read More modal — locked-down styling so themes can't bleed in */
.slbja-fl-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.slbja-fl-modal[hidden] { display: none; }
.slbja-fl-modal .slbja-fl-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 23, 61, 0.55);
    backdrop-filter: blur(2px);
    border: 0;
    cursor: pointer;
}
.slbja-fl-modal .slbja-fl-modal-window {
    position: relative;
    background: #fff;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(5, 23, 61, 0.35);
    color: var(--slbja-color-text);
    font-family: var(--slbja-font-body);
}

/* Close button — !important to defeat theme button :hover / :focus shadows */
.slbja-fl-modal .slbja-fl-modal-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--slbja-color-heading) !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    z-index: 2;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s, color 0.15s, transform 0.15s !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.slbja-fl-modal .slbja-fl-modal-close::before,
.slbja-fl-modal .slbja-fl-modal-close::after { content: none !important; display: none !important; }
.slbja-fl-modal .slbja-fl-modal-close:hover,
.slbja-fl-modal .slbja-fl-modal-close:focus,
.slbja-fl-modal .slbja-fl-modal-close:active {
    background: var(--slbja-color-primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(64, 41, 119, 0.35) !important;
    transform: none !important;
    outline: 0 !important;
}

.slbja-fl-modal .slbja-fl-modal-content { padding: 0; }
.slbja-fl-modal .slbja-fl-modal-img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    margin: 0;
}

/* Padded text container — controls all spacing for title + body. */
.slbja-fl-modal .slbja-fl-modal-text {
    padding: 1.75rem 2rem 2rem;
}

/* Title — neutralise theme h2 margins / pseudo-element accents. */
.slbja-fl-modal .slbja-fl-modal-title {
    font-family: var(--slbja-font-heading) !important;
    color: var(--slbja-color-heading) !important;
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
    margin: 0 0 1rem !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-align: left !important;
}
.slbja-fl-modal .slbja-fl-modal-title::before,
.slbja-fl-modal .slbja-fl-modal-title::after { content: none !important; display: none !important; }

.slbja-fl-modal .slbja-fl-modal-body {
    line-height: 1.65;
    color: var(--slbja-color-text);
    font-size: 1rem;
}
.slbja-fl-modal .slbja-fl-modal-body p { margin: 0 0 1rem; }
.slbja-fl-modal .slbja-fl-modal-body p:first-child { margin-top: 0; }
.slbja-fl-modal .slbja-fl-modal-body p:last-child { margin-bottom: 0; }
.slbja-fl-modal .slbja-fl-modal-body ul,
.slbja-fl-modal .slbja-fl-modal-body ol { margin: 0 0 1rem 1.5rem; padding: 0; }
.slbja-fl-modal .slbja-fl-modal-body li { margin-bottom: 0.4rem; }
.slbja-fl-modal .slbja-fl-modal-body a { color: var(--slbja-color-primary); }
.slbja-fl-modal .slbja-fl-modal-body a:hover { color: var(--slbja-color-primary-dk); }

@media (max-width: 720px) {
    .slbja-fl-modal .slbja-fl-modal-text { padding: 1.25rem 1.25rem 1.5rem; }
    .slbja-fl-modal .slbja-fl-modal-title { font-size: 1.35rem !important; }
    .slbja-fl-modal .slbja-fl-modal-img { max-height: 220px; }
}

/* Lock body scroll while a modal is open */
body.slbja-fl-modal-open { overflow: hidden; }
.slbja-fl-mt { margin-top: 1rem !important; }

.slbja-fl-media,
.slbja-fl-video {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 1rem;
    border: 1px dashed #c9d1d9;
    background: var(--slbja-color-surface);
    color: var(--slbja-color-muted);
    text-align: center;
    border-radius: 4px;
    font-size: 0.9rem;
}
.slbja-fl-video { min-height: 240px; }
.slbja-fl-media-img { display: block; width: 100%; height: auto; border-radius: 4px; }

.slbja-fl-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    background: #000;
}
.slbja-fl-video-embed iframe,
.slbja-fl-video-embed object,
.slbja-fl-video-embed embed,
.slbja-fl-video-embed video {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* Glossary */
.slbja-fl-glossary {
    border: 1px solid var(--slbja-color-border);
    border-radius: var(--slbja-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--slbja-color-card-bg);
}
.slbja-fl-glossary-item { border-bottom: 1px solid var(--slbja-color-border); }
.slbja-fl-glossary-item:last-child { border-bottom: none; }
.slbja-fl-glossary-term {
    padding: 0.85rem 1rem;
    background: var(--slbja-color-surface);
    cursor: pointer;
    font-weight: 600;
    color: var(--slbja-color-heading);
    font-family: var(--slbja-font-heading);
    display: flex;
    justify-content: space-between;
    user-select: none;
    transition: background 0.15s;
}
.slbja-fl-glossary-term:hover { background: #e6e2f0; }
.slbja-fl-glossary-term::after {
    content: "+";
    font-size: 1.2rem;
    line-height: 1;
    color: var(--slbja-color-primary);
    font-weight: 700;
}
.slbja-fl-glossary-item.is-open .slbja-fl-glossary-term { background: var(--slbja-color-primary); color: #fff; }
.slbja-fl-glossary-item.is-open .slbja-fl-glossary-term::after { content: "\2212"; color: #fff; }
.slbja-fl-glossary-def {
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s, padding 0.2s;
    color: var(--slbja-color-text);
}
.slbja-fl-glossary-item.is-open .slbja-fl-glossary-def {
    padding: 0.9rem 1rem;
    max-height: 400px;
    border-top: 1px solid var(--slbja-color-border);
}
