:root {
  --ink: #1a1a1a;
  --accent: #8B1A1A;
  --muted: #666;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #ffffff;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body {
  display: flex;
  flex-direction: column;
}

.masthead {
  flex: 0 0 auto;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 20px 0;
}
.masthead-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: var(--accent);
  letter-spacing: 0.5px;
  line-height: 1;
}
.header-right {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
.edition-info {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  line-height: 1.4;
}
#archive-select {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  cursor: pointer;
}
.rule {
  border-bottom: 2px solid var(--accent);
  margin-top: 6px;
}

main {
  flex: 1 1 auto;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 20px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#pdf-viewer {
  flex: 1 1 auto;
  width: 100%;
  border: 1px solid #d8d8d8;
  background: #fff;
}
#mobile-card { display: none; }

footer {
  flex: 0 0 auto;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 20px 10px;
  text-align: center;
  border-top: 1px solid #ddd;
}
footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
footer .links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}
footer .links a:hover { color: var(--accent); border-color: var(--accent); }
.copyright { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
  html, body { overflow: auto; height: auto; }
  body { min-height: 100vh; }

  .masthead { padding: 16px 16px 0; }
  .masthead-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .brand { font-size: 26px; }
  .header-right {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  .edition-info { text-align: left; font-size: 12px; }
  #archive-select { font-size: 14px; padding: 8px 10px; }

  main {
    padding: 16px;
    display: block;
  }

  /* Hide the broken iframe on mobile, show the card instead */
  #pdf-viewer { display: none; }
  #mobile-card {
    display: block;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    padding: 28px 20px;
    text-align: center;
    background: #fafafa;
  }
  .mc-label {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .mc-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 17px;
    padding: 14px 28px;
    border-radius: 6px;
    letter-spacing: 0.03em;
  }
  .mc-btn:active { background: #6b1414; }
  .mc-hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
  }

  footer { padding: 16px; }
  footer .links { gap: 12px; font-size: 13px; }
}
