/* Colors are taken from the printed paper: the blue of the masthead, the red of the motto,
   the yellow of the information strip under the title. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Lexend";
  src: url("/fonts/lexend-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Lexend";
  src: url("/fonts/lexend-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #141a33;
  --ink-soft: #4a5070;
  --blue: #23378f;
  --blue-deep: #172566;
  --blue-wash: #edf0fa;
  --red: #d4151d;
  --red-deep: #a80f15;
  --yellow: #fff2a8;
  --display: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --text: "Lexend", "Helvetica Neue", Arial, sans-serif;
  --page: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a { color: var(--blue); text-underline-offset: 0.18em; }

a:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

/* The masthead: the valley photo from the printed masthead, tinted with the paper's blue. */
.masthead {
  position: relative;
  background:
    linear-gradient(180deg, rgb(23 37 102 / 0.62) 0%, rgb(35 55 143 / 0.35) 38%, rgb(35 55 143 / 0.55) 70%, var(--blue) 100%),
    url("/valle-1200.webp") center 30% / cover no-repeat,
    var(--blue);
  color: #fff;
}

@media (min-width: 900px) {
  .masthead {
    background:
      linear-gradient(180deg, rgb(23 37 102 / 0.62) 0%, rgb(35 55 143 / 0.3) 38%, rgb(35 55 143 / 0.5) 70%, var(--blue) 100%),
      url("/valle-2400.webp") center 38% / cover no-repeat,
      var(--blue);
  }
}

/* Pages without the photo credit in the footer must not show the photo (CC BY-SA). */
.masthead.plain { background: var(--blue); }

.masthead-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(36px, 7vw, 72px) 16px clamp(28px, 5vw, 44px);
}

.masthead h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 11.5vw, 8.25rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 18px rgb(10 18 60 / 0.35);
}

.masthead-inner { position: relative; }

.masthead-link {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 1px solid rgb(255 255 255 / 0.6);
  border-radius: 999px;
  color: #fff;
  font-size: 0.95rem;
  text-decoration: none;
}

.masthead-link:hover, .masthead-link:focus-visible { background: rgb(255 255 255 / 0.14); }

@media (min-width: 800px) {
  .masthead-link { position: absolute; top: 24px; right: 16px; margin: 0; }
}

.masthead-line {
  margin: 18px 0 0;
  max-width: 48em;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: rgb(255 255 255 / 0.92);
}

main { display: block; }


/* Latest issue */
.latest {
  display: grid;
  gap: 28px;
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.front-page {
  display: block;
  justify-self: center;
  width: 100%;
  max-width: 560px;
}

.front-page img {
  width: 100%;
  background: #fff;
  border: 1px solid #d9dce8;
  box-shadow: 0 1px 2px rgb(20 26 51 / 0.12), 0 18px 40px -12px rgb(20 26 51 / 0.35);
}

.latest-text h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
  color: var(--blue);
}

.volume {
  margin: 10px 0 28px;
  color: var(--ink-soft);
}

.download {
  display: inline-block;
  padding: 16px 24px 14px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.25;
  text-decoration: none;
  border-radius: 6px;
}

.download span {
  display: block;
  font-weight: 400;
  font-size: 0.95rem;
  color: rgb(255 255 255 / 0.88);
}

.download:hover, .download:focus-visible { background: var(--red-deep); }

.free-note {
  margin: 28px 0 0;
  padding: 14px 18px;
  max-width: 34em;
  background: var(--yellow);
  border-left: 4px solid var(--blue);
  font-size: 1rem;
}

.zoom-hint {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

@media (min-width: 1000px) {
  .latest {
    grid-template-columns: 560px 1fr;
    gap: 56px;
    align-items: start;
    padding-top: 0;
  }

  /* The front page rises out of the blue band, like a copy pulled from the stack.
     The band gets the same extra height, so the page never covers its text. */
  .masthead-inner { padding-bottom: 170px; }
  .front-page { margin-top: -130px; justify-self: start; position: relative; }

  .latest-text { position: sticky; top: 24px; padding-top: 40px; }
}

/* Archive */
.archive { background: var(--blue-wash); }

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

.archive-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1;
  color: var(--blue);
}

.archive-head p {
  margin: 10px 0 0;
  max-width: 36em;
  color: var(--ink-soft);
}

.year {
  display: grid;
  gap: 12px;
  margin-top: 40px;
}

.year h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--blue-deep);
}

@media (min-width: 800px) {
  .year { grid-template-columns: 140px 1fr; gap: 24px; }
  .year h3 { position: sticky; top: 20px; align-self: start; font-size: 3rem; }
}

.covers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 16px;
}

@media (min-width: 560px) { .covers { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .covers { grid-template-columns: repeat(5, 1fr); } }

.cover {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.cover img {
  width: 100%;
  background: #fff;
  border: 1px solid #d3d8ea;
  box-shadow: 0 1px 3px rgb(20 26 51 / 0.12);
}

.cover:hover img, .cover:focus-visible img { border-color: var(--blue); }

.cover-month {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
}

.cover-file {
  display: block;
  font-size: 0.9rem;
  color: var(--blue);
}

/* Advertising: the red of the printed motto */
.spazio { background: var(--red); color: #fff; }

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

.spazio h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 7.5vw, 3rem);
  line-height: 1.05;
}

.spazio p { margin: 14px 0 0; max-width: 36em; }

/* Footer */
footer {
  background: var(--ink);
  color: rgb(255 255 255 / 0.82);
  font-size: 1rem;
}

footer p {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 16px 8px;
}

.footer-name {
  padding-top: 36px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.8rem;
  color: #fff;
}

footer .credit { font-size: 0.85rem; color: rgb(255 255 255 / 0.6); }
footer .credit a { color: inherit; }

footer .privacy { padding-bottom: 40px; font-size: 0.92rem; color: rgb(255 255 255 / 0.65); }

.not-found { padding: 56px 16px; }

/* Statistics page */
.stats-masthead .masthead-inner { padding-bottom: 36px; }
.stats-masthead h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); }
.stats-back { margin: 0 0 10px; }
.stats-back a { color: #fff; }

.stats {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.stats-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stats-numbers div {
  padding: 18px 20px;
  background: var(--blue-wash);
  border-top: 4px solid var(--blue);
}

.stats-numbers b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  color: var(--blue);
}

.stats-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.stats-list h3, .stats-table h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--blue-deep);
}

.stats-list ol { list-style: none; margin: 0; padding: 0; }

.stats-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #e3e6f1;
}

.stats-empty, .stats-note { color: var(--ink-soft); font-size: 0.95rem; }

.stats-table { margin-top: 36px; overflow-x: auto; }
.stats-table table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.stats-table th, .stats-table td { padding: 8px 10px; border-bottom: 1px solid #e3e6f1; text-align: right; }
.stats-table th:first-child { text-align: left; }
.stats-table thead th { font-weight: 600; color: var(--ink-soft); }
.stats-table tr.current { background: var(--yellow); }
.not-found h2 { font-family: var(--display); font-size: 2.4rem; color: var(--blue); margin: 0 0 12px; }

@media (prefers-reduced-motion: no-preference) {
  .cover img { transition: border-color 0.15s ease; }
}
