/* ============================================================
   Learn English JP — Homepage v3.1
   Hard-coded values used for anything where CSS variable
   contrast is insufficient (#fdfcff bg vs #f8f7ff alt).
   ============================================================ */

.ej-home { background: #fdfcff; color: #1e293b; }

/* ── Section chrome ─────────────────────────────────────── */
.ej-section { padding: 64px 24px; background: #fdfcff; }
.ej-section--alt { background: #f0f1ff; }  /* lavender tint — clearly distinct */
.ej-section__inner { max-width: 1200px; margin: 0 auto; }

.ej-section-label {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
    padding: 6px 14px; border-radius: 100px;
    background: #eef2ff; color: #4f46e5;
    font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.ej-section-title {
    font-size: clamp(24px, 3.5vw, 34px); font-weight: 900; color: #1e293b;
    margin: 0 0 10px; letter-spacing: -0.03em; line-height: 1.2;
}
.ej-section-subtitle { font-size: 15px; color: #475569; margin: 0; max-width: 58ch; line-height: 1.65; }
.ej-section-header { margin-bottom: 36px; }

/* ── Button overrides (critical.css already has .ej-btn) ─── */
.ej-btn--sm { padding: 9px 18px !important; font-size: 13px !important; }

/* ── Hero ───────────────────────────────────────────────── */
.ej-hero {
    background:
        radial-gradient(ellipse 70% 60% at 80% 20%, rgba(79,70,229,.09), transparent),
        radial-gradient(ellipse 50% 50% at 20% 80%, rgba(5,150,105,.07), transparent),
        linear-gradient(180deg, #fff 0%, #f0f1ff 100%);
    border-bottom: 1px solid #e2e8f0; padding: 72px 24px 56px;
}
.ej-hero__inner {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: center;
}
.ej-hero__eyebrow {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
    padding: 7px 15px; border-radius: 100px;
    background: #eef2ff; color: #4f46e5; font-size: 12px; font-weight: 800;
}
.ej-hero__title {
    font-size: clamp(36px, 5vw, 58px); font-weight: 900; line-height: 1.06;
    letter-spacing: -0.04em; color: #1e293b; margin: 0 0 18px;
}
.ej-hero__title em { font-style: normal; color: #4f46e5; }
.ej-hero__subtitle { font-size: 17px; color: #475569; line-height: 1.7; max-width: 44ch; margin: 0 0 10px; }
.ej-hero__jp-subtitle { font-size: 13px; color: #94a3b8; margin: 0 0 24px; }
.ej-hero__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.ej-hero__chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ej-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 100px;
    font-size: 12px; font-weight: 700; color: #475569;
}
.ej-hero__panel {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 20px;
    padding: 28px; box-shadow: 0 4px 24px rgba(79,70,229,.08);
}
.ej-hero__panel-kicker {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
    color: #4f46e5; margin-bottom: 6px;
}
.ej-hero__panel-title { font-size: 18px; font-weight: 900; color: #1e293b; margin: 0 0 16px; line-height: 1.3; }
.ej-hero__panel-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.ej-hero__panel-list li { font-size: 14px; font-weight: 600; color: #475569; padding-left: 20px; position: relative; }
.ej-hero__panel-list li::before { content: '✓'; position: absolute; left: 0; color: #059669; font-weight: 800; }
.ej-hero__panel-divider { border: none; border-top: 1px solid #e2e8f0; margin: 0 0 16px; }
.ej-hero__panel-stats { display: flex; gap: 12px; }
.ej-hero__stat { flex: 1; text-align: center; background: #f8f7ff; border-radius: 12px; padding: 10px 8px; }
.ej-hero__stat-num { display: block; font-size: 18px; font-weight: 900; color: #4f46e5; }
.ej-hero__stat-label { display: block; font-size: 11px; font-weight: 700; color: #94a3b8; margin-top: 2px; }

/* ── Learning paths ─────────────────────────────────────── */
.ej-paths-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 28px; }
.ej-path-card {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 16px;
    transition: all .2s ease; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.ej-path-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(79,70,229,.14); border-color: #4f46e5; }
.ej-path-link { display: flex; flex-direction: column; padding: 20px 18px; text-decoration: none; color: inherit; height: 100%; box-sizing: border-box; }
.ej-path-icon { font-size: 26px; margin-bottom: 10px; }
.ej-path-level-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.ej-path-title { font-size: 14px; font-weight: 900; color: #1e293b; margin: 0; line-height: 1.2; }
.ej-path-level-badge {
    display: inline-block; padding: 2px 8px; border-radius: 100px;
    background: #eef2ff; color: #4f46e5; font-size: 10px; font-weight: 900;
    letter-spacing: .06em; white-space: nowrap; flex-shrink: 0;
}
.ej-path-jp-name { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 8px; }
.ej-path-desc { font-size: 12px; color: #475569; line-height: 1.5; margin: 0 0 12px; flex: 1; }
.ej-path-arrow { font-size: 12px; font-weight: 800; color: #4f46e5; margin-top: auto; }

/* ── Level guide ────────────────────────────────────────── */
.ej-level-guide {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 16px;
    padding: 22px 26px; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.ej-level-guide__title { font-size: 14px; font-weight: 800; color: #1e293b; margin-bottom: 18px; }
.ej-level-guide__rows { display: flex; flex-direction: column; gap: 16px; }
.ej-level-guide__row { display: flex; align-items: flex-start; gap: 14px; }
.ej-level-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 42px; height: 26px; border-radius: 8px;
    font-size: 11px; font-weight: 900; flex-shrink: 0; margin-top: 1px;
}
.ej-level-pill--a1 { background: #dcfce7; color: #15803d; }
.ej-level-pill--a2 { background: #fef9c3; color: #a16207; }
.ej-level-pill--b1 { background: #e0e7ff; color: #4f46e5; }
.ej-level-guide__row strong { display: block; font-size: 13px; color: #1e293b; margin-bottom: 4px; }
.ej-level-guide__hint { display: block; font-size: 12px; color: #475569; line-height: 1.55; margin-bottom: 5px; }
.ej-level-guide__link { font-size: 12px; font-weight: 800; color: #4f46e5; text-decoration: none; }
.ej-level-guide__link:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   FEATURED STRIP — compact 3-card row, lavender bg section
   ════════════════════════════════════════════════════════════ */
.ej-featured-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.ej-fstrip-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(79,70,229,.08), 0 1px 4px rgba(0,0,0,.06);
    transition: all .2s ease;
}
.ej-fstrip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(79,70,229,.16), 0 2px 8px rgba(0,0,0,.08);
    border-color: #4f46e5;
}
.ej-fstrip-card__thumb {
    height: 110px;
    background-size: cover; background-position: center;
    background-color: #eef2ff;
    flex-shrink: 0;
}
.ej-fstrip-card__thumb--empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}
.ej-fstrip-card__body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ej-fstrip-card__cat {
    font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
    color: #4f46e5; background: #eef2ff; padding: 3px 9px; border-radius: 100px;
    text-decoration: none; display: inline-block; width: fit-content;
}
.ej-fstrip-card__cat:hover { background: #4f46e5; color: #fff; }
.ej-fstrip-card__title { font-size: 14px; font-weight: 900; color: #1e293b; margin: 0; line-height: 1.35; }
.ej-fstrip-card__title a { text-decoration: none; color: inherit; }
.ej-fstrip-card__title a:hover { color: #4f46e5; }
.ej-fstrip-card__chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }

/* ════════════════════════════════════════════════════════════
   ACTIVITY CHIPS — used in featured strip AND topic hub
   High-contrast: indigo-tinted pill with visible border.
   ════════════════════════════════════════════════════════════ */
.ej-activity-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 4px 10px; border-radius: 100px;
    background: #f0f1ff;
    border: 1.5px solid #c7d2fe;
    color: #3730a3;
    font-size: 11px; font-weight: 700;
    text-decoration: none; transition: all .14s ease; white-space: nowrap;
}
.ej-activity-chip:hover {
    background: #4f46e5; border-color: #4f46e5; color: #fff;
    transform: translateY(-1px);
}
.ej-activity-chip__icon { font-size: 11px; }
.ej-activity-chip__label { font-size: 11px; }

/* ── Activity type legend ────────────────────────────────── */
.ej-type-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.ej-type-legend__item {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
    border-radius: 100px; background: #fff;
    border: 1.5px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,.04);
    font-size: 12px; font-weight: 700; color: #475569;
}
.ej-type-legend__jp { font-size: 10px; color: #94a3b8; }

/* ════════════════════════════════════════════════════════════
   TOPIC GRID & CARDS
   ════════════════════════════════════════════════════════════ */
.ej-topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.ej-topic-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06), 0 1px 3px rgba(79,70,229,.04);
    transition: all .2s ease; position: relative; overflow: hidden;
}
.ej-topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(79,70,229,.12), 0 0 0 2px #4f46e5;
    border-color: transparent;
}
.ej-topic-card--complete { border-color: transparent; box-shadow: 0 3px 12px rgba(0,0,0,.07), 0 0 0 2px #86efac; }
.ej-topic-card--complete:hover { box-shadow: 0 10px 28px rgba(5,150,105,.12), 0 0 0 2px #059669; }

.ej-topic-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ej-topic-card__cat {
    font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
    color: #4f46e5; background: #eef2ff; padding: 3px 9px; border-radius: 100px;
    text-decoration: none; white-space: nowrap;
}
.ej-topic-card__cat:hover { background: #4f46e5; color: #fff; }
.ej-topic-card__count { font-size: 11px; font-weight: 700; color: #94a3b8; white-space: nowrap; }
.ej-topic-card__title { font-size: 15px; font-weight: 900; color: #1e293b; margin: 0; line-height: 1.35; }
.ej-topic-card__title a { text-decoration: none; color: inherit; }
.ej-topic-card__title a:hover { color: #4f46e5; }

/* ── Topic activity chips ─────────────────────────────────── */
.ej-topic-card__chips { display: flex; flex-wrap: wrap; gap: 5px; }

.ej-topic-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 10px; border-radius: 100px;
    font-size: 11px; font-weight: 700; white-space: nowrap;
    text-decoration: none;
    transition: all .13s ease;
}
.ej-topic-chip--active {
    background: #f0f1ff;
    border: 1.5px solid #c7d2fe;
    color: #3730a3;
    text-decoration: none;
}
.ej-topic-chip--active:hover {
    background: #4f46e5; border-color: #4f46e5; color: #fff;
    transform: translateY(-1px); box-shadow: 0 2px 6px rgba(79,70,229,.3);
}
.ej-topic-chip--inactive {
    background: transparent;
    border: 1.5px dashed #d1d5db;
    color: #cbd5e1;
    cursor: default;
}
.ej-topic-chip__icon  { font-size: 11px; }
.ej-topic-chip__label { font-size: 11px; }

/* ── Article chip ─────────────────────────────────────────── */
.ej-topic-chip--article {
    background: #fff; border: 2px solid #c7d2fe; color: #3730a3;
    text-decoration: none; font-weight: 800;
}
.ej-topic-chip--article:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; transform: translateY(-1px); }
.ej-topic-chip--article.is-read { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.ej-topic-chip--article.is-read:hover { background: #059669; border-color: #059669; color: #fff; }

/* ── Per-topic progress ──────────────────────────────────── */
.ej-topic-card__footer { margin-top: auto; padding-top: 4px; }
.ej-topic-progress { display: flex; align-items: center; gap: 10px; }
.ej-topic-progress__track {
    flex: 1; height: 5px; background: #e2e8f0; border-radius: 100px; overflow: hidden;
}
.ej-topic-progress__fill {
    height: 100%; background: #4f46e5; border-radius: 100px; transition: width .5s ease;
}
.ej-topic-card--complete .ej-topic-progress__fill { background: #059669; }
.ej-topic-progress__label { font-size: 11px; font-weight: 700; color: #94a3b8; white-space: nowrap; }

/* ── Load more ───────────────────────────────────────────── */
.ej-load-more-wrap { text-align: center; margin-top: 36px; }
.ej-load-more-btn {
    padding: 13px 36px; border-radius: 100px; border: 2px solid #e2e8f0;
    border-bottom: 4px solid #cbd5e1; background: #fff;
    font-family: var(--ej-font); font-size: 14px; font-weight: 800; color: #64748b;
    cursor: pointer; transition: all .18s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.ej-load-more-btn:hover { border-color: #4f46e5; color: #4f46e5; background: #eef2ff; }
.ej-load-more-btn:disabled { opacity: .5; cursor: default; }

/* ── CTA ─────────────────────────────────────────────────── */
.ej-cta-section { background: #4f46e5; padding: 64px 24px; }
.ej-cta-inner {
    max-width: 900px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 36px; flex-wrap: wrap;
}
.ej-cta-eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.65); margin-bottom: 8px; }
.ej-cta-title { font-size: clamp(22px, 3vw, 30px); font-weight: 900; color: #fff; margin: 0 0 12px; line-height: 1.2; }
.ej-cta-text { font-size: 15px; color: rgba(255,255,255,.8); margin: 0; line-height: 1.6; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
    .ej-paths-grid { grid-template-columns: repeat(3, 1fr); }
    .ej-topic-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .ej-featured-strip { grid-template-columns: 1fr 1fr; }
    .ej-paths-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .ej-hero__inner { grid-template-columns: 1fr; }
    .ej-hero__panel { display: none; }
    .ej-featured-strip { grid-template-columns: 1fr; }
    .ej-topic-grid  { grid-template-columns: 1fr; }
    .ej-cta-inner   { flex-direction: column; text-align: center; }
    .ej-level-guide__row { flex-direction: column; gap: 8px; }
    .ej-paths-grid  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .ej-hero        { padding: 48px 16px 40px; }
    .ej-section     { padding: 48px 16px; }
}