/*
Theme Name: Scarlet Math Tutor
Theme URI: https://scarletmathtutor.com
Author: JWM360
Template: twentytwentyfive
Version: 2.0.6
Description: Scarlet Math Tutor child theme (TT5) with Lexend typography, accessible minimum text sizing, 50px interactive targets, and responsive content width.
Text Domain: scarlet-math-tutor
*/
/* =========================================================
   Self-hosted Lexend
   Only the weights used by the Scarlet design system are
   bundled with the child theme. No Google Fonts request.
   ========================================================= */

@font-face {
    font-family: "Lexend";
    src: url("fonts/Lexend-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Lexend";
    src: url("fonts/Lexend-Medium.ttf") format("truetype");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Lexend";
    src: url("fonts/Lexend-SemiBold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Lexend";
    src: url("fonts/Lexend-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}



/* =========================================================
   Scarlet Base Typography
   Ensures Lexend is applied globally for English interface text
   with accessible line-height and consistent rendering across
   blocks, dashboard panels, and deck content.
   ========================================================= */

html,
body,
body * {
    font-family: var(--wp--preset--font-family--lexend);
}

body,
.wp-site-blocks {
    font-weight: 400;
    line-height: 1.65;
}

/*
 * Lexend is the sole typeface for the Scarlet front end.
 * Apply it explicitly to every element rather than depending on
 * font-family inheritance through WordPress or plugin wrappers.
 */

/* =========================================================
   Main Content Canvas
   Constrain only the main canvas; do not interfere with
   alignfull groups.
   ========================================================= */

.wp-site-blocks > main {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Front page only: let the page canvas and hero reach the viewport edges.
   Content padding inside the hero stays editable in the Site Editor. */
body.home .wp-site-blocks > main {
    padding-inline: 0;
}

body.home .wp-site-blocks > main > .wp-block-post-content {
    width: 100%;
    max-width: none;
}

body.home .wp-block-post-content > .scarlet-hero {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}

/* =========================================================
   Hero
   SVG curve sits bottom-right behind content.
   ========================================================= */

.scarlet-hero {
    position: relative;
    overflow: hidden;
}

.scarlet-hero__curve {
    position: absolute;
    right: -6%;
    bottom: -18%;
    width: min(680px, 55vw);
    height: auto;
    z-index: 0;
    pointer-events: none;
}

.scarlet-hero__content {
    position: relative;
    z-index: 1;
}


/* =========================================================
   Standard Scarlet Card
   ========================================================= */

.scarlet-card {
    border: 1px solid rgba(20, 20, 20, .9);
    border-radius: 16px;
    padding: 1.75rem;
    background: var(--wp--preset--color--paper);
}

/* =========================================================
   CTA
   ========================================================= */

.scarlet-cta .wp-block-button__link {
    font-size: 1.4rem;
    padding: .9rem 1.2rem;
    border-radius: 999px;
}

/* =========================================================
   Full-Width Background Bands
   ========================================================= */

.wp-block-group.alignfull.has-background {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* =========================================================
   Header
   Full available width, with padding controlled by the header block.
   ========================================================= */

.scarlet-header-inner {
    width: 100%;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    align-items: center;
}

@media (max-width: 782px) {
    .scarlet-header-inner {
        max-width: 100%;
    }
}

/* =========================================================
   JWM Universal Resource Card Grid v1.0
   3 desktop / 2 tablet / 1 mobile
   ========================================================= */

.jwm-resource-grid {
    --jwm-card-border: #c8d8ee;
    --jwm-card-heading: #162a54;
    --jwm-card-text: #222222;
    --jwm-card-link: #162a54;
    --jwm-card-divider: #d8dee8;
    --jwm-card-bg: #ffffff;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
    align-items: stretch;
    margin-block: 2rem;
}

@media (max-width: 980px) {
    .jwm-resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .jwm-resource-grid {
        grid-template-columns: 1fr;
    }
}

/* Resource Card Shell */

.jwm-resource-card {
    display: flex;
    flex-direction: column;
    min-height: 22rem;
    height: 100%;
    box-sizing: border-box;
    padding: 1.1rem 1.15rem 1.2rem;
    border: 1px solid var(--jwm-card-border);
    border-radius: 14px;
    background: var(--jwm-card-bg);
    overflow: hidden;
}

/* Remove TT5 default vertical gaps inside resource cards */

.jwm-resource-card > * {
    margin-block-start: 0;
    margin-block-end: 0;
}

/* Resource Card Icon */

.jwm-resource-card .wp-block-image {
    display: flex;
    justify-content: center;
    margin: 0 0 0.45rem;
}

.jwm-resource-card .wp-block-image img {
    width: 4.5rem;
    max-width: 4.5rem;
    height: auto;
}

/* Resource Card Heading */

.jwm-resource-card h3 {
    margin: 0 0 0.75rem;
    color: var(--jwm-card-heading);
    font-size: clamp(1.2rem, 1.35vw, 1.5rem);
    line-height: 1.15;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .jwm-resource-card h3 {
        white-space: normal;
    }
}

/* Optional Resource Card Paragraph Text */

.jwm-resource-card p {
    margin: 0 0 0.85rem;
    color: var(--jwm-card-text);
    font-size: 1.2rem;
    line-height: 1.4;
    text-align: center;
}

/* Resource Link Stack */

.jwm-resource-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: auto;
}

/* Flat Resource Link Rows */

.jwm-resource-link,
.jwm-resource-card .wp-block-button__link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.78rem 0.35rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--jwm-card-link);
    box-shadow: none;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
}

/* Dividers Between Resource Link Rows */

.jwm-resource-link + .jwm-resource-link,
.jwm-resource-card .wp-block-button + .wp-block-button {
    border-top: 1px solid var(--jwm-card-divider);
}

/* Optional Emphasized Middle Row */

.jwm-resource-link.is-middle-row,
.jwm-resource-card .wp-block-button.is-middle-row {
    border-top: 1px solid var(--jwm-card-divider);
    border-bottom: 1px solid var(--jwm-card-divider);
}

/* Resource Help / CTA Card */

.jwm-resource-card.is-help-card h3 {
    margin-bottom: 0.5rem;
}

.jwm-resource-card.is-help-card p {
    margin-bottom: 0.85rem;
}

/* =========================================================
   Scarlet Support Form
   Fluent Forms accessibility and typography.
   ========================================================= */

/* Entered Text */

.fluent_form_3 .ff-el-form-control {
    font-size: 1.2rem;
    color: #101828 !important;
}

/* Field Labels */

.fluent_form_3 .ff-el-input--label label {
    font-size: 1.2rem;
    color: #101828 !important;
}

/* Placeholder Text */

.fluent_form_3 .ff-el-form-control::placeholder {
    font-size: 1.2rem;
    color: #475467 !important;
    opacity: 1;
}

/* Dropdown Text */

.fluent_form_3 select.ff-el-form-control {
    font-size: 1.2rem;
    color: #101828 !important;
}

/* Checkbox / Privacy Text */

.fluent_form_3 .ff-el-group .ff-el-form-check-label {
    font-size: 1.2rem;
    color: #101828 !important;
}

/* Privacy Policy Link */

.fluent_form_3 .ff-el-form-check-label a {
    color: #004f73 !important;
}

/* Submit Button */

.fluent_form_3 .ff-btn-submit {
    font-size: 1.3rem;
    color: #ffffff !important;
    background-color: #1B3165 !important;
    border: 2px solid #1B3165 !important;
    min-height: 48px;
    padding: 12px 24px;
    font-weight: 600;
}

/* Submit Button Hover and Keyboard Focus */

.fluent_form_3 .ff-btn-submit:hover,
.fluent_form_3 .ff-btn-submit:focus {
    color: #ffffff !important;
    background-color: #A41318 !important;
    border-color: #A41318 !important;
}

/* =========================================================
   Scarlet Accessibility Baseline
   ========================================================= */

/* Absolute learner/site text floor: never render below 1.2rem. */

body,
button,
input,
select,
textarea,
.wp-site-blocks {
    font-size: max(1.2rem, 1em);
}

/* 50x50 minimum interactive target for primary WordPress controls. */

a.wp-block-button__link,
.wp-element-button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.wp-block-navigation-item__content {
    min-width: 50px;
    min-height: 50px;
    box-sizing: border-box;
}

/* Navigation links remain comfortably tappable without fixed dimensions. */

.wp-block-navigation-item__content {
    display: inline-flex;
    align-items: center;
    padding-block: 0.5rem;
}

/* =========================================================
   Scarlet Math Field Cards
   Card styling only; column layout belongs to the
   WordPress Group/Grid block configured in the editor.
   ========================================================= */

.scarlet-math-field-card {
    width: 100%;
    min-height: 180px;
    margin: 0;
    padding: 1.5rem;
    box-sizing: border-box;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.scarlet-math-field-card h2 {
    margin: 0;
    line-height: 1.25;
    text-align: center;
}
/* Outer hero: solid navy only */
.scarlet-hero {
    background: #061426;
    color: #FFFFFF;
    box-sizing: border-box;
    padding: clamp(32px, 4vw, 64px);
}

/* Two-column layout */
.scarlet-hero .wp-block-columns {
    align-items: center;
    gap: clamp(24px, 3vw, 48px);
}

/* Right column: SVG only */
.scarlet-hero .scarlet-hero-art {
    min-height: 520px;
    background-image: url("assets/scarlet-hero-art-corrected.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Editable WordPress text */
.scarlet-hero h1,
.scarlet-hero p {
    color: #FFFFFF;
}

/* Keep the math accent */
.scarlet-hero h1 span {
    color: #26B2D9;
}

/* Native WordPress Button colors and borders remain controlled by TT5. */
.scarlet-hero .wp-block-button__link {
    min-height: 54px;
    font-weight: 600;
}

.scarlet-hero .wp-block-button__link:focus-visible {
    outline: 3px solid #FFFFFF;
    outline-offset: 4px;
}

/* Smaller screens */
@media (max-width: 781px) {
    .scarlet-hero .wp-block-columns {
        flex-direction: column;
    }

    .scarlet-hero .scarlet-hero-art {
        width: 100%;
        min-height: 320px;
        background-size: contain;
    }
}
