/* ============================================================
   SANKOFA PAGE LAYOUTS
   Per-page layout rules + desktop breakpoints (≥ 1024px).
   ============================================================ */

/* ── APP SHELL ───────────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100dvh;
  position: relative;
}

#page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── HOME PAGE ───────────────────────────────────────────── */
#page-home .hero {
  padding: var(--space-10) var(--space-6) var(--space-12);
}

#page-home .hero .medallion-center {
  margin: var(--space-4) auto 0;
}

.path-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.path-card {
  background: var(--color-light-fill);
  border: 1px solid var(--color-warm-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.path-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.path-card__heading {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-dark);
  line-height: 1.2;
  margin-top: var(--space-2);
}

.path-card__body {
  font-size: var(--text-base);
  color: var(--color-charcoal);
  line-height: 1.55;
}

/* ── LENS MAP PAGE ───────────────────────────────────────── */
#page-lens-map .page-scroll {
  background: var(--color-white);
}

.checkpoint-map-section {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.map-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.map-section-header .kicker--green {
  font-size: var(--text-xs);
}

.map-location-label {
  font-size: var(--text-sm);
  color: var(--color-charcoal-light);
}

.checkpoint-detail-section {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.checkpoint-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

/* ── LENS ROUTE COMPLETE PAGE ────────────────────────────── */
.badge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

#page-lens-complete .page-scroll {
  background: var(--color-white);
}

/* ── VOICES LIBRARY PAGE ─────────────────────────────────── */
.voices-search-section {
  padding: var(--space-5) var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-warm-border);
}

.stories-results-label {
  font-size: var(--text-sm);
  color: var(--color-charcoal-light);
  padding: var(--space-4) var(--space-5) 0;
}

.stories-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  padding-bottom: calc(var(--nav-height) + var(--space-4));
}

/* ── VOICES DETAIL PAGE ──────────────────────────────────── */
#page-voices-detail .page-scroll {
  background: var(--color-white);
}

.story-detail-content {
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-bottom: calc(var(--nav-height) + var(--space-8));
}

.story-detail-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.story-detail-header .story-origin {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--color-red);
}

.story-detail-header h1 {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-dark);
  line-height: 1.15;
}

.story-text {
  font-size: var(--text-base);
  color: var(--color-charcoal);
  line-height: 1.75;
}

.story-text p + p {
  margin-top: var(--space-4);
}

.wisdom-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── PROFILE PAGE ────────────────────────────────────────── */
#page-profile .page-scroll {
  background: var(--color-white);
}

#page-profile .section-heading {
  font-size: var(--text-lg);
}
.profile-header-card {
  background: var(--color-green);
  padding: var(--space-8) var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  color: var(--color-white);
}

.profile-header-card__name {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
}

.profile-header-card__sub {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-1);
  padding: 0 var(--space-5);
  margin-top: calc(-1 * var(--space-5));
}

.profile-stat-card {
  background: var(--color-light-fill);
  border: 1px solid var(--color-warm-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.profile-stat-card__value {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-green);
}

.profile-stat-card__label {
  font-size: var(--text-xs);
  color: var(--color-charcoal-light);
  margin-top: var(--space-1);
}

.completed-walk-card {
  background: var(--color-light-fill);
  border: 1px solid var(--color-warm-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.completed-walk-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.completed-walk-card__info { flex: 1; }

.completed-walk-card__name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-dark);
}

.completed-walk-card__meta {
  font-size: var(--text-xs);
  color: var(--color-charcoal-light);
  margin-top: 2px;
}

.profile-badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.profile-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.profile-badge-item__circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green-dark);
}

.profile-badge-item__circle svg {
  width: 28px;
  height: 28px;
}

.profile-badge-item__name {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-charcoal);
}

.saved-stories-card {
  background: var(--color-light-fill);
  border: 1px solid var(--color-warm-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ── VOICES EMPTY STATE PAGE ─────────────────────────────── */
#page-voices-empty .voices-search-section {
  /* Same search bar section */
}

/* ── DESKTOP RESPONSIVE ≥ 1024px ─────────────────────────── */
@media (min-width: 1024px) {

  /* Hide mobile bottom nav */
  .bottom-nav {
    display: none;
  }

  /* Show and style left sidebar */
  .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    min-height: 100dvh;
    background: var(--color-white);
    border-right: 1px solid var(--color-warm-border);
    padding: var(--space-6) 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100dvh;
    z-index: var(--z-nav);
    flex-shrink: 0;
  }

  .sidebar__logo {
    padding: var(--space-4) var(--space-6) var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--color-warm-border);
    margin-bottom: var(--space-4);
  }

  .sidebar__logo-text {
    font-family: 'Playfair Display', Cambria, Georgia, serif;
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--color-green);
    letter-spacing: var(--tracking-wide);
  }

  .sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: 0 var(--space-3);
    flex: 1;
  }

  .sidebar__nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    position: relative;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
  }

  .sidebar__nav-item:hover {
    background: rgba(4, 106, 56, 0.06);
  }

  .sidebar__nav-item.is-active {
    background: rgba(4, 106, 56, 0.08);
  }

  .sidebar__nav-item svg {
    width: 22px;
    height: 22px;
    color: #9E9E9E;
    flex-shrink: 0;
    transition: color var(--duration-fast);
  }

  .sidebar__nav-item.is-active svg {
    color: var(--color-green);
  }

  .sidebar__nav-item__label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: #9E9E9E;
    transition: color var(--duration-fast), font-weight var(--duration-fast);
  }

  .sidebar__nav-item.is-active .sidebar__nav-item__label {
    color: var(--color-green);
    font-weight: var(--weight-bold);
  }

  .sidebar__nav-item__dot {
    position: absolute;
    right: var(--space-4);
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-gold);
    opacity: 0;
    transition: opacity var(--duration-fast);
  }

  .sidebar__nav-item.is-active .sidebar__nav-item__dot {
    opacity: 1;
  }

  /* Page container gets left padding when sidebar is visible */
  #page-container {
    min-width: 0;
  }

  /* Pages fill available width */
  .page.is-active {
    min-height: 100dvh;
  }

  .page-scroll {
    padding-bottom: var(--space-8);
  }

  /* Increase base card padding on desktop */
  .card,
  .audio-player,
  .path-card,
  .story-card,
  .badge-item,
  .wisdom-card {
    padding: var(--space-6);
  }

  /* ── HOME — path cards side by side ── */
  #page-home .page-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #page-home .hero {
    width: 100%;
    padding: var(--space-12) var(--space-8);
  }

  #page-home .section {
    width: 100%;
    max-width: var(--content-max);
    padding: var(--space-8);
  }

  .path-cards {
    flex-direction: row;
    align-items: stretch;
  }

  .path-card {
    flex: 1;
  }

  /* ── LENS MAP + DETAIL — side by side ── */
  #page-lens-map .page-scroll {
    display: flex;
    flex-direction: column;
  }

  .lens-desktop-split {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: var(--space-5);
    padding: var(--space-5);
    align-items: start;
  }

  .lens-desktop-split .checkpoint-map-section {
    padding: 0;
  }

  .lens-desktop-split .checkpoint-detail-section {
    padding: 0;
  }

  /* ── ROUTE COMPLETE — 3-col badge grid ── */
  #page-lens-complete .page-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #page-lens-complete .hero {
    width: 100%;
  }

  #page-lens-complete .section {
    width: 100%;
    max-width: 800px;
  }

  .badge-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  /* ── VOICES LIBRARY — 2-col story grid ── */
  #page-voices-library .page-scroll {
    display: flex;
    flex-direction: column;
  }

  .stories-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }

  .voices-search-section {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .voices-search-section .search-bar {
    flex: 1 1 300px;
  }

  .voices-search-section .voices-curator-bar {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .voices-search-section .filter-pills {
    width: 100%;
    flex: 1 1 100%;
  }

  /* ── VOICES DETAIL — reading-width max ── */
  #page-voices-detail .story-detail-content {
    max-width: var(--reading-max);
    margin: 0 auto;
    padding: var(--space-8);
  }

  /* ── PROFILE — wider layout ── */
  #page-profile .profile-stats {
    max-width: var(--content-max);
  }

  /* ── HEADER on desktop — full-width still ── */
  .page-header {
    position: sticky;
  }

  /* Bigger section headings on desktop */
  .section-heading {
    font-size: var(--text-3xl);
  }

  /* Voices empty state */
  #page-voices-empty .story-detail-content,
  #page-voices-empty .empty-state {
    max-width: 520px;
    margin: 0 auto;
  }
}

/* ── LARGE DESKTOP (≥ 1280px) ────────────────────────────── */
@media (min-width: 1280px) {
  :root {
    --sidebar-width: 260px;
  }

  .hero__heading {
    font-size: var(--text-5xl);
  }
}

/* ============================================================
   CHECKPOINT UNLOCK PANEL (GPS unlock — Proposal §5)
   ============================================================ */
.checkpoint-unlock-panel {
  background: var(--color-light-fill);
  border: 1px solid var(--color-warm-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.checkpoint-unlock-panel__hint {
  font-size: var(--text-xs);
  color: var(--color-charcoal-light);
  text-align: center;
  line-height: 1.5;
}

.checkpoint-unlock-panel__hint a {
  color: var(--color-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.checkpoint-unlock-panel__error {
  font-size: var(--text-xs);
  color: var(--color-red);
  text-align: center;
  margin-top: var(--space-2);
}

.checkpoint-unlock-panel--done {
  background: rgba(4, 106, 56, 0.08);
  border-color: var(--color-green);
  text-align: center;
  color: var(--color-green-dark);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  padding: var(--space-4);
}

/* ============================================================
   AUTH PAGES (login.html / signup.html)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  position: relative;
  background: linear-gradient(160deg, #1E160D 0%, #2B1F14 50%, #1E160D 100%);
  font-family: var(--font-sans);
}

.auth-page__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.auth-page__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-page__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(30,22,13,0.55) 0%, rgba(30,22,13,0.85) 60%, rgba(30,22,13,0.96) 100%),
    linear-gradient(105deg, rgba(252,209,22,0.18) 0%, rgba(4,106,56,0.14) 50%, rgba(206,17,38,0.16) 100%);
}

.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8) var(--space-6);
}

.auth-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.auth-card__logo-text {
  font-family: var(--font-serif);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-wide);
  color: var(--color-dark);
}

.auth-card__heading {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-dark);
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-card__sub {
  font-size: var(--text-sm);
  color: var(--color-charcoal-light);
  text-align: center;
  margin-bottom: var(--space-6);
  line-height: 1.5;
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-charcoal);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
}

.form-group__row {
  display: flex;
  gap: var(--space-3);
}

.form-group__row .form-group {
  flex: 1;
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-white);
  border: 1.5px solid var(--color-warm-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-charcoal);
  transition: border-color var(--duration-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-green);
}

.form-input::placeholder {
  color: var(--color-charcoal-light);
  opacity: 0.6;
}

.auth-error {
  display: none;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-text);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  line-height: 1.4;
}

.auth-notice {
  display: none;
  background: rgba(4, 106, 56, 0.08);
  border: 1px solid var(--color-green);
  color: var(--color-green-dark);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  line-height: 1.4;
  text-align: center;
}

.auth-card__footer {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-charcoal-light);
  margin-top: var(--space-5);
}

.auth-card__footer a {
  color: var(--color-green);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.auth-card__footer a:hover {
  text-decoration: underline;
}

.auth-forgot {
  display: block;
  text-align: right;
  font-size: var(--text-xs);
  color: var(--color-charcoal-light);
  margin: calc(var(--space-3) * -1) 0 var(--space-4);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-card__hint {
  font-size: var(--text-xs);
  color: var(--color-charcoal-light);
  text-align: center;
  margin-top: var(--space-3);
  line-height: 1.4;
}

/* ============================================================
   CONFIRM MODAL (used for Log Out; reusable for future confirms)
   ============================================================ */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 22, 13, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  z-index: var(--z-modal);
}

.confirm-modal-overlay[hidden] {
  display: none;
}

.confirm-modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 340px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.confirm-modal__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(206, 17, 38, 0.1);
  color: var(--color-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.confirm-modal__title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-dark);
  margin-bottom: var(--space-2);
}

.confirm-modal__body {
  font-size: var(--text-sm);
  color: var(--color-charcoal-light);
  line-height: 1.5;
  margin-bottom: var(--space-5);
}

.confirm-modal__actions {
  display: flex;
  gap: var(--space-3);
}

.confirm-modal__actions .btn {
  width: auto;
  flex: 1;
}