/* Updates.lk - Term Test Papers
   Tokens come from the One UI theme; nothing here invents a new colour. */

.ttp-hub {
  --gap: 18px;
}

/* ---------- hero ---------- */
.th-hero {
  position: relative;
  padding: 40px 0 26px;
  overflow: hidden;
  background:
    radial-gradient(900px 380px at 82% -18%, var(--gold-soft, rgba(255, 196, 0, .14)), transparent 70%),
    linear-gradient(180deg, var(--bg2, #0a0a0b), var(--bg, #000));
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, .09));
}

.th-hero .crumbs { margin-bottom: 22px; }

.th-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold, #ffc400);
}

.th-kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold, #ffc400);
}

.th-hero h1 {
  margin: 0;
  font-size: clamp(28px, 5.4vw, 52px);
  line-height: 1.06;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--tx, #fff);
  max-width: 18ch;
}

.th-hero h1 em {
  font-style: normal;
  color: var(--gold, #ffc400);
}

.th-lead {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.6;
  color: var(--tx2, rgba(255, 255, 255, .7));
}

.th-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 20px 0 0;
  color: var(--tx3, rgba(255, 255, 255, .46));
  font-size: 13px;
}

.th-stats b {
  color: var(--tx, #fff);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.th-search { margin-top: 24px; max-width: 560px; }

.th-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  background: var(--card, #121214);
  min-height: 52px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.th-search-box:focus-within {
  border-color: var(--gold, #ffc400);
  box-shadow: 0 0 0 3px var(--gold-soft, rgba(255, 196, 0, .14));
}

.th-search-box svg {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--tx3, rgba(255, 255, 255, .46));
}

.th-search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--tx, #fff);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.th-search-box input::placeholder { color: var(--tx3, rgba(255, 255, 255, .46)); }

.th-search-box button {
  border: 0;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 20px;
  background: var(--gold, #ffc400);
  color: var(--gold-ink, #1a1200);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.th-search-box button:hover { background: var(--gold2, #ffd54a); }
.th-search-box button:active { transform: scale(.98); }

/* ---------- filters ---------- */
.th-filters { padding-top: 22px; }

.th-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.th-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  background: var(--card, #121214);
  color: var(--tx2, rgba(255, 255, 255, .7));
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.th-pill:hover {
  border-color: rgba(255, 196, 0, .5);
  color: var(--tx, #fff);
}

.th-pill.is-on {
  background: var(--gold, #ffc400);
  border-color: var(--gold, #ffc400);
  color: var(--gold-ink, #1a1200);
}

.th-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.th-selects label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tx3, rgba(255, 255, 255, .46));
  font-weight: 700;
}

.th-selects select {
  min-height: 44px;
  min-width: 160px;
  padding: 0 34px 0 14px;
  border-radius: var(--r-sm, 14px);
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  background: var(--card, #121214)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>")
    no-repeat right 12px center / 16px;
  color: var(--tx, #fff);
  font: inherit;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  appearance: none;
  cursor: pointer;
}

.th-selects select:focus-visible {
  outline: 2px solid var(--gold, #ffc400);
  outline-offset: 2px;
}

.th-go {
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r-sm, 14px);
  border: 0;
  background: var(--gold, #ffc400);
  color: var(--gold-ink, #1a1200);
  font-weight: 700;
  cursor: pointer;
}

/* ---------- results ---------- */
.th-results { padding: 24px 0 56px; }

.th-count {
  margin: 0 0 16px;
  color: var(--tx3, rgba(255, 255, 255, .46));
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.th-count a { color: var(--gold, #ffc400); }

.th-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.tc {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md, 20px);
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  background: var(--card, #121214);
  overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.tc:hover,
.tc:focus-within {
  transform: translateY(-3px);
  border-color: rgba(255, 196, 0, .45);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .9);
}

.tc-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.tc-hit:focus-visible {
  outline: 2px solid var(--gold, #ffc400);
  outline-offset: -2px;
}

.tc-shot {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 260px;
  background: var(--card2, #1b1b1e);
  overflow: hidden;
}

.tc-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .4s ease;
}

.tc:hover .tc-shot img { transform: scale(1.03); }

.tc-shot::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .55));
  pointer-events: none;
}

.tc-shot.is-plain {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--card2, #1b1b1e), #0d0d0f);
}

.tc-glyph {
  font-size: 54px;
  font-weight: 800;
  color: rgba(255, 196, 0, .35);
}

.tc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  border: 1px solid rgba(255, 196, 0, .5);
  color: var(--gold, #ffc400);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tc-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 15px 15px;
}

.tc-body h3 {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--tx, #fff);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tc-meta {
  margin: 0;
  font-size: 12px;
  color: var(--tx3, rgba(255, 255, 255, .46));
}

.tc-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold, #ffc400);
}

.tc-cta svg { width: 15px; height: 15px; }

.th-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.th-pages a,
.th-pages span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  color: var(--tx2, rgba(255, 255, 255, .7));
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.th-pages a:hover { border-color: var(--gold, #ffc400); color: var(--tx, #fff); }

.th-pages .current {
  background: var(--gold, #ffc400);
  border-color: var(--gold, #ffc400);
  color: var(--gold-ink, #1a1200);
  font-weight: 700;
}

.th-empty {
  padding: 48px 22px;
  border-radius: var(--r-md, 20px);
  border: 1px dashed var(--line, rgba(255, 255, 255, .18));
  background: var(--card, #121214);
  text-align: center;
}

.th-empty h3 { margin: 0 0 8px; font-size: 20px; color: var(--tx, #fff); }
.th-empty p { margin: 0 0 18px; color: var(--tx2, rgba(255, 255, 255, .7)); }

/* ---------- single paper ---------- */
.ttp {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 22px 0 8px;
}

.ttp-hero {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 22px;
  border-radius: var(--r-lg, 26px);
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  background:
    radial-gradient(600px 260px at 92% -20%, var(--gold-soft, rgba(255, 196, 0, .14)), transparent 70%),
    var(--card, #121214);
}

.ttp-shot {
  margin: 0;
  border-radius: var(--r-sm, 14px);
  overflow: hidden;
  border: 1px solid var(--line, rgba(255, 255, 255, .12));
  background: var(--bg, #000);
  box-shadow: 0 22px 44px -26px rgba(0, 0, 0, .95);
}

.ttp-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top center;
}

.ttp-shot figcaption {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--tx3, rgba(255, 255, 255, .46));
  border-top: 1px solid var(--line, rgba(255, 255, 255, .09));
}

.ttp-fact { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.ttp-kicker {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold, #ffc400);
}

.ttp-fact h2 {
  margin: 0;
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.16;
  letter-spacing: -.015em;
  color: var(--tx, #fff);
}

.ttp-lede {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--tx2, rgba(255, 255, 255, .7));
  max-width: 66ch;
}

.ttp-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.ttp-chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, .12));
  background: var(--card2, #1b1b1e);
  color: var(--tx2, rgba(255, 255, 255, .7));
  font-size: 12px;
  font-weight: 600;
}

.ttp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: fit-content;
  min-height: 52px;
  margin-top: 4px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--gold, #ffc400);
  color: var(--gold-ink, #1a1200) !important;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none !important;
  transition: background .18s ease, transform .18s ease;
}

.ttp-btn:hover { background: var(--gold2, #ffd54a); }
.ttp-btn:active { transform: scale(.985); }

.ttp-btn small {
  font-size: 11.5px;
  font-weight: 600;
  opacity: .72;
  white-space: nowrap;
}

.ttp-dls {
  padding: 18px;
  border-radius: var(--r-md, 20px);
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  background: var(--card, #121214);
}

.ttp-dls h3,
.ttp-note strong {
  display: block;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx3, rgba(255, 255, 255, .46));
}

.ttp-dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "med go" "meta go";
  gap: 2px 14px;
  align-items: center;
  padding: 13px 16px;
  margin-top: 8px;
  border-radius: var(--r-sm, 14px);
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  background: var(--card2, #1b1b1e);
  text-decoration: none !important;
  transition: border-color .18s ease, background .18s ease;
}

.ttp-dl:hover {
  border-color: rgba(255, 196, 0, .5);
  background: #202024;
}

.ttp-dl-med {
  grid-area: med;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--tx, #fff);
}

.ttp-i { width: 17px; height: 17px; color: var(--gold, #ffc400); flex: none; }

.ttp-dl-meta {
  grid-area: meta;
  font-size: 12px;
  color: var(--tx3, rgba(255, 255, 255, .46));
  font-variant-numeric: tabular-nums;
}

.ttp-dl-go {
  grid-area: go;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--gold-soft, rgba(255, 196, 0, .14));
  color: var(--gold, #ffc400);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.ttp-note {
  padding: 16px 18px;
  border-radius: var(--r-md, 20px);
  border: 1px solid var(--line, rgba(255, 255, 255, .09));
  border-left: 3px solid var(--gold, #ffc400);
  background: var(--card2, #1b1b1e);
}

.ttp-note strong { margin-bottom: 6px; }
.ttp-note p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--tx2, rgba(255, 255, 255, .7));
}

.ttp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ttp-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, .14));
  color: var(--tx2, rgba(255, 255, 255, .7));
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color .18s ease, color .18s ease;
}

.ttp-links a:hover { border-color: var(--gold, #ffc400); color: var(--tx, #fff); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .th-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ttp-hero { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 640px) {
  .th-hero { padding: 28px 0 20px; }
  .th-grid { grid-template-columns: 1fr; gap: 14px; }
  .tc { flex-direction: row; }
  .tc-shot { width: 38%; max-height: none; aspect-ratio: 4 / 5; flex: none; }
  .tc-body { padding: 13px 14px; }
  .tc-body h3 { font-size: 14px; -webkit-line-clamp: 4; }
  .th-selects label { flex: 1 1 46%; }
  .th-selects select { min-width: 0; width: 100%; }
  .ttp-hero { grid-template-columns: 1fr; padding: 16px; }
  .ttp-shot { max-width: 260px; }
  .ttp-btn { width: 100%; }
  .ttp-dls { padding: 14px; }
  .ttp-dl { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (prefers-reduced-motion: reduce) {
  .tc, .tc-shot img, .ttp-btn, .th-search-box, .th-pill { transition: none; }
  .tc:hover { transform: none; }
  .tc:hover .tc-shot img { transform: none; }
}
