/* Anek Malayalam (SIL Open Font License), self-hosted and trimmed to wght 400–800, wdth 75–100. */
@font-face {
  font-family: "Anek Malayalam";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("fonts/anek-malayalam-malayalam.woff2") format("woff2");
  unicode-range: U+0307, U+0323, U+0951-0952, U+0964-0965, U+0D00-0D7F, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC, U+A830-A832;
}
@font-face {
  font-family: "Anek Malayalam";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("fonts/anek-malayalam-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Anek Malayalam";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("fonts/anek-malayalam-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Newsprint, ink and one red spot colour, like a Malayalam newspaper's market-rate box. */
:root {
  --paper: #eeeee8;
  --paper-2: #e3e3db;
  --ink: #151515;
  --ink-2: #45453f;
  --ink-3: #62625b;
  --rule: #c6c6bc;
  --rule-strong: #151515;
  --red: #c4122f;
  --band: #151515;
  --band-ink: #eeeee8;
  --band-ink-2: #b4b4aa;
  --focus: #151515;

  --font: "Anek Malayalam", "Noto Sans Malayalam", system-ui, sans-serif;
  --wrap: 60rem;
  --pw: 4.9rem;            /* price column width */
  --toolbar-h: 7rem;       /* measured in JS */
  --ease: cubic-bezier(.16, 1, .3, 1);

  color-scheme: light;
  accent-color: var(--red);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141413;
    --paper-2: #1d1d1b;
    --ink: #ebebe4;
    --ink-2: #bdbdb4;
    --ink-3: #9a9a91;
    --rule: #33332f;
    --rule-strong: #ebebe4;
    --red: #ff5f6d;
    --band: #ebebe4;
    --band-ink: #141413;
    --band-ink-2: #55554f;
    --focus: #ebebe4;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  font-synthesis: none;
}
::selection { background: var(--red); color: var(--paper); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---- Masthead ---------------------------------------------------------- */
.masthead { padding-top: 14px; }
.mast-row {
  display: flex; padding-top: 0; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding-bottom: 8px;
  border-bottom: 4px solid var(--rule-strong);
  box-shadow: 0 3px 0 -2px var(--paper), 0 5px 0 -2px var(--red);  /* newspaper double rule, second rule in the spot colour */
}
.wordmark { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; line-height: 1; }
.wm-ml { font-size: 3.4rem; font-weight: 800; font-stretch: 75%; letter-spacing: -0.01em; }
.wm-en { font-size: 1rem; font-weight: 600; color: var(--ink-3); }
.lang {
  flex: none; min-height: 40px; padding: 6px 12px;
  background: none; border: 1.5px solid var(--ink); border-radius: 0;
  font-size: .9rem; font-weight: 600; cursor: pointer;
}
.lang:hover { background: var(--ink); color: var(--paper); }
.dateline {
  margin: 0; padding: 9px 0 10px;
  font-size: .86rem; color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
}
.dateline b { color: var(--ink); font-weight: 700; }
.dateline .sep { color: var(--rule); margin: 0 .35em; }

/* ---- Toolbar: search and section tabs (sticky) ----------------------------- */
.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  padding-top: 12px;
  border-bottom: 1px solid var(--rule);
}
.search { position: relative; display: block; }
.search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: var(--ink-2); pointer-events: none; }
#q {
  width: 100%; height: 50px; padding: 0 14px 0 44px;
  font: inherit; font-size: 1.05rem; font-weight: 500;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 0;
  caret-color: var(--red);
  -webkit-appearance: none; appearance: none;
}
#q::placeholder { color: var(--ink-3); opacity: 1; }
#q:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ink); background: var(--paper-2); }
#q::-webkit-search-cancel-button { -webkit-appearance: none; height: 18px; width: 18px; cursor: pointer;
  background: var(--ink-2); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.3 5.7 12 12l6.3 6.3-1.4 1.4L10.6 13.4 4.3 19.7l-1.4-1.4L9.2 12 2.9 5.7l1.4-1.4 6.3 6.3 6.3-6.3z'/%3E%3C/svg%3E") center/contain no-repeat; }

/* One row of tabs. When it overflows it scrolls, fading at the edge that has more. */
.tabs { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; margin-top: 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.overflowing {
  padding-right: 28px;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
/* Mouse users get a thin scrollbar in the page's colours to reach the last tabs. */
@media (hover: hover) and (pointer: fine) {
  .tabs.overflowing { scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; padding-bottom: 2px; }
  .tabs.overflowing::-webkit-scrollbar { display: block; height: 4px; }
  .tabs.overflowing::-webkit-scrollbar-thumb { background: var(--ink-3); }
}
.tabs button {
  flex: none; min-height: 42px; padding: 8px 7px 6px;
  background: none; border: 0; border-bottom: 3px solid transparent; appearance: none;
  font-size: .95rem; font-weight: 600; color: var(--ink-3); cursor: pointer;
  white-space: nowrap;
}
.tabs button small { font-size: .7rem; font-weight: 500; margin-left: 3px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--red); }
.tabs button.zero { color: var(--ink-3); font-weight: 500; cursor: default; }
.tabs button.zero small { opacity: .8; }


/* ---- Filter controls --------------------------------------------------------- */
.filters summary { display: none; }
.controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 0 4px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.controls select {
  min-width: 0; height: 42px; padding: 0 30px 0 10px;
  font: inherit; font-size: .92rem; font-weight: 500; color: var(--ink);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2362625b'%3E%3Cpath d='M7.4 8.6 12 13.2l4.6-4.6L18 10l-6 6-6-6z'/%3E%3C/svg%3E") right 6px center / 20px no-repeat;
  border: 1px solid var(--ink-3); border-radius: 0;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.controls select:hover { border-color: var(--ink); }
@media (prefers-color-scheme: dark) {
  .controls select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23bdbdb4'%3E%3Cpath d='M7.4 8.6 12 13.2l4.6-4.6L18 10l-6 6-6-6z'/%3E%3C/svg%3E"); }
}
@media (max-width: 640px) {
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 4px; }
  .filters { border-bottom: 1px solid var(--rule); }
  .filters summary {
    display: flex; align-items: center; gap: 8px; min-height: 46px; cursor: pointer; list-style: none;
    font-size: .92rem; font-weight: 700;
  }
  .filters summary::-webkit-details-marker { display: none; }
  .filters summary svg { width: 20px; height: 20px; margin-left: auto; fill: var(--ink-2); transition: transform .18s var(--ease); }
  .filters[open] summary svg { transform: rotate(180deg); }
  .filters[open] .controls { padding-bottom: 14px; }
  .active-count:not(:empty) { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center;
    background: var(--red); color: var(--paper); font-size: .78rem; font-weight: 700; }
  .dateline .d-count, .dateline .d-count + .sep { display: none; }
  .dateline { font-size: .82rem; }
}

.count { margin: 12px 0 10px; font-size: .88rem; color: var(--ink-2); min-height: 1.3em; }
.count b { color: var(--ink); }

/* ---- Rate tables ------------------------------------------------------------ */
.sheet { margin-bottom: 26px; }
.sheet-head {
  position: sticky; top: var(--toolbar-h); z-index: 5;
  display: grid; grid-template-columns: 1fr repeat(var(--cols), var(--pw)); align-items: stretch;
  background: var(--band); color: var(--band-ink);
}
.band {
  margin: 0; padding: 9px 12px 7px; min-width: 0;
  display: flex; align-items: baseline; gap: 8px;
  font-size: 1.12rem; font-weight: 800; font-stretch: 75%; line-height: 1.1;
}
.band small { font-size: .78rem; font-weight: 600; font-stretch: 100%; color: var(--band-ink-2); }
.col {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px;
  padding: 6px 10px 5px 4px; min-height: 44px;
  background: none; border: 0; border-bottom: 3px solid transparent; appearance: none;
  color: inherit; cursor: pointer; text-align: right;
  font-size: .8rem; font-weight: 700; font-stretch: 87.5%; line-height: 1.1;
}
.col + .col { border-left: 1px solid color-mix(in srgb, var(--band-ink) 22%, transparent); }
.col span { display: inline-flex; align-items: center; gap: 3px; }
.col small { font-size: .68rem; font-weight: 500; color: var(--band-ink-2); }
.col svg { width: 9px; height: 9px; fill: currentColor; opacity: 0; }
.col:hover svg { opacity: .45; }
.col[aria-sort="ascending"], .col[aria-sort="descending"] { border-bottom-color: var(--red); }
.col[aria-sort="ascending"] svg, .col[aria-sort="descending"] svg { opacity: 1; }
.col[aria-sort="descending"] svg { transform: rotate(180deg); }
.col:focus-visible { outline-color: var(--band-ink); outline-offset: -3px; }

.row {
  display: grid; grid-template-columns: 1fr repeat(var(--cols), var(--pw));
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.row:hover { background: var(--paper-2); }
.row .name { padding: 7px 0 7px 12px; min-width: 0; }
.row .line { display: flex; align-items: baseline; }
.leader { flex: 1; min-width: 12px; margin: 0 6px 0 10px; border-bottom: 2px dotted var(--rule); transform: translateY(-4px); }
.unit { white-space: nowrap; }
.row .name button {
  all: unset; display: inline; cursor: pointer;
  font-size: 1rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}
.row .name button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.row .name svg { width: 14px; height: 14px; fill: var(--ink-3); vertical-align: -2px; margin-left: 3px; transition: transform .18s var(--ease); }
.row.open .name svg { transform: rotate(180deg); }
.meta { display: block; margin-top: 0; font-size: .8rem; line-height: 1.35; color: var(--ink-3); }
.meta .other { color: var(--ink-2); }
.price { padding: 7px 10px 7px 4px; border-left: 1px solid var(--rule); align-self: stretch; text-align: right; font-size: 1rem; font-weight: 520; white-space: nowrap; }
.price.none { color: var(--ink-3); font-weight: 400; }
.price.hit { font-weight: 720; }

.row.open { background: var(--paper-2); border-bottom-color: transparent; }
.fine {
  background: var(--paper-2);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 10px 18px -16px rgb(0 0 0 / .5);
  padding: 2px 12px 12px;
  overflow-x: auto;
  animation: reveal .18s var(--ease);
}
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
.fine-stack { display: none; }
.fine-size h3 { margin: 10px 0 4px; font-size: .86rem; font-weight: 700; }
.fine-size dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.fine-size dl div { padding: 5px 0 6px; border-bottom: 1px solid var(--rule); }
.fine-size dt { font-size: .72rem; font-weight: 600; color: var(--ink-3); }
.fine-size dd { margin: 0; font-size: .9rem; }
.fine table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.fine th, .fine td { padding: 6px 8px; text-align: right; white-space: nowrap; }
.fine th:first-child, .fine td:first-child { text-align: left; padding-left: 0; }
.fine th { font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--ink); font-size: .76rem; }
.fine td { border-bottom: 1px solid var(--rule); }
.fine p { margin: 8px 0 0; font-size: .8rem; color: var(--ink-3); }

/* Phones: the brand name takes its own line; prices sit under the column heads. */
@media (max-width: 560px) {
  :root { --pw: 4.35rem; }
  .row { grid-template-columns: 1fr repeat(var(--cols), var(--pw)); grid-template-rows: auto auto; }
  .row .name { grid-column: 1 / -1; padding: 10px 10px 0; }
  .row .meta-cell { grid-column: 1; grid-row: 2; padding: 2px 10px 10px; align-self: start; }
  .row .meta-cell .meta { margin: 0; }
  .row .name .meta { display: none; }
  .price { grid-row: 2; padding: 2px 8px 10px 2px; align-self: auto; }
  .leader { display: none; }
  .fine-table { display: none; }
  .fine-stack { display: block; }
  .fine { overflow-x: visible; }
  .band { padding-left: 10px; font-size: 1.02rem; }
  .col { padding-right: 8px; }
  .wm-ml { font-size: 2.2rem; }
}
@media (min-width: 561px) { .row .meta-cell { display: none; } }

/* ---- States ------------------------------------------------------------------ */
.skeleton .sk-band { height: 44px; background: var(--paper-2); }
.skeleton .sk-row { height: 58px; border-bottom: 1px solid var(--rule);
  background: linear-gradient(90deg, transparent 0 12px, var(--paper-2) 12px 45%, transparent 45%) no-repeat;
  background-size: 100% 14px; background-position: 0 50%; }
.empty { padding: 36px 0 24px; border-top: 4px solid var(--ink); }
.empty h2 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 800; font-stretch: 75%; }
.empty p { margin: 0 0 14px; color: var(--ink-2); max-width: 36rem; }
.btn {
  min-height: 42px; padding: 8px 14px; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 0;
  font-size: .92rem; font-weight: 600;
}
.btn:hover { background: var(--red); }

.foot { margin-top: 28px; border-top: 4px solid var(--rule-strong); }
.foot p { margin: 0; padding: 14px 0 36px; max-width: 44rem; font-size: .8rem; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
