/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #faf7f2;
  --surface:   #ffffff;
  --border:    #e2d9ce;
  --accent:    #7b4f2e;
  --accent-lt: #b07850;
  --text:      #2c2015;
  --muted:     #8a7566;
  --radius:    10px;
  --shadow:    0 2px 16px rgba(100, 60, 20, 0.10);
  font-size: 16px;
}

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

/* ── Header ────────────────────────────────────────────────── */
header {
  background: var(--accent);
  color: #fff;
  padding: 1.25rem 1.5rem;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  font-weight: normal;
}

.site-subtitle {
  flex: 1;
  font-size: 0.95rem;
  opacity: 0.85;
  font-style: italic;
}

.lang-btn {
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}
.lang-btn:hover { background: rgba(255,255,255,0.32); }

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

/* ── Date navigation ───────────────────────────────────────── */
.date-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.date-picker-wrap {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
select:focus { outline: 2px solid var(--accent-lt); outline-offset: 1px; }

#month-select { flex: 2; }
#day-select   { flex: 1; }

.today-btn {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.today-btn:hover { background: var(--accent); color: #fff; }

.nav-btn {
  width: 2.4rem;
  height: 2.4rem;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.nav-btn:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Quote card ────────────────────────────────────────────── */
.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  animation: fadein 0.3s ease;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quote-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
}

.quote-date {
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--accent);
  font-style: italic;
}

.quote-counter {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Quote body ────────────────────────────────────────────── */
.quote-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.author-col {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.author-img-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.author-img[src=""] {
  display: none;
}

.author-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.author-name {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
}
.author-name:hover { text-decoration: underline; }

.book-title {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Quote text ────────────────────────────────────────────── */
.quote-col {
  flex: 1;
  min-width: 0;
}

.quote-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  font-style: italic;
  border-left: 3px solid var(--accent-lt);
  padding-left: 1rem;
  margin-bottom: 1rem;
}

/* make inline bold/italic from HTML look right */
.quote-text b { font-style: normal; font-weight: bold; color: var(--accent); }

.quote-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.source-link, .pic-link {
  font-size: 0.8rem;
  color: var(--accent-lt);
  text-decoration: none;
  font-style: normal;
}
.source-link:hover, .pic-link:hover { text-decoration: underline; }

/* ── Quote pagination ──────────────────────────────────────── */
.quote-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.quote-nav-label {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 80px;
  text-align: center;
}

/* ── No-quote fallback ─────────────────────────────────────── */
.no-quote {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-style: italic;
}

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

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 580px) {
  .quote-body {
    flex-direction: column;
    align-items: center;
  }
  .author-col { width: 100%; flex-direction: row; align-items: center; justify-content: flex-start; gap: 1rem; }
  .author-img-wrap { width: 70px; height: 70px; flex-shrink: 0; }
  .author-info { text-align: left; }
  .site-subtitle { display: none; }
}
