/* ──────────────────────────────────────────────────────────────
   Adaptive Practice / Study Techniques picker.
   Target visual: 4 technique cards in a row, each with an icon
   in a soft-tinted circle, a title, a short description, and a
   call-to-action. Uses Khio's rust/cream palette (NOT blue/purple
   like the reference mock), the 4 card tones are pulled from the
   same earth-tone family the subject palette uses elsewhere so
   nothing clashes with the accent color.
   ────────────────────────────────────────────────────────────── */
.adaptive-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 4px 32px;
}
/* Desktop: scale up to match Sets/Review/Khio LM (1700 max-width) +
   serif title in the brand display font, matching the "Khio Study" /
   "Review & Learn" / "My Notebooks" hero typography. James:
   "make it bigger so it fits the screen like this, and the study
   techniques should be the proper font" + "I want them to be elongated
   to fit the room and the banner on the bottom make it a bit bigger.
   Then folloiwng the theme make the text bigger". */
@media (min-width: 761px) {
    .adaptive-shell { max-width: 1700px; padding: 16px 32px 56px; }
    .adaptive-head { margin-bottom: 36px; }
    .adaptive-title {
        font-family: 'Ramillas', 'Playfair Display', Georgia, serif;
        font-size: clamp(40px, 4.4vw, 56px);
        font-weight: 600;
        letter-spacing: -0.025em;
    }
    .adaptive-subtitle { font-size: 17px; }
    .adaptive-grid { gap: 24px; }
    /* Elongated cards, TALLER, more breathing room. min-height bumped
       to 380 so cards read as portrait-oriented like the reference. */
    .adaptive-card { padding: 36px 28px 32px; min-height: 380px; gap: 4px; }
    .adaptive-card-icon {
        width: 64px !important; height: 64px !important;
        border-radius: 18px !important;
        margin-bottom: 22px !important;
    }
    .adaptive-card-icon i { width: 28px !important; height: 28px !important; }
    .adaptive-card-title { font-size: 24px !important; margin: 0 0 12px !important; }
    .adaptive-card-desc { font-size: 16px !important; line-height: 1.55 !important; margin: 0 0 28px !important; }
    .adaptive-card-cta {
        font-size: 14px !important;
        padding: 10px 18px !important;
        border-radius: 14px !important;
    }
    .adaptive-card-cta i { width: 16px !important; height: 16px !important; }

    /* Bigger Science-backed banner */
    .adaptive-banner { padding: 26px 32px; margin-top: 32px; gap: 22px; border-radius: 20px; }
    .adaptive-banner-icon { width: 68px !important; height: 68px !important; }
    .adaptive-banner-icon i { width: 28px !important; height: 28px !important; }
    .adaptive-banner-title { font-size: 18px !important; margin: 0 0 4px !important; }
    .adaptive-banner-desc { font-size: 15px !important; line-height: 1.5 !important; }
}

.adaptive-head {
    margin-bottom: 24px;
}
.adaptive-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--study-text);
    margin: 0 0 8px;
    line-height: 1.15;
}
.adaptive-subtitle {
    font-size: 14px;
    color: var(--study-text-secondary);
    line-height: 1.5;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.adaptive-subtitle-emph {
    color: var(--study-accent);
    font-weight: 600;
}
.adaptive-card-count {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--study-text-secondary);
    background: var(--study-bg-secondary);
    border: 1px solid var(--study-border);
    border-radius: 999px;
    white-space: nowrap;
}

.adaptive-rule {
    height: 1px;
    background: var(--study-border);
    opacity: 0.5;
    margin: 18px 0 22px;
}

/* ── Technique card grid ── */
.adaptive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    align-items: stretch;
}
@media (max-width: 1100px) { .adaptive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .adaptive-grid { grid-template-columns: 1fr; } }

.adaptive-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px 20px 20px;
    border-radius: 18px;
    background: var(--study-bg-secondary, #fff);
    border: 1px solid var(--study-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}
.adaptive-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--study-accent) 40%, var(--study-border));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Decorative halftone in the bottom-right corner, matches the reference's
   dotted fade without introducing a new image asset. */
.adaptive-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 110px;
    height: 110px;
    background-image: radial-gradient(
        circle,
        color-mix(in srgb, currentColor 18%, transparent) 2px,
        transparent 2.5px
    );
    background-size: 10px 10px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}
.adaptive-card > * { position: relative; z-index: 1; }

.adaptive-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.adaptive-card-icon i { width: 22px; height: 22px; }

.adaptive-card-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--study-text);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}
.adaptive-card-desc {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--study-text-secondary);
    margin: 0 0 22px;
    flex: 1;
}

.adaptive-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--study-border);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    align-self: flex-start;
}
.adaptive-card-cta i { width: 14px; height: 14px; }
.adaptive-card-cta:hover {
    transform: translateX(2px);
    background: color-mix(in srgb, var(--tone-bg, transparent) 60%, var(--bg-card, #fff));
    border-color: color-mix(in srgb, var(--tone-fg, var(--study-border)) 35%, var(--study-border));
}

/* ── Per-technique color tokens ──
   Each card gets a different hue from Khio's earth-tone subject palette.
   --tone-bg is used on both the icon circle and (via currentColor) the
   halftone dots. --tone-fg colors the icon and CTA text. */
.adaptive-card--recall    { --tone-fg: #C1724E; --tone-bg: rgba(193, 114, 78, 0.14); color: #C1724E; }
.adaptive-card--explain   { --tone-fg: #588157; --tone-bg: rgba(88, 129, 87, 0.14);  color: #588157; }
.adaptive-card--ask       { --tone-fg: #BC6C25; --tone-bg: rgba(188, 108, 37, 0.14); color: #BC6C25; }
.adaptive-card--mix       { --tone-fg: #3D5A80; --tone-bg: rgba(61, 90, 128, 0.14);  color: #3D5A80; }

.adaptive-card-icon { background: var(--tone-bg); color: var(--tone-fg); }
.adaptive-card-cta  { color: var(--tone-fg); }

/* ── Science-backed banner ── */
.adaptive-banner {
    margin-top: 26px;
    padding: 18px 22px;
    border-radius: 16px;
    background: var(--study-bg-secondary, #fff);
    border: 1px solid var(--study-border);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.adaptive-banner-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #fff);
    border: 1px solid color-mix(in srgb, var(--study-accent) 18%, var(--study-border));
    color: var(--study-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.adaptive-banner-icon i { width: 22px; height: 22px; }
.adaptive-banner-body { flex: 1; min-width: 0; }
.adaptive-banner-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--study-text);
    margin: 0 0 2px;
}
.adaptive-banner-desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--study-text-secondary);
    margin: 0;
}
.adaptive-banner-chart {
    display: flex;
    align-items: center;
    gap: 10px;
    color: color-mix(in srgb, var(--study-accent) 65%, var(--study-text-tertiary));
    flex-shrink: 0;
    opacity: 0.85;
}
.adaptive-banner-chart svg { display: block; }
@media (max-width: 620px) { .adaptive-banner-chart { display: none; } }

/* ── Skip button (Active Recall) ──
   Has its own class because `.learn-submit-btn` is themed with
   `color: var(--bg-base) !important` for the primary action, using
   that class for Skip makes the text white-on-white. This styles
   Skip as a clean ghost button instead. */
.learn-skip-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 22px;
    border-radius: 12px;
    border: 1px solid var(--study-border);
    background: transparent;
    color: var(--study-text-secondary);
    font-weight: 700;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.learn-skip-btn:hover {
    background: var(--study-bg-secondary);
    color: var(--study-text);
    border-color: color-mix(in srgb, var(--study-text) 25%, var(--study-border));
}

/* ── Practice card, desktop sizing ──
   The default `.learn-question-text` (in study.css) caps at 680px and
   `.learn-typed-wrap` at 620px, which look tiny inside the 1700px
   adaptive shell on a wide laptop. Bump them up on desktop so the
   card actually uses the screen, with a heftier font and roomier
   padding. Mobile sizing untouched, James asked us to keep mobile
   alone earlier and this preserves the same scoping. */
@media (min-width: 761px) {
    .adaptive-shell .learn-question-text {
        max-width: 1100px;
        font-size: clamp(26px, 2.4vw, 34px);
        padding: 48px 44px 52px;
        border-radius: 24px;
    }
    .adaptive-shell .learn-typed-wrap {
        max-width: 1000px;
    }
    .adaptive-shell .learn-typed-input {
        font-size: 19px;
        padding: 22px 26px;
        border-radius: 16px;
    }
    .adaptive-shell .learn-typed-input[rows],
    .adaptive-shell textarea.learn-typed-input {
        font-size: 17px;
    }
    .adaptive-shell .learn-submit-row {
        gap: 14px;
    }
    .adaptive-shell .learn-submit-btn {
        padding: 12px 22px !important;
        font-size: 15px !important;
        border-radius: 14px !important;
    }
    .adaptive-shell .learn-status-bar {
        margin-bottom: 32px;
    }
    .adaptive-shell .learn-status-pill {
        padding: 6px 14px !important;
        font-size: 12px !important;
    }
}
@media (min-width: 1280px) {
    .adaptive-shell .learn-question-text { max-width: 1300px; }
    .adaptive-shell .learn-typed-wrap { max-width: 1200px; }
}

/* ── Module picker grid ──
   Mobile: single column (vertical list). Desktop: 2 or 3 columns so
   the picker actually uses the screen width instead of leaving giant
   empty margins. Sizing scoped under the desktop @media so mobile
   stays the original tall single-column layout James asked for. */
.learn-module-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@media (min-width: 761px) {
    .learn-module-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .learn-module-row {
        padding: 22px 26px !important;
        border-radius: 18px !important;
        gap: 20px !important;
    }
    .learn-module-row > div:first-child {
        width: 56px !important;
        height: 56px !important;
        font-size: 20px !important;
    }
}
@media (min-width: 1280px) {
    .learn-module-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── No-cards empty state (fallback) ── */
.adaptive-empty {
    max-width: 420px;
    margin: 64px auto 0;
    text-align: center;
    padding: 28px 24px;
    border-radius: 16px;
    background: var(--study-bg-secondary);
    border: 1px solid var(--study-border);
}
.adaptive-empty h3 { font-size: 18px; font-weight: 800; margin: 0 0 8px; color: var(--study-text); }
.adaptive-empty p  { font-size: 13px; color: var(--study-text-secondary); line-height: 1.5; margin: 0; }
