/* ==========================================================
   Raees-ul-Akhbar ePaper
   Design tokens
   ========================================================== */

:root {
  /* Ink, brass and paper — the materials of a printed daily */
  --ink:        #0D1B1E;
  --ink-soft:   #16292E;
  --ink-line:   #21393F;
  --brass:      #C69749;
  --brass-lit:  #E8CE92;
  --crimson:    #A81F2D;
  --paper:      #FAF6EE;
  --paper-warm: #F2EADA;
  --rule:       #D8CDB8;
  --text:       #1A1512;
  --text-soft:  #5E554A;

  --shell:      min(1320px, 100% - 2.5rem);
  --radius:     3px;

  --shadow-sheet: 0 1px 2px rgba(13,27,30,.10),
                  0 12px 28px rgba(13,27,30,.14),
                  0 40px 80px rgba(13,27,30,.10);

  --urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
  --latin: "Marcellus", "Cormorant Garamond", Georgia, serif;
}

/* ==========================================================
   Base
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--urdu);
  line-height: 2.1;
  overflow-x: hidden;
}

body[dir="rtl"] { text-align: right; }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.latin { font-family: var(--latin); line-height: 1.4; }

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: .75rem 1.25rem;
}
.skip-link:focus { inset-inline-start: 1rem; }

/* ==========================================================
   Masthead
   ========================================================== */

.ledger {
  background: var(--ink);
  color: var(--brass-lit);
  font-size: .92rem;
  line-height: 1.9;
  border-bottom: 1px solid var(--ink-line);
}
.ledger .shell {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 2rem;
  justify-content: space-between;
  align-items: center;
  padding: .45rem 0;
}
.ledger span { white-space: nowrap; }
.ledger b { color: var(--paper); font-weight: 400; }

.masthead {
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
  border-bottom: 1px solid var(--rule);
}
.masthead .shell {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0 1.25rem;
}

.nameplate {
  text-align: center;
  display: grid;
  gap: .15rem;
  justify-items: center;
}
.nameplate .mark {
  font-family: var(--urdu);
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.75;
  color: var(--ink);
  letter-spacing: 0;
}
.nameplate .sub {
  font-family: var(--latin);
  font-size: .72rem;
  letter-spacing: .38em;
  color: var(--text-soft);
  padding-inline-start: .38em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 1.02rem;
}
.nav--end { justify-content: flex-start; }
.nav a { position: relative; padding-block: .3rem; color: var(--text); }
.nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transition: transform .25s ease;
}
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.btn-brass {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--ink);
  color: var(--brass-lit);
  border: 1px solid var(--ink);
  padding: .5rem 1.2rem;
  border-radius: var(--radius);
  transition: background .25s ease, color .25s ease;
}
.btn-brass:hover { background: var(--brass); color: var(--ink); border-color: var(--brass); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .45rem .7rem;
  color: var(--ink);
}

/* Headline ticker */
.ticker {
  background: var(--crimson);
  color: #fff;
  overflow: hidden;
  border-bottom: 3px solid var(--ink);
}
.ticker__inner {
  display: flex;
  gap: 4rem;
  padding: .35rem 0;
  white-space: nowrap;
  animation: slide 48s linear infinite;
  font-size: 1.05rem;
}
.ticker:hover .ticker__inner { animation-play-state: paused; }
@keyframes slide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ==========================================================
   Front page hero
   ========================================================== */

.hero {
  background:
    radial-gradient(120% 90% at 50% 0%, var(--ink-soft) 0%, var(--ink) 65%);
  color: var(--paper);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__sheet {
  position: relative;
  background: var(--paper);
  padding: 10px;
  border: 1px solid rgba(198,151,73,.45);
  box-shadow: var(--shadow-sheet);
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.hero__sheet:hover { transform: translateY(-6px); }
.hero__sheet img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
}
.hero__seal {
  position: absolute;
  inset-block-start: -14px;
  inset-inline-start: -14px;
  background: var(--crimson);
  color: #fff;
  font-size: .85rem;
  padding: .2rem 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

.hero__copy h1 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.9;
  margin: 0 0 .4rem;
  color: var(--paper);
  font-weight: 400;
}
.hero__date {
  color: var(--brass-lit);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}
.hero__copy p {
  color: rgba(250,246,238,.78);
  max-width: 46ch;
  margin: 0 0 1.75rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .85rem; }

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: var(--brass);
  color: var(--ink);
  padding: .7rem 1.6rem;
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  transition: background .25s ease, transform .25s ease;
}
.btn-gold:hover { background: var(--brass-lit); transform: translateY(-2px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  border: 1px solid rgba(232,206,146,.45);
  color: var(--brass-lit);
  padding: .7rem 1.6rem;
  border-radius: var(--radius);
  transition: border-color .25s ease, color .25s ease;
}
.btn-ghost:hover { border-color: var(--brass-lit); color: #fff; }

/* ==========================================================
   Sections
   ========================================================== */

.section { padding: clamp(2.5rem, 5vw, 4.25rem) 0; }
.section--warm { background: var(--paper-warm); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .6rem;
  margin-bottom: 2rem;
}
.section__head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 400;
  line-height: 1.9;
}
.section__head a { color: var(--text-soft); font-size: .95rem; }
.section__head a:hover { color: var(--crimson); }

/* Edition cards */
.editions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.edition {
  display: block;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 9px 9px 0;
  transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease;
}
.edition:hover {
  transform: translateY(-4px);
  border-color: var(--brass);
  box-shadow: 0 18px 40px rgba(13,27,30,.16);
}
.edition__sheet {
  position: relative;
  overflow: hidden;
  background: var(--paper-warm);
}
.edition__sheet img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
}
.edition__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .3rem .85rem;
  border-top: 1px solid var(--rule);
  margin-top: 9px;
}
.edition__meta strong { font-weight: 400; font-size: 1.15rem; }
.edition__meta span { font-size: .85rem; color: var(--text-soft); }

.badge-soon {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  background: repeating-linear-gradient(
    135deg, var(--paper-warm), var(--paper-warm) 12px, #ece2ce 12px, #ece2ce 24px);
  color: var(--text-soft);
  font-size: 1.05rem;
}

/* Article cards */
.articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
}
.article-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--paper);
  border: 1px solid var(--rule);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.article-card:hover { border-color: var(--brass); box-shadow: 0 14px 30px rgba(13,27,30,.12); }
.article-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.article-card__body { padding: 1rem 1.15rem 1.35rem; display: grid; gap: .5rem; align-content: start; }
.article-card__body h3 { margin: 0; font-size: 1.15rem; font-weight: 400; line-height: 1.95; }
.article-card__body time { font-size: .82rem; color: var(--text-soft); font-family: var(--latin); }

/* ==========================================================
   Reader
   ========================================================== */

.reader { background: var(--ink); color: var(--paper); min-height: 70vh; }

.reader__bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13,27,30,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-line);
}
.reader__bar .shell {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 0;
}
.reader__group { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: transparent;
  color: var(--brass-lit);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: .42rem .95rem;
  font-size: .95rem;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.chip:hover:not(:disabled) { border-color: var(--brass); background: rgba(198,151,73,.12); }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.chip--solid { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.chip--solid:hover { background: var(--brass-lit); }
.chip--date { background: var(--paper); color: var(--ink); border-color: var(--paper); font-family: var(--latin); }

select.chip { appearance: none; padding-inline-end: 1.6rem; background-color: transparent; }
select.chip option { background: var(--ink-soft); color: var(--paper); }

.reader__stage {
  padding: clamp(1.25rem, 3vw, 2.5rem) 0 3rem;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}

/* page thumbnails rail */
.rail {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  display: grid;
  gap: .75rem;
  padding-inline-end: .35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-line) transparent;
}
.rail__item {
  display: grid;
  gap: .3rem;
  border: 1px solid var(--ink-line);
  padding: 5px;
  background: var(--ink-soft);
  transition: border-color .25s ease;
}
.rail__item img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top center; width: 100%; }
.rail__item span { font-size: .78rem; color: rgba(250,246,238,.65); text-align: center; }
.rail__item:hover { border-color: var(--brass); }
.rail__item[aria-current="true"] { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass) inset; }
.rail__item[aria-current="true"] span { color: var(--brass-lit); }

/* the page sheet itself */
.viewer { display: grid; justify-items: center; gap: 1rem; }

.viewer__frame {
  position: relative;
  display: inline-block;
  background: var(--paper);
  padding: 8px;
  border: 1px solid rgba(198,151,73,.35);
  box-shadow: var(--shadow-sheet);
  max-width: 100%;
  transform-origin: top center;
  transition: transform .25s ease;
}
.viewer__frame img {
  display: block;
  width: 100%;
  height: auto;
}

.hotspot {
  position: absolute;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  padding: 0;
}
.hotspot:hover,
.hotspot:focus-visible {
  border-color: var(--crimson);
  background: rgba(168,31,45,.10);
  box-shadow: 0 0 0 1px rgba(198,151,73,.7), 0 8px 22px rgba(0,0,0,.18);
}
.hotspot__label {
  position: absolute;
  inset-block-end: calc(100% + 6px);
  inset-inline-start: 0;
  background: var(--ink);
  color: var(--brass-lit);
  font-size: .9rem;
  line-height: 1.8;
  padding: .15rem .75rem;
  white-space: nowrap;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label { opacity: 1; }

.hotspot-hint {
  color: rgba(250,246,238,.55);
  font-size: .92rem;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: clamp(3rem, 8vw, 6rem) 1rem;
  color: rgba(250,246,238,.75);
  display: grid;
  gap: 1rem;
  justify-items: center;
}
.empty-state h2 { font-weight: 400; margin: 0; font-size: 1.5rem; color: var(--paper); }

/* ==========================================================
   Article page
   ========================================================== */

.prose {
  max-width: 68ch;
  margin-inline: auto;
  font-size: 1.12rem;
  line-height: 2.35;
}
.prose h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 400; line-height: 1.95; margin: 0 0 .5rem; }
.prose h2, .prose h3 { font-weight: 400; line-height: 2; }
.prose img { margin: 1.5rem auto; border: 1px solid var(--rule); padding: 6px; background: var(--paper); }
.prose blockquote {
  margin: 1.75rem 0;
  padding-inline-start: 1.25rem;
  border-inline-start: 3px solid var(--brass);
  color: var(--text-soft);
}
.prose a { color: var(--crimson); border-bottom: 1px solid rgba(168,31,45,.35); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  align-items: center;
  color: var(--text-soft);
  font-size: .92rem;
  border-block: 1px solid var(--rule);
  padding: .6rem 0;
  margin-bottom: 2rem;
}

/* ==========================================================
   Archive
   ========================================================== */

.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .9rem;
}
.calendar a {
  border: 1px solid var(--rule);
  padding: .85rem 1rem;
  display: grid;
  gap: .2rem;
  background: var(--paper);
  transition: border-color .25s ease, background .25s ease;
}
.calendar a:hover { border-color: var(--brass); background: var(--paper-warm); }
.calendar strong { font-weight: 400; font-size: 1.05rem; }
.calendar span { font-size: .82rem; color: var(--text-soft); }

/* ==========================================================
   Footer
   ========================================================== */

.footer {
  background: var(--ink);
  color: rgba(250,246,238,.72);
  padding: 3rem 0 1.5rem;
  border-top: 4px solid var(--brass);
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ink-line);
}
.footer h3 { color: var(--brass-lit); font-weight: 400; font-size: 1.15rem; margin: 0 0 .75rem; }
.footer a:hover { color: var(--brass-lit); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.footer__base {
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  font-size: .88rem;
  color: rgba(250,246,238,.55);
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__sheet { max-width: 360px; margin-inline: auto; order: -1; }
  .reader__stage { grid-template-columns: 1fr; }
  .rail {
    position: static;
    max-height: none;
    grid-auto-flow: column;
    grid-auto-columns: 92px;
    overflow-x: auto;
    padding-bottom: .5rem;
  }
}

@media (max-width: 768px) {
  :root { --shell: min(1320px, 100% - 1.75rem); }
  .masthead .shell { grid-template-columns: auto 1fr auto; padding: 1rem 0; }
  .nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-block: 1px solid var(--rule);
    padding: .5rem 1.25rem;
    z-index: 50;
  }
  .masthead { position: relative; }
  .nav.is-open { display: flex; }
  .nav a { padding: .65rem 0; border-bottom: 1px solid var(--rule); }
  .nav a:last-child { border-bottom: 0; }
  .nav-toggle { display: inline-flex; }
  .nav--end { justify-content: flex-end; }
  .ledger { font-size: .8rem; }
  .ledger .shell { justify-content: center; gap: .25rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .ledger, .ticker, .nav, .reader__bar, .rail, .footer, .hotspot { display: none !important; }
  body { background: #fff; }
  .viewer__frame { border: 0; box-shadow: none; padding: 0; }
}

/* Disabled navigation chips */
.chip[aria-disabled="true"] {
  opacity: .35;
  pointer-events: none;
}
