/* ==========================================================================
   Saving Alex — Landing Page
   Classic Material Design theme on top of MDC Web
   Primary: teal/blue · Accent: amber
   ========================================================================== */

:root {
    --sa-primary: #00695c;
    /* teal 800 */
    --sa-primary-dark: #004d40;
    /* teal 900 */
    --sa-primary-light: #4db6ac;
    /* teal 300 */
    --sa-accent: #ffb300;
    /* amber 600 */
    --sa-accent-dark: #ff8f00;
    /* amber 800 */
    --sa-text: rgba(0, 0, 0, 0.87);
    --sa-text-secondary: rgba(0, 0, 0, 0.6);
    --sa-bg-alt: #eceff1;
    /* blue-grey 50 */
    --sa-content-width: 1160px;
}

/* --- MDC theme overrides ------------------------------------------------- */

.mdc-button--raised.mdc-button--secondary {
    --mdc-protected-button-container-color: var(--sa-accent-dark);
    --mdc-protected-button-label-text-color: rgba(0, 0, 0, 0.87);
}

/* --- Base ---------------------------------------------------------------- */

/* Even out the MDC type scale (default jumps are too large) */
.mdc-typography--headline1 {
    font-size: 2.5rem;
}

.mdc-typography--headline2 {
    font-size: 2.1rem;
    line-height: 1.2;
}

.mdc-typography--headline3 {
    font-size: 1.75rem;
    line-height: 1.25;
}

.mdc-typography--headline4 {
    font-size: 1.5rem;
}

.mdc-typography--headline5 {
    font-size: 1.25rem;
}

.mdc-typography--headline6 {
    font-size: 1.125rem;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

/* Open Sans for body/reading text (Roboto stays for headings & components) */
.body-font {
    font-family: "Open Sans", "Roboto", sans-serif;
}

.body-font .mdc-typography--body1,
.body-font .mdc-typography--body2,
.body-font .mdc-typography--subtitle1,
.body-font .mdc-typography--caption,
.body-font .faq__answer,
.body-font .stepper__step p,
.body-font .outcome-card p,
.body-font .overview-card__text p,
.body-font .resource-card p {
    font-family: "Open Sans", "Roboto", sans-serif;
}

/* App bar tabs use the text font at body size */
.app-bar__links,
.app-bar__links a {
    font-family: "Open Sans", "Roboto", sans-serif;
}

body {
    margin: 0;
    color: var(--sa-text);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--sa-primary);
}

/* --- App bar -------------------------------------------------------------- */

.app-bar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 64px;
    background: var(--sa-primary);
    color: #fff;
    z-index: 20;
}

.app-bar__row {
    max-width: var(--sa-content-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
}

.app-bar__menu {
    color: #fff;
}

.app-bar__title {
    font-size: 1.25rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    margin-right: auto;
    white-space: nowrap;
}

.app-bar__logo {
    height: 36px;
    width: 36px;
    border-radius: 50%;
    margin-right: 8px;
    display: none;
}

@media (min-width: 720px) {
    .app-bar__logo {
        display: block;
    }
}

.app-bar__links {
    display: none;
    gap: 4px;
}

.app-bar__links a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    padding: 10px 12px;
    border-radius: 4px;
}

.app-bar__links a:hover,
.app-bar__links a:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.app-bar__links a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.24);
}

@media (min-width: 900px) {
    .app-bar__menu {
        display: none;
    }

    .app-bar__links {
        display: flex;
    }
}

/* --- Drawer (mobile) ------------------------------------------------------ */

.drawer {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    background: #fff;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 30;
}

.drawer__content {
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

.drawer__content a {
    color: var(--sa-text);
    text-decoration: none;
    font-weight: 500;
    padding: 14px 24px;
}

.drawer__content a:hover,
.drawer__content a:focus-visible {
    background: var(--sa-bg-alt);
}

.drawer__content a[aria-current="page"] {
    color: var(--sa-primary);
    background: #e0f2f1;
}

.drawer__title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--sa-primary) !important;
    margin-bottom: 8px;
}

/* --- Layout ---------------------------------------------------------------- */

main {
    padding-top: 64px;
}

.section {
    max-width: var(--sa-content-width);
    margin: 0 auto;
    padding: 56px 24px;
}

.section--alt {
    max-width: none;
    background: var(--sa-bg-alt);
}

.section--alt>* {
    max-width: var(--sa-content-width);
    margin-left: auto !important;
    margin-right: auto !important;
}

.section--alt>.section__title,
.section--alt>.section__lead {
    margin-left: auto !important;
    margin-right: auto !important;
}

.section__title {
    margin: 0 0 8px;
    color: var(--sa-primary-dark);
}

.section__lead {
    margin: 0 0 32px;
    color: var(--sa-text-secondary);
}

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

.hero {
    display: grid;
    gap: 32px;
    max-width: var(--sa-content-width);
    margin: 0 auto;
    padding: 48px 24px 56px;
    grid-template-columns: 1fr;
    align-items: center;
    background: linear-gradient(180deg, #e0f2f1 0%, #ffffff 100%);
}

.hero__text h1 {
    margin: 0 0 24px;
    color: var(--sa-primary-dark);
}

.hero__network-logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin-bottom: 16px;
}

.hero__subtitle {
    display: block;
    font-size: 0.65em;
    font-weight: 400;
    color: var(--sa-text-secondary);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
}

.hero__media {
    margin: 0;
    justify-self: center;
    text-align: center;
}

.hero__media figcaption {
    margin-top: 8px;
    color: var(--sa-text-secondary);
}

@media (min-width: 900px) {
    .hero {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* --- Animated images (static frame, animate on click) ----------------------- */

.anim-image {
    position: relative;
    display: block;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.anim-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.anim-image__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.26);
    color: #fff;
    transition: opacity 0.2s ease;
}

.anim-image__overlay .material-icons {
    font-size: 56px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.anim-image__hint {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.anim-image:hover .anim-image__overlay,
.anim-image:focus-visible .anim-image__overlay {
    background: rgba(0, 0, 0, 0.36);
}

.anim-image[aria-pressed="true"] .anim-image__overlay {
    display: none;
    /* animation running — hide affordance */
}

.anim-image:focus-visible {
    outline: 3px solid var(--sa-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .anim-image__hint::after {
        content: "";
    }
}

/* --- Card grids --------------------------------------------------------------- */

.card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .card-grid--outcomes {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-grid--overview,
    .card-grid--resources {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .card-grid--outcomes {
        grid-template-columns: repeat(3, 1fr);
    }

    .card-grid--overview,
    .card-grid--resources {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Outcome cards ------------------------------------------------------------- */

.outcome-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.outcome-card:hover {
    box-shadow: var(--mdc-elevation-box-shadow-for-raised, 0 8px 24px rgba(0, 0, 0, 0.2));
}

.outcome-card p {
    margin: 0;
}

.outcome-card__icon {
    font-size: 36px;
    color: var(--sa-primary);
    background: #e0f2f1;
    border-radius: 50%;
    padding: 10px;
}

/* --- Learning outcomes (text + media) ------------------------------------ */

.outcomes {
    display: grid;
    gap: 32px;
    align-items: start;
    grid-template-columns: 1fr;
}

.outcomes__text .section__lead {
    margin-bottom: 24px;
}

.outcomes__media {
    margin: 0;
    align-self: center;
}

@media (min-width: 900px) {
    .outcomes {
        grid-template-columns: 1.8fr 1fr;
    }
}

/* --- How to play (stepper with side-by-side steps) -------------------------- */

.how-to-play__cta {
    max-width: var(--sa-content-width);
    margin: 0 auto 24px;
}

.stepper--with-images {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
    max-width: var(--sa-content-width);
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    .stepper--with-images {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 32px;
    }
}

.stepper--with-images .stepper__step {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.stepper--with-images .stepper__step p {
    margin: 0;
    min-height: 3.5em;
    font-size: 0.9375rem;
}

.stepper__image {
    width: 100%;
    height: auto;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.stepper__placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--sa-text-secondary);
    border-radius: 8px;
    color: var(--sa-text-secondary);
    font-weight: 500;
    text-align: center;
    padding: 8px;
    box-sizing: border-box;
}

.stepper__step--placeholder .stepper__number {
    background: var(--sa-text-secondary);
}

.stepper__number {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sa-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

/* --- Overview cards --------------------------------------------------------------- */

.overview-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.overview-card__media {
    margin: 0;
}

.overview-card__media img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.overview-card__text {
    padding: 16px 20px 20px;
}

.overview-card__text h3 {
    margin: 0 0 8px;
    color: var(--sa-primary-dark);
}

.overview-card__text p {
    margin: 0;
}

/* --- FAQ accordion ------------------------------------------------------------------- */

.faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 820px;
}

.faq__item {
    overflow: hidden;
}

.faq__question {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    font-weight: 500;
    font-size: 1rem;
    color: var(--sa-text);
}

.faq__question:hover {
    background: var(--sa-bg-alt);
}

.faq__question:focus-visible {
    outline: 3px solid var(--sa-accent);
    outline-offset: -3px;
}

.faq__question-text {
    flex: 1;
}

.faq__chevron {
    color: var(--sa-text-secondary);
    transition: transform 0.2s ease;
}

.faq__question[aria-expanded="true"] .faq__chevron {
    transform: rotate(180deg);
}

.faq__answer {
    padding: 4px 20px 20px;
    color: var(--sa-text-secondary);
}

.faq__answer p {
    margin: 0 0 12px;
}

.faq__answer ul {
    margin: 0 0 12px;
    padding-left: 20px;
}

.faq__answer li {
    margin-bottom: 8px;
}

/* --- Acknowledgments -------------------------------------------------------------------- */

.logos__heading {
    margin: 32px 0 16px;
    color: var(--sa-text);
}

.ack-network-logo {
    display: block;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin: 24px 0 8px;
}

.logo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 40px;
    align-items: center;
}

.logo-row a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    border-radius: 4px;
}

.logo-row__img {
    height: 80px;
    width: auto;
    max-width: 240px;
    filter: grayscale(100%);
    opacity: 0.85;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.logo-row__img--wide {
    max-width: 320px;
}

.logo-row a:hover .logo-row__img,
.logo-row a:focus-visible .logo-row__img {
    filter: grayscale(0%);
    opacity: 1;
}

/* --- Teacher resources --------------------------------------------------------------------- */

.resource-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
}

.resource-card h2 {
    margin: 0;
    color: var(--sa-primary-dark);
}

.resource-card p {
    margin: 0 0 8px;
    flex-grow: 1;
}

.resource-card__link {
    align-self: flex-start;
}

.resource-card__icon {
    font-size: 32px;
    color: var(--sa-primary);
}

.resources-note {
    margin-top: 32px;
    color: var(--sa-text-secondary);
}

/* --- Footer ------------------------------------------------------------------------------------ */

.footer {
    background: var(--sa-primary-dark);
    color: rgba(255, 255, 255, 0.87);
    text-align: center;
    padding: 24px 16px;
}

.footer p {
    margin: 4px 0;
}