/* AawaaZ — public edition.
   Layout, palette and proportions follow issue0.php: a 1120px newspaper with a
   hero card beside the Morning 5, and a three-up story grid. Deliberately one
   light "paper" design, as the prototype is — no dark variant.
   The only departures are a slightly larger base size and stepped A+/A-,
   because every reader is over sixty. */

:root{
  --ink:#23312c;
  --muted:#6c756f;
  --paper:#fffdf7;
  --cream:#f5efe2;
  --line:#ded8cb;
  --accent:#8b4d2f;
  --green:#315b4b;
  --gold:#b8883b;
  --white:#ffffff;
  --shadow:0 10px 30px rgba(38,47,42,.08);
  --focus:#0b62c4;
  --f-head: Georgia, "Noto Serif Devanagari", "Noto Sans Devanagari", system-ui, sans-serif;
  --f-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Reader-controlled size. 17px default rather than 16. */
html                { font-size:17px }
html[data-size="1"] { font-size:15px }
html[data-size="2"] { font-size:17px }
html[data-size="3"] { font-size:20px }
html[data-size="4"] { font-size:24px }

*{box-sizing:border-box}

body{
  margin:0;
  color:var(--ink);
  background:var(--cream);
  font-family:var(--f-head);
  line-height:1.55;
}
a{color:inherit}
a:focus-visible,button:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:2px}

.wrap{max-width:1120px;margin:auto;padding:0 20px}

.skip{position:absolute;left:-9999px;background:var(--green);color:#fff;padding:.7rem 1rem;z-index:30}
.skip:focus{left:.5rem;top:.5rem}

.internal-note{
  background:#fff4cc;border-bottom:1px solid #ead58a;color:#5b4a13;
  text-align:center;padding:9px 15px;font:700 .82rem var(--f-ui)
}

.topbar{background:var(--green);color:#fff;font-family:var(--f-ui);font-size:.85rem}
.topbar .wrap{display:flex;justify-content:space-between;gap:16px;align-items:center;padding-top:9px;padding-bottom:9px}
.toplinks{display:flex;gap:14px;flex-wrap:wrap}
.toplinks a{text-decoration:none;opacity:.95}
.toplinks a:hover{opacity:1;text-decoration:underline}

.header{background:var(--paper);border-bottom:1px solid var(--line)}
.brandrow{display:grid;grid-template-columns:1fr auto 1fr;gap:20px;align-items:center;padding:26px 0 18px}
.foundation{font-family:var(--f-ui);font-size:.85rem;color:var(--muted);font-weight:650}
.masthead{text-align:center}
.masthead h1{margin:0;font-size:3.4rem;letter-spacing:-2px;line-height:1;color:var(--accent)}
.masthead .dev{font-size:1.35rem;font-weight:700;color:var(--green);margin-top:7px}
.masthead .strap{font-family:var(--f-ui);font-size:.85rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-top:8px}

.controls{display:flex;justify-content:flex-end;gap:8px;align-items:center;flex-wrap:wrap}
button,.btn{
  border:1px solid var(--line);background:#fff;border-radius:999px;padding:9px 14px;
  font:600 .85rem var(--f-ui);cursor:pointer;text-decoration:none;color:var(--ink);
  display:inline-flex;align-items:center;gap:.35rem
}
button:hover,.btn:hover{border-color:var(--green);color:var(--green)}
button.active{background:var(--green);color:#fff;border-color:var(--green)}
button[disabled]{opacity:.4;cursor:default}
.btn.primary{background:var(--green);color:#fff;border-color:var(--green)}
.btn.primary:hover{background:var(--accent);border-color:var(--accent);color:#fff}

.issuebar{
  border-top:1px solid var(--line);padding:10px 0 12px;
  display:flex;justify-content:space-between;align-items:center;gap:16px;
  font-family:var(--f-ui);font-size:.85rem
}
.issuebar .arch{text-decoration:none;font-weight:700;color:var(--accent)}
.badge{background:#f2e2ca;color:#6d431f;padding:5px 9px;border-radius:6px;font-weight:700}

.hero{padding:28px 0}
.hero-grid{display:grid;grid-template-columns:1.6fr .8fr;gap:22px;align-items:start}
.hero-card,.side-card,.story,.audio-card,.reader-card{
  background:var(--paper);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)
}
.hero-card{padding:28px}
.kicker{font:800 .72rem var(--f-ui);letter-spacing:.08em;text-transform:uppercase;color:var(--accent)}
.hero-card h2{font-size:2.24rem;line-height:1.16;margin:10px 0 12px}
.hero-card p.gist{font-size:1.12rem;margin:0;color:#3e4944}

.meaning{margin-top:20px;padding:15px 17px;border-left:4px solid var(--gold);background:#fbf5ea;border-radius:8px}
/* No display here: the .hi/.en rules must decide whether it shows. */
.meaning strong{font-family:var(--f-ui);font-size:.85rem;margin-bottom:.2rem}
.source{margin-top:14px;font:.78rem var(--f-ui);color:var(--muted)}
.source a{color:var(--muted)}

.side-card{padding:22px}
.side-card h3{margin:0 0 12px;font-size:1.3rem}
.morning5{margin:0;padding-left:22px}
.morning5 li{padding:8px 0;border-bottom:1px solid #ebe6dc}
.morning5 li:last-child{border-bottom:0}
.morning5 .m5gist{display:block;font-size:.86rem;color:var(--muted);margin-top:2px}

.section-title{
  display:flex;justify-content:space-between;align-items:end;gap:12px;
  padding:24px 0 11px;border-bottom:2px solid var(--ink)
}
.section-title h2{margin:0;font-size:1.7rem}
.section-title span{font:.78rem var(--f-ui);color:var(--muted)}

.stories{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;padding:18px 0 8px}
.story{padding:20px;min-height:230px;display:flex;flex-direction:column}
.story .icon{font-size:1.65rem;line-height:1}
.story h3{font-size:1.24rem;line-height:1.25;margin:10px 0 8px}
.story p.gist{margin:0 0 12px;color:#4b5650}
.story .meaning{margin-top:0;margin-bottom:12px;padding:11px 13px;font-size:.92rem}
.story .source{margin-top:10px}

details.more{margin-top:auto;border-top:1px dashed var(--line);padding-top:10px}
details.more>summary{cursor:pointer;list-style:none;font:700 .85rem var(--f-ui);color:var(--accent)}
details.more>summary::-webkit-details-marker{display:none}
details.more>summary::after{content:" →"}
details.more[open]>summary::after{content:" ↑"}
details.more .body{margin-top:10px;font-size:.96rem}
.hero-card details.more{margin-top:18px}

.audio-card{
  margin:26px 0;padding:25px;display:grid;grid-template-columns:auto 1fr auto;gap:20px;align-items:center;
  background:linear-gradient(135deg,#fffdf7,#f3ede0)
}
.audio-icon{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;background:var(--green)}
.audio-icon svg{width:34px;height:34px}
.audio-card h2{margin:0 0 4px;font-size:1.65rem}
.audio-card p{margin:0;color:var(--muted);font-size:.95rem}

/* Visually hidden, not display:none — some mobile browsers won't play a
   media element that was never actually laid out on the page. This stays
   in the layout at 1x1px instead, which plays everywhere. */
.audio-el{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;padding:0;margin:-1px}

/* The play/pause button sits opposite the headphone mark, the same
   round green badge at the same size — the two circles bookend the
   card. The progress line stays with the text, under the description. */
.audio-toggle{
  width:72px;height:72px;padding:0;border:0;border-radius:50%;cursor:pointer;flex-shrink:0;
  background:var(--green);display:grid;place-items:center;box-shadow:var(--shadow)
}
.audio-toggle:hover{background:var(--accent)}
.audio-toggle svg{width:30px;height:30px}
.audio-toggle .ic-play{margin-left:3px}
.audio-track{display:flex;flex-direction:column;gap:6px;min-width:0;margin-top:14px}
.audio-progress{height:6px;border-radius:4px;background:#e3ddce;cursor:pointer;overflow:hidden}
.audio-progress-fill{height:100%;width:0;background:var(--accent);border-radius:4px}
.audio-time{font:.78rem var(--f-ui);color:var(--muted);letter-spacing:.01em}

.reader-card{margin:24px 0;padding:25px;background:#eef4f0;border-color:#cfded5}
.reader-card h2{margin:0 0 8px;font-size:1.5rem}
.reader-card p{margin:0;color:#41504a}
.reader-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}

.disclaimer{margin:26px 0 0;font:.8rem var(--f-ui);color:var(--muted);text-align:center}
.empty{text-align:center;padding:70px 0}
.empty h1{font-size:1.6rem;margin:0 0 .4rem}

/* Archive */
.archive-card{background:var(--paper);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:8px 22px;margin:22px 0}
.archive{list-style:none;margin:0;padding:0}
.archive li{border-bottom:1px solid #ebe6dc}
.archive li:last-child{border-bottom:0}
.archive a{display:flex;flex-wrap:wrap;align-items:baseline;gap:.3rem .9rem;padding:14px 0;text-decoration:none}
.archive a:hover .a-date{color:var(--accent)}
.a-date{font-weight:700}
.a-num{font:.8rem var(--f-ui);color:var(--muted)}
.pager{display:flex;justify-content:center;gap:1.4rem;padding-bottom:24px;font:.88rem var(--f-ui)}

.footer{margin-top:36px;background:#213d33;color:#fff;padding:30px 0;font-family:var(--f-ui);font-size:.85rem}
.footer-grid{display:grid;grid-template-columns:2fr 1fr;gap:20px}
.footer a{color:#fff}

/* Both languages are in the markup; the toggle is a body class, as in the
   prototype. "inl" marks the few places that must stay on the same line as
   their neighbours (an icon, a label, a button's text). Order matters: the
   hiding rules must outrank the inline ones. */
.hi{display:block}
.en{display:none}
.hi.inl{display:inline}
body.lang-en .hi{display:none}
body.lang-en .en{display:block}
body.lang-en .en.inl{display:inline}

@media(max-width:1000px){
  .stories{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:800px){
  .brandrow{grid-template-columns:1fr;text-align:center}
  .controls{justify-content:center}
  .foundation{text-align:center}
  .masthead h1{font-size:2.8rem}
  .hero-grid{grid-template-columns:1fr}
  .stories{grid-template-columns:1fr}
  .story{min-height:0}
  .audio-icon,.audio-toggle{width:56px;height:56px}
  .audio-icon svg{width:26px;height:26px}
  .audio-toggle svg{width:24px;height:24px}
  /* The description line ("The audio brief for this edition...") is
     dropped here — the heading and the play button already say what
     this card is for, and the page is text-heavy enough by this point. */
  .audio-card p.audio-desc{display:none}
  .footer-grid{grid-template-columns:1fr}
}
@media(max-width:520px){
  .wrap{padding:0 14px}
  .topbar .wrap{align-items:flex-start;flex-direction:column}
  .masthead h1{font-size:2.5rem}
  .hero-card h2{font-size:1.75rem}
  .hero-card{padding:21px}
  .issuebar{align-items:flex-start;flex-direction:column}
}

@media print{
  .topbar,.controls,.internal-note,.audio-card,.reader-card,.footer,.skip{display:none}
  body{background:#fff}
  html{font-size:11pt}
  .story,.hero-card,.side-card{box-shadow:none;break-inside:avoid}
  details.more>summary{display:none}
  details.more .body{margin-top:0}
}
@media (prefers-reduced-motion:reduce){*{animation-duration:.001ms!important;transition-duration:.001ms!important}}

/* ---------- links into the inside pages ---------- */

.headlink{text-decoration:none;color:inherit}
.headlink:hover{color:var(--accent)}
.more-link{
  margin-top:auto;border-top:1px dashed var(--line);padding-top:10px;
  font:700 .85rem var(--f-ui);color:var(--accent);text-decoration:none;display:block
}
.more-link:hover{text-decoration:underline}
.hero-card .more-link{margin-top:18px;display:inline-block;border-top:0;padding-top:0}

/* ---------- inside page ---------- */

.header-slim .slimrow{
  display:grid;grid-template-columns:1fr auto 1fr;gap:16px;align-items:center;padding:14px 0
}
.backlink{font:700 .85rem var(--f-ui);color:var(--accent);text-decoration:none}
.backlink:hover{text-decoration:underline}
.slimmast{text-align:center;text-decoration:none;display:block}
.slimlogo{display:block;font-size:1.7rem;line-height:1;color:var(--accent)}
.slimdev{display:block;font-size:.9rem;font-weight:700;color:var(--green);margin-top:2px}

.sheet{
  background:var(--paper);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);
  padding:34px 38px 30px;margin:26px 0 0;position:relative;overflow:hidden
}
.crease{
  position:absolute;left:0;right:0;top:0;height:26px;pointer-events:none;
  background:linear-gradient(180deg,rgba(35,49,44,.07),rgba(35,49,44,0))
}
.sheet .kicker{margin-bottom:10px}
.sheet h1{font-size:2.1rem;line-height:1.2;margin:0 0 14px}
.sheet-lead h1{font-size:2.45rem}
.sheet .lede{font-size:1.2rem;line-height:1.5;color:#3e4944;margin:0 0 18px}
.storybody{font-size:1.04rem;line-height:1.72;margin-top:18px}
.storybody div{margin-bottom:1rem}
.storybody div:last-child{margin-bottom:0}
.nobody{margin-top:18px;font:.95rem var(--f-ui);color:var(--muted);font-style:italic}
.sheet .source{margin-top:22px;padding-top:14px;border-top:1px solid var(--line)}

.turn{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:22px 0 0}
.turn a{
  background:var(--paper);border:1px solid var(--line);border-radius:14px;
  padding:15px 18px;text-decoration:none;display:block;box-shadow:var(--shadow)
}
.turn a:hover{border-color:var(--accent)}
.turn-next{text-align:right}
.turn-label{display:block;font:700 .78rem var(--f-ui);color:var(--accent);margin-bottom:5px}
.turn-title{font-size:1.02rem;line-height:1.3}
.backrow{display:flex;justify-content:center;margin-top:22px}

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

.artfig{margin:0;background:var(--cream);overflow:hidden}
.artfig img{display:block;width:100%;height:auto}

/* On a card the picture bleeds to the edges and rounds with the corner. */
.story .artfig-card{margin:-20px -20px 14px;border-radius:15px 15px 0 0}
.hero-card .artfig-card{margin:-28px -28px 18px;border-radius:15px 15px 0 0}
.column-card .artfig-card{margin:-32px -36px 18px;border-radius:15px 15px 0 0;max-height:280px}
.column-card .artfig-card img{object-fit:cover;height:280px}

/* On the inside page it sits in the text, with its caption. */
.sheet .artfig-full{margin:20px 0 4px;border-radius:10px}
.artfig figcaption{
  padding:9px 2px 0;font:.82rem var(--f-ui);color:var(--muted);line-height:1.45;background:var(--paper)
}
.artfig .credit{display:block;margin-top:3px;font-style:italic}

@media(max-width:800px){
  .story .artfig-card{margin:-20px -20px 14px}
  .hero-card .artfig-card{margin:-21px -21px 16px}
  .column-card .artfig-card{margin:-24px -20px 16px;max-height:200px}
  .column-card .artfig-card img{height:200px}
}

/* ---------- राज़ की कलम से — the signed column ---------- */

.column-card{
  margin:26px 0 0;padding:32px 36px 26px;border-radius:16px;
  background:linear-gradient(180deg,#fbf5ea,var(--paper));
  border:1px solid var(--line);border-top:3px solid var(--accent);
  box-shadow:var(--shadow)
}
.column-head{margin-bottom:14px}
.column-byline{font:.8rem var(--f-ui);color:var(--muted);margin-top:3px}

/* The editor's mark — a pen-nib seal, standing in for a photograph.
   It sits inline with the headline itself, not on its own banner row:
   a signature beside the title, not a masthead photo above it. */
.column-title-row{display:flex;align-items:center;gap:12px;margin:0 0 12px}
.column-title-row h3,.column-title-row h1{margin:0}
.column-mark-inline{flex:0 0 auto;width:40px;height:40px;line-height:0}
.column-mark-inline .editor-mark{display:block;width:100%;height:100%;opacity:.94}
.sheet .column-mark-inline{width:48px;height:48px}

.column-card h3{font-size:1.9rem;line-height:1.22;max-width:34ch}
.column-lede{font-size:1.14rem;line-height:1.6;color:#3e4944;margin:0 0 4px;max-width:62ch}
.column-card .meaning{margin-top:16px;max-width:62ch}
.column-foot{
  display:flex;justify-content:space-between;align-items:baseline;gap:16px;flex-wrap:wrap;
  margin-top:18px;padding-top:14px;border-top:1px solid var(--line)
}
.column-sign{font-family:var(--f-head);font-style:italic;font-size:1.3rem;color:var(--accent)}
.column-foot .more-link{margin-top:0;border-top:0;padding-top:0;display:inline-block}

/* the column's own page */
.sheet-column{
  background:linear-gradient(180deg,#fbf5ea,var(--paper));
  border-top:3px solid var(--accent)
}
.sheet-column .column-byline{margin:0 0 14px}
.column-sign-end{
  margin:0;text-align:left;
  font-family:var(--f-head);font-style:italic;font-size:1.35rem;color:var(--accent)
}

/* The editor's closing photograph, cropped to a circle, next to the
   signature at the very end of the column. One fixed picture, the same
   every week — see editor_photo() in lib/helpers.php. Falls back to the
   pen-nib mark (.editor-mark) until that photo file is actually placed. */
.editor-signoff{
  display:flex;align-items:center;gap:18px;
  margin:28px 0 4px;padding-top:20px;border-top:1px solid var(--line)
}
.editor-signoff>.editor-photo,.editor-signoff>.editor-mark{flex:0 0 auto;display:block}
.editor-photo{border-radius:50%;object-fit:cover;border:2px solid var(--gold);background:var(--cream)}
.editor-signoff-text{min-width:0}
.editor-signoff-caption{font:.8rem var(--f-ui);color:var(--muted);margin:4px 0 0}

@media(max-width:800px){
  .column-card{padding:24px 20px 20px;border-radius:12px}
  .column-card h3{font-size:1.6rem}
  .column-lede{font-size:1.06rem}
  .column-foot{flex-direction:column;align-items:flex-start;gap:10px}
}

@media(max-width:560px){
  .editor-signoff{flex-direction:column;text-align:center}
  .editor-signoff .column-sign-end{text-align:center}
}

/* ---------- the unfold, on a phone ---------- */

@media(max-width:800px){
  .header-slim .slimrow{grid-template-columns:1fr;text-align:center;gap:10px}
  .backlink{justify-self:center}
  .sheet{padding:24px 20px 22px;border-radius:12px}
  .sheet h1{font-size:1.7rem}
  .sheet-lead h1{font-size:1.85rem}
  .sheet .lede{font-size:1.08rem}
  .turn{grid-template-columns:1fr}
  .turn-next{text-align:left}

  /* Each inside page opens like a sheet being unfolded from the crease. */
  .sheet{
    transform-origin:top center;
    animation:unfold .55s cubic-bezier(.2,.75,.28,1) both
  }
  .sheet .kicker,.sheet h1,.sheet .lede,.sheet .meaning,.storybody,.sheet .source,.nobody{
    animation:settle .5s ease-out .18s both
  }
  @keyframes unfold{
    0%{transform:perspective(1500px) rotateX(-82deg);opacity:0}
    55%{opacity:1}
    100%{transform:perspective(1500px) rotateX(0);opacity:1}
  }
  @keyframes settle{
    from{opacity:0;transform:translateY(6px)}
    to{opacity:1;transform:none}
  }
}

@media (prefers-reduced-motion:reduce){
  .sheet,.sheet .kicker,.sheet h1,.sheet .lede,.sheet .meaning,.storybody,.sheet .source,.nobody{
    animation:none!important;transform:none!important;opacity:1!important
  }
}

/* A Morning 5 line that leads somewhere shows it. */
.morning5 .m5link{text-decoration:none;color:inherit}
.morning5 .m5link::after{content:" ›";color:var(--accent);font-weight:700}
.morning5 .m5link:hover{color:var(--accent)}

/* A line of provenance or correction, at the foot of a piece. */
.ednote{
  margin:14px 0 0;font:.78rem var(--f-ui);font-style:italic;color:var(--muted);
  padding-top:10px;border-top:1px dotted var(--line)
}
.story .ednote{margin-top:10px;padding-top:8px}

/* On a story told by a person, the picture sits in the text and the words
   wrap around it, the way a printed feature reads. */
.sheet-feature .artfig-full{
  float:right;width:44%;margin:6px 0 18px 26px;border-radius:10px
}
.sheet-feature .artfig-full figcaption{padding:8px 2px 0}
.sheet-feature::after{content:"";display:block;clear:both}
.sheet-feature .storybody{overflow:visible}

@media(max-width:800px){
  /* Too narrow to wrap: let the picture run full width again. */
  .sheet-feature .artfig-full{float:none;width:100%;margin:18px 0 4px}
}

/* ---------- share ---------- */

.share{
  display:flex;flex-wrap:wrap;align-items:center;gap:10px;
  margin:24px 0 0;padding:16px 18px;
  background:var(--paper);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)
}
.share-label{font:700 .82rem var(--f-ui);color:var(--muted);margin-right:2px}
.share .btn{font-size:.85rem}
.share-wa{background:#25683f;border-color:#25683f;color:#fff}
.share-wa:hover{background:var(--accent);border-color:var(--accent);color:#fff}
.share .copied{color:#0f5132;font:700 .82rem var(--f-ui)}
@media(max-width:520px){
  .share{padding:14px}
  .share .btn{flex:1 1 auto;justify-content:center}
}
.share-pdf{background:var(--accent);border-color:var(--accent);color:#fff}
.share-pdf:hover{background:var(--green-ink,#315b4b);border-color:var(--green-ink,#315b4b);color:#fff}

/* ---------- sources, collected ---------- */

.sources{margin:10px 0 0}
/* Quiet on purpose: this is an obligation, not a feature, and it sits with
   the disclaimer rather than competing with the edition. */
.sources{text-align:center}
.sources>summary{
  display:inline-flex;align-items:center;gap:.35rem;cursor:pointer;list-style:none;
  font:600 .74rem var(--f-ui);color:var(--muted);
  border:1px solid var(--line);border-radius:999px;padding:.35em .9em;background:transparent
}
.sources>summary::-webkit-details-marker{display:none}
.sources>summary:hover{border-color:var(--muted);color:var(--ink)}
.sources>summary::after{content:" ▾"}
.sources[open]>summary::after{content:" ▴"}
.sources ol{
  margin:12px auto 0;max-width:36rem;text-align:left;padding:14px 18px 14px 34px;
  background:var(--paper);border:1px solid var(--line);border-radius:12px;
  font-size:.88rem;line-height:1.55
}
.sources li{margin-bottom:10px}
.sources li:last-child{margin-bottom:0}
.sources .s-head{color:var(--ink)}
.sources .s-name{display:block;font:.82rem var(--f-ui);color:var(--muted);margin-top:2px}
.sources .s-name a{color:var(--accent)}

/* An audio clip belonging to a piece. */
.clip{
  background:var(--green-soft,#eef4f0);border:1px solid #cfded5;border-radius:10px;
  padding:10px 12px;margin:0 0 12px
}
.clip-label{margin:0 0 7px;font:600 .82rem var(--f-ui);color:var(--green-ink,#315b4b)}
.clip audio{width:100%;display:block}
.sheet .clip{margin:16px 0}
