/* ============================================================
   PIANO CHORD LIBRARY — STYLESHEET
   Warm cream/gold palette designed for non-techy users 50+
   ============================================================ */

:root {
  --color-bg: #fdfaf5;
  --color-card: #ffffff;
  --color-cream: #faf7f2;
  --color-border: #e8e2d6;
  --color-gold: #c8a96a;
  --color-gold-dark: #b59556;
  --color-text: #2a2a2a;
  --color-text-soft: #5a4a3a;
  --color-text-muted: #6b6b6b;
  --color-green: #5e8a5e;
  --color-red: #a85a4a;

  --font-serif: Georgia, "Times New Roman", "Cormorant Garamond", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --shadow-soft: 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lift: 0 8px 20px rgba(0,0,0,0.10);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
}

/* ============================================================
   ACCESS CODE GATE
   ============================================================ */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gate-card {
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.gate-card h1 {
  font-size: 28px;
  margin: 0 0 12px 0;
  color: var(--color-text-soft);
}

.gate-card p {
  color: var(--color-text-muted);
  margin: 0 0 24px 0;
}

.gate-card input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-serif);
  font-size: 18px;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 16px;
  outline: none;
}

.gate-card input:focus {
  border-color: var(--color-gold);
}

.gate-card button {
  width: 100%;
  padding: 14px 20px;
  background: var(--color-gold);
  color: white;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gate-card button:hover {
  background: var(--color-gold-dark);
}

.gate-error {
  color: var(--color-red);
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

/* ============================================================
   WELCOME HERO (homepage)
   ============================================================ */

.hero {
  text-align: center;
  padding: 32px 20px 28px 20px;
  background: var(--color-cream);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.hero-logo {
  display: block;
  margin: 0 auto 14px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: white;
  object-fit: contain;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hero h1 {
  font-size: 34px;
  margin: 0 0 10px 0;
  color: var(--color-text-soft);
  font-weight: 600;
}

.hero p {
  font-size: 18px;
  color: var(--color-text-muted);
  margin: 0 0 18px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-tour {
  display: inline-block;
  padding: 12px 22px;
  background: white;
  color: var(--color-text-soft);
  text-decoration: none;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.hero-tour:hover {
  border-color: var(--color-gold);
  color: var(--color-gold-dark);
}

.hero-scroll {
  margin-top: 18px;
  font-size: 15px;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Inline welcome tour video (revealed when the hero link is clicked) */
.hero-video {
  margin: 18px auto 4px auto;
  max-width: 720px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: #000;
}
.hero-video video {
  width: 100%;
  display: block;
}
.hero-video[hidden] {
  display: none;
}

/* ============================================================
   A-Z JUMP STRIP
   ============================================================ */

.az-strip-wrapper {
  background: var(--color-cream);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0 28px 0;
  text-align: center;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 8px;
  z-index: 100;
}

.az-strip-label {
  font-size: 15px;
  color: var(--color-text-soft);
  margin: 0 0 10px 0;
  font-weight: 500;
}

.az-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.az-strip a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 6px 10px;
  background: white;
  color: var(--color-text);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.15s ease;
}

.az-strip a:hover,
.az-strip a:focus {
  background: var(--color-gold);
  color: white;
  border-color: var(--color-gold);
  transform: translateY(-1px);
}

.az-strip a.disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: default;
}

/* Jump-to-ebooks shortcut at the end of the A-Z strip */
.az-strip a.az-ebooks-link {
  margin-left: 6px;
  border-color: var(--color-gold);
  background: var(--color-cream);
  font-size: 18px;
  line-height: 1;
}
.az-strip a.az-ebooks-link::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 18px;
  margin-right: 8px;
  background: var(--color-gold);
  opacity: 0.5;
  vertical-align: middle;
}
.az-strip a.az-ebooks-link:hover,
.az-strip a.az-ebooks-link:focus {
  background: var(--color-gold);
  transform: translateY(-1px);
}

/* Quick-access shortcuts at the start of the A-Z strip (favorites, recent) */
.az-strip a.az-quick-link {
  background: var(--color-cream);
  border-color: var(--color-gold);
  font-size: 17px;
  line-height: 1;
}
.az-strip a.az-quick-link:hover,
.az-strip a.az-quick-link:focus {
  background: var(--color-gold);
  transform: translateY(-1px);
}

/* Favorite button on song cards (small heart in upper-right of thumbnail) */
.song-card-wrapper {
  position: relative;
}
.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.favorite-btn:hover,
.favorite-btn:focus {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  outline: none;
}
.favorite-btn:active {
  transform: scale(0.95);
}
.favorite-btn.is-favorite {
  background: white;
}

/* Large favorite button on the song page header */
.favorite-btn-large {
  position: static;
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 600;
  background: var(--color-cream);
  border: 1.5px solid var(--color-gold);
  color: var(--color-text);
  margin-top: 12px;
  display: inline-flex;
  gap: 6px;
}
.favorite-btn-large.is-favorite {
  background: #fff0f0;
  border-color: #d96f6f;
  color: #b04a4a;
}

/* Quick sections (favorites, recent) at the top of the library page */
.quick-section {
  margin-bottom: 36px;
}
.quick-section .section-heading {
  margin-top: 8px;
  margin-bottom: 18px;
}

@media (max-width: 600px) {
  .az-strip a {
    min-width: 36px;
    min-height: 36px;
    font-size: 15px;
    padding: 4px 8px;
  }
}

/* ============================================================
   LIBRARY SECTIONS
   ============================================================ */

.library-section {
  margin-bottom: 40px;
  scroll-margin-top: 100px;
}

.letter-heading {
  font-size: 30px;
  color: var(--color-gold);
  margin: 28px 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
  letter-spacing: 2px;
  font-weight: 600;
}

.section-heading {
  font-size: 26px;
  color: var(--color-text-soft);
  margin: 40px 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}

/* ============================================================
   SONG GRID & CARDS
   ============================================================ */

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

@media (max-width: 900px) {
  .song-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (max-width: 600px) {
  .song-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.song-card {
  display: block;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
}

.song-card:hover,
.song-card:focus {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--color-gold);
}

.song-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-cream);
  overflow: hidden;
}

.song-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.badge-beginner { background: var(--color-green); }
.badge-intermediate { background: var(--color-gold); }
.badge-advanced { background: var(--color-red); }

.song-card-body {
  padding: 16px 18px 18px 18px;
}

.song-card-title {
  font-size: 21px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.song-card-meta {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

@media (max-width: 600px) {
  .song-card-title { font-size: 19px; }
  .song-card-meta { font-size: 13px; }
}

/* ============================================================
   E-BOOK CARDS
   ============================================================ */

.ebook-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 700px) {
  .ebook-grid {
    grid-template-columns: 1fr;
  }
}

.ebook-card {
  display: block;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: 14px;
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
}

.ebook-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--color-gold);
}

.ebook-card-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.ebook-card-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--color-text);
}

.ebook-card-desc {
  font-size: 15px;
  color: var(--color-text-muted);
  margin: 0;
}

/* ============================================================
   SONG PAGE
   ============================================================ */

.back-link {
  display: inline-block;
  font-size: 16px;
  color: var(--color-text-soft);
  text-decoration: none;
  margin-bottom: 20px;
  padding: 8px 14px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: white;
  transition: all 0.2s ease;
}

.back-link:hover {
  border-color: var(--color-gold);
  color: var(--color-gold-dark);
}

.song-header {
  text-align: center;
  margin-bottom: 24px;
}

.song-header h1 {
  font-size: 36px;
  margin: 0 0 8px 0;
  color: var(--color-text);
  font-weight: 600;
}

.song-header-meta {
  color: var(--color-text-muted);
  font-size: 16px;
}

.song-key-pill {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 14px;
  background: var(--color-cream);
  color: var(--color-gold);
  border: 1.5px solid var(--color-gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: black;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
  background: black;
}

.video-hint {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 32px 0;
}

.chord-sheet-section {
  background: var(--color-cream);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.chord-sheet-section h2 {
  font-size: 22px;
  margin: 0 0 16px 0;
  color: var(--color-text-soft);
}

.action-button {
  display: block;
  width: 100%;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: white;
  color: var(--color-text);
  border: 2px solid var(--color-border);
  border-radius: 10px;
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-button:hover {
  border-color: var(--color-gold);
  background: var(--color-gold);
  color: white;
  transform: translateY(-1px);
}

.action-button:last-child {
  margin-bottom: 0;
}

.action-icon {
  margin-right: 8px;
  font-size: 20px;
}

.print-tip {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 12px;
  font-style: italic;
}

.quick-tip {
  background: #fdf6e3;
  border-left: 4px solid var(--color-gold);
  padding: 18px 20px;
  border-radius: 8px;
  margin-bottom: 32px;
}

.quick-tip-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-gold-dark);
  letter-spacing: 1px;
  margin: 0 0 6px 0;
  text-transform: uppercase;
}

.quick-tip-body {
  font-size: 16px;
  color: var(--color-text-soft);
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   E-BOOK VIEWER PAGE
   ============================================================ */


/* ============================================================
   STUCK BUTTON & FOOTER
   ============================================================ */

.stuck-help-section {
  text-align: center;
  margin: 40px 0 24px 0;
  padding: 24px;
  background: var(--color-cream);
  border-radius: var(--radius);
}

.stuck-help-section p {
  font-size: 17px;
  color: var(--color-text-soft);
  margin: 0 0 14px 0;
}

.stuck-help-button {
  display: inline-block;
  background: var(--color-gold);
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.stuck-help-button:hover {
  background: var(--color-gold-dark);
  transform: translateY(-1px);
}

.smiley-feedback {
  text-align: center;
  margin: 30px 0;
  padding: 16px;
}

.smiley-feedback p {
  color: var(--color-text-soft);
  margin: 0 0 14px 0;
  font-size: 16px;
}

.smiley-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 12px 0;
}

.smiley {
  font-size: 38px;
  text-decoration: none;
  transition: transform 0.2s ease;
  display: inline-block;
}

.smiley:hover {
  transform: scale(1.2);
}

.smiley-caption {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 12px;
}

.footer {
  text-align: center;
  padding: 30px 20px 10px 20px;
  border-top: 1px solid var(--color-border);
  margin-top: 30px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.footer a {
  color: var(--color-gold-dark);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ============================================================
   PRINT STYLES (when printing the page itself)
   ============================================================ */

@media print {
  .az-strip-wrapper, .hero-tour, .hero-scroll, .stuck-help-section,
  .smiley-feedback, .back-link, .footer {
    display: none !important;
  }
}
