/* ============================================================
   css/style.css — Public zone styles (bhakti / saffron palette)
   Radhe Krishan · mobile-first
   ============================================================ */

/* ── Custom properties ──────────────────────────────────────── */
:root {
  --rk-bg:        #FDF6EC;
  --rk-surface:   #FFFDF8;
  --rk-border:    #EAD9C0;
  --rk-saffron:   #F59E0B;
  --rk-saffron-d: #D97706;
  --rk-saffron-l: #FEF3C7;
  --rk-text-1:    #1C0F00;
  --rk-text-2:    #6B4F30;
  --rk-text-3:    #A07840;
  --rk-radius:    12px;
  --rk-shadow:    0 2px 12px rgba(28,15,0,.08);
  --nav-h:        56px;   /* top nav height */
  --tab-h:        64px;   /* bottom tab bar height */
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--rk-bg);
  color: var(--rk-text-1);
  min-height: 100vh;
  /* leave room for fixed top nav + bottom tab bar */
  padding-top: var(--nav-h);
  padding-bottom: var(--tab-h);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Sora', sans-serif; line-height: 1.2; }
h1 { font-size: clamp(1.5rem, 5vw, 2.25rem); }
h2 { font-size: clamp(1.2rem, 4vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p  { line-height: 1.6; }

/* ── Layout helpers ─────────────────────────────────────────── */
.page-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.section { margin-bottom: 2rem; }

.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--rk-text-3);
  margin-bottom: 0.75rem;
}

/* ── Top navigation bar ─────────────────────────────────────── */
#rk-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--rk-surface);
  border-bottom: 1px solid var(--rk-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
}

.rk-nav__logo {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--rk-saffron);
}

.rk-nav__greeting {
  font-size: 0.8rem;
  color: var(--rk-text-2);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-nav__actions { display: flex; align-items: center; gap: 0.5rem; }

/* ── Bottom tab bar ─────────────────────────────────────────── */
#rk-tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--tab-h);
  background: var(--rk-surface);
  border-top: 1px solid var(--rk-border);
  display: flex;
  align-items: stretch;
  z-index: 100;
}

.rk-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--rk-text-3);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}
.rk-tab svg { width: 22px; height: 22px; }
.rk-tab.active {
  color: var(--rk-saffron);
}
.rk-tab.active svg { stroke: var(--rk-saffron); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background .15s, opacity .15s;
  min-height: 44px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--rk-saffron);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--rk-saffron-d); }

.btn-secondary {
  background: var(--rk-saffron-l);
  color: var(--rk-saffron-d);
}
.btn-secondary:hover:not(:disabled) { background: #fde68a; }

.btn-ghost {
  background: transparent;
  color: var(--rk-text-2);
  border: 1px solid var(--rk-border);
}
.btn-ghost:hover:not(:disabled) { background: var(--rk-bg); }

.btn-full { width: 100%; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius);
  box-shadow: var(--rk-shadow);
  overflow: hidden;
}

.card-body { padding: 1rem; }

/* ── Story card ─────────────────────────────────────────────── */
.story-card {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius);
  overflow: hidden;
  transition: box-shadow .15s;
}
.story-card:hover { box-shadow: var(--rk-shadow); }

.story-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--rk-saffron-l);
}

.story-card__body { padding: 0.875rem; }
.story-card__title {
  font-family: 'Sora', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--rk-text-1);
}
.story-card__excerpt {
  font-size: 0.8rem;
  color: var(--rk-text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

/* ── Pillar badge ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--rk-saffron-l);
  color: var(--rk-saffron-d);
}

/* ── Quick-resume japa card ─────────────────────────────────── */
.japa-resume-card {
  background: linear-gradient(135deg, var(--rk-saffron) 0%, var(--rk-saffron-d) 100%);
  color: #fff;
  border-radius: var(--rk-radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.japa-resume-card__info { flex: 1; }
.japa-resume-card__label {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: .85;
  margin-bottom: 0.25rem;
}
.japa-resume-card__count {
  font-family: 'Sora', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}
.japa-resume-card__btn {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  min-height: 44px;
}

/* ── Greeting header ────────────────────────────────────────── */
.greeting {
  margin-bottom: 1.25rem;
}
.greeting__text {
  font-family: 'Sora', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rk-text-1);
}
.greeting__sub {
  font-size: 0.85rem;
  color: var(--rk-text-2);
  margin-top: 0.2rem;
}

/* ── Streak dots ────────────────────────────────────────────── */
.streak-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.streak-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rk-border);
}
.streak-dot.done { background: var(--rk-saffron); }
.streak-dot.today {
  background: transparent;
  border: 2px solid var(--rk-saffron);
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--rk-border);
  margin: 1.5rem 0;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--rk-text-3);
}
.empty-state p { font-size: 0.9rem; margin-top: 0.5rem; }

/* ── Stories grid ───────────────────────────────────────────── */
.stories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .stories-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Stat grid ──────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.stat-box {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: 10px;
  padding: 0.875rem;
  text-align: center;
}
.stat-box__value {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rk-saffron);
}
.stat-box__label {
  font-size: 0.72rem;
  color: var(--rk-text-3);
  margin-top: 0.2rem;
}

/* ── Toast notification ─────────────────────────────────────── */
.rk-toast {
  position: fixed;
  bottom: calc(var(--tab-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--rk-text-1);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 200;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.rk-toast.show { opacity: 1; }

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
