/* Twitter On This Day page. Scoped to this utility page only. */

body.tweets-otd-page-body {
  background:
    radial-gradient(circle at 15% 12%, rgba(64, 132, 126, 0.10), transparent 18rem),
    radial-gradient(circle at 86% 20%, rgba(178, 87, 62, 0.08), transparent 18rem),
    linear-gradient(180deg, rgba(248, 244, 231, 0.95), rgba(253, 251, 244, 0.96));
}

body.tweets-otd-page-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/images/tweets-archive/on-this-day-vintage-bg.svg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: min(1600px, 100vw) auto;
  opacity: 0.92;
}

body.tweets-otd-page-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.38) 42%, transparent 72%);
  opacity: 0.88;
}

body.tweets-otd-page-body > .tweets-on-this-day-page,
body.tweets-otd-page-body > .site-footer {
  position: relative;
  z-index: 1;
}

.tweets-on-this-day-page {
  position: relative;
  isolation: isolate;
}

.tweets-otd-container article {
  background: rgba(255, 254, 248, 0.73);
  border: 1px solid rgba(135, 114, 83, 0.12);
  box-shadow: 0 20px 50px rgba(77, 63, 42, 0.07);
  padding: 0 1.2rem 2rem;
}

.tweets-otd-intro p {
  color: rgba(52, 48, 41, 0.68);
  font-size: 0.92rem;
}

.tweets-otd-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 1.35rem;
}

.tweets-otd-nav-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(64, 132, 126, 0.24);
  border-radius: 999px;
  background: rgba(255, 254, 248, 0.78);
  color: #4f7771;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.52rem 0.82rem;
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(77, 63, 42, 0.05);
}

.tweets-otd-nav-link-back {
  background: linear-gradient(180deg, rgba(255, 254, 248, 0.96), rgba(245, 240, 222, 0.9));
  border-color: rgba(64, 132, 126, 0.34);
  color: #3f6f69;
  box-shadow: 0 8px 20px rgba(77, 63, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.tweets-otd-nav-link-back::before {
  content: "←";
  margin-right: 0.35rem;
}

.tweets-otd-nav-link:hover {
  background: rgba(111, 174, 170, 0.12);
  box-shadow: 0 10px 24px rgba(77, 63, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transform: translateY(-1px);
}

.tweets-otd-nav-link:focus-visible {
  outline: 2px solid #4f9c98;
  outline-offset: 3px;
}

.tweets-otd-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.6rem 0 1.4rem;
  padding: 1.6rem 1.8rem;
  min-height: 7.5rem;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 255, 255, 0.24), transparent 9rem),
    linear-gradient(135deg, #6faeaa, #4f9c98);
  color: #fff8e8;
  box-shadow: 0 14px 30px rgba(64, 132, 126, 0.18);
}

.tweets-otd-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0, rgba(255, 255, 255, 0.07) 1px, transparent 1px, transparent 3rem),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0, rgba(255, 255, 255, 0.05) 1px, transparent 1px, transparent 2.4rem);
  opacity: 0.45;
}

.tweets-otd-hero > * {
  position: relative;
  z-index: 1;
}

.tweets-otd-bird {
  width: 3.4rem;
  height: 3.4rem;
  fill: #d77b62;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.25));
  flex: 0 0 auto;
}

.tweets-otd-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 248, 232, 0.78);
}

.tweets-otd-hero h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
  color: #fff8e8;
  text-shadow: 0 1px 0 rgba(70, 44, 31, 0.25);
}

#tweets-otd-date-label {
  margin: 0.35rem 0 0;
  color: rgba(255, 248, 232, 0.86);
}

.tweets-otd-stamp {
  position: absolute;
  right: 1.2rem;
  top: 1rem;
  width: 5rem;
  height: 5rem;
  border: 2px solid rgba(255, 248, 232, 0.44);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(255, 248, 232, 0.52);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.45;
  text-transform: uppercase;
  transform: rotate(10deg);
}

.tweets-otd-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tweets-otd-summary,
.tweets-otd-loading {
  margin: 0 0 0.5rem;
  color: rgba(52, 48, 41, 0.62);
  font-size: 0.94rem;
}

.tweets-otd-year {
  margin: 1.2rem 0 0.35rem;
  color: #8a5949;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tweets-otd-card {
  background: rgba(255, 254, 248, 0.88);
  border: 1px solid rgba(64, 132, 126, 0.18);
  border-radius: 8px;
  padding: 0.95rem 1rem;
  box-shadow: 0 9px 22px rgba(77, 63, 42, 0.06);
}

.tweets-otd-card-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(52, 48, 41, 0.62);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.tweets-otd-card-header svg,
.tweets-otd-stat svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.tweets-otd-card-header a {
  margin-left: auto;
  color: #4f9c98;
  text-decoration: none;
  font-weight: 700;
}

.tweets-otd-card-header a:hover,
.tweets-otd-body a:hover {
  text-decoration: underline;
}

.tweets-otd-body {
  color: #2d2924;
  font-size: 0.96rem;
  line-height: 1.55;
}

.tweets-otd-body a {
  color: #2e8d8a;
  text-decoration: none;
  font-weight: 650;
}

.tweets-otd-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.tweets-otd-media img,
.tweets-otd-media video {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(64, 132, 126, 0.08);
}

.tweets-otd-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.6rem;
  color: rgba(52, 48, 41, 0.56);
  font-size: 0.82rem;
}

.tweets-otd-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.tweets-otd-empty {
  text-align: center;
  padding: 1.5rem 0 0;
}

.tweets-otd-empty img {
  max-width: min(100%, 32rem);
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(77, 63, 42, 0.13));
}

.tweets-otd-empty p {
  margin: 1rem auto 0;
  max-width: 32rem;
  color: rgba(52, 48, 41, 0.67);
  font-weight: 700;
}

@media (max-width: 760px) {
  body.tweets-otd-page-body::before,
  body.tweets-otd-page-body::after {
    opacity: 0.22;
  }

  .tweets-otd-container article {
    padding: 0 0.75rem 1.4rem;
  }

  .tweets-otd-hero {
    align-items: flex-start;
    padding: 1.25rem;
  }

  .tweets-otd-stamp {
    display: none;
  }
}

html.theme-dark body.tweets-otd-page-body,
html[data-theme="dark"] body.tweets-otd-page-body {
  background:
    radial-gradient(circle at 15% 12%, rgba(94, 126, 119, 0.24), transparent 18rem),
    radial-gradient(circle at 86% 20%, rgba(139, 105, 86, 0.16), transparent 18rem),
    linear-gradient(180deg, #0e1310, #171410);
}

html.theme-dark body.tweets-otd-page-body::before,
html[data-theme="dark"] body.tweets-otd-page-body::before {
  filter: sepia(0.22) saturate(0.70) brightness(0.48);
  opacity: 0.54;
}

html.theme-dark body.tweets-otd-page-body::after,
html[data-theme="dark"] body.tweets-otd-page-body::after {
  background: radial-gradient(ellipse at 50% 45%, rgba(18, 20, 16, 0.38), rgba(18, 20, 16, 0.18) 42%, transparent 72%);
  opacity: 0.82;
}

html.theme-dark .tweets-otd-container article,
html[data-theme="dark"] .tweets-otd-container article,
html.theme-dark .tweets-otd-card,
html[data-theme="dark"] .tweets-otd-card {
  background: rgba(23, 22, 18, 0.94);
  border-color: rgba(130, 156, 148, 0.36);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(236, 226, 199, 0.06);
}

html.theme-dark .tweets-otd-body,
html[data-theme="dark"] .tweets-otd-body {
  color: #eee4d0;
}

html.theme-dark .tweets-otd-intro p,
html[data-theme="dark"] .tweets-otd-intro p,
html.theme-dark .tweets-otd-summary,
html[data-theme="dark"] .tweets-otd-summary,
html.theme-dark .tweets-otd-loading,
html[data-theme="dark"] .tweets-otd-loading,
html.theme-dark .tweets-otd-card-header,
html[data-theme="dark"] .tweets-otd-card-header,
html.theme-dark .tweets-otd-stats,
html[data-theme="dark"] .tweets-otd-stats {
  color: rgba(238, 228, 208, 0.68);
}

html.theme-dark .tweets-otd-nav-link,
html[data-theme="dark"] .tweets-otd-nav-link {
  background: rgba(26, 24, 20, 0.78);
  border-color: rgba(111, 174, 170, 0.28);
  color: #9fd3cd;
}

body.tweets-otd-page-body #scrollToTop.scroll-to-top {
  left: auto !important;
  right: max(1rem, env(safe-area-inset-right)) !important;
}

@media (max-width: 560px) {
  body.tweets-otd-page-body #scrollToTop.scroll-to-top {
    left: auto !important;
    right: 0.85rem !important;
  }
}
