@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/PlayfairDisplay-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/PlayfairDisplay-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("assets/fonts/CrimsonText-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("assets/fonts/CrimsonText-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("assets/fonts/CrimsonText-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("assets/fonts/CrimsonText-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("assets/fonts/LibreFranklin-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #f6efe0;
  --cream-paper: #faf4e8;
  --cream-dark: #e8d4b0;
  --ink: #2a2218;
  --ink-soft: #5c5348;
  --red: #b51218;
  --red-deep: #8e0e14;
  --blue: #3b68ac;
  --blue-deep: #2a4e86;
  --gold: #c4a035;
  --rule: #d2c0a0;
  --ad-bg: #e6dece;
  --ad-border: #b5a88f;
  --ad-text: #6b6256;
  --max: 1240px;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Crimson Text", "Palatino Linotype", Palatino, "Times New Roman", serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--blue-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--red);
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 20px 48px;
}

/* ----- Top row: logo + leaderboard ----- */

.top-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 8px 0 14px;
}

.logo {
  flex: 0 1 auto;
  display: block;
  line-height: 0;
  max-width: 320px;
}

.logo img {
  width: 180px;
  height: auto;
  border: 1px solid var(--cream-dark);
}

/* ----- Advertisement placeholders ----- */

.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.ad-placeholder {
  font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ad-text);
  user-select: none;
}

.ad-728x90 {
  width: 728px;
  height: 90px;
}

.ad-300x250 {
  width: 300px;
  height: 250px;
}

/* ----- Postcard header ----- */

.hero {
  margin: 0 0 28px;
  border: 1px solid var(--cream-dark);
  box-shadow: 0 1px 0 rgba(42, 34, 24, 0.04);
  background: var(--cream-dark);
  line-height: 0;
}

.hero img {
  width: 100%;
  height: auto;
}

/* ----- Main layout ----- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px 40px;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 8px;
}

.sidebar .ad-slot {
  margin-inline: auto;
}

/* ----- Article typography ----- */

.article h1 {
  font-family: "Playfair Display", "Palatino Linotype", Palatino, serif;
  font-weight: 700;
  font-size: 2.35rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--red-deep);
  margin: 0 0 0.7em;
  max-width: 18ch;
}

.article h2 {
  font-family: "Playfair Display", "Palatino Linotype", Palatino, serif;
  font-weight: 650;
  font-size: 1.55rem;
  line-height: 1.25;
  color: var(--blue-deep);
  margin: 1.7em 0 0.55em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--rule);
}

.article h2:first-of-type {
  margin-top: 1.1em;
}

.article p {
  margin: 0 0 1em;
  max-width: 42em;
}

.article .lede {
  font-size: 1.12rem;
  line-height: 1.65;
  max-width: 44em;
}

.article .lede::first-letter {
  font-family: "Playfair Display", "Palatino Linotype", Palatino, serif;
  font-weight: 700;
  font-size: 3.6rem;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.1em 0 0;
  color: var(--red);
}

.article ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
  max-width: 42em;
}

.article li {
  margin: 0 0 0.45em;
}

.article li strong {
  color: var(--ink);
}

/* ----- Figures ----- */

.article-figure {
  margin: 1.5em 0 1.8em;
  max-width: 100%;
  background: var(--cream-paper);
  border: 1px solid var(--rule);
  padding: 8px 8px 10px;
}

.article-figure img {
  width: 100%;
  height: auto;
  background: #ddd4c2;
}

.article-figure figcaption {
  padding: 0.65em 0.4em 0.15em;
}

.article-figure .caption {
  display: block;
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink);
}

.article-figure .credit {
  display: block;
  margin-top: 0.3em;
  font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.68rem;
  font-style: normal;
  line-height: 1.45;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.article-figure .credit a {
  color: var(--ink-soft);
}

.figure-wide {
  padding: 12px 8px 10px;
  background: #fbf6eb;
}

.figure-wide img {
  background: transparent;
}

/* ----- Credits table & sources ----- */

.credits,
.sources {
  margin-top: 2.4em;
}

.credits table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.45;
}

.credits th,
.credits td {
  text-align: left;
  vertical-align: top;
  padding: 0.55em 0.7em 0.55em 0;
  border-bottom: 1px solid var(--rule);
}

.credits th {
  font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.credits td:first-child {
  font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  white-space: nowrap;
  padding-right: 1em;
}

.credits th:last-child,
.credits td:last-child {
  white-space: nowrap;
}

.credits .table-wrap,
.credits {
  overflow-x: auto;
}

.sources ol {
  margin: 0;
  padding-left: 1.3em;
  max-width: 48em;
}

.sources li {
  margin: 0 0 0.4em;
  padding-left: 0.2em;
}

.sources a,
.credits a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ----- Bottom ad & footer ----- */

.bottom-ad {
  display: flex;
  justify-content: center;
  margin: 36px 0 28px;
}

.site-footer {
  border-top: 3px double var(--blue);
  padding: 1.3em 0 0;
  text-align: center;
  color: var(--ink-soft);
}

.site-footer .copyright {
  margin: 0 0 0.25em;
  font-family: "Playfair Display", "Palatino Linotype", Palatino, serif;
  font-size: 1rem;
  color: var(--ink);
}

.site-footer .disclaimer {
  margin: 0;
  font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

/* ----- Responsive ----- */

@media (max-width: 1100px) {
  .logo {
    max-width: 240px;
  }
  .logo img {
    width: 160px;
  }
}

@media (max-width: 980px) {
  html {
    font-size: 17px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 0;
  }

  .article h1 {
    max-width: none;
    font-size: 2rem;
  }
}

@media (max-width: 800px) {
  .page {
    padding: 10px 14px 36px;
  }

  .top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .logo {
    max-width: 100%;
  }

  .logo img {
    width: min(160px, 100%);
  }

  .ad-728x90 {
    width: 100%;
    max-width: 728px;
    height: auto;
    aspect-ratio: 728 / 90;
    align-self: stretch;
  }

  .bottom-ad {
    margin: 28px 0 22px;
  }

  .article h1 {
    font-size: 1.75rem;
  }

  .article .lede::first-letter {
    font-size: 3rem;
  }

  .credits td:first-child {
    white-space: normal;
  }
}

@media (max-width: 340px) {
  .ad-300x250 {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 300 / 250;
  }
}

@media print {
  .ad-slot,
  .sidebar,
  .bottom-ad,
  .top-row .ad-slot {
    display: none;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  body {
    background: #fff;
  }
}
