/*
  The Words tab (/ENK/WordLists/, words.js). On top of enk.css; loaded only on that page.
  The table and banners copy ENK Studio's printed words sheet (EditionHtml.kt: banner-bar,
  table.words.vocab-table), so a change there should be made here too.
*/

:root {
    --ww-g3: #1e6fd9;
    --ww-g4: #2e9e4f;
    --ww-g5: #f28c1b;
    --ww-g6: #d8352a;
    --ww-ink: #101012;
    --ww-kor: #e7e1fb;
    --ww-playing: #ffe680;
    --ww-rainbow: linear-gradient(90deg, #ff4fa3 0%, #ff8a3d 28%, #ffd23f 52%, #33d6c0 76%, #7c6bf2 100%);
    --ww-baloo: "Baloo 2", "Malgun Gothic", sans-serif;
    --ww-poppins: "Poppins", "Malgun Gothic", sans-serif;
}

.ww h2 { margin: 0 0 0.75rem; }
.ww section + section { margin-top: 2rem; }
.ww .pill, .ww-preview .pill { border: 0; font: inherit; font-weight: 700; cursor: pointer; }

/* This week's card and the earlier weeks' tiles. */
.ww-card {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: 1.4rem;
    align-items: center;
    padding: 1rem;
    border-radius: 18px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
}
.ww-card:hover { background: #343945; color: var(--text); }
.ww-card-text { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; min-width: 0; }
.ww-card-date { color: var(--muted); font-size: 0.92rem; }
.ww-card-title { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); font-weight: 800; line-height: 1.15; }
.ww-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ww-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--bg); font-size: 0.85rem; }
.ww-chip b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 0.78rem; }
@media (max-width: 600px) { .ww-card { grid-template-columns: 1fr; } }

.ww-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 14px; }
.ww-tile { display: flex; flex-direction: column; height: 100%; padding: 8px; border-radius: 16px; background: var(--panel); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35); color: var(--text); text-align: center; text-decoration: none; }
.ww-tile:hover { background: #343945; color: var(--text); }
.ww-tile-name { display: block; padding: 8px 2px 2px; font-size: 1rem; font-weight: 700; line-height: 1.25; }
.ww-tile-year { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 400; }

/* The thumbnail: a small drawing of the printed list. */
.ww-thumb { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--paper); color: var(--ink); text-align: left; container-type: inline-size; }
.ww-thumb-top { display: block; height: 3.2cqw; background: var(--rainbow); }
.ww-thumb-head { display: flex; justify-content: space-between; align-items: baseline; padding: 3.5cqw 5cqw 2cqw; }
.ww-thumb-head strong { font-size: 7.4cqw; font-weight: 900; }
.ww-thumb-head span { font-size: 4.4cqw; color: var(--ink-muted); font-weight: 700; }
.ww-thumb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; padding: 0 4cqw; }
.ww-thumb-box { display: block; min-height: 33cqw; padding: 1.6cqw 2.2cqw; border: 0.6cqw solid; border-radius: 2.4cqw; overflow: hidden; }
.ww-thumb-box i { display: block; margin: -1.6cqw -2.2cqw 1.2cqw; padding: 0.6cqw 2.2cqw; color: #fff; font-style: normal; font-size: 4cqw; font-weight: 800; }
.ww-thumb-box p { margin: 0; font-size: 3.5cqw; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ww-thumb-box p span { color: var(--ink-muted); }

/* One week. */
.ww-back { display: inline-block; }
#ww-week h1 { margin: 0.4rem 0 1rem; }
.ww-grades { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.ww-grade { display: inline-flex; align-items: center; min-height: 48px; padding: 0.4rem 1.1rem; border: 2px solid var(--panel-line); border-radius: 999px; background: var(--panel); color: var(--text); font-weight: 700; text-decoration: none; }
.ww-grade::before { content: ""; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; background: var(--gc); }
.ww-grade:hover { color: var(--text); border-color: var(--gc); }
.ww-grade[aria-selected="true"] { border-color: var(--gc); background: var(--gc); }
.ww-grade[aria-selected="true"]::before { background: #fff; }
.ww-lesson { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-bottom: 12px; padding: 0.9rem 1rem; border-top: 6px solid var(--gc); border-radius: 14px; background: var(--panel); }
.ww-lesson-name { font-weight: 800; font-size: 1.15rem; }
.ww-lesson-name small { display: block; color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.ww-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.ww-toggle { min-height: 44px; padding: 0.3rem 0.9rem; border: 0; border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.ww-toggle[aria-pressed="true"] { background: var(--switch-on); }
.ww-actions { display: flex; gap: 10px; }

/* The printed word table, on paper. */
.ww-paper { margin-bottom: 1.2rem; padding: 14px; border: 4px solid var(--ww-ink); border-radius: 16px; background: #fff; color: var(--ww-ink); font-family: var(--ww-poppins); }
.ww-banner { margin-bottom: 6px; padding: 2px 14px; border: 3px solid var(--ww-ink); border-radius: 10px; background: var(--ww-rainbow); text-align: center; }
.ww-pill { border: 3px solid var(--ww-ink); border-radius: 999px; background: var(--ww-rainbow); text-align: center; }
.ww-label { font-family: var(--ww-baloo); font-weight: 800; font-size: 22px; letter-spacing: 0.3px; text-transform: uppercase; color: #fff; -webkit-text-stroke: 2px var(--ww-ink); paint-order: stroke fill; }
.ww-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 18px; }
.ww-table td { padding: 6px 8px; border: 1.5px solid var(--ww-ink); background: #fff; color: var(--ww-ink); font-family: var(--ww-poppins); font-weight: 700; line-height: 1.3; text-align: center; }
.ww-table td.kor { background: var(--ww-kor); }
.ww-table td[data-audio] { cursor: pointer; }
.ww-table td[data-audio]:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.ww-table td.playing { background: var(--ww-playing); }
.ww-table.hide-ko td.kor, .ww-table.hide-en td.eng { color: transparent; }
@media (max-width: 560px) { .ww-table { font-size: 15px; } .ww-table td { padding: 5px 4px; } }

/* Print: the A4 page, shown on screen first. One grade fills it. */
.ww-preview { position: fixed; inset: 0; z-index: 20; overflow: auto; padding: 16px var(--gutter) 24px; background: rgba(10, 11, 14, 0.88); }
.ww-preview-bar { max-width: 640px; margin: 0 auto 12px; display: flex; justify-content: flex-end; gap: 8px; }
.ww-preview .ww-quiet { background: var(--panel); }
.ww-sheet { max-width: 640px; margin: 0 auto; aspect-ratio: 210 / 297; overflow: hidden; border-radius: 2cqw; background: #fff; color: var(--ww-ink); container-type: inline-size; font-family: var(--ww-poppins); }
.ww-sheet-in { height: 100%; display: flex; flex-direction: column; padding: 0 2.4cqw 3cqw; }
.ww-sheet .ww-pill { margin: 3cqw 0 2cqw; padding: 1cqw 3cqw; border-width: 0.4cqw; }
.ww-sheet .ww-pill .ww-label { font-size: 5cqw; -webkit-text-stroke: 0.4cqw var(--ww-ink); }
.ww-block { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ww-sheet .ww-banner { margin-bottom: 1.2cqw; padding: 0.6cqw 2cqw; border-width: 0.38cqw; border-radius: 1.3cqw; }
.ww-sheet .ww-banner .ww-label { font-size: 4cqw; -webkit-text-stroke: 0.35cqw var(--ww-ink); }
.ww-sheet .ww-table { flex: 1; height: 100%; font-size: 3.6cqw; }
.ww-sheet .ww-table tr { height: var(--row-h); }
.ww-sheet .ww-table td { padding: 1cqw; border-width: 0.3cqw; line-height: 1.25; overflow-wrap: normal; word-break: keep-all; }
.ww-sheet .ww-table td span { display: inline-block; }
body.ww-printing { overflow: hidden; }

@page { size: A4; margin: 0; }
@media print {
    body.ww-printing { background: #fff; overflow: visible; }
    body.ww-printing .enk-header, body.ww-printing .enk-footer, body.ww-printing .skip,
    body.ww-printing #ww, body.ww-printing .ww-preview-bar { display: none !important; }
    body.ww-printing main { padding: 0; margin: 0; max-width: none; }
    body.ww-printing .ww-preview { position: static; padding: 0; overflow: visible; background: none; }
    body.ww-printing .ww-sheet { width: 210mm; height: 297mm; max-width: none; margin: 0; aspect-ratio: auto; border-radius: 0; }
    body.ww-printing .ww-sheet, body.ww-printing .ww-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
