@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700&family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap");

:root {
  --bg-page: #ffffff;
  --bg-page-image: url("./images/blue-dash.gif");
  --bg-sheet: #ffffff;
  --bg-sheet-alt: #fafaf0;
  --bg-well: #ffffff;
  --bg-quote: #fcf7f4;
  --ink: #333333;
  --ink-soft: #555555;
  --ink-faint: #999999;
  --ink-invert: #ffffff;
  --rule: #808080;
  --rule-soft: #cccccc;
  --rule-hair: #cccccc;
  --accent: #e7651a;
  --accent-soft: rgba(231, 101, 26, 0.1);
  --accent-ink: #990000;
  --link: #990000;
  --quote-border: #ebd4c8;
  --shadow-sheet: none;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "PT Serif", Georgia, "Times New Roman", serif;
  --font-mono: Courier, "Courier New", monospace;
  --sheet-pad: clamp(1rem, 2.5vw, 2.25rem);
  --bg-selection: rgba(231, 101, 26, 0.18);
}

[data-theme="dark"] {
  --bg-page: #ffffff;
  --bg-page-image: url("./images/blue-dash.gif");
  --bg-sheet: #241f1c;
  --bg-sheet-alt: #2e2824;
  --bg-well: #1c1916;
  --bg-quote: #3a2c26;
  --ink: #e8e4df;
  --ink-soft: #c4bdb4;
  --ink-faint: #8a8278;
  --ink-invert: #1a1614;
  --rule: #6a635c;
  --rule-soft: rgba(232, 228, 223, 0.22);
  --rule-hair: rgba(232, 228, 223, 0.14);
  --accent: #e7651a;
  --accent-soft: rgba(231, 101, 26, 0.16);
  --accent-ink: #e8a0a0;
  --link: #e8a0a0;
  --quote-border: #6b4a3a;
  --shadow-sheet: none;
  --bg-selection: rgba(231, 101, 26, 0.28);
}

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

::selection {
  background-color: var(--bg-selection);
  color: inherit;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0 0 5px 0;
  background-color: var(--bg-page);
  background-image: var(--bg-page-image);
  background-repeat: repeat;
  border-top: 10px solid var(--accent);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
  max-width: 100%;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

a:hover {
  text-decoration: underline;
}

.page-container {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0 0 4rem;
}

/* Emma chrome sits on the dash field; the newspaper is the .post panel.
   Wide screens use the live blog override: max-width 60%, auto side
   margins. Do not restore the old 1180px sheet cap. */
.site-header {
  position: relative;
  z-index: 2;
  width: auto;
  color: #333333;
  padding-top: 1px;
  margin-top: 24pt;
  margin-bottom: 10pt;
  overflow: visible;
  font-size: 17px;
  line-height: normal;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

.site-header-portrait {
  float: left;
  padding-right: 12px;
  margin-left: 12pt;
}

.site-header-portrait img {
  display: block;
  box-sizing: content-box;
  width: 120px;
  height: 148px;
  border: 1px solid #000000;
}

.site-header-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2em;
  line-height: normal;
  color: #333333;
  margin: 0;
  padding-top: 1pt;
}

.site-header-tagline {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.17em;
  color: #808080;
  line-height: normal;
  margin: 0 0 1em;
  padding-top: 0;
}

.site-header-nav {
  font-family: var(--font-body);
  font-size: 90%;
  color: #990000;
  line-height: normal;
  margin: 0 0 1em;
}

.site-header-nav a {
  color: #990000;
  text-decoration: underline;
  text-underline-offset: auto;
}

/* Portrait hangs over the newspaper’s top hairline — that line is the sheet border. */
.newspaper-sheet {
  position: relative;
  z-index: 1;
  width: auto;
  background: var(--bg-sheet);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sheet);
  padding: var(--sheet-pad);
  padding-bottom: 0.4rem;
  margin-top: -10pt;
  overflow: visible;
}

.newspaper-sheet .masthead {
  clear: both;
}

.copyright {
  clear: both;
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
  font-size: 11px;
  margin-top: 5px;
  text-align: center;
  color: #999999;
}

.copyright a {
  color: #990000;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.masthead {
  position: relative;
  text-align: center;
  padding-bottom: 0.45rem;
}

.masthead-eyebrow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 0.35rem;
}

.masthead-eyebrow-left {
  text-align: left;
}

.masthead-eyebrow-center {
  text-align: center;
  font-style: normal;
  color: var(--link);
  letter-spacing: 0.04em;
}

.masthead-eyebrow-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  text-align: right;
  justify-self: end;
}

#theme-toggle {
  width: auto;
  height: auto;
  padding: 0.2rem;
  color: var(--ink-faint);
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

#theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle-icon .sun {
  display: none;
}

.theme-toggle-icon .moon {
  display: inline-block;
}

[data-theme="dark"] .theme-toggle-icon .sun {
  display: inline-block;
}

[data-theme="dark"] .theme-toggle-icon .moon {
  display: none;
}

.masthead-brand {
  display: block;
  margin: 0.15rem 0 0.15rem;
}

.masthead-brand-copy {
  text-align: center;
}

.masthead-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 5vw, 3.85rem);
  letter-spacing: 0;
  margin: 0;
  line-height: 1.02;
  color: var(--ink);
}

.masthead-tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin: 0.15rem 0 0;
}

.masthead-rule-thick {
  border: none;
  border-top: 4px double var(--rule);
  margin: 1.1rem 0 0.32rem;
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px dashed var(--rule-soft);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  position: relative;
}

.filter-options {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.filter-mobile-trigger {
  display: none;
}

.source-filter,
.interest-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  font-style: italic;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: normal;
  margin-right: 0.6rem;
}

.filter-label::after {
  content: ":";
}

.filter-btn {
  background-color: var(--bg-sheet);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0;
}

.filter-btn:hover {
  color: var(--ink);
  background-color: var(--bg-well);
  border-color: var(--accent);
}

.filter-btn.active,
.filter-btn.active:hover,
.filter-btn.active:focus {
  color: #ffffff;
  background-color: var(--accent);
  border-color: var(--accent);
}

.no-stories-message {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--rule-hair);
}

.newspaper-columns {
  column-count: 3;
  column-gap: 1.6rem;
  column-rule: 1px solid var(--rule-hair);
}

.story {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--rule-hair);
}

.story:last-child {
  border-bottom: none;
}

.story.is-lead,
.story.is-feature {
  column-span: all;
  padding: 1.1rem 0 1rem;
  border-bottom: 1px dashed var(--rule-soft);
  margin-bottom: 1.5rem;
}

.story.is-lead::before,
.story.is-feature::before {
  display: block;
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #e7651a;
}

.story.is-lead::before {
  content: "• Top Story";
}

.story.is-feature::before {
  content: "• Featured";
}

.story-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.32;
  letter-spacing: 0.005em;
  margin: 0 0 0.4rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px dashed var(--rule-soft);
}

.story-headline a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.story-headline a:hover {
  color: var(--link);
  text-decoration: none;
}

.story.is-lead .story-headline {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
}

.story.is-feature .story-headline {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
}

.story:not(.is-lead):not(.is-feature) .story-headline {
  font-size: 1rem;
  line-height: 1.22;
}

.story-byline {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.story-source-sep {
  margin: 0 0.35em;
}

.story-source-link {
  color: #e7651a;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  border-bottom: none;
}

.story-source-link:hover {
  color: #e7651a;
  border-bottom: none;
}

.story-deck {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 0.7rem;
  background-color: var(--bg-quote);
  border: 1px solid var(--quote-border);
  border-left: 4px solid var(--accent);
  padding: 0.55rem 0.75rem;
}

.story.is-lead .story-deck,
.story.is-feature .story-deck {
  font-size: 0.98rem;
  margin: 0.15rem 0 0.85rem;
  padding: 0.7rem 0.9rem;
}

.story-body {
  font-size: 0.92rem;
  line-height: 1.55;
}

.story:not(.is-lead):not(.is-feature) .story-body {
  font-size: 0.9rem;
}

.story.is-lead .story-body,
.story.is-feature .story-body {
  font-size: 0.98rem;
}

.story.is-lead .story-body {
  column-count: 2;
  column-gap: 1.75rem;
}

.story-body p {
  margin: 0 0 0.6em;
}

.story-body p:last-child {
  margin-bottom: 0;
}

.story.is-lead .story-body > p:first-child::first-letter {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  float: left;
  font-size: 2.6em;
  line-height: 0.82;
  padding: 0.03em 0.08em 0 0;
  color: #e7651a;
}

.edition-colophon {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 4px double var(--rule);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.edition-colophon a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.edition-colophon a:hover {
  color: var(--link);
}

[data-hidden="true"] {
  display: none !important;
}

/* Live blog width: 60% column on desktop, 10px insets on phones.
   Matches #header / .post in https://indrayam.com/style.css */
@media screen and (min-width: 900px) {
  .site-header {
    margin-left: auto;
    margin-right: auto;
    max-width: 60%;
  }

  .newspaper-sheet {
    margin-left: auto;
    margin-right: auto;
    /* v1's 60% .post width excludes its 15px padding and 1px borders. */
    max-width: calc(60% + 32px);
  }
}

@media screen and (max-width: 899px) {
  .site-header,
  .newspaper-sheet {
    margin-left: 10px;
    margin-right: 10px;
    max-width: none;
  }
}

@media (max-width: 1000px) {
  .newspaper-columns {
    column-count: 2;
  }
}

@media (max-width: 720px) {
  .story.is-lead .story-body {
    column-count: 1;
  }
}

@media (max-width: 640px) {
  .newspaper-columns {
    column-count: 1;
  }
}

@media (max-width: 600px) {
  .newspaper-sheet {
    padding: 1.25rem 0.75rem 0.4rem;
  }

  .filter-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
  }

  .filter-label {
    font-size: 0.72rem;
  }

  .filter-mobile-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-sheet);
    border: 1px solid var(--rule);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    border-radius: 0;
  }

  .filter-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    margin-top: 0.35rem;
    background-color: var(--bg-sheet);
    border: 1px solid var(--rule);
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.25rem;
    min-width: 130px;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .interest-filter .filter-options {
    left: auto;
    right: 0;
  }

  .filter-group.open .filter-options {
    display: flex;
  }

  .filter-options .filter-btn {
    text-align: left;
    padding: 0.45rem 0.75rem;
    font-size: 0.72rem;
    width: 100%;
    border: none;
    background: transparent;
  }

  .filter-options .filter-btn.active,
  .filter-options .filter-btn.active:hover,
  .filter-options .filter-btn.active:focus {
    background-color: var(--accent);
    color: #ffffff;
  }
}

@media (max-width: 480px) {
  .masthead-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0;
  }

  .masthead-eyebrow-center {
    order: 3;
    width: 100%;
    padding-top: 0.25rem;
  }

  .masthead-eyebrow-left,
  .masthead-eyebrow-right {
    flex: 1 0 auto;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  * {
    print-color-adjust: exact !important;
  }

  html,
  body {
    background: var(--bg-sheet) !important;
    background-image: none !important;
    border-top: none !important;
  }

  #theme-toggle,
  .filter-bar,
  .no-stories-message {
    display: none !important;
  }

  .site-header {
    margin-bottom: 0.5rem;
  }

  .newspaper-sheet {
    box-shadow: none !important;
    border: none !important;
    margin-top: 0;
  }

  .newspaper-columns {
    column-count: 3 !important;
  }

  .story.is-lead .story-body {
    column-count: 2 !important;
  }
}
