/* CuppaLifeStories - Blended Design
   Warm, personal, clean storytelling aesthetic */

:root {
  --bg: #faf8f5;
  --bg-card: #ffffff;
  --text: #2c2a26;
  --text-muted: #5c574f;
  --accent: #8b5e3c;          /* warm wood brown */
  --accent-soft: #c4a484;
  --accent-dark: #5c3d28;
  --border: #e8e2d9;
  --shadow: 0 4px 20px rgba(44, 42, 38, 0.08);
  --radius: 12px;
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent);
}

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.75rem;
}
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav a:hover {
  color: var(--accent-dark);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 70vh;
  min-height: 480px;
  max-height: 720px;
  background: #1a1814;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.85;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(26, 24, 20, 0.75) 0%,
    rgba(26, 24, 20, 0.35) 50%,
    rgba(26, 24, 20, 0.15) 100%
  );
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  color: #fff;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.6rem;
  letter-spacing: -0.03em;
}

.hero-content .tagline {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 400;
  opacity: 0.92;
  font-family: var(--font-serif);
  font-style: italic;
}

/* ===== SECTIONS ===== */
.section {
  padding: 4.5rem 0;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 720px;
  margin-bottom: 2rem;
}

/* Intro section */
.intro {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.intro-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.intro-photo {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.intro-photo img {
  width: 100%;
  height: auto;
}

/* ===== SONG SPOTLIGHT ===== */
.spotlight {
  background: var(--bg);
}

.spotlight-intro {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.song-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid var(--border);
}
.song-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(44, 42, 38, 0.12);
}

.song-card a {
  display: block;
  color: inherit;
}

.song-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #e8e2d9;
}
.song-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.song-card:hover .song-card-img img {
  transform: scale(1.04);
}

.song-card-body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.song-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.song-card audio {
  width: 100%;
  height: 36px;
  margin-top: 0.25rem;
}

/* ===== ABOUT RICK ===== */
.about {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: sticky;
  top: 5.5rem;
}
.about-photo img {
  width: 100%;
}

.about-text p {
  margin-bottom: 1.15rem;
  color: var(--text);
}
.about-text p:last-child {
  margin-bottom: 0;
}

/* ===== SONG PAGE ===== */
.song-hero {
  background: #1a1814;
  padding: 2.5rem 0 0;
  text-align: center;
}

.song-hero-img {
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
}
.song-hero-img img {
  width: 100%;
  display: block;
}

.song-player-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

.song-player-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.song-player-inner h1 {
  font-size: 1.5rem;
  font-weight: 700;
  flex: 1;
}

.song-player-inner audio {
  flex: 1.2;
  max-width: 320px;
}

.song-content {
  padding: 3rem 0 4rem;
}

.song-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.song-columns h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent-dark);
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 0.4rem;
}

.lyrics {
  white-space: pre-line;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}

.story p {
  margin-bottom: 1rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}
.back-link:hover {
  text-decoration: underline;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #2c2a26;
  color: #c8c2b8;
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.95rem;
}
.site-footer a {
  color: #e8e2d9;
}
.site-footer p {
  margin-bottom: 0.4rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .intro-grid,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .about-photo {
    position: static;
    max-width: 280px;
  }
  .song-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
  .song-columns {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .song-player-inner {
    flex-direction: column;
    text-align: center;
  }
  .song-player-inner audio {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .nav {
    gap: 1rem;
  }
  .hero {
    height: 55vh;
    min-height: 380px;
  }
  .section {
    padding: 3rem 0;
  }
}

/* Compact table-style for Cupboard */
.song-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.song-table th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  background: #f0ebe4;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
}
.song-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.song-table tr:hover { background: #faf8f5; }
.song-table img { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; }
.song-table audio { width: 140px; height: 28px; }
.song-table .meta { font-size: 0.8rem; color: var(--text-muted); }

/* ===== SONG TEASERS ===== */
.song-card-teaser {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: -0.25rem 0 0.8rem;
}
.song-teaser {
  max-width: 720px;
  margin: 0.9rem auto 0;
  padding: 0 1.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}
.song-table .teaser {
  display: block;
  max-width: 34ch;
  margin-top: 0.2rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.song-card-teaser:empty, .song-teaser:empty, .song-table .teaser:empty { display: none; }

/* ===== MOBILE MENU ===== */
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .header-inner { position: relative; flex-wrap: wrap; gap: 0.5rem 1rem; }
  /* Without JavaScript: the links simply wrap under the logo */
  .nav { flex-wrap: wrap; gap: 0.35rem 1rem; }

  /* With JavaScript (js/nav.js adds .has-nav-toggle): Menu button + dropdown */
  .has-nav-toggle .header-inner { flex-wrap: nowrap; }
  .has-nav-toggle .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    color: var(--accent-dark);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font: 600 0.95rem var(--font-sans);
    cursor: pointer;
  }
  .has-nav-toggle .nav-toggle:hover,
  .has-nav-toggle .nav-toggle[aria-expanded="true"] { background: #f3ece3; }
  .has-nav-toggle .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
  }
  .nav-toggle-icon { position: relative; }
  .nav-toggle-icon::before,
  .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-icon::before { top: -6px; }
  .nav-toggle-icon::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }

  .has-nav-toggle .nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 1rem;
    min-width: 230px;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(44, 42, 38, 0.16);
    padding: 0.4rem 0;
    z-index: 200;
  }
  .has-nav-toggle .nav.is-open { display: flex; }
  .has-nav-toggle .nav a {
    display: block;
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
    color: var(--text);
  }
  .has-nav-toggle .nav a + a { border-top: 1px solid var(--border); }
  .has-nav-toggle .nav a:hover,
  .has-nav-toggle .nav a:focus-visible { background: #f7f2ec; color: var(--accent-dark); outline: none; }
  .has-nav-toggle .nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
}

/* Song page player: keep the audio player visible when the bar stacks on phones
   (flex: 1.2 collapsed it to zero height in the stacked/column layout). */
@media (max-width: 900px) {
  .song-player-inner h1 { flex: none; }
  .song-player-inner audio { flex: none; height: 44px; }
}

@media (max-width: 820px) {
  .nav-toggle { -webkit-tap-highlight-color: transparent; }
  /* Song Spotlight heading picture: fit the phone screen (inline style says 420px) */
  #spotlight .section-inner > img { max-width: 100% !important; }

  /* Cupboard & Pantry: each song row becomes a little card so the picture,
     title, teaser and player all fit on a phone screen (no sideways scrolling). */
  .song-table, .song-table tbody { display: block; width: 100%; }
  .song-table thead { display: none; }
  .song-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.8rem;
    margin-bottom: 0.9rem;
  }
  .song-table tr:hover { background: var(--bg-card); }
  .song-table td { display: block; border: 0; padding: 0; }
  .song-table td:nth-child(1) { flex: 0 0 76px; }
  .song-table td:nth-child(1) img { width: 76px; height: 57px; border-radius: 8px; }
  .song-table td:nth-child(2) { flex: 1 1 0; min-width: 0; }
  .song-table td:nth-child(3) { flex: 0 0 100%; margin: 0.2rem 0; }
  .song-table td:nth-child(3) audio { width: 100%; height: 40px; }
  .song-table td:nth-child(n+4) {
    font-size: 0.8rem;
    background: #f3ece3;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
  }
  .song-table td:nth-child(n+4):has(.badge) { background: none; padding: 0; }
  .song-table .teaser { max-width: none; }
}

/* Mobile-only hint under song pictures */
.tap-hint { display: block; font-size: 0.78rem; font-style: italic; color: #8a7f72; line-height: 1.35; margin: 0.4rem 0.25rem 0.1rem; text-align: center; }
.song-card .tap-hint { padding: 0 0.75rem; }
.verb-touch { display: none; }
@media (max-width: 820px), (hover: none) { .verb-touch { display: inline; } .verb-click { display: none; } }
@media (max-width: 820px) {
  .tap-hint { display: block; font-size: 0.72rem; font-style: italic; color: #8a7f72; line-height: 1.35; margin: 0.35rem 0.25rem 0.1rem; text-align: center; }
  .song-card .tap-hint { padding: 0 0.75rem; }
}
@media (max-width: 820px) { .play-hint { margin-top: 0.4rem; } }

/* Picture inside "The Story Behind the Song" (e.g. Gramma Adams on Hey! Don't Go) */
.story-figure {
  margin: 0.5rem 0 1.25rem;
  padding: 0.5rem;
  background: #fffaf3;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.story-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}
@media (min-width: 821px) {
  .story-figure { max-width: 560px; margin: 0.75rem auto 1.5rem; }
}
