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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: #f7f8fa;
  color: #1a1a1a;
  line-height: 1.6;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

/* ─── Site masthead ─────────────────────────────────── */
.site-masthead {
  background: linear-gradient(160deg, #1a2a4a 0%, #1e3461 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

/* US flag stripe */
.site-masthead::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(to right,
    #b22234 0 33.33%,
    #ffffff 33.33% 66.66%,
    #3c3b6e 66.66% 100%);
}

.masthead-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 0;
  position: relative;
}

.masthead-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.masthead-branding h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.masthead-branding h1 a {
  color: white;
  text-decoration: none;
}

.masthead-branding h1 a:hover { color: #c8d8f0; }

.masthead-subtitle {
  color: rgba(255,255,255,0.68);
  font-size: 0.85rem;
  margin-top: 5px;
}

.stat-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 9px;
  padding: 4px 11px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.stat-counter:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(212,175,55,0.8);
}

.stat-counter-value {
  font-family: 'Courier New', Courier, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  font-weight: 700;
  color: #d4af37;
  letter-spacing: 0.02em;
}

.stat-counter-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.62);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* White House silhouette SVG — positioned bottom-right of masthead-inner */
.wh-silhouette {
  fill: white;
  opacity: 0.13;
  position: absolute;
  right: 0;
  bottom: 0;
  width: 210px;
  height: auto;
  pointer-events: none;
}

/* Nav tabs */
.site-nav {
  display: flex;
  gap: 0;
  margin-top: 18px;
  position: relative;
  z-index: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  display: block;
  flex-shrink: 0;
  padding: 9px 16px 11px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover { color: rgba(255,255,255,0.9); }
.site-nav a.active { color: white; border-bottom-color: #d4af37; }

/* ─── Subscribe button ─────────────────────────────── */
.subscribe-btn {
  flex-shrink: 0;
  padding: 7px 13px;
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.45);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.81rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.subscribe-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.85);
}

.subscribe-btn:disabled,
.subscribe-btn[data-state="loading"],
.subscribe-btn[data-state="error"] {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.35);
  cursor: default;
}

/* ─── Report page slim nav ─────────────────────────── */
.masthead-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
}

.back-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover { color: white; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Share button + menu ───────────────────────────── */
.share-wrap { position: relative; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.45);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.icon-btn svg { width: 16px; height: 16px; }

.icon-btn:hover,
.icon-btn[aria-expanded="true"] {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.85);
}

.share-menu {
  /* Fixed (not absolute) so it isn't clipped by .site-masthead's
     overflow:hidden, which exists to crop the decorative flag stripe/WH
     silhouette — an absolutely-positioned dropdown inside that box would
     get cut off before it could render below the header. share.js sets
     top/right inline to anchor it under the share button. */
  position: fixed;
  min-width: 210px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.share-menu[hidden] { display: none; }

.share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: white;
  border: none;
  border-bottom: 1px solid #eee;
  color: #333;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.share-item:last-child { border-bottom: none; }
.share-item:hover { background: #f5f6f8; }
.share-item svg { width: 16px; height: 16px; flex-shrink: 0; color: #666; }
.share-item.copied { color: #1e8e3e; }
.share-item.copied svg { color: #1e8e3e; }

/* ─── Schedule page ────────────────────────────────── */
.schedule-list { display: flex; flex-direction: column; gap: 0; }

.schedule-day {
  padding: 24px 0;
  border-bottom: 1px solid #e8eaed;
}

.schedule-day-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.schedule-day-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.badge-updated {
  display: inline-block;
  padding: 2px 7px;
  background: #fef3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-list { display: flex; flex-direction: column; gap: 12px; }

.zone-header {
  align-self: flex-start;
  padding: 3px 8px;
  background: #f1f3f4;
  color: #5f6368;
  border: 1px solid #dadce0;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0 14px;
  font-size: 0.9rem;
}

.event-time {
  font-weight: 600;
  color: #333;
  padding-top: 1px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.event-desc { color: #1a1a1a; line-height: 1.45; }

.event-details {
  margin-top: 2px;
  font-size: 0.8rem;
  color: #888;
}

.schedule-source-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.82rem;
  color: #c0392b;
  text-decoration: none;
}

.schedule-source-link:hover { text-decoration: underline; }

/* ─── Live indicator ────────────────────────────────── */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  color: #8a8f98;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c0392b;
  animation: live-pulse 1.8s ease-in-out infinite;
}

.live-label {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #c0392b;
}

.live-sep { color: #c8ccd1; }

@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.45; }
}

/* ─── Report list ──────────────────────────────────── */
.report-list { display: flex; flex-direction: column; }

.report-card {
  padding: 20px 0;
  border-bottom: 1px solid #e8eaed;
}

.report-card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.4;
}

.report-card h2 a {
  color: #1a1a1a;
  text-decoration: none;
}

.report-card h2 a:hover {
  color: #c0392b;
  text-decoration: underline;
}

.meta {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 8px;
}

.sender { color: #999; }

.excerpt {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.55;
}

.empty {
  text-align: center;
  color: #888;
  padding: 64px 0;
  font-size: 1rem;
}

/* ─── Pagination ───────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e2e4e8;
  font-size: 0.88rem;
}

.pagination a {
  color: #c0392b;
  text-decoration: none;
  font-weight: 500;
}

.pagination a:hover { text-decoration: underline; }
.page-info { color: #888; }

/* ─── Photo gallery ────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.photo-card {
  margin: 0;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.photo-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}

.photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #f0f1f3;
}

.photo-card figcaption {
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #444;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.88);
}

.lightbox:not([hidden]) {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-caption {
  max-width: 800px;
  color: #eee;
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}

/* ─── Full report ──────────────────────────────────── */
.full-report { padding-top: 4px; }

.full-report h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.report-body {
  font-family: inherit;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.75;
  color: #222;
  margin-top: 24px;
}

.report-body-html {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #222;
  margin-top: 24px;
}

.report-body-html img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px 0;
}

/* Small inline icons (e.g. the attachments paperclip) carry an explicit
   width attribute — content images extracted from emails never do — so
   this overrides the block-display rule above just for those. */
.report-body-html img[width] {
  display: inline-block;
  vertical-align: middle;
  height: auto;
  margin: 0;
}

.report-body-html p { margin-bottom: 1em; }
.report-body-html h1, .report-body-html h2, .report-body-html h3 { margin: 1.2em 0 0.5em; }
.report-body-html ul, .report-body-html ol { margin: 0.5em 0 1em 1.5em; }
.report-body-html blockquote { border-left: 3px solid #ddd; margin: 1em 0; padding-left: 1em; color: #555; }
.report-body-html table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.report-body-html td, .report-body-html th { border: 1px solid #e0e0e0; padding: 6px 10px; }

/* ─── About page ──────────────────────────────────── */
.about-page { padding-top: 12px; }

.about-page h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 32px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e8eaed;
}

.about-page h2:first-child { margin-top: 8px; }

.about-page p {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.75;
  margin-bottom: 14px;
}

.about-page a { color: #c0392b; }
.about-page a:hover { text-decoration: underline; }

/* ─── Search ───────────────────────────────────────── */
.search-form-wrap {
  padding: 24px 0 8px;
  border-bottom: 1px solid #e8eaed;
  margin-bottom: 8px;
}

.search-fields {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-field-keyword { flex: 1 1 220px; }
.search-field-date    { flex: 0 0 auto; }
.search-field-submit  { flex: 0 0 auto; }

.search-field input[type="search"],
.search-field input[type="date"] {
  height: 38px;
  padding: 0 10px;
  border: 1.5px solid #d0d3d8;
  border-radius: 4px;
  font-size: 0.92rem;
  font-family: inherit;
  background: white;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.15s;
}

.search-field input[type="search"]:focus,
.search-field input[type="date"]:focus {
  border-color: #1e3461;
}

.search-submit {
  height: 38px;
  padding: 0 18px;
  background: #1e3461;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}

.search-submit:hover { background: #162442; }

.search-summary {
  font-size: 0.88rem;
  color: #666;
  padding: 14px 0 6px;
}

.search-summary strong { color: #1a1a1a; }
.search-summary em { font-style: italic; color: #444; }

/* ─── Archive stat banner ──────────────────────────── */
.archive-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 24px 16px;
  margin-top: 20px;
  background: linear-gradient(160deg, #1a2a4a 0%, #1e3461 100%);
  border-radius: 8px;
  border-bottom: 3px solid #d4af37;
}

.archive-stat-number {
  font-family: 'Courier New', Courier, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 2.4rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.01em;
}

.archive-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Archive calendar ─────────────────────────────── */
.calendar-wrap {
  padding: 24px 0 8px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a2a4a;
}

.calendar-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid #d0d3d8;
  border-radius: 4px;
  color: #1e3461;
  font-weight: 700;
  text-decoration: none;
}

.calendar-nav:hover { background: #f0f2f5; }

.calendar-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar-grid th {
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 0;
  text-align: center;
}

.calendar-cell {
  height: 56px;
  text-align: center;
  vertical-align: top;
  border: 1px solid #e8eaed;
  padding: 4px;
  font-size: 0.85rem;
  color: #999;
}

.calendar-cell.empty-cell { border-color: transparent; }

.calendar-cell .cell-day {
  display: block;
  font-weight: 600;
}

.calendar-cell.has-reports {
  padding: 0;
  color: inherit;
}

.calendar-cell.has-reports a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-decoration: none;
  color: #1a1a1a;
  background: #fdecea;
  border-radius: 3px;
  transition: background 0.15s;
}

.calendar-cell.has-reports a:hover { background: #f8d7d3; }

.calendar-cell.has-reports .cell-count {
  font-size: 0.68rem;
  color: #c0392b;
  font-weight: 600;
}

.calendar-cell.has-reports.selected a {
  background: #1e3461;
}

.calendar-cell.has-reports.selected a .cell-day,
.calendar-cell.has-reports.selected a .cell-count {
  color: white;
}

@media (max-width: 560px) {
  .calendar-cell { height: 44px; font-size: 0.75rem; }
}

/* ─── President picker ─────────────────────────────── */
.president-picker {
  padding: 20px 0 4px;
  border-top: 1px solid #e8eaed;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2a4a;
  margin-bottom: 12px;
}

.president-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.president-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1.5px solid #e8eaed;
  border-radius: 6px;
  text-decoration: none;
  color: #1a1a1a;
  transition: border-color 0.15s, background 0.15s;
}

.president-card:hover { border-color: #1e3461; background: #f7f8fa; }

.president-card.selected {
  border-color: #1e3461;
  background: #eef1f7;
}

.president-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 1px solid #d0d3d8;
}

.president-name {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
}

.president-count {
  font-size: 0.7rem;
  color: #c0392b;
  font-weight: 600;
}

.president-dates {
  font-size: 0.68rem;
  color: #888;
}

/* ─── Site footer ──────────────────────────────────── */
.site-footer {
  background: linear-gradient(160deg, #1a2a4a 0%, #1e3461 100%);
  margin-top: 48px;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.footer-logo span { color: rgba(255,255,255,0.5); font-weight: 400; }

.footer-logo:hover { color: white; }
.footer-logo:hover span { color: rgba(255,255,255,0.7); }

.footer-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 320px;
}

.footer-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.18);
}

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
  transition: color 0.15s;
}

.footer-social svg { width: 17px; height: 17px; }

.footer-social:hover { color: #d4af37; }

.footer-copyright {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.42);
  text-transform: uppercase;
  text-align: center;
}

@media (max-width: 560px) {
  /* Subscribe button floats free of the header on mobile so the masthead
     stays compact — the header no longer needs to reserve row space for it. */
  .masthead-title-row .subscribe-btn,
  .masthead-back-row .subscribe-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100;
    max-width: calc(100vw - 32px);
    padding: 12px 20px;
    font-size: 0.85rem;
    background: #1e3461;
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    border-radius: 999px;
    -webkit-tap-highlight-color: transparent;
  }
  /* Higher specificity than the base :hover rule, which otherwise wins on
     mobile — iOS Safari applies :hover as a "sticky" state after a tap and
     was turning the floating button translucent, letting page content show
     through it. */
  .masthead-title-row .subscribe-btn:hover:not(:disabled),
  .masthead-back-row .subscribe-btn:hover:not(:disabled) {
    background: #24407a;
    border-color: rgba(255,255,255,0.3);
  }
  .masthead-branding h1 { font-size: 1.35rem; }
  .wh-silhouette { width: 130px; opacity: 0.1; }
  .site-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 2px;
  }
  .site-nav a { padding: 9px 11px 11px; font-size: 0.82rem; }
  .full-report h1 { font-size: 1.2rem; }
  .search-field-keyword,
  .search-field-date { flex: 1 1 auto; }
}
