/* ═══════════════════════════════════════════════════════
   style.css  —  UK Lesson · Green / Dark Theme
   Fonts: Inter (body) + Fira Mono (code words)
   ═══════════════════════════════════════════════════════ */

/* ── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #111416;
    --surface:     #181b1f;
    --surface-2:   #1f2328;
    --surface-3:   #252b32;
    --border:      #2a2f38;
    --border-2:    #333b46;

    --green:       #2ecc71;
    --green-dark:  #27ae60;
    --green-dim:   #1a7a42;
    --amber:       #f0a500;
    --amber-dim:   #b87c00;

    --text-hi:     #f0f2f5;
    --text-mid:    #b8bfc9;
    --text-lo:     #6b7585;

    --england:     #e05c5c;
    --scotland:    #4a9fd4;
    --wales:       #2ecc71;
    --ni:          #9b7fd4;

    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;

    --shadow:      0 2px 12px rgba(0,0,0,0.45);
    --shadow-card: 0 4px 24px rgba(0,0,0,0.55);
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text-hi);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── CONTAINER ────────────────────────────────────────── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* ── HEADER ───────────────────────────────────────────── */
header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.header-text { flex: 1; min-width: 0; }

.header-meta {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 6px;
}

header h1 {
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 700;
    color: var(--text-hi);
    line-height: 1.2;
    margin-bottom: 6px;
}

.header-tags {
    font-size: 0.82rem;
    color: var(--text-lo);
    line-height: 1.5;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-mid);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.back-link:hover {
    background: var(--surface-3);
    color: var(--green);
    border-color: var(--green-dark);
}

/* ── NAV STRIP ────────────────────────────────────────── */
.nav-strip {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-mid);
    padding: 9px 15px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
    user-select: none;
}

.tab-btn:hover {
    background: var(--surface-3);
    color: var(--text-hi);
    border-color: var(--border-2);
}

.tab-btn.active {
    background: var(--green-dark);
    color: #fff;
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green-dark);
}

.tab-btn:active { transform: scale(0.97); }

/* ── SECTIONS ─────────────────────────────────────────── */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── CARD ─────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--green);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 4vw, 36px);
    margin-bottom: 32px;
    box-shadow: var(--shadow-card);
}

.card--england  { border-top-color: var(--england);  }
.card--scotland { border-top-color: var(--scotland); }
.card--wales    { border-top-color: var(--wales);    }
.card--ni       { border-top-color: var(--ni);       }

.card h2 {
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 700;
    color: var(--green);
    margin-bottom: 16px;
    line-height: 1.25;
}

.h2--england  { color: var(--england);  }
.h2--scotland { color: var(--scotland); }
.h2--wales    { color: var(--wales);    }
.h2--ni       { color: var(--ni);       }

/* ── CONTEXT NOTE ─────────────────────────────────────── */
.context-note {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green-dark);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: var(--text-mid);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 8px;
}

.context-note strong { color: var(--text-hi); }

/* ── SUB-HEADINGS ─────────────────────────────────────── */
.sub-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 32px 0 14px;
    padding: 10px 14px;
    background: var(--surface-2);
    border-left: 3px solid var(--amber);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sub-heading span { font-size: 1.1rem; line-height: 1; }

.sub-heading h3 {
    margin: 0;
    color: var(--amber);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── GEO GRID ─────────────────────────────────────────── */
.geo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.geo-fact {
    display: flex;
    gap: 14px;
    background: var(--surface-2);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    align-items: flex-start;
    transition: border-color 0.2s;
}

.geo-fact:hover { border-color: var(--border-2); }

.geo-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.geo-label {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--green);
    margin-bottom: 5px;
    letter-spacing: 0.01em;
}

.geo-value {
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.6;
}

/* ── FACTS GRID ───────────────────────────────────────── */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.fact-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green-dark);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color 0.2s;
}

.fact-card:hover { border-color: var(--green); }

.fact-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
    line-height: 1;
}

.fact-card p {
    margin: 0;
    color: var(--text-mid);
    font-size: 0.9rem;
    line-height: 1.6;
}

.fact-card strong { color: var(--text-hi); }

/* ── VOCAB TABLE ──────────────────────────────────────── */
.vocab-cat {
    color: var(--green);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-top: 28px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 4px;
}

.uk-vocab-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.uk-vocab-table thead { position: sticky; top: 0; }

.uk-vocab-table th {
    background: var(--surface-3);
    color: var(--green);
    text-align: left;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.uk-vocab-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.92rem;
}

.uk-vocab-table tr:last-child td { border-bottom: none; }

.uk-vocab-table tbody tr:hover td {
    background: var(--surface-2);
}

.uk-word {
    font-family: 'Fira Mono', 'Courier New', monospace;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-hi);
    white-space: nowrap;
}

.uk-meaning { color: var(--text-mid); }

.uk-us {
    color: var(--text-lo);
    font-size: 0.85rem;
    font-style: italic;
}

.uk-bg {
    color: var(--text-lo);
    font-size: 0.85rem;
}

/* ── SPEAK BUTTON ─────────────────────────────────────── */
.speak-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
}

.speak-btn:hover {
    background: var(--surface-3);
    border-color: var(--green-dark);
}

/* ── READING CARD ─────────────────────────────────────── */
.reading-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 24px;
    box-shadow: var(--shadow);
}

.reading-header {
    background: var(--surface-3);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--green);
}

.reading-label {
    font-size: 0.72rem;
    color: var(--text-lo);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 700;
    margin-bottom: 4px;
}

.reading-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-hi);
    margin: 0;
    line-height: 1.3;
}

.reading-body { padding: 20px; }

.reading-text {
    font-size: 0.97rem;
    line-height: 1.75;
    color: var(--text-mid);
    margin-bottom: 20px;
}

/* ── QUIZ ─────────────────────────────────────────────── */
.questions-box {
    background: var(--surface);
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.q-label {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.q-item { margin-bottom: 22px; }
.q-item:last-child { margin-bottom: 0; }

.q-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-hi);
    margin-bottom: 10px;
    line-height: 1.5;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hq-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-mid);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.45;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.hq-btn:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--border-2);
    color: var(--text-hi);
}

.hq-btn:disabled { cursor: default; }

.q-feedback {
    min-height: 20px;
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 0 4px;
}

/* ── VIDEO ────────────────────────────────────────────── */
.video-slot { margin-top: 32px; }

.video-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.video-frame iframe {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-md);
    border: none;
    display: block;
}

.video-placeholder {
    width: 100%;
    height: 180px;
    background: var(--surface-2);
    border: 2px dashed var(--border-2);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-lo);
    gap: 8px;
}

.video-placeholder span { font-size: 2rem; }
.video-placeholder p    { margin: 0; font-size: 0.85rem; }

/* ── VIDEO REFLECTION ─────────────────────────────────── */
.video-reflection {
    background: var(--surface-2);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-top: 12px;
}

.vr-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 14px;
}

.vr-question { margin-bottom: 10px; }

.vr-q-text {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 8px;
}

.vr-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-hi);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.vr-input:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.18);
}

.vr-input::placeholder { color: var(--text-lo); }

.vr-save-btn {
    background: var(--green-dark);
    color: #fff;
    border: 1px solid var(--green);
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.vr-save-btn:hover { background: var(--green-dim); }

/* ── SCROLLBAR ────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-lo); }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 680px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .back-link { align-self: flex-start; }

    .nav-strip { gap: 5px; }

    .tab-btn {
        padding: 8px 11px;
        font-size: 0.82rem;
    }

    .geo-grid,
    .facts-grid {
        grid-template-columns: 1fr;
    }

    .video-frame iframe { height: 220px; }

    /* Hide US English column on small screens */
    .col-us { display: none; }
}

@media (max-width: 480px) {
    .col-bg { display: none; }

    .uk-vocab-table { min-width: 0; }
}
