/* ============================================================
   The Daily Cheer — style.css
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow:    #f5c842;
  --yellow-lt: #fff8d6;
  --yellow-dk: #d4a200;
  --green:     #2ecb71;
  --green-lt:  #e6faf0;
  --coral:     #ff6b6b;
  --coral-lt:  #fff0f0;
  --bg:        #fffdf4;
  --surface:   #ffffff;
  --border:    #f0ead8;
  --text:      #1a1a1a;
  --text-2:    #555;
  --text-3:    #888;
  --radius:    14px;
  --shadow:    0 4px 20px rgba(0,0,0,.07);
  --shadow-hover: 0 8px 32px rgba(0,0,0,.13);
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
  --max-w:     1200px;
  --trans:      0.22s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(100%, var(--max-w));
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 24px; border-radius: 100px;
  font-family: var(--font-sans); font-size: .95rem; font-weight: 600;
  cursor: pointer; text-decoration: none; border: 2px solid transparent;
  transition: transform var(--trans), box-shadow var(--trans), background var(--trans), color var(--trans);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--yellow); color: #1a1a1a; border-color: var(--yellow); }
.btn-primary:hover  { background: var(--yellow-dk); border-color: var(--yellow-dk); box-shadow: 0 4px 16px rgba(245,200,66,.4); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--text); }
.btn-secondary:hover { background: var(--text); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--yellow); background: var(--yellow-lt); }
.btn-sm { padding: 8px 18px; font-size: .88rem; }

/* ---------- Site Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,253,244,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.logo-icon { font-size: 1.5rem; }
.logo-text  { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; color: var(--text); }

.main-nav {
  display: flex; gap: 4px; margin-left: auto;
}
.main-nav a {
  padding: 6px 14px; border-radius: 100px;
  text-decoration: none; font-size: .9rem; font-weight: 500; color: var(--text-2);
  transition: background var(--trans), color var(--trans);
}
.main-nav a:hover { background: var(--yellow-lt); color: var(--text); }

.mood-btn {
  flex-shrink: 0; padding: 8px 18px; border-radius: 100px;
  background: var(--yellow); border: none; font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: background var(--trans), transform var(--trans);
}
.mood-btn:hover { background: var(--yellow-dk); transform: scale(1.04); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #fff8d6 0%, #fde9b0 50%, #ffe4c8 100%);
  padding: 80px 0 0;
  position: relative; overflow: hidden;
}
.hero-inner { text-align: center; padding-bottom: 60px; }
.hero-kicker {
  display: inline-block; font-size: .9rem; font-weight: 600;
  color: var(--text-2); letter-spacing: .04em; margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-serif); font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 900; line-height: 1.1; color: var(--text);
  margin-bottom: 16px;
}
.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.3rem); color: var(--text-2);
  max-width: 540px; margin: 0 auto 32px;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex; gap: 40px; justify-content: center; flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num {
  font-family: var(--font-serif); font-size: 2rem; font-weight: 700;
  color: var(--text);
}
.stat-label { font-size: .8rem; color: var(--text-3); font-weight: 500; }

.hero-wave { display: block; line-height: 0; margin-bottom: -2px; }
.hero-wave svg { width: 100%; display: block; }

/* ---------- Ticker ---------- */
.ticker-wrap {
  background: var(--yellow);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; overflow: hidden;
  border-bottom: 2px solid var(--yellow-dk);
  position: relative;
  z-index: 10;
  clear: both;
}
.ticker-label {
  flex-shrink: 0; font-size: .85rem; font-weight: 700;
  white-space: nowrap;
}
.ticker-track {
  display: flex; gap: 24px; white-space: nowrap;
  animation: ticker 28s linear infinite;
  font-size: .88rem;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Story Grid ---------- */
main { padding: 40px 0 20px; margin-top: 20px; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 {
  font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700; margin-bottom: 8px;
}
.section-sub { color: var(--text-2); font-size: 1rem; }

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.story-card {
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans);
  display: flex; flex-direction: column;
  position: relative;
}
.story-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.card-featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.card-featured .card-media { width: 40%; flex-shrink: 0; }
.card-featured .card-body  { padding: 32px; }

.card-media { aspect-ratio: 16/9; overflow: hidden; }
.card-featured .card-media { aspect-ratio: auto; min-height: 240px; }

.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.card-emoji { font-size: 4rem; }

.card-badge {
  position: absolute; top: 14px; left: 14px;
  background: var(--yellow); color: var(--text);
  padding: 4px 12px; border-radius: 100px;
  font-size: .78rem; font-weight: 700;
}
.funny-badge { background: var(--coral-lt); color: var(--coral); }

.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-tag {
  display: inline-block; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--green); margin-bottom: 8px;
}
.card-body h3 {
  font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700;
  line-height: 1.3; margin-bottom: 10px; flex: 1;
}
.card-featured .card-body h3 { font-size: 1.7rem; }
.card-body p { font-size: .9rem; color: var(--text-2); line-height: 1.6; margin-bottom: 16px; }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
}
.card-date { font-size: .8rem; color: var(--text-3); }
.smile-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 100px; padding: 4px 12px;
  font-size: .85rem; cursor: pointer;
  transition: background var(--trans), transform var(--trans);
  display: flex; align-items: center; gap: 4px;
}
.smile-btn:hover { background: var(--yellow-lt); transform: scale(1.06); }
.smile-btn.smiling { background: var(--yellow-lt); border-color: var(--yellow); }

.load-more-wrap { text-align: center; margin-bottom: 60px; }

/* ---------- Categories ---------- */
.categories-section { background: var(--surface); padding: 60px 0; }
.categories-section h2 {
  font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700; margin-bottom: 8px;
}
.category-grid {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px;
}
.cat-pill {
  padding: 10px 20px; border-radius: 100px;
  border: 2px solid var(--border); background: var(--surface);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: all var(--trans);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--yellow); border-color: var(--yellow);
  transform: scale(1.04);
}

/* ---------- Quote ---------- */
.quote-section {
  background: linear-gradient(135deg, #fff8d6 0%, #fffdf4 100%);
  padding: 60px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.quote-inner {
  max-width: 680px; text-align: center; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.quote-mark {
  font-family: var(--font-serif); font-size: 8rem; line-height: 0;
  color: var(--yellow); position: absolute; top: -20px; left: -20px;
  opacity: .4; user-select: none;
}
blockquote {
  font-family: var(--font-serif); font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 700; line-height: 1.4; color: var(--text); position: relative;
}
cite { font-size: .95rem; color: var(--text-2); font-style: normal; }

/* ---------- Mood Overlay ---------- */
.mood-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.mood-overlay[hidden] { display: none; }
.mood-box {
  background: var(--surface); border-radius: 24px;
  padding: 48px 40px; max-width: 440px; width: 100%;
  text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.2);
  position: relative;
  animation: popIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mood-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; font-size: 1.2rem;
  cursor: pointer; color: var(--text-3);
}
.mood-emoji { font-size: 4rem; margin-bottom: 16px; }
.mood-fact {
  font-size: 1.1rem; line-height: 1.5; color: var(--text);
  margin-bottom: 24px;
}

/* ---------- Newsletter ---------- */
.newsletter-section {
  background: var(--green);
  padding: 80px 0;
  color: #fff;
}
.newsletter-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.nl-kicker { display: block; font-size: .85rem; font-weight: 700; opacity: .85; margin-bottom: 8px; }
.newsletter-section h2 {
  font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700; margin-bottom: 12px; color: #fff;
}
.newsletter-section p { opacity: .9; margin-bottom: 16px; }
.nl-perks { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.nl-perks li { font-size: .95rem; opacity: .9; }

.nl-form { display: flex; flex-direction: column; gap: 12px; }
.nl-form input {
  padding: 14px 18px; border-radius: 10px;
  border: 2px solid rgba(255,255,255,.3); background: rgba(255,255,255,.15);
  color: #fff; font-size: 1rem; font-family: var(--font-sans);
  transition: border-color var(--trans);
}
.nl-form input::placeholder { color: rgba(255,255,255,.65); }
.nl-form input:focus { outline: none; border-color: rgba(255,255,255,.8); }
.nl-fine { font-size: .8rem; opacity: .7; }
.nl-success {
  background: rgba(255,255,255,.2); padding: 14px; border-radius: 10px;
  font-weight: 600; text-align: center;
}

/* ---------- Footer ---------- */
.site-footer { background: #1a1a1a; color: #ccc; padding: 60px 0 0; }
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 40px; border-bottom: 1px solid #333;
}
.footer-brand .logo-text { color: #fff; }
.footer-brand p { font-size: .9rem; margin-top: 12px; opacity: .7; }
.footer-fine { font-size: .8rem; opacity: .5; margin-top: 6px; }

.footer-nav h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #fff; margin-bottom: 12px; }
.footer-nav a {
  display: block; color: #999; text-decoration: none; font-size: .9rem;
  margin-bottom: 8px; transition: color var(--trans);
}
.footer-nav a:hover { color: var(--yellow); }

.footer-social h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #fff; margin-bottom: 12px; }
.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 40px; height: 40px; border-radius: 50%;
  background: #333; display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; font-weight: 700;
  transition: background var(--trans);
}
.social-links a:hover { background: var(--yellow); color: #1a1a1a; }

.footer-bottom { background: #111; padding: 16px 0; }
.footer-bottom p { font-size: .82rem; color: #666; text-align: center; }
.footer-bottom a { color: #888; text-decoration: none; }
.footer-bottom a:hover { color: var(--yellow); }

/* ---------- Chill Zone Widget ---------- */

/* ===== ZEN LOFI WIDGET ===== */
.chill-trigger {
  position: fixed; bottom: 24px; right: 20px; z-index: 9999;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--yellow); border: none; font-size: 1.9rem;
  cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.chill-trigger:active { transform: scale(.92); }
.chill-panel {
  position: fixed; bottom: 100px; right: 12px; left: 12px; z-index: 9998;
  background: #fff; border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,.22);
  overflow: hidden; max-width: 420px; margin: 0 auto;
  transform: translateY(20px) scale(.97); opacity: 0; pointer-events: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s;
}
@media (min-width: 480px) {
  .chill-panel { left: auto; right: 20px; width: 380px; }
}
.chill-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.chill-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--yellow);
}
.chill-title { font-weight: 700; font-size: 1.05rem; }
.chill-title a { color: inherit; text-decoration: none; }
.chill-close {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.1); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chill-tabs { display: flex; gap: 8px; padding: 12px 12px 0; }
.chill-tab {
  flex: 1; padding: 12px 4px; border-radius: 12px;
  border: 2px solid #e5e7eb; background: none;
  font-size: .85rem; font-weight: 600; cursor: pointer;
  color: #555; min-height: 48px; transition: all .15s;
}
.chill-tab.active { background: var(--yellow); border-color: var(--yellow); color: #1a1a1a; }
.chill-body { padding: 12px; }
.chill-pane { display: none; }
.chill-pane.active { display: block; }
.chill-hint { font-size: .78rem; color: #888; margin: 0 0 10px; text-align: center; }

/* Nature grid — 2x4 big tap targets */
.nature-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.nb {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 8px; border-radius: 14px;
  border: 2px solid #e5e7eb; background: #fafafa;
  font-size: 1.6rem; cursor: pointer; min-height: 72px;
  transition: all .15s; -webkit-tap-highlight-color: transparent;
}
.nb span { font-size: .78rem; font-weight: 600; color: #444; }
.nb.playing { background: #d1fae5; border-color: #34d399; }
.nb:active { transform: scale(.93); }

/* Stream links — big tap-friendly */
.stream-links { display: flex; flex-direction: column; gap: 10px; }
.stream-link {
  display: block; padding: 16px 18px; border-radius: 14px;
  background: #f3f4f6; border: 2px solid #e5e7eb;
  font-size: .95rem; font-weight: 600; color: #1a1a1a;
  text-decoration: none; transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.stream-link:active { background: var(--yellow-lt); border-color: var(--yellow); }
.zl-link { background: var(--yellow-lt); border-color: var(--yellow); }
/* ===== END ZEN LOFI WIDGET ===== */

/* Stream cards */
.stream-cards { display: flex; flex-direction: column; gap: 8px; }
.stream-card {
  padding: 14px 16px; border-radius: 12px;
  border: 2px solid #e5e7eb; background: #f9fafb;
  font-size: .92rem; font-weight: 600; color: #1a1a1a;
  cursor: pointer; transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.stream-card:active, .stream-card.active {
  background: var(--yellow-lt); border-color: var(--yellow);
}
