/* ---------------------------------------------------------------------------
   Swabhimaan -- the website.

   The palette and the type are the paper's, sampled from style/fmw.sty. What
   differs is what a screen cannot inherit from a page: no columns, no folios,
   no fixed measure in millimetres. The rule followed throughout is the one in
   WEBSITE-PLAN.md -- anything that exists because a page has edges is
   print-only; anything that carries meaning crosses over.
--------------------------------------------------------------------------- */

:root {
  --paper:  #F8F3E8;   /* cream stock */
  --ink:    #1A1713;
  --slate:  #4A453D;
  --grey:   #6E6558;
  --rule:   #C9BFAC;
  --tint:   #EFE8D8;
  --accent: #C64E0C;   /* masthead orange: display type, rules, drop caps */
  /* The same orange darkened to 5.13:1 on cream. Small orange text -- kickers,
     crossheads, labels -- uses this so it passes WCAG AA; --accent is 4.22:1,
     which is fine at display sizes and not at 12px. The two are
     indistinguishable side by side. */
  --accent-text: #B0450B;
  --blue:   #184F95;
  --teal:   #17906C;

  --measure: 34em;
  --body: "XCharter", Charter, Georgia, "Times New Roman", serif;
  --display: "Fraunces", Georgia, serif;
  --label: "Lato", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1713;  --ink: #EDE6D8;  --slate: #B8AE9C;  --grey: #A09683;
    --rule:  #3A342C;  --tint: #24201B; --accent: #E87A3C; --accent-text: #F08A4A;
  }
}

/* ------------------------------------------------------------------ fonts -- */

@font-face { font-family: "XCharter"; src: url("/fonts/XCharter-Roman.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "XCharter"; src: url("/fonts/XCharter-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "XCharter"; src: url("/fonts/XCharter-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "XCharter"; src: url("/fonts/XCharter-BoldItalic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces-Headline.woff2") format("woff2");
  font-weight: 650; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces-HeadlineItalic.woff2") format("woff2");
  font-weight: 650; font-style: italic; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces-Masthead.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/Lato-Semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap; }
/* Neither XCharter nor Fraunces carries the rupee sign, exactly as in print --
   where the style sheet borrows Lato's. Here the browser composes it. */
@font-face { font-family: "XCharter"; src: url("/fonts/Lato-Rupee.woff2") format("woff2");
  unicode-range: U+20B9; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Lato-Rupee.woff2") format("woff2");
  unicode-range: U+20B9; font-display: swap; }

/* ------------------------------------------------------------------- base -- */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-kerning: normal;
  font-variant-numeric: oldstyle-num;
  -webkit-text-size-adjust: 100%;
}
@media (min-width: 48em) { body { font-size: 1.1875rem; line-height: 1.55; } }

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: .12em; }
a:hover { text-decoration-color: var(--accent); }
img, svg { max-width: 100%; height: auto; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--paper); padding: .6em 1em;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

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

/* --------------------------------------------------------------- masthead -- */

.masthead {
  text-align: center;
  padding: 2.2rem 1rem 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.masthead-name {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(2.4rem, 9vw, 4.2rem); line-height: 1;
  color: var(--ink); text-decoration: none; display: block;
}
.masthead-tagline {
  font-family: var(--label); font-weight: 600;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin: .7rem 0 0;
}
.masthead-nav { margin-top: 1rem; font-family: var(--label); font-size: .8rem; }
.masthead-nav a {
  margin: 0 .7rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 600; color: var(--slate); text-decoration: none;
}
.masthead-nav a:hover { color: var(--accent-text); }

main { display: block; }

/* ------------------------------------------------------------------ cover -- */

.cover { position: relative; margin: 0 0 2.5rem; background: var(--ink); }
.cover-photo { width: 100%; display: block; object-fit: cover; max-height: 78vh; }
.cover-lines {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2rem clamp(1rem, 5vw, 4rem);
  color: #F8F3E8;
  background: linear-gradient(to top, rgba(12,10,8,.86), rgba(12,10,8,.55) 55%, transparent);
}
.cover-issue {
  font-family: var(--label); font-weight: 600; font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .5rem;
  color: #F0C9A8;
}
.cover-headline {
  font-family: var(--display); font-weight: 650;
  font-size: clamp(1.9rem, 6vw, 3.4rem); line-height: 1.05; margin: 0;
  max-width: 20ch;
}
.cover-headline a { color: inherit; text-decoration: none; }
.cover-headline a:hover { text-decoration: underline; text-decoration-color: #E87A3C; }
.cover-kicker {
  font-size: .95rem; line-height: 1.45; margin: .8rem 0 0;
  max-width: 52ch; color: #E4DCCC;
}

/* --------------------------------------------------------------- epigraph -- */

.epigraph {
  max-width: var(--measure); margin: 0 auto 3rem; padding: 0 1.2rem;
  text-align: center;
}
.epigraph blockquote { margin: 0; font-family: var(--display); font-style: italic;
  font-size: 1.2rem; line-height: 1.45; color: var(--slate); }
.epigraph blockquote p { margin: 0; text-indent: 0; }
.epigraph blockquote p::before { content: "\201C"; color: var(--accent); }
.epigraph blockquote p::after  { content: "\201D"; color: var(--accent); }
.epigraph-source {
  font-family: var(--label); font-weight: 600; font-size: .7rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin: .9rem 0 0;
}

/* --------------------------------------------------------------- contents -- */

.section-label {
  font-family: var(--label); font-weight: 600; font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text);
  border-bottom: 1px solid var(--rule); padding-bottom: .5rem; margin: 0 0 1.2rem;
}
.issue-contents, .issue-print, .page, .archive {
  max-width: var(--measure); margin: 0 auto 3rem; padding: 0 1.2rem;
}
.contents { list-style: none; margin: 0; padding: 0; counter-reset: entry; }
.contents-entry { border-bottom: 1px solid var(--rule); }
.contents-entry:last-child { border-bottom: 0; }
.contents-entry a {
  display: block; padding: 1rem 0; text-decoration: none;
}
.contents-entry a:hover .contents-title { text-decoration: underline;
  text-decoration-color: var(--accent); }
.contents-entry a[aria-current="page"] .contents-title { color: var(--accent-text); }
.contents-title {
  display: block; font-family: var(--display); font-weight: 650;
  font-size: 1.3rem; line-height: 1.2;
}
.contents-section {
  font-family: var(--label); font-weight: 600; font-size: .7rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--grey);
  padding: 1.4rem 0 .4rem;
}
.kicker {
  display: block; font-family: var(--label); font-weight: 600;
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: .35rem;
}
.byline {
  display: block; font-family: var(--label); font-size: .72rem;
  letter-spacing: .06em; color: var(--grey); margin-top: .35rem;
}

.pdf-link {
  display: inline-block; font-family: var(--label); font-weight: 600;
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--paper); background: var(--accent);
  padding: .8em 1.3em; text-decoration: none; border-radius: 2px;
}
.pdf-link:hover { background: var(--ink); }
.issue-rights { font-size: .8rem; color: var(--grey); margin-top: 1.2rem; }

/* ---------------------------------------------------------------- article -- */

.story { max-width: var(--measure); margin: 0 auto; padding: 2rem 1.2rem 0; }
.story-head { margin-bottom: 2rem; }
.story-head h1 {
  font-family: var(--display); font-weight: 650;
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin: 0 0 .6rem;
}
.standfirst {
  font-style: italic; font-size: 1.2rem; line-height: 1.45;
  color: var(--slate); margin: 0 0 1rem; text-indent: 0;
}
.story-meta {
  font-family: var(--label); font-size: .72rem; letter-spacing: .06em;
  color: var(--grey); border-top: 1px solid var(--rule);
  padding-top: .8rem; margin: 0;
  display: flex; flex-wrap: wrap; gap: .4rem 1.2rem;
}
.story-meta .byline { display: inline; margin: 0; }

/* Body copy is set the way the paper sets it: indented paragraphs, no space
   between them, the indent suppressed after anything that is not a paragraph. */
.story-body p { margin: 0; text-indent: 1.1em; }
.story-body > p:first-child,
.story-body .opener p,
.story-body h2 + p, .story-body h3 + p,
.story-body figure + p, .story-body .numbers + p,
.story-body .note + p, .story-body .pullquote + p,
.story-body .highlight + p, .story-body ul + p, .story-body ol + p {
  text-indent: 0;
}
.story-body h2, .story-body h3 {
  font-family: var(--label); font-weight: 600; font-size: .78rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text);
  margin: 2.2rem 0 .9rem;
}

/* The drop cap, on the paragraph print puts it on. The float is the baseline
   because Firefox still has no initial-letter; where it exists it is better. */
.opener p::first-letter {
  font-family: var(--display); font-weight: 650; color: var(--accent);
  float: left; font-size: 3.3em; line-height: .82; padding: .06em .08em 0 0;
}
@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .opener p::first-letter {
    float: none; font-size: inherit; padding-right: .1em;
    -webkit-initial-letter: 3; initial-letter: 3;
  }
}

/* -------------------------------------------------------- layout blocks -- */

figure { margin: 2rem 0; }
figure img, figure svg { display: block; width: 100%; }
figcaption {
  font-family: var(--label); font-size: .74rem; line-height: 1.45;
  color: var(--grey); margin-top: .6rem;
}

/* The chart palette was validated against cream and nothing else, so in dark
   mode the figure stays on its own cream ground -- a printed clipping laid on
   the page -- rather than being recoloured into something unvalidated. */
@media (prefers-color-scheme: dark) {
  figure img[src$=".svg"] { background: #F8F3E8; padding: .6rem; border-radius: 2px; }
}

.numbers {
  background: var(--tint); border-left: 3px solid var(--accent);
  padding: 1.3rem 1.4rem; margin: 2rem 0;
}
.numbers::before {
  content: attr(data-title);
  display: block; font-family: var(--label); font-weight: 600;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: .8rem;
}
.numbers ul { list-style: none; margin: 0; padding: 0; }
.numbers li { margin-bottom: .9rem; font-size: .95rem; line-height: 1.4; }
.numbers li:last-child { margin-bottom: 0; }
.numbers strong {
  display: block; font-family: var(--display); font-weight: 650;
  font-size: 1.9rem; line-height: 1.1; color: var(--accent); font-weight: 650;
}

.pullquote { margin: 2rem 0; }
.pullquote blockquote {
  margin: 0; padding-left: 1.2rem; border-left: 3px solid var(--accent);
  font-family: var(--display); font-style: italic; font-size: 1.25rem;
  line-height: 1.4; color: var(--slate);
}
.pullquote blockquote p { margin: 0; text-indent: 0; }

.highlight { margin: 2rem 0; }
.highlight blockquote {
  margin: 0; background: var(--tint); padding: 1.3rem 1.4rem; border: 0;
  font-family: var(--display); font-style: italic; font-size: 1.2rem;
  line-height: 1.4; color: var(--accent-text);
}
.highlight blockquote p { margin: 0; text-indent: 0; }

.note {
  font-size: .88rem; line-height: 1.5; color: var(--grey);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .9rem 0; margin: 2rem 0;
}
.note p { text-indent: 0; margin: 0; }

table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rule); }
th { font-family: var(--label); font-weight: 600; font-size: .72rem;
     letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.story-body > table, .table-scroll { display: block; overflow-x: auto; }

/* ---------------------------------------------------------------- archive -- */

.page-head { margin-bottom: 2.5rem; }
.page-head h1 { font-family: var(--display); font-weight: 650;
  font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 .5rem; }
.archive { max-width: 52em; }
.cards { display: grid; gap: 2.5rem; }
@media (min-width: 44em) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card { border-top: 1px solid var(--rule); padding-top: 1.2rem; }
.card-cover img { width: 100%; display: block; }
.card-body h2 { font-family: var(--display); font-weight: 650; font-size: 1.4rem;
  line-height: 1.15; margin: .6rem 0 .3rem; }
.card-body h2 a { text-decoration: none; }
.card-body h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.card-date { font-family: var(--label); font-size: .72rem; letter-spacing: .06em;
  color: var(--grey); margin: 0 0 .8rem; }
.card-contents { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.card-contents li { padding: .35rem 0; border-top: 1px solid var(--rule); }
.card-contents a { text-decoration: none; }
.card-contents a:hover { text-decoration: underline; }
.card-contents .kicker { display: inline; margin-right: .5em; font-size: .62rem; }

/* --------------------------------------------------------------- colophon -- */

.story-foot { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.colophon {
  border-top: 1px solid var(--rule); margin-top: 4rem;
  padding: 2.5rem 1.2rem 3rem; text-align: center;
  font-size: .85rem; color: var(--grey);
}
.colophon p { margin: .3rem 0; }
.colophon-name { font-family: var(--display); font-weight: 900;
  font-size: 1.4rem; color: var(--ink); }
.colophon-links { margin-top: 1rem !important; font-family: var(--label); font-size: .78rem; }
.colophon-fine { margin-top: 1.2rem !important; font-size: .75rem; }

@media print {
  .masthead-nav, .skip, .pdf-link, .story-foot, .colophon-links { display: none; }
}
