/* ==========================================================================
   Mel's Music & Ministry — site styles
   One stylesheet, no framework. Mobile-first; breakpoints at 42rem / 62rem.
   ========================================================================== */

:root {
  --paper:   #fbfaf7;
  --paper-2: #f4f2ec;
  --ink:     #111a2b;
  --ink-2:   #39414f;
  --muted:   #6d7280;
  --line:    #e3ded3;
  --accent:  #a8202a;
  --accent-2:#c22c34;
  --gold:    #b08a42;
  --lav:     #f1eff8;
  --white:   #ffffff;
  --radius:  14px;
  --shadow:  0 1px 2px rgba(17,26,43,.05), 0 12px 32px -18px rgba(17,26,43,.28);
  --serif:   "Fraunces", Georgia, "Times New Roman", serif;
  --sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max:     74rem;
  --read:    40rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 .6em;
  font-variation-settings: "SOFT" 0, "WONK" 0;
}
h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1.15em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: clamp(1.15rem, 4vw, 2.5rem); }
.narrow { max-width: var(--read); }
.center { text-align: center; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--white); padding: .75rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ------------------------------------------------------------------ header */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 1rem; min-height: 4.5rem; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark { display: block; width: 2.5rem; height: 2.5rem; flex: 0 0 auto; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 1.06rem; color: var(--ink); }
.brand-tag { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.site-nav ul { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: .9rem; letter-spacing: .01em;
  padding-block: .35rem; border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-cart a { display: inline-flex; align-items: center; gap: .35rem; }
.cart-badge {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem;
  padding-inline: .3rem; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: .68rem; font-weight: 600;
}

.nav-toggle { display: none; }

@media (max-width: 62rem) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 2.6rem; height: 2.4rem; padding: .5rem; cursor: pointer;
    border: 1px solid var(--line); border-radius: 9px; order: 3;
  }
  .nav-toggle span { display: block; height: 1.5px; background: var(--ink); width: 100%; }
  .site-nav {
    display: none; order: 4; width: 100%; border-top: 1px solid var(--line); padding-block: .6rem 1rem;
  }
  .nav-toggle-input:checked ~ .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: .1rem; }
  .site-nav a { display: block; padding: .55rem 0; font-size: 1rem; }
  .head-inner { flex-wrap: wrap; }
}

/* -------------------------------------------------------------------- hero */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 1.9rem; height: 1px; background: var(--accent); opacity: .55; }

.hero h1 { margin-bottom: .5em; }
.hero-lede { font-size: clamp(1.05rem, 1.7vw, 1.24rem); color: var(--ink-2); max-width: 33rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }

.hero-art { position: relative; }
.hero-art img {
  border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow);
  width: 100%; max-width: 24rem; margin-inline: auto;
}
.hero-grid--solo { grid-template-columns: minmax(0, 34rem); }
.hero-grid--solo .hero-quote { margin-top: 2rem; }
.hero-quote {
  margin-top: 1.25rem; padding: 1rem 1.15rem; border-left: 2px solid var(--gold);
  font-family: var(--serif); font-size: 1.02rem; color: var(--ink); font-style: italic;
}
.hero-quote cite { display: block; margin-top: .4rem; font-family: var(--sans); font-style: normal; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  font-size: .93rem; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  background: var(--ink); color: var(--paper); font-family: var(--sans);
}
.btn:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); }
.btn-sm { padding: .5rem .95rem; font-size: .83rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ------------------------------------------------------------------ blocks */
.section { padding-block: clamp(2.75rem, 6vw, 4.75rem); }
.section-alt { background: var(--paper-2); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; margin-bottom: 2rem; }
.section-head h2 { margin: 0; }
.section-head .more { margin-left: auto; font-size: .88rem; }
.section-lede { max-width: 38rem; color: var(--muted); margin-top: -.75rem; margin-bottom: 2rem; }

/* ------------------------------------------------------------------ books */
.book-rows { display: flex; flex-direction: column; gap: clamp(2rem, 5vw, 3.5rem); }
.book-row { display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; }
@media (min-width: 52rem) { .book-row { grid-template-columns: 17rem 1fr; } }
.book-row .book-cover { display: block; max-width: 17rem; }
.book-copy .prose { max-width: 40rem; margin-top: .75rem; }
.card-soft {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.card-soft p { color: var(--muted); font-size: .95rem; }
.book-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.book { display: grid; gap: 1.25rem; }
.book-cover { border-radius: 6px; overflow: hidden; box-shadow: 0 18px 40px -24px rgba(17,26,43,.55); background: var(--paper-2); }
.book-cover img { width: 100%; display: block; }
.badge-free {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  background: #eef4ec; color: #2c6b3f; font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 600; margin-bottom: .6rem;
}
.book-title { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); margin: 0 0 .3rem; }
.book-sub { font-size: .88rem; color: var(--muted); margin: 0 0 .7rem; }
.book-detail .book-cover { max-width: 22rem; }

/* ------------------------------------------------------------------- cards */
.grid { display: grid; gap: clamp(1.1rem, 2.5vw, 1.75rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--line) 60%, var(--gold)); }
.card-media { aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-kicker { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.card-title { font-family: var(--serif); font-size: 1.18rem; color: var(--ink); margin: 0; line-height: 1.25; }
.card-text { font-size: .92rem; color: var(--muted); margin: 0; }
.card-price { margin-top: auto; font-size: .95rem; color: var(--ink); font-weight: 500; }

.card-song .card-media { aspect-ratio: 16 / 9; }
.play-badge {
  position: absolute; inset: auto auto .6rem .6rem; display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%; background: rgba(27,23,18,.72); color: #fff;
  font-size: .7rem;
}

/* -------------------------------------------------------------- page header */
.page-head { padding-block: clamp(2.75rem, 7vw, 5rem) 1.5rem; }
.page-head h1 { max-width: 24ch; }
.page-head .lede { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--muted); max-width: 42rem; margin-top: -.25rem; }
.page-meta { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------------ prose */
.prose { max-width: var(--read); font-size: 1.06rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.1em; font-size: clamp(1.5rem, 3vw, 1.95rem); }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-bottom: .45em; }
.prose blockquote {
  margin: 1.9em 0; padding: .35em 0 .35em 1.25em; border-left: 2px solid var(--gold);
  font-family: var(--serif); font-size: 1.16rem; color: var(--ink);
}
.prose img { border-radius: var(--radius); margin-block: 1.6em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.4em; }
.prose a { text-decoration: underline; }
.prose-lede > p:first-of-type {
  font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  line-height: 1.45; color: var(--ink); margin-bottom: 1.2em;
}
.prose h2 + p { margin-top: .2em; }
.prose > h2 { margin-top: 2.4em; }

/* ------------------------------------------------------------- song detail */
.song-layout { display: grid; gap: clamp(1.75rem, 4vw, 3rem); align-items: start; }
@media (min-width: 62rem) { .song-layout { grid-template-columns: 1.25fr .75fr; } }

.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lyrics {
  white-space: pre-wrap; font-family: var(--serif); font-size: 1.08rem; line-height: 1.85;
  color: var(--ink-2); background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem);
}
.scripture {
  font-family: var(--serif); font-style: italic; color: var(--ink);
  border-left: 2px solid var(--gold); padding-left: 1rem; margin-block: 1.5rem;
}
.song-aside { display: flex; flex-direction: column; gap: 1rem; }
.aside-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.aside-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.aside-card p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- forms */
.field { margin-bottom: 1.15rem; }
.field label, .label { display: block; font-size: .84rem; font-weight: 500; letter-spacing: .02em; color: var(--ink); margin-bottom: .4rem; }
.hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.err { font-size: .8rem; color: #9b2323; margin-top: .3rem; }

.input, .textarea, .select {
  width: 100%; padding: .72rem .85rem; font: inherit; font-size: .96rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 42rem) { .field-row { grid-template-columns: 1fr 1fr; } }

/* --------------------------------------------------------------- shop/cart */
.product-layout { display: grid; gap: clamp(1.75rem, 4vw, 3.25rem); align-items: start; }
@media (min-width: 62rem) { .product-layout { grid-template-columns: 1fr 1fr; } }
.product-media { border-radius: var(--radius); overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); }
.product-price { font-family: var(--serif); font-size: 1.6rem; color: var(--ink); margin-bottom: 1rem; }

.cart-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.cart-table th {
  text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding-bottom: .7rem; border-bottom: 1px solid var(--line);
}
.cart-table td { padding-block: 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cart-table .qty-input { width: 4.2rem; text-align: center; }
.cart-summary { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.06rem; font-weight: 500; color: var(--ink); margin-bottom: 1rem; }
.cart-empty { text-align: center; padding-block: 4rem; }

/* ------------------------------------------------------------------- flash */
.flash-wrap { width: 100%; max-width: var(--max); margin: 1rem auto 0; padding-inline: clamp(1.15rem, 4vw, 2.5rem); }
.flash {
  padding: .8rem 1rem; border-radius: 10px; font-size: .92rem; margin-bottom: .6rem;
  border: 1px solid var(--line); background: var(--white);
}
.flash-success { border-color: #b7d6bd; background: #f1f8f2; color: #245b31; }
.flash-error { border-color: #e3c0c0; background: #fdf2f2; color: #8a2626; }

/* ------------------------------------------------------------------ footer */
.site-foot { margin-top: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--line); background: var(--paper-2); }
.foot-grid { display: grid; gap: 2rem; padding-block: 3rem 2rem; }
@media (min-width: 48rem) { .foot-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.foot-logo { width: 11rem; height: auto; margin-bottom: 1rem; }
.foot-brand { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin-bottom: .35rem; }
.foot-note { font-size: .9rem; color: var(--muted); max-width: 26rem; }
.foot-head { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; font-size: .92rem; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }
.foot-base {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  padding-block: 1.2rem 2rem; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted);
}
.foot-base p { margin: 0; }

/* ------------------------------------------------------------------ events */
.event { display: grid; gap: .4rem 1.5rem; padding-block: 1.4rem; border-bottom: 1px solid var(--line); }
@media (min-width: 48rem) { .event { grid-template-columns: 11rem 1fr; } }
.event-date { font-family: var(--serif); font-size: 1.02rem; color: var(--accent); }
.event-loc { font-size: .85rem; color: var(--muted); }

/* ------------------------------------------------------------------ quotes */
.quote-block {
  font-family: var(--serif); font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.35;
  color: var(--ink); max-width: 34ch; margin-inline: auto; text-align: center;
}
.quote-block cite { display: block; margin-top: 1rem; font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-style: normal; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; }
.pagination a, .pagination span {
  padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  font-size: .85rem; text-decoration: none; color: var(--ink-2);
}
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
