/* =========================================================
   Books & Cloud — Reading Room (v11)
   Modern hero + section nav + card grids.
   Built on the same CSS variables as the rest of the site,
   so it auto-supports Sunlit/Candlelit theming.
   ========================================================= */

/* ----------- HERO ----------- */
.rr-hero {
  position: relative;
  min-height: 62vh;
  max-height: 720px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  overflow: hidden;
}
.rr-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 16, 12, 0.45) 0%,
    rgba(20, 16, 12, 0.60) 60%,
    rgba(20, 16, 12, 0.80) 100%
  );
}
.rr-hero-inner {
  position: relative; z-index: 2;
  padding: 96px 0 120px;
  max-width: 820px;
}
.rr-eyebrow {
  display: inline-block;
  font: 500 0.7rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 999px;
  margin-bottom: 28px;
}
.rr-hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  color: #fdf8ed;
}
.rr-hero-lead {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: rgba(255,255,255,0.86);
  margin: 0;
  max-width: 640px;
}

/* ----------- SUB-NAV (floating chip rail) ----------- */
.rr-subnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
  margin-top: -1px; /* avoid 1px seam under hero */
}
.rr-subnav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  justify-content: center;
}
.rr-subnav a {
  display: inline-block;
  padding: 9px 18px;
  font: 500 0.78rem/1 var(--sans);
  letter-spacing: 0.08em;
  color: var(--brown);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  text-decoration: none;
  transition: all .2s ease;
}
.rr-subnav a:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
}
.rr-subnav a.is-active {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green);
}
html[data-theme="candlelit"] .rr-subnav a.is-active {
  background: var(--gold);
  color: #1a1612;
  border-color: var(--gold);
}

/* ----------- MAIN AREA ----------- */
.rr-main {
  padding: 60px 0 120px;
}
.rr-section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.rr-section-head .subtitle {
  display: inline-block;
  font: 500 0.7rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 16px;
}
.rr-section-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.1;
  margin: 0 0 18px;
  color: var(--ink);
}
.rr-section-head .lead {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--brown);
  margin: 0;
}

/* ----------- EMPTY STATE ----------- */
.rr-empty {
  text-align: center;
  font-style: italic;
  color: var(--brown);
  padding: 60px 20px;
}

/* ----------- CARD GRIDS ----------- */
.rr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-bottom: 40px;
}
.rr-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.rr-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(28,27,24,.08);
  border-color: var(--gold);
}
.rr-card.is-featured {
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(182,140,63,.15);
}
.rr-card-img {
  display: block;
  aspect-ratio: 4/3;
  background: var(--cream-2);
  overflow: hidden;
}
.rr-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.rr-card:hover .rr-card-img img {
  transform: scale(1.04);
}
.rr-card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.rr-card-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--ink);
}
.rr-card-desc {
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--brown);
  margin: 0 0 16px;
}
.rr-card-meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--brown-2);
  margin: 4px 0;
}
.rr-card-actions {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Small button variant used inside cards */
.btn-sm {
  padding: 0.5em 1em !important;
  font-size: 0.7rem !important;
}

/* Status pills for the Community section */
.rr-bucket-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 48px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.rr-bucket-label:first-child { margin-top: 0; }
.rr-bucket-pill {
  display: inline-block;
  font: 500 0.66rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.rr-bucket-pill.status-upcoming { background: rgba(30, 51, 41, 0.1); color: var(--green); }
.rr-bucket-pill.status-ongoing  { background: rgba(182, 140, 63, 0.18); color: var(--gold-deep); }
.rr-bucket-pill.status-past     { background: rgba(28, 27, 24, 0.08); color: var(--brown-2); }

/* ----------- JOURNALS (different layout — list, not grid) ----------- */
.rr-journals {
  max-width: 760px;
  margin: 0 auto;
}
.rr-journal {
  display: flex;
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--hairline);
}
.rr-journal:last-child { border-bottom: none; }
.rr-journal-img {
  flex: 0 0 200px;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--cream-2);
}
.rr-journal-img img { width: 100%; height: 100%; object-fit: cover; }
.rr-journal-body { flex: 1; min-width: 0; }
.rr-journal-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.65rem;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--ink);
}
.rr-journal-meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--brown-2);
  margin: 0 0 16px;
}
.rr-journal-excerpt {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--brown);
  margin: 0 0 18px;
}
.rr-journal-full summary {
  display: inline-block;
  cursor: pointer;
  font: 500 0.78rem/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding: 8px 18px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  list-style: none;
  transition: all .2s ease;
}
.rr-journal-full summary::-webkit-details-marker { display: none; }
.rr-journal-full summary:hover {
  background: var(--gold);
  color: var(--cream);
}
.rr-journal-content {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink-2);
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

@media (max-width: 720px) {
  .rr-journal { flex-direction: column; gap: 16px; }
  .rr-journal-img { width: 100%; flex: none; max-width: 320px; }
}

/* ----------- ATMOSPHERE (audio tracks) ----------- */
.rr-tracks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.rr-track {
  display: flex;
  gap: 18px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}
.rr-track-cover {
  flex: 0 0 88px;
  width: 88px; height: 88px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-2);
}
.rr-track-cover img { width: 100%; height: 100%; object-fit: cover; }
.rr-track-cover-fallback {
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-deep);
}
.rr-track-body { flex: 1; min-width: 0; }
.rr-track-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 4px;
  color: var(--ink);
}
.rr-track-artist {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--brown);
  margin: 0 0 8px;
}
.rr-mood-pill {
  display: inline-block;
  font: 500 0.65rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(182, 140, 63, 0.12);
  color: var(--gold-deep);
  margin-bottom: 12px;
}
.rr-audio {
  width: 100%;
  margin-top: 8px;
  outline: none;
}
.rr-embed {
  margin-top: 10px;
  position: relative;
  width: 100%;
  /* For YouTube-style embeds */
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.rr-embed iframe {
  width: 100%; height: 100%; border: 0;
  position: absolute; inset: 0;
}
/* SoundCloud + Spotify embeds need a fixed height, not aspect ratio.
   Heuristic: if the iframe src contains soundcloud or spotify, override. */
.rr-embed:has(iframe[src*="soundcloud"]),
.rr-embed:has(iframe[src*="spotify"]) {
  aspect-ratio: auto;
  height: 160px;
}

@media (max-width: 480px) {
  .rr-track { flex-direction: column; }
  .rr-track-cover { width: 100%; height: 160px; flex: none; }
}
