:root {
  --gold: #b8860b;
  --gold-light: #d4a017;
  --gold-pale: #f5e6c0;
  --burgundy: #6b1a1a;
  --burgundy-light: #8b2222;
  --cream: #faf7f0;
  --cream-dark: #f0ead8;
  --text: #2c1810;
  --text-muted: #6b5a4e;
  --shadow: rgba(0,0,0,0.15);
  --border: #d4b483;
}

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

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Header ── */
header {
  background: var(--burgundy);
  color: #f5e6c0;
  text-align: center;
  padding: 2rem 1rem 1.75rem;
  border-bottom: 3px solid var(--gold);
}

.header-inner {
  max-width: 700px;
  margin: 0 auto;
}

.cross {
  font-size: 2.5rem;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
  line-height: 1;
}

header h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  letter-spacing: 0.05em;
  font-weight: normal;
  color: var(--gold-pale);
  text-shadow: 1px 2px 6px rgba(0,0,0,0.4);
}

.subtitle {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 0.3rem;
  font-style: italic;
}

/* ── Main Layout ── */
main {
  flex: 1;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ── Date Navigation ── */
.date-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
}

.nav-btn {
  background: var(--burgundy);
  color: var(--gold-pale);
  border: none;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.date-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

#date-picker {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--cream);
  cursor: pointer;
}

#date-picker:focus {
  outline: 2px solid var(--gold);
}

#date-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Cards ── */
.card {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gold-pale);
}

.card-icon {
  font-size: 1.4rem;
}

.card-title {
  font-size: 1.1rem;
  color: var(--burgundy);
  font-weight: bold;
  letter-spacing: 0.03em;
}

/* ── Date headline card ── */
.day-headline {
  background: var(--cream);
  border-left: 4px solid var(--gold);
  text-align: center;
  padding: 1.25rem 1.5rem;
}

.day-headline .date-big {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--burgundy);
  font-weight: bold;
}

.day-headline .day-of-week {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.feast-badge {
  display: inline-block;
  background: var(--burgundy);
  color: var(--gold-pale);
  font-size: 0.75rem;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  margin-top: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Liturgical season & name days ── */
.liturgical-season {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

.season-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}

.name-days {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--burgundy);
}

.name-days strong {
  font-weight: bold;
}

/* ── Saints ── */
.saints-list {
  list-style: none;
}

.saints-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--cream-dark);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.saints-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.saint-name {
  font-size: 1.05rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.saint-name::before {
  content: "✦";
  color: var(--gold);
  font-size: 0.7rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

/* ── Expand button ── */
.expand-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--burgundy);
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  align-self: flex-start;
  min-height: 36px;
}

.expand-icon {
  font-size: 0.65rem;
}

/* ── Saint biography / Bible text ── */
.saint-story,
.reading-text {
  margin-top: 0.5rem;
  border-top: 1px solid var(--cream-dark);
  padding-top: 0.75rem;
}

.story-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
  background: var(--cream);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--cream-dark);
  max-height: 400px;
  overflow-y: auto;
}

.story-text p {
  margin-bottom: 0.75rem;
}

.story-text p:last-child {
  margin-bottom: 0;
}

/* ── Lectionary source note ── */
.lectionary-source {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--cream);
  border-radius: 4px;
}

/* ── Readings ── */
.readings-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reading-entry {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--cream-dark);
}

.reading-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.reading-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tone-entry .reading-label {
  color: var(--text-muted);
}

.reading-label {
  font-weight: bold;
  color: var(--burgundy);
  white-space: nowrap;
  min-width: 160px;
}

.reading-ref {
  color: var(--text);
  font-style: italic;
  flex: 1;
}

/* ── Notes / Fast ── */
.note-item {
  background: var(--cream-dark);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.fast-info {
  background: #e8f4e8;
  border-left: 3px solid #5a8a5a;
  color: #2a5a2a;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ── Full text ── */
.full-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  background: var(--cream);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--cream-dark);
}

/* ── Loader ── */
.loader {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--cream-dark);
  border-top-color: var(--burgundy);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* ── Error ── */
.error {
  background: #ffeaea;
  border: 1px solid #e08080;
  border-radius: 8px;
  padding: 1.25rem;
  color: #8b0000;
  text-align: center;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--cream-dark);
}

footer a {
  color: var(--burgundy);
  text-decoration: none;
}


/* ── Responsive ── */
@media (max-width: 480px) {
  .date-nav {
    padding: 0.5rem 0.75rem;
    gap: 0.6rem;
  }
  .card {
    padding: 1rem;
  }
  .reading-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  .reading-label {
    min-width: unset;
    width: auto;
  }
  .reading-ref {
    padding-left: 0;
  }
  .story-text {
    max-height: none;
  }
}
