/* The Morning Dispatch: everything around the paper (the "desk").
   Top bar, desk surface, buttons, back-issues menu, hint, colophon, loading card and the reading glass.
   The newspaper pages themselves are styled in paper.css. */
:root {
  --desk: #241c17;          /* walnut desk */
  --desk-deep: #16110e;     /* top bar ink */
  --cream: #efe6cf;         /* newsprint */
  --cream-hi: #fff6dc;
  --cream-dim: #c9bb98;     /* faded type on the desk */
  --cream-faint: #8f8168;
  --brass: #d8b46a;         /* focus ring, small accents */
}
html { scrollbar-color: #6b5d4f var(--desk-deep); }
body {
  margin: 0; min-height: 100vh; color: var(--cream);
  display: flex; flex-direction: column; align-items: center;
  font-family: "Old Standard TT", Georgia, serif;
  background-color: var(--desk);
  /* faint wood grain + a lamp-lit center */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 35%, rgba(255, 214, 150, 0.07), transparent 70%),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.07) 0 2px, transparent 2px 9px, rgba(255, 255, 255, 0.015) 9px 10px, transparent 10px 23px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .5' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .06 0 0 0 0 .04 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

/* ---------- Top bar: a strip of ink with a double rule, like a masthead's edge ---------- */
.topline {
  position: sticky; top: 0; z-index: 20; width: 100%;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px 16px;
  padding: 9px 20px 10px; background: var(--desk-deep);
  border-bottom: 4px double rgba(239, 230, 207, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.brand { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name { font-family: "UnifrakturMaguntia", serif; font-size: 25px; color: var(--cream); white-space: nowrap; }
.brand-sub { font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--cream-faint); margin-top: 3px; }
.controls { display: flex; gap: 10px; align-items: center; justify-content: center; }
.tools { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }

/* Buttons: little letterpress tickets with a double ink border. */
.key {
  font-family: "Old Standard TT", Georgia, serif; font-size: 13.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: #1d1a16; background: var(--cream);
  border: 0; border-radius: 2px; padding: 8px 14px 7px; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 0 0 2px var(--cream), inset 0 0 0 3px #1d1a16, 0 2px 0 rgba(0, 0, 0, 0.45);
  transition: background 0.15s, transform 0.08s;
}
.key:hover { background: var(--cream-hi); }
.key:active { transform: translateY(1px); box-shadow: inset 0 0 0 2px var(--cream), inset 0 0 0 3px #1d1a16; }
.key.ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1px rgba(239, 230, 207, 0.6); }
.key.ghost:hover { background: rgba(239, 230, 207, 0.1); }
.key:focus-visible, .issues select:focus-visible, .x:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* "PAGE 1 OF 8" between two hairlines, like a folio line. */
.folio-tag {
  min-width: 150px; text-align: center; font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--cream-dim); padding: 4px 6px; border-top: 1px solid rgba(239, 230, 207, 0.35);
  border-bottom: 1px solid rgba(239, 230, 207, 0.35); white-space: nowrap;
}

/* Back issues menu */
.issues { display: flex; align-items: center; gap: 8px; }
.issues-lbl { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--cream-dim); white-space: nowrap; }
.issues select {
  appearance: none; -webkit-appearance: none; font-family: "Old Standard TT", Georgia, serif; font-size: 14px;
  color: #1d1a16; background-color: var(--cream); border: 0; border-radius: 2px; padding: 7px 30px 6px 11px; cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--cream), inset 0 0 0 3px #1d1a16, 0 2px 0 rgba(0, 0, 0, 0.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%231d1a16'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.issues select:hover { background-color: var(--cream-hi); }

/* ---------- The paper on the desk ---------- */
.stage { width: 100%; display: flex; justify-content: center; padding: 26px 16px 8px; }
#book { margin: 0 auto; }
#book .stf__item { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35); }

/* Hint under the paper, with an old printer's pointing hand. */
.hint { max-width: 760px; margin: 6px auto 0; padding: 0 16px; text-align: center; font-style: italic; font-size: 14.5px; color: var(--cream-dim); }
.hint .fist { font-style: normal; font-size: 18px; vertical-align: -1px; margin-right: 4px; color: var(--cream); }

/* Colophon: the small print at the very bottom. */
.colophon { margin: 34px auto 40px; padding: 0 16px; text-align: center; color: var(--cream-faint); }
.colophon .orn { font-size: 22px; color: var(--cream-dim); }
.colophon .colo-mast { font-family: "UnifrakturMaguntia", serif; font-size: 26px; color: var(--cream-dim); margin: 2px 0 6px; }
.colophon .colo-line { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; line-height: 1.8; }
.colophon .colo-line.small { letter-spacing: 0.08em; text-transform: none; font-style: italic; font-size: 13px; }

/* ---------- Loading card and notices (a telegram on the desk) ---------- */
.press-card {
  width: min(440px, calc(100vw - 32px)); margin: 70px auto; padding: 30px 30px 26px; text-align: center; color: #1d1a16;
  background: var(--cream); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); transform: rotate(-0.6deg);
}
.press-rule { border-top: 4px double #1d1a16; margin: 0 0 14px; }
.press-rule:last-child { margin: 16px 0 0; }
.press-head { font-weight: 700; font-style: italic; text-transform: uppercase; font-size: 28px; letter-spacing: 0.02em; line-height: 1.1; }
.press-sub { margin-top: 8px; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: #5c5244; }
.press-sub.plain { text-transform: none; letter-spacing: 0; font-size: 16px; line-height: 1.55; color: #3a332b; }
.dots i { font-style: normal; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.15; } 40% { opacity: 1; } }
.notice { display: contents; }

/* ---------- Reading glass: the story as a clipping ---------- */
.glass { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 48px 16px; background: rgba(14, 11, 9, 0.8); }
.glass.open { display: flex; animation: fadein 0.18s ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.clip {
  position: relative; width: 100%; max-width: 660px; padding: 0 44px 34px; color: #1d1a16;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  font-family: "Libre Caslon Text", Georgia, serif; transform: rotate(-0.5deg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
}
.clip-top { display: flex; justify-content: space-between; align-items: center; margin: 0 -44px 22px; padding: 12px 18px 10px 44px;
  border-bottom: 2px dashed rgba(29, 26, 22, 0.45); font-family: "Old Standard TT", serif; font-size: 11.5px;
  letter-spacing: 0.22em; text-transform: uppercase; color: #6b5f4d; }
.clip-top span::before { content: "\2702"; font-size: 15px; letter-spacing: 0; margin-right: 8px; vertical-align: -1px; }
.clip .x { position: static; font-family: "Old Standard TT", serif; font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: #1d1a16; background: transparent; border: 1px solid rgba(29, 26, 22, 0.5); border-radius: 2px;
  padding: 5px 10px 4px; cursor: pointer; white-space: nowrap; }
.clip .x:hover { background: rgba(29, 26, 22, 0.08); }
.clip h2 { font-family: "Old Standard TT", serif; font-weight: 700; text-transform: uppercase; text-align: center;
  font-size: 30px; line-height: 1.08; margin: 0 0 12px; padding: 0; text-wrap: balance; }
.clip .deck { font-family: "Old Standard TT", serif; text-align: center; font-size: 16.5px; line-height: 1.3; margin: 0; padding: 6px 0; text-wrap: balance; }
.clip .deck + .deck { border-top: 1px solid #1d1a16; font-style: italic; }
.clip .text { margin-top: 16px; padding-top: 16px; border-top: 4px double #1d1a16; font-size: 18px; line-height: 1.62; text-align: justify; hyphens: auto; }
.clip .text p { margin: 0 0 13px; }
.clip .text p:first-child::first-letter { float: left; font-family: "Old Standard TT", serif; font-weight: 700; font-size: 58px; line-height: 0.82; padding: 6px 8px 0 0; }
.clip .text b { font-variant: small-caps; letter-spacing: 0.04em; }
.clip .src { margin-top: 20px; padding: 12px 14px; border: 1px solid rgba(29, 26, 22, 0.55); font-family: "Old Standard TT", serif; font-size: 14px; line-height: 1.7; }
.clip .src b { display: block; font-size: 11.5px; letter-spacing: 0.24em; text-transform: uppercase; margin-bottom: 2px; }
.clip .src a { color: #1d1a16; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.clip .src a:hover { background: rgba(216, 180, 106, 0.3); }

/* ---------- Phones and narrow windows ---------- */
@media (max-width: 1250px) {
  .topline { grid-template-columns: 1fr auto; padding: 8px 12px; }
  .controls { grid-column: 1 / -1; grid-row: 2; }
  .brand-name { font-size: 21px; }
  .issues-lbl { display: none; }
}
@media (max-width: 520px) {
  .brand { display: none; }
  .topline { grid-template-columns: 1fr; }
  .tools { justify-content: center; }
  .issues select { font-size: 13.5px; max-width: 62vw; }
  .colophon .colo-line { letter-spacing: 0.1em; }
  .key .lbl { display: none; }
  .key { padding: 8px 13px 7px; }
  .folio-tag { min-width: 120px; letter-spacing: 0.18em; }
  .clip { padding: 0 20px 26px; transform: none; }
  .clip-top { margin: 0 -20px 18px; padding-left: 20px; letter-spacing: 0.14em; gap: 10px; }
  .clip h2 { font-size: 23px; }
  .clip .text { font-size: 16.5px; }
  .glass { padding: 20px 10px; }
}

/* Photo in the reading glass: larger, uncropped, still black and white. */
.clip-photo { margin: 16px 0 0; }
.clip-photo img { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #e4d8b9;
  filter: grayscale(1) contrast(1.2) brightness(1.03); mix-blend-mode: multiply; border: 1px solid #1d1a16; }
.clip-photo figcaption { margin-top: 6px; font-family: "Old Standard TT", serif; font-style: italic; font-size: 14.5px; line-height: 1.4; }
.clip-photo figcaption span { display: block; font-style: normal; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #6b5f4d; margin-top: 2px; }
.clip-photo figcaption a { color: inherit; }
a.key { text-decoration: none; display: inline-block; }

/* ---------- Text edition (for readers without JavaScript, search engines and link previews) ---------- */
.js .static-ed { display: none; }
html:not(.js) .press-card, html:not(.js) .controls, html:not(.js) #view, html:not(.js) .issues, html:not(.js) .hint { display: none; }
.static-ed { width: min(860px, calc(100vw - 32px)); margin: 0 auto; padding: 28px 34px; color: #1d1a16; background: var(--cream);
  font-family: "Libre Caslon Text", Georgia, serif; font-size: 17px; line-height: 1.55; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }
.static-ed .static-note { margin: 0 0 14px; padding: 8px 12px; border: 1px solid #1d1a16; font-style: italic; font-size: 15px; }
.static-ed header { text-align: center; border-bottom: 4px double #1d1a16; margin-bottom: 14px; }
.static-ed .static-mast { font-family: "UnifrakturMaguntia", serif; font-size: 44px; line-height: 1.1; margin: 0; }
.static-ed header p { margin: 4px 0 10px; font-family: "Old Standard TT", serif; letter-spacing: 0.08em; }
.static-ed h2 { font-family: "UnifrakturMaguntia", serif; font-weight: 400; font-size: 30px; margin: 24px 0 8px; border-bottom: 1px solid #1d1a16; }
.static-ed h3 { font-family: "Old Standard TT", serif; text-transform: uppercase; font-size: 20px; line-height: 1.15; margin: 16px 0 4px; }
.static-ed .deck, .static-ed .by { font-family: "Old Standard TT", serif; font-style: italic; margin: 0 0 6px; }
.static-ed .src { font-size: 14px; color: #5c5244; }
.static-ed .src a, .static-ed nav a { color: #1d1a16; }
.static-ed figure { margin: 8px 0; }
.static-ed img { display: block; width: 100%; height: auto; max-height: 380px; object-fit: cover; object-position: 50% 25%; filter: grayscale(1); }
.static-ed figcaption { font-size: 13.5px; font-style: italic; }
.static-ed nav { margin-top: 26px; padding-top: 12px; border-top: 4px double #1d1a16; font-size: 15px; }

/* ---------- Preview-card mode (?card=1): only the top of the front page ---------- */
.card .topline, .card .hint, .card .colophon { display: none; }
.card .stage { padding: 0; }
.card body { overflow: hidden; }
/* Links in the top bar (About page's "Back to today's paper") always show, with or without JavaScript. */
html:not(.js) .controls:has(a.key) { display: flex; }

/* ---------- Home Delivery coupon (below the paper; never over it) ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html { scroll-behavior: smooth; }
.delivery { width: 100%; display: flex; justify-content: center; padding: 30px 16px 0; scroll-margin-top: 90px; }
.coupon { position: relative; width: min(560px, 100%); padding: 22px 26px 18px; text-align: center; color: #1d1a16; background: var(--cream);
  border: 2px dashed #1d1a16; outline: 6px solid var(--cream); box-shadow: 0 0 0 7px rgba(0,0,0,0.25), 0 12px 30px rgba(0,0,0,0.45); transform: rotate(-0.4deg); }
.coupon-cut { position: absolute; top: -15px; left: 22px; font-size: 22px; background: var(--cream); padding: 0 4px; line-height: 1; color: #1d1a16; }
.coupon h2 { margin: 0; font-family: "UnifrakturMaguntia", serif; font-weight: 400; font-size: 34px; line-height: 1.1; }
.coupon-sub { margin: 4px 0 14px; font-style: italic; font-size: 16px; }
#delivery-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#delivery-form input { flex: 1 1 240px; max-width: 320px; font: 16px "Libre Caslon Text", Georgia, serif; color: #1d1a16; background: #fffaf0;
  border: 1px solid #1d1a16; border-radius: 2px; padding: 8px 10px; }
#delivery-form input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
#delivery-form .key { box-shadow: inset 0 0 0 2px var(--cream), inset 0 0 0 3px #1d1a16; background: #1d1a16; color: var(--cream); }
#delivery-form .key:hover { background: #3a332b; }
#delivery-form.sent { display: none; }
.coupon-msg { min-height: 1.2em; margin: 10px 0 0; font-size: 15.5px; line-height: 1.45; }
.coupon-fine { margin: 10px 0 0; font-size: 13px; color: #5c5244; }
@media (max-width: 520px) { .coupon { padding: 20px 16px 16px; } .coupon h2 { font-size: 30px; } #delivery-form .key { width: 100%; } }
html:not(.js) .delivery, html:not(.js) #delivery-link { display: none; }
/* Until approved, the rating and Home Delivery only show with ?preview=readers */
html:not(.readers-on) .rate, html:not(.readers-on) .delivery, html:not(.readers-on) #delivery-link { display: none !important; }

/* Quiet text links in the top bar (Home Delivery, About): no box, so the bar stays balanced. */
.toplink { font-family: "Old Standard TT", Georgia, serif; font-size: 12.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cream-dim); text-decoration: none; padding: 4px 2px; border-bottom: 1px solid transparent; white-space: nowrap; }
.toplink:hover { color: var(--cream); border-bottom-color: rgba(239, 230, 207, 0.6); }
.toplink:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.tools { gap: 14px; }
.tools .toplink + .toplink { position: relative; }
.tools .toplink + .toplink::before { content: "\00b7"; position: absolute; left: -10px; color: var(--cream-faint); }
/* Left side: the paper's name, then the quiet links, so the bar is balanced around the page controls. */
.topline > .left { display: flex; align-items: center; gap: 22px; min-width: 0; }
.quick { display: flex; gap: 14px; }
.quick .toplink + .toplink { position: relative; }
.quick .toplink + .toplink::before { content: "\00b7"; position: absolute; left: -10px; color: var(--cream-faint); }
@media (max-width: 1500px) { .issues-lbl { display: none; } }
@media (max-width: 1360px) { .topline { grid-template-columns: 1fr auto; } .topline .controls { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 640px) { .topline > .left { justify-content: center; } .quick { gap: 18px; } }
/* Phones: links, then back issues, then the page buttons, each on its own centered row. */
@media (max-width: 640px) {
  .topline { grid-template-columns: 1fr; gap: 8px; }
  .topline > .left { grid-column: 1; grid-row: 1; justify-content: center; }
  .topline .tools { grid-column: 1; grid-row: 2; justify-content: center; }
  .topline .controls { grid-column: 1; grid-row: 3; }
  .toplink { font-size: 12px; letter-spacing: 0.14em; }
}
