/* ===== Theme variables – edit these to restyle the whole site ===== */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1c2230;
  --muted: #6b7385;
  --primary: #3b5bdb;
  --primary-contrast: #ffffff;
  --accent: #f59f00;
  --border: #e3e6ee;
  --radius: 14px;
  --lyrics-size: 20px;
  --font-main: 'Inter', 'Noto Sans Myanmar', 'Padauk', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
[data-theme="dark"] {
  --bg: #0f1320;
  --surface: #181d2e;
  --text: #e8ebf5;
  --muted: #9aa3ba;
  --primary: #7c9bff;
  --primary-contrast: #0f1320;
  --border: #2a3148;
}

body { font-family: var(--font-main); background: var(--bg); color: var(--text); line-height: 1.7; }
a { color: var(--primary); }
.text-muted { color: var(--muted) !important; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-color: var(--primary-contrast); --bs-btn-hover-color: var(--primary-contrast); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: var(--primary-contrast); }
.print-only { display: none; }

/* Navbar & footer */
.site-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-nav .navbar-brand, .site-nav .nav-link { color: var(--text); }
.site-nav .nav-link:hover { color: var(--primary); }
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; }

/* Home hero */
.home-hero, .page-hero {
  background: linear-gradient(135deg, #3b5bdb 0%, #7048e8 100%);
  color: #fff; text-align: center; padding: 3rem 0 2.5rem;
}
.page-hero { text-align: left; padding: 2rem 0; }
.page-hero a { color: #fff; opacity: .85; }
.home-hero .form-control, .home-hero .form-select { border: 0; }

/* Song cards */
.song-card { display: block; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.song-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); color: var(--text); }
.song-card-bg { height: 70px; background-size: cover; background-position: center; }
.song-card-body { padding: .9rem 1rem 1rem; }
.badge-key { background: var(--accent); color: #1c2230; }

/* Background presets (used by cards and hero) */
.bg-default { background: linear-gradient(135deg, #4c6ef5, #9775fa); }
.bg-sunrise { background: linear-gradient(135deg, #ff922b, #f06595); }
.bg-ocean   { background: linear-gradient(135deg, #1c7ed6, #15aabf); }
.bg-forest  { background: linear-gradient(135deg, #2f9e44, #94d82d); }
.bg-night   { background: linear-gradient(135deg, #1b1f3b, #5f3dc4); }
.has-img    { background-size: cover; background-position: center; }

/* Song page */
.song-hero { background-size: cover; background-position: center; color: #fff; }
.song-hero-overlay { background: linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,.7)); padding: 3rem 0 2.5rem; backdrop-filter: blur(2px); }
.song-title { font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.8rem); line-height: 1.35; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.song-subtitle { font-size: 1.15rem; opacity: .9; margin: 0; }
.back-link { color: #fff; opacity: .9; text-decoration: none; }
.reader-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }

.lyrics { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1rem, 3vw, 2rem); font-size: var(--lyrics-size); line-height: 1.9; overflow-wrap: anywhere; }
.lyrics p { margin: 0 0 .15rem; white-space: pre-wrap; }
.lyrics p:has(> strong:only-child) { margin-top: 1.1rem; color: var(--primary); }
.lyrics h2, .lyrics h3, .lyrics h4 { margin-top: 1.2rem; color: var(--primary); font-size: 1.1em; }
.lyrics pre, .lyrics .ql-syntax { background: transparent; color: inherit; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-weight: 700; white-space: pre-wrap; margin: 0; padding: 0; color: var(--accent); }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }

/* Responsive tweaks (mobile-first base, projector scale-up) */
@media (min-width: 1600px) { :root { --lyrics-size: 28px; } .container { max-width: 1400px; } }

/* ===== Print: A4, black on white, only title + key + lyrics ===== */
@page { size: A4; margin: 15mm; }
@media print {
  .no-print, nav, footer, .song-hero, aside, .reader-toolbar, iframe { display: none !important; }
  .print-only { display: block !important; }
  html, body { background: #fff !important; color: #000 !important; }
  body { font-size: 12pt; line-height: 1.5; }
  .container { max-width: 100% !important; padding: 0 !important; }
  .col-lg-8 { width: 100% !important; flex: 0 0 100% !important; }
  .print-header { border-bottom: 1.5px solid #000; margin-bottom: 10pt; padding-bottom: 6pt; }
  .print-header h1 { font-size: 20pt; margin: 0 0 4pt; color: #000; }
  .print-header p { margin: 0; font-size: 11pt; }
  .lyrics { border: 0 !important; background: none !important; padding: 0 !important; font-size: 13pt !important; line-height: 1.55 !important; color: #000 !important; }
  .lyrics *, .lyrics p:has(> strong:only-child) { color: #000 !important; }
  .lyrics a { text-decoration: none; }
  .lyrics p, .lyrics li { break-inside: avoid; }
}

/* ===== Song number + search additions ===== */
.num-badge { display: inline-block; min-width: 2.6em; padding: 0 .45em; border-radius: 6px; background: var(--primary); color: var(--primary-contrast); font-weight: 700; font-size: .85em; text-align: center; }
.exact-match { border: 2px solid #2f9e44; box-shadow: 0 0 0 4px rgba(47,158,68,.18); }
.exact-match .song-card-bg { height: 46px; }
.nav-search { min-width: 220px; }
.nav-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 1050; margin-top: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); overflow: hidden; min-width: 280px; }
.nav-results a { display: flex; gap: .6rem; align-items: center; padding: .5rem .75rem; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.nav-results a:last-child { border-bottom: 0; }
.nav-results a:hover, .nav-results a.active { background: var(--bg); }
.nav-results .nr-empty { padding: .6rem .75rem; color: var(--muted); font-size: .9rem; }
.nav-results .nr-exact { border-left: 4px solid #2f9e44; background: rgba(47,158,68,.08); }
@media (max-width: 991.98px) { .nav-results { position: static; box-shadow: none; } }
@media print { .nav-search, .nav-results { display: none !important; } .print-num { font-weight: 700; } }
