/* Ancient Calendar — This Day in History */

.tvih-calendar-page {
  background: #000 !important;
}

.tvih-calendar-page .tvih-book-hero.tvih-util-hero .tvih-book-hero-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}

.tvih-calendar-page .tvih-book-hero.tvih-util-hero .tvih-book-hero-content h1 {
  width: fit-content;
  max-width: 100%;
  padding: 0 0 0.42rem !important;
  border-bottom: 1px solid #d4a373;
}

.tvih-cal-content {
  max-width: 1120px;
}

.tvih-cal-intro {
  max-width: 40rem;
  margin: 0 auto 1.75rem;
  text-align: center;
}

.tvih-cal-kicker {
  margin: 0 0 0.45rem;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4a373;
}

.tvih-cal-lead {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #c8c0b4;
}

/* Same field as the index library search strip. */
.tvih-calendar-page .tvih-libsearch-form {
  margin: 0 auto 1.75rem;
  max-width: 640px;
}
.tvih-calendar-page .tvih-libsearch-field {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid rgba(212, 163, 115, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(22, 18, 14, 0.96) 0%, rgba(8, 8, 8, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 0 32px rgba(212, 163, 115, 0.08),
    0 12px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tvih-calendar-page .tvih-libsearch-field:focus-within {
  border-color: rgba(212, 163, 115, 0.78);
  box-shadow:
    0 0 0 1px rgba(212, 163, 115, 0.15) inset,
    0 0 40px rgba(212, 163, 115, 0.16),
    0 12px 36px rgba(0, 0, 0, 0.5);
}
.tvih-calendar-page .tvih-libsearch-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  flex-shrink: 0;
  color: rgba(212, 163, 115, 0.75);
  font-size: 0.95rem;
  pointer-events: none;
}
.tvih-calendar-page .tvih-libsearch-field input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  color: #f0ebe4 !important;
  font-family: 'Atkinson Hyperlegible', sans-serif !important;
  font-size: 1.05rem !important;
  padding: 0.95rem 0.35rem 0.95rem 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}
.tvih-calendar-page .tvih-libsearch-field input[type="search"]::placeholder {
  color: #666 !important;
  opacity: 1;
}
.tvih-calendar-page .tvih-libsearch-field input[type="search"]::-webkit-search-decoration,
.tvih-calendar-page .tvih-libsearch-field input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.tvih-calendar-page .tvih-libsearch-submit {
  flex: 0 0 auto;
  border: none;
  border-left: 1px solid rgba(212, 163, 115, 0.28);
  background: rgba(212, 163, 115, 0.12);
  color: #d4a373;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 0 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.tvih-calendar-page .tvih-libsearch-submit:hover,
.tvih-calendar-page .tvih-libsearch-submit:focus-visible {
  background: #d4a373;
  color: #111;
  outline: none;
}
@media (max-width: 575.98px) {
  .tvih-calendar-page .tvih-libsearch-submit { padding: 0 0.9rem; font-size: 0.85rem; }
  .tvih-calendar-page .tvih-libsearch-field input[type="search"] { font-size: 0.98rem !important; }
}

.tvih-cal-find {
  position: relative;
}

.tvih-cal-hits {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 0.4rem);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #0c0a08;
  border: 1px solid rgba(212, 163, 115, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.tvih-cal-hits[hidden] {
  display: none !important;
}

.tvih-cal-hits button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #e8e0d4;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.35;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.tvih-cal-hits button:hover,
.tvih-cal-hits button:focus-visible {
  background: rgba(212, 163, 115, 0.12);
  color: #fff;
  outline: none;
}

.tvih-cal-hits-year {
  color: #d4a373;
}

.tvih-cal-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.75rem 2rem;
  align-items: start;
}

.tvih-cal-board {
  position: sticky;
  top: 5.25rem;
  padding: 0.85rem 0.85rem 1rem;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(212, 163, 115, 0.08), transparent 58%),
    #0c0a08;
  border: 1px solid rgba(212, 163, 115, 0.28);
  border-radius: 14px;
}

.tvih-cal-monthbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.tvih-cal-monthbar h2 {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
}

.tvih-cal-navbtn,
.tvih-cal-today {
  background: transparent;
  color: #d4a373;
  border: 1px solid rgba(212, 163, 115, 0.45);
  cursor: pointer;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
}

.tvih-cal-navbtn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tvih-cal-navbtn:hover,
.tvih-cal-navbtn:focus-visible,
.tvih-cal-today:hover,
.tvih-cal-today:focus-visible {
  background: rgba(212, 163, 115, 0.16);
  color: #fff;
  outline: none;
}

.tvih-cal-tools {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}

.tvih-cal-today {
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tvih-cal-markcount {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(212, 163, 115, 0.85);
}

.tvih-cal-weekdays,
.tvih-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.tvih-cal-weekdays span {
  text-align: center;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(212, 163, 115, 0.75);
  padding-bottom: 0.25rem;
}

.tvih-cal-daybtn {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #9a9288;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.92rem;
  cursor: pointer;
}

.tvih-cal-daybtn.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.tvih-cal-daybtn.has-events {
  color: #f3efe8;
}

.tvih-cal-daybtn.is-today:not(.is-selected) {
  color: #d4a373;
}

.tvih-cal-daybtn.is-selected {
  color: #fff;
  background: rgba(212, 163, 115, 0.18);
  border-color: rgba(212, 163, 115, 0.85);
}

.tvih-cal-daybtn:hover:not(.is-empty),
.tvih-cal-daybtn:focus-visible:not(.is-empty) {
  border-color: rgba(212, 163, 115, 0.55);
  outline: none;
}

.tvih-cal-dot {
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #d4a373;
  opacity: 0;
}

.tvih-cal-daybtn.has-events .tvih-cal-dot {
  opacity: 1;
}

.tvih-cal-daybox {
  padding: 1.15rem 1.25rem 1.1rem;
  overflow: hidden;
  background-color: #000;
  background-image:
    linear-gradient(90deg, rgba(6, 4, 2, 0.34) 0%, rgba(6, 4, 2, 0) 20%, rgba(6, 4, 2, 0) 80%, rgba(6, 4, 2, 0.34) 100%),
    linear-gradient(180deg, rgba(8, 10, 14, 0.86) 0%, rgba(8, 10, 14, 0.78) 18%, rgba(8, 10, 14, 0.74) 52%, rgba(8, 10, 14, 0.80) 80%, rgba(8, 10, 14, 0.90) 100%),
    url("../media/photos/desolation-card.jpg");
  background-repeat: no-repeat;
  background-size: auto, auto, cover;
  background-position: center, center, 12% 46%;
  border: 1px solid rgba(212, 163, 115, 0.28);
  border-radius: 14px;
}

.tvih-cal-dayhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.7rem;
}

.tvih-cal-daynav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.tvih-cal-daynav .tvih-cal-navbtn {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.7rem;
}

.tvih-cal-dayhead h2 {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(1.375rem, calc(0.575rem + 1.5vw), 1.65rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.15;
}

.tvih-cal-now {
  flex: 0 0 auto;
  margin: 0;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d4a373;
}

.tvih-cal-now[hidden] {
  display: none !important;
}

.tvih-cal-event {
  scroll-margin-top: 5.75rem;
  position: relative;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.tvih-cal-event + .tvih-cal-event {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 163, 115, 0.22);
}

.tvih-cal-daybox:has(.is-target) {
  border: 1px solid rgba(212, 163, 115, 0.28);
  box-shadow: none;
}

.tvih-cal-event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.tvih-cal-year {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d4a373;
}

.tvih-cal-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid rgba(212, 163, 115, 0.5);
  color: #d4a373;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

.tvih-cal-share-btn .fa {
  font-size: 0.95em;
  line-height: 1;
  letter-spacing: 0;
}

.tvih-cal-share-btn:hover,
.tvih-cal-share-btn:focus-visible {
  background: rgba(212, 163, 115, 0.16);
  color: #fff;
  outline: none;
}

.tvih-cal-event h3 {
  margin: 0 0 0.55rem;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.25;
  color: #fff;
}

.tvih-cal-summary {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #ddd4c6;
}

.tvih-cal-note {
  margin: 0.75rem 0 0;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.88rem;
  font-style: italic;
  line-height: 1.45;
  color: rgba(212, 163, 115, 0.92);
}

.tvih-cal-books {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(212, 163, 115, 0.22);
}

.tvih-cal-books-kicker {
  margin: 0 0 0.4rem;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4a373;
}

.tvih-cal-books ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tvih-calendar-page .tvih-cal-books a,
.tvih-calendar-page .tvih-cal-books a:hover,
.tvih-calendar-page .tvih-cal-books a:focus,
.tvih-calendar-page .tvih-cal-books a:focus-visible {
  color: #f4efe6 !important;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.95rem;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(212, 163, 115, 0.55);
}

.tvih-calendar-page .tvih-cal-books a:hover,
.tvih-calendar-page .tvih-cal-books a:focus-visible {
  color: #d4a373 !important;
  outline: none;
}

.tvih-cal-empty {
  padding: 0;
  border: 0;
  background: transparent;
}

.tvih-cal-empty p {
  margin: 0 0 0.85rem;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #c8c0b4;
}

.tvih-cal-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.tvih-cal-jumps button {
  background: none;
  border: 0;
  padding: 0;
  color: #d4a373;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.92rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(212, 163, 115, 0.4);
}

.tvih-cal-jumps button:hover,
.tvih-cal-jumps button:focus-visible {
  color: #fff;
  outline: none;
}

.tvih-cal-share[hidden] {
  display: none !important;
}

.tvih-cal-share {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.72);
}

.tvih-cal-share-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  padding: 3.4rem 1.5rem 1.45rem;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(212, 163, 115, 0.1), transparent 55%),
    linear-gradient(180deg, #16130f 0%, #000 70%);
  border: 1px solid rgba(212, 163, 115, 0.35);
}

.tvih-cal-share-dialog .exit-x {
  left: 50% !important;
  right: auto !important;
  top: 12px !important;
  transform: translateX(-50%) !important;
}

.tvih-cal-share-kicker {
  margin: 0 0 1.15rem;
  text-align: center;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4a373;
}

.tvih-cal-share-dialog img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 1.25rem;
  background: #000;
  border: 1px solid rgba(212, 163, 115, 0.45);
}

.tvih-cal-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.tvih-cal-share-actions button {
  background: transparent;
  border: 1px solid rgba(212, 163, 115, 0.55);
  color: #d4a373;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.tvih-cal-share-actions button:hover,
.tvih-cal-share-actions button:focus-visible {
  background: rgba(212, 163, 115, 0.16);
  color: #fff;
  outline: none;
}

.tvih-cal-share-actions .is-primary {
  background: rgba(212, 163, 115, 0.16);
  color: #fff;
}

.tvih-cal-share-status {
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  text-align: center;
  font-family: 'Atkinson Hyperlegible', Georgia, serif;
  font-size: 0.85rem;
  font-style: italic;
  color: #d4a373;
}

@media (max-width: 800px) {
  .tvih-cal-layout {
    grid-template-columns: 1fr;
  }

  .tvih-cal-board {
    position: static;
  }

  .tvih-cal-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
