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

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: #faf6ee;
  color: #262626;
  font-family: 'Libre Baskerville', Georgia, serif;
  line-height: 1.7;
  min-height: 100dvh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

/* Navigation — Calendar Strip */
.nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0;
  user-select: none;
}

.strip-month {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #999;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}

.strip {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  padding: 2px 0;
  padding-left: calc(50% - 31px);
  padding-right: calc(50% - 31px);
  position: relative;
}

.strip::-webkit-scrollbar {
  display: none;
}

.strip.grabbing {
  cursor: grabbing;
}

.strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 62px;
  height: 68px;
  justify-content: center;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  background: transparent;
  border: none;
  font-family: 'Fira Sans', sans-serif;
  flex-shrink: 0;
}

@media (hover: hover) {
  .strip-day:not(.active):not(.future):hover {
    background: rgba(195, 55, 55, 0.04);
  }
}

.strip-day.active {
  background: #c33737;
}

.strip-day .weekday {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #bbb;
}

.strip-day.active .weekday {
  color: rgba(255, 255, 255, 0.7);
}

.strip-day .day-num {
  font-size: 1.2rem;
  font-weight: 600;
  color: #444;
}

.strip-day.active .day-num {
  color: #fff;
}

.strip-day.future {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* Content transition */
#content {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#content.fade-out {
  opacity: 0;
  transform: translateY(6px);
}

#content.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Divider — gradient fade line with diamond */
.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0;
  margin-bottom: 1.2rem;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to var(--dir, right), transparent, #d4c5b0);
}

.divider-line:first-child { --dir: right; }
.divider-line:last-child { --dir: left; }

.divider-gem {
  width: 6px;
  height: 6px;
  background: #d4b896;
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Bottom divider — fade line only */
.divider-bottom {
  height: 1px;
  background: linear-gradient(to right, transparent, #d4c5b0, transparent);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

/* Episode badge — bottom */
.episode-badge {
  display: block;
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #bbb;
  text-align: center;
}

/* Subsection title */
.piece-title {
  font-family: 'Fira Sans', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
}

/* Body text */
.piece-body p {
  margin-bottom: 1.1em;
}

.piece-body strong {
  font-weight: 700;
  color: #c33737;
}

.piece-body em {
  font-style: italic;
  color: #2b7ab0;
}

.piece-body mark {
  background: #ffdb00;
  color: #262626;
  padding: 0.05em 0.2em;
  border-radius: 2px;
}

/* Blockquotes */
.piece-body blockquote {
  margin: 1.5em 0;
  padding: 0.75em 1.2em;
  border-left: 4px solid #ffdb00;
  color: #444;
  font-style: italic;
  background: #fffef5;
  border-radius: 0 3px 3px 0;
}

/* Callouts */
.callout {
  margin: 1.5em 0;
  padding: 1.1em 1.2em;
  background: #fffef5;
  border: 2px solid #ffdb00;
  border-radius: 14px;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c33737;
  margin-bottom: 0.4em;
}

.callout-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.callout-tip { border-color: #4a8c5c; }
.callout-tip .callout-title,
.callout-tip .callout-icon { color: #4a8c5c; }

.callout-quote { border-color: #c33737; }
.callout-quote .callout-title,
.callout-quote .callout-icon { color: #c33737; }

.callout-info { border-color: #2b7ab0; }
.callout-info .callout-title,
.callout-info .callout-icon { color: #2b7ab0; }

.callout-warning { border-color: #c8913a; }
.callout-warning .callout-title,
.callout-warning .callout-icon { color: #c8913a; }

.callout-body p {
  font-style: italic;
  color: #333;
  margin-bottom: 0;
}

/* Lists */
.piece-body ul {
  margin: 1em 0;
  padding-left: 1.5em;
}

.piece-body li {
  margin-bottom: 0.5em;
}

.piece-body li::marker {
  color: #c33737;
}

/* Footer */
.footer {
  margin-top: 1rem;
  text-align: center;
}

.footer span {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.7rem;
  color: #bbb;
  letter-spacing: 0.02em;
}

/* Loading */
.loading {
  text-align: center;
  color: #bbb;
  padding: 4rem 0;
  font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .container {
    padding: 1.5rem 1rem 2rem;
  }

  .piece-title {
    font-size: 1.3rem;
  }
}
