/* ============================================================================
   English Skills by Topic — a topic library.

   BolEnglish palette throughout: lavender page, white cards, purple/pink brand.
   Each topic keeps its accent colour but wears it lightly — a thin top rule, a
   soft icon tile, the count badge, the progress bar and the hover glow. Nothing
   heavily saturated. CSS transitions only; no animation library.
   ========================================================================== */
body { font-family: 'Inter', system-ui, sans-serif; font-size: 1.0625rem; }
h1, h2, h3, h4, h5 { font-family: 'Inter', system-ui, sans-serif; }

:root {
  --et-grad: linear-gradient(135deg, #7c3aed, #ec4899);
  --et-ease: cubic-bezier(.4, 0, .2, 1);
  --et-stick: 84px;                 /* measured from the real topbar at runtime */
}

/* ============================== TOPIC HERO ============================== */
.et-hero { padding: 26px 0 14px; }
.et-kicker { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .12em;
             text-transform: uppercase; color: var(--purple); background: #f3f0ff;
             border-radius: 999px; padding: 6px 14px; }

/* segmented control — Grades | Topics */
.et-views { position: relative; display: inline-flex; padding: 4px; border-radius: 999px;
            background: #efeafb; margin: 14px 0 16px; }
.et-view { position: relative; z-index: 1; padding: 9px 22px; border-radius: 999px;
           min-height: 42px; display: inline-flex; align-items: center; text-decoration: none;
           font-size: .875rem; font-weight: 700; color: #6b6482;
           transition: color .25s var(--et-ease); }
.et-view:hover { color: var(--purple); }
.et-view.is-on { color: #4c1d95; }
.et-view:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
/* the sliding indicator sits behind the labels */
.et-views::before { content: ""; position: absolute; z-index: 0; top: 4px; bottom: 4px;
                    left: 4px; width: calc(50% - 4px); border-radius: 999px; background: #fff;
                    box-shadow: 0 4px 14px -5px rgba(124, 58, 237, .5);
                    transition: transform .3s var(--et-ease); }
.et-views[data-on="topics"]::before { transform: translateX(100%); }

.et-h1 { font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
         font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 8px; }
.et-h1 .gg { background: var(--et-grad); -webkit-background-clip: text; background-clip: text;
             -webkit-text-fill-color: transparent; }
.et-lead { color: var(--muted); font-size: 1rem; max-width: 60ch; line-height: 1.6; }

/* stat pills */
.et-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.et-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 15px;
           border-radius: 999px; background: var(--card); border: 1px solid var(--line);
           font-size: .8125rem; font-weight: 600; color: var(--muted); }
.et-stat b { font-size: .9375rem; font-weight: 800; color: var(--purple); }
.et-stat.is-ready b { color: #059669; }

/* ========================= CONTINUE LEARNING ============================ */
.et-cont { display: flex; align-items: center; gap: 13px; margin: 18px 0 4px; padding: 13px 16px;
           border-radius: 14px; background: var(--card); border: 1px solid var(--line);
           border-left: 4px solid var(--c); }
.et-contic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid;
             place-items: center; font-size: 1.125rem;
             background: color-mix(in srgb, var(--c) 12%, transparent); }
.et-conttx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.et-conttx b { font-size: .9375rem; font-weight: 700; }
.et-conttx small { font-size: .75rem; color: var(--muted); }
.et-contbtn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 17px;
              border-radius: 10px; min-height: 42px; text-decoration: none; background: var(--et-grad);
              color: #fff; font-size: .8125rem; font-weight: 700;
              transition: filter .18s var(--et-ease), transform .18s var(--et-ease); }
.et-contbtn:hover { filter: brightness(1.07); transform: translateX(2px); }
.et-contbtn:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

/* ========================= SEARCH & FILTERS (sticky) ==================== */
.et-controls { position: sticky; top: var(--et-stick); z-index: 20; padding: 12px 0 10px;
               margin-bottom: 6px;
               background: rgba(250, 249, 255, .82);
               -webkit-backdrop-filter: blur(12px) saturate(1.5);
               backdrop-filter: blur(12px) saturate(1.5);
               border-bottom: 1px solid transparent; transition: border-color .2s var(--et-ease); }
.et-controls.is-stuck { border-bottom-color: var(--line); }

.et-searchwrap { position: relative; max-width: 520px; }
.et-searchico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
                pointer-events: none; color: var(--muted); font-size: .9375rem; }
.et-searchwrap input { width: 100%; padding: 13px 44px 13px 42px; border-radius: 14px;
                       min-height: 50px; border: 1.5px solid var(--line); background: var(--card);
                       color: var(--ink); font-family: inherit; font-size: .9375rem;
                       transition: border-color .2s var(--et-ease), box-shadow .2s var(--et-ease); }
.et-searchwrap input:hover { border-color: #c4b5fd; }
.et-searchwrap input:focus { outline: none; border-color: var(--purple);
                             box-shadow: 0 0 0 4px rgba(124, 58, 237, .15); }
.et-searchwrap input::-webkit-search-cancel-button { display: none; }
.et-clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
            width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 0;
            background: #f1ecfd; color: var(--muted); font-size: 1.125rem; line-height: 1;
            display: grid; place-items: center;
            transition: background .18s var(--et-ease), color .18s var(--et-ease); }
.et-clear:hover { background: #e6ddfb; color: var(--purple); }
.et-clear:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

.et-filters { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.et-fchip { padding: 7px 14px; border-radius: 999px; cursor: pointer; min-height: 38px;
            white-space: nowrap; border: 1.5px solid var(--line); background: var(--card);
            color: var(--ink); font-family: inherit; font-size: .8125rem; font-weight: 600;
            transition: transform .18s var(--et-ease), border-color .18s var(--et-ease); }
.et-fchip:hover { border-color: var(--purple); transform: translateY(-1px); }
.et-fchip:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.et-fchip.is-on { background: var(--et-grad); border-color: transparent; color: #fff;
                  box-shadow: 0 6px 15px -8px rgba(124, 58, 237, .8); }

.et-count { min-height: 1.1em; margin: 12px 0 4px; font-size: .8125rem;
            font-weight: 600; color: var(--muted); }
.et-empty { padding: 46px 0 80px; text-align: center; color: var(--muted); }

/* ============================ POPULAR TOPICS =========================== */
.et-poprow { margin: 10px 0 30px; }
.et-poplbl { font-size: .75rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
             color: var(--muted); margin-bottom: 10px; }
.et-popular { display: flex; gap: 9px; flex-wrap: wrap; }
.et-pop { display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px 9px 9px;
          border-radius: 999px; cursor: pointer; min-height: 46px; font-family: inherit;
          border: 1px solid var(--line); background: var(--card); color: var(--ink);
          transition: transform .2s var(--et-ease), border-color .2s var(--et-ease),
                      box-shadow .2s var(--et-ease); }
.et-pop:hover { transform: translateY(-2px); border-color: var(--c);
                box-shadow: 0 10px 22px -14px var(--c); }
.et-pop:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.et-popic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid;
            place-items: center; font-size: .9375rem;
            background: color-mix(in srgb, var(--c) 13%, transparent); }
.et-popname { font-size: .875rem; font-weight: 700; }
.et-popn { font-size: .75rem; font-weight: 600; color: var(--muted); }

/* ============================== TOPIC GROUPS =========================== */
.et-group { margin-bottom: 40px; }
.et-gh { display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
         font-size: clamp(1.25rem, 2.4vw, 1.5rem); font-weight: 700; letter-spacing: -.01em; }
.et-gn { margin-left: auto; font-size: .75rem; font-weight: 700; color: var(--muted);
         background: var(--card); border: 1px solid var(--line);
         border-radius: 999px; padding: 4px 12px; }

/* 2 columns desktop and tablet · 1 mobile */
.et-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .et-grid { grid-template-columns: minmax(0, 1fr); } }

/* ========================= EXPANDABLE TOPIC CARDS ====================== */
.et-card { border-radius: 16px; background: var(--card); border: 1px solid var(--line);
           border-top: 3px solid var(--c); overflow: hidden; align-self: start;
           box-shadow: 0 1px 2px rgba(16, 12, 40, .04);
           transition: transform .25s var(--et-ease), box-shadow .25s var(--et-ease),
                       border-color .25s var(--et-ease); }
.et-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 40%, var(--line));
                 box-shadow: 0 12px 30px -16px color-mix(in srgb, var(--c) 80%, #000); }
.et-card.is-open { transform: none; }
.et-card.is-hit { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }
.et-card.et-pre { opacity: 0; transform: translateY(12px); }

/* the card itself is the link now */
.et-card { display: flex; flex-direction: column; gap: 9px; padding: 18px;
           text-decoration: none; color: var(--ink); }
.et-card:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }

.et-top { display: flex; align-items: center; gap: 10px; }
.et-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid;
          place-items: center; font-size: 1.0625rem;
          background: color-mix(in srgb, var(--c) 12%, transparent);
          transition: transform .22s var(--et-ease); }
.et-card:hover .et-ico { transform: scale(1.08); }
.et-name { flex: 1; min-width: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
.et-count-badge { flex: none; min-width: 30px; padding: 4px 10px; border-radius: 999px;
                  text-align: center; font-size: .8125rem; font-weight: 800; color: var(--c);
                  background: color-mix(in srgb, var(--c) 13%, transparent); }
.et-desc { font-size: .8125rem; color: var(--muted); line-height: 1.55; }

/* ================================ MOBILE =============================== */
@media (max-width: 700px) {
  .et-hero { padding: 20px 0 10px; }
  .et-views { width: 100%; }
  .et-view { flex: 1; justify-content: center; padding: 9px 12px; }
  .et-stats { gap: 6px; }
  .et-stat { padding: 6px 12px; font-size: .75rem; }
  /* filters scroll sideways rather than stacking into rows */
  .et-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
                scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .et-filters::-webkit-scrollbar { display: none; }
  /* touch targets stay at the 44px minimum on mobile */
  .et-fchip { flex: 0 0 auto; min-height: 44px; padding: 9px 15px; }
  .et-popular { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
                scrollbar-width: none; }
  .et-popular::-webkit-scrollbar { display: none; }
  .et-pop { flex: 0 0 auto; }
  .et-cont { flex-wrap: wrap; }
  .et-contbtn { width: 100%; justify-content: center; }
  .et-card { padding: 16px 15px; }
  .et-group { margin-bottom: 30px; }
}

/* ============================ REDUCED MOTION =========================== */
@media (prefers-reduced-motion: reduce) {
  .et-card, .et-ico, .et-arrow, .et-explore, .et-barfill,
  .et-fchip, .et-pop, .et-clear, .et-searchwrap input, .et-view,
  .et-views::before, .et-contbtn { transition: none !important; }
  .et-card.et-pre { opacity: 1; transform: none; }
  .et-card:hover, .et-pop:hover, .et-contbtn:hover, .et-fchip:hover { transform: none; }
  .et-card:hover .et-ico { transform: none; }
}

/* ================================ PRINT ================================ */
@media print {
  .et-controls, .et-views, .et-poprow, .et-count, .et-cont,
  .topbar, .site-footer { display: none !important; }
  .et-card { break-inside: avoid; opacity: 1 !important; transform: none !important;
             box-shadow: none !important; }
  .et-grid { grid-template-columns: minmax(0, 1fr); }
}
