/* Today layout v2 — visual pass that pairs with the section reorder in index.html.
 *
 * Order on Today (top → bottom):
 *   Greeting + Walk status → Verse for today → Weekly study → Continue (concierge)
 *   → Context + Guidance (compact) → Explore shelf → Together → For today → Library
 *
 * Scope: light theme, with the approved Explore cards shared across themes.
 * Loaded after app-shell.css and today-feature-spotlight.css so these rules win
 * without !important (except where the base rule already uses it).
 */

/* ── Shared tokens (light) ─────────────────────────────────────────────── */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed {
  --tl2-espresso: #3E2A24;
  --tl2-body: #5C4B45;
  --tl2-muted: #6E5A54;
  --tl2-rose: #734651;
  --tl2-rose-soft: #E4C2BA;      /* muted rose CTA fill (espresso text, AA) */
  --tl2-rose-soft-press: #DBB4AB;
  --tl2-ivory: #FDF8F3;
  --tl2-blush: #F6E8E2;
  --tl2-line: rgba(214, 186, 176, 0.45);
}

/* ── 1 · Verse for today — keep the card, give it room at the top ─────── */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-section#homeResponse {
  margin-top: 18px;
}

/* ── 2 · Weekly study — ivory/blush body, one clear path ───────────────── */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-theme-block {
  background: linear-gradient(180deg, var(--tl2-ivory) 0%, var(--tl2-blush) 100%);
  border-color: rgba(226, 200, 190, 0.6);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-theme-block .theme-photo-band {
  height: 115px;
}

@media (max-width: 599px) {
  :root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .today-walk-greeting {
    font-size: clamp(20.9px, 5.32vw, 27.55px);
  }
  :root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .today-walk-recognition,
  :root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .today-walk-hero:has(.today-walk-recognition[hidden]) .today-walk-week {
    margin-top: 8px;
  }
  :root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .today-walk-recognition:not([hidden]) + .today-walk-week {
    margin-top: 10px;
  }
  :root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-section#homeResponse {
    margin-top: 8px;
  }
  :root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-theme-block {
    margin-top: 6px;
  }
  :root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-theme-block .theme-photo-band {
    height: 94px;
  }
}

:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-theme-block .theme-photo-band::after {
  /* fade the photo into the ivory body instead of white */
  background: linear-gradient(to bottom, transparent 55%, rgba(253, 248, 243, 0.85) 100%);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-theme-block .theme-card-body {
  padding: 12px 18px 14px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-title {
  color: var(--tl2-espresso);
  margin-bottom: 3px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-desc {
  color: var(--tl2-muted);
  margin-bottom: 6px;
}

/* Today's Bible Study → white inset panel with the one primary CTA */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-dual {
  gap: 6px;
  margin-top: 10px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-exp--study {
  padding: 12px 14px 12px;
  border: 1px solid rgba(240, 226, 220, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 2px rgba(82, 62, 54, 0.04);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-exp--study .home-weekly-exp-headline {
  color: var(--tl2-espresso);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-exp--study .home-weekly-exp-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  height: auto;
  max-height: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin-bottom: 10px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-exp--study .home-weekly-study-btn {
  min-height: 50px;
  border: 0;
  background: var(--tl2-rose-soft);
  color: var(--tl2-espresso);
  font-weight: 600;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-exp--study .home-weekly-study-btn:active {
  background: var(--tl2-rose-soft-press);
}

/* Guided Reflection → quieter secondary row under the study panel */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #homeWeeklyStudyExp:not([hidden]) + .home-weekly-exp--reflect {
  padding: 8px 4px 0;
  border-top: 0;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #homeWeeklyStudyExp:not([hidden]) + .home-weekly-exp--reflect .home-weekly-exp-body {
  display: none;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #homeWeeklyStudyExp:not([hidden]) + .home-weekly-exp--reflect .home-weekly-exp-headline {
  margin-bottom: 6px;
}

/* When there's no study today, the reflection is the main path → same muted rose CTA */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #homeWeeklyStudyExp[hidden] + .home-weekly-exp--reflect .home-weekly-explore-btn {
  min-height: 50px;
  border: 0;
  background: var(--tl2-rose-soft);
  color: var(--tl2-espresso);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #homeWeeklyStudyExp[hidden] + .home-weekly-exp--reflect .home-weekly-explore-btn svg {
  stroke: var(--tl2-espresso);
}

/* Plan progress → one compact row */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-plan-progress:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--tl2-line);
  text-align: left;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-plan-progress-text {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(11px, 3.1vw, 12.5px);
  font-weight: 500;
  color: var(--tl2-muted);
  line-height: 1.25;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-weekly-plan-link {
  min-height: 44px;
  padding: 0;
  white-space: nowrap;
  text-decoration: none;
  color: var(--tl2-rose);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #studyPlanBtnWrap {
  flex-shrink: 0;
}

/* ── 2b · Bible in a Year — compact warm card below the weekly study ───── */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed .home-byiar {
  margin-top: 10px;
}
.home-byiar-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-lg, 16px);
  background: var(--tl2-ivory, #FDF8F3);
  border: 1px solid rgba(226, 200, 190, 0.5);
}
.home-byiar-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(226, 200, 190, 0.3);
  color: var(--tl2-muted, #6E5A54);
}
.home-byiar-body {
  flex: 1;
  min-width: 0;
}
.home-byiar-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--tl2-espresso, #3E2A24);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-byiar-progress {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--tl2-muted, #6E5A54);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-byiar-progress:empty { display: none; }
.home-byiar-cta {
  flex-shrink: 0;
  padding: 8px 8px;
  border: 1px solid rgba(200, 170, 158, 0.52);
  border-radius: 20px;
  background: #FDF8F3;
  color: #3E2A24;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.home-byiar-cta:active { opacity: 0.78; }
#homeBibleYearCard[hidden] { display: none !important; }
#homeConciergeSection[hidden] { display: none !important; }
#screen-feed > #homeConciergeSection { padding: 0; }
#homeConciergeSection #journeyCardTitle {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
  margin: 0;
  color: var(--tl2-espresso, #3E2A24);
}

/* Both continuation rows share the same surface in Evening/Dark. */
:root:is([data-theme="dark"], [data-theme="evening"]) .home-byiar-card {
  background: var(--card, #3A302B);
  border-color: rgba(200, 170, 158, 0.35);
}
:root:is([data-theme="dark"], [data-theme="evening"]) .home-byiar-title {
  color: var(--text, #F7EEE5);
}
:root:is([data-theme="dark"], [data-theme="evening"]) #homeConciergeSection #journeyCardTitle {
  color: var(--text, #F7EEE5);
}
:root:is([data-theme="dark"], [data-theme="evening"]) .home-byiar-progress {
  color: var(--text-light, #D8C9BE);
}
:root:is([data-theme="dark"], [data-theme="evening"]) .home-byiar-icon {
  color: var(--text-light, #D8C9BE);
}

/* ── 3 · Continue (concierge) — sits under the study, slimmer ─────────── */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #homeConciergeSection:not([hidden]) {
  margin-top: 12px;
}

/* ── 4 · Context + Guidance — same blush card, ~35% shorter ────────────── */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-card {
  padding: 18px 16px 14px;
  background: linear-gradient(180deg, #F4EAE4 0%, #EEDFD8 100%);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-branch--tr {
  opacity: 0.62;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-branch--bl {
  opacity: 0.58;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-title {
  font-size: 1.2rem;
  color: var(--tl2-espresso, #3E2A24);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-sub {
  margin-top: 4px;
  font-size: 13px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-form {
  margin-top: 10px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-field {
  min-height: 46px;
  padding: 6px 12px;
}
/* The placeholder already says what to type; the example line doubled the field's height. */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-example {
  display: none;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-btn--primary {
  min-height: 46px;
  margin-top: 8px;
  padding: 0 16px;
  /* darker fill so white label passes contrast (was #c4a094 ≈ 2.4:1) */
  background: #8A5A52;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-btn--primary:hover {
  background: #7E5049;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-btn--primary:active {
  background: #734651;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-rule {
  margin: 12px 0;
}
/* Guidance stays a distinct, outlined action — title + button on one line. */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-block + .tfs-rule + .tfs-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-block + .tfs-rule + .tfs-block > * {
  grid-column: 1;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight .tfs-block + .tfs-rule + .tfs-block .tfs-sub {
  display: none;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight #tfsGuidanceBtn {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border-color: rgba(138, 90, 82, 0.6);
  color: #6E423D;
  font-weight: 600;
  white-space: nowrap;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight #tfsGuidanceNote {
  grid-column: 1 / -1;
  margin-top: 8px;
}

/* Personalized mode: today's question shows under the title; button and "ask your own" share one row. */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight[data-tfs-question="1"] .tfs-block + .tfs-rule + .tfs-block {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight[data-tfs-question="1"] .tfs-block + .tfs-rule + .tfs-block > * {
  grid-column: 1 / -1;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight[data-tfs-question="1"] .tfs-block + .tfs-rule + .tfs-block .tfs-sub {
  display: block;
  margin-top: 4px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight[data-tfs-question="1"] #tfsGuidanceBtn {
  grid-column: 1;
  grid-row: auto;
  margin-top: 8px;
  justify-self: start;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #homeFeatureSpotlight[data-tfs-question="1"] #tfsGuidanceOwn {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 4px 0 0;
  font-size: 12.5px;
  white-space: nowrap;
}

/* ── 5 · Explore shelf — soft cream / blush / mauve rotation, not all one tone ── */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #discoveryShelfGrid > .discovery-shelf-card:nth-child(4n + 1) {
  background: #FAF3EA;
  border-color: rgba(226, 208, 188, 0.75);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #discoveryShelfGrid > .discovery-shelf-card:nth-child(4n + 2) {
  background: #F6E6E1;
  border-color: rgba(222, 196, 188, 0.75);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #discoveryShelfGrid > .discovery-shelf-card:nth-child(4n + 3) {
  background: #EFE3E4;
  border-color: rgba(214, 196, 200, 0.75);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #discoveryShelfGrid > .discovery-shelf-card:nth-child(4n + 4) {
  background: #FDF8F3;
  border-color: rgba(232, 218, 210, 0.75);
}

/* ── 6 · Affirmations card — compact strip with horizontal swipe ─────── */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-quote-block {
  padding: 18px 20px 16px;
  border-radius: 16px;
  background: var(--tl2-ivory, #FDF8F3);
  border: 1px solid rgba(226, 200, 190, 0.45);
  box-shadow: none !important;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-quote-block::before {
  display: none;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-atmosphere {
  display: none;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-kicker {
  margin-bottom: 10px;
  font-size: 9.5px;
  opacity: 0.6;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-lines {
  min-height: 54px;
  padding: 0 !important;
  overflow: hidden;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-line {
  font-size: clamp(0.88rem, 3.2vw, 1.02rem);
  line-height: 1.52;
  max-width: 100%;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-line--breath {
  animation: none;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-dots {
  margin: 10px auto 4px;
  gap: 7px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-dot {
  width: 5px;
  height: 5px;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-actions {
  margin-top: 10px;
  gap: 16px;
}
/* Typewriter reveal + exit */
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-line {
  clip-path: inset(0 0 0 0);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod #walkTruthsLines.walk-truths-lines--exit .walk-truths-line {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease-out, transform 0.14s ease-out;
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod #walkTruthsLines.walk-truths-lines--typewriter-ready .walk-truths-line {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 100% 0 0);
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod #walkTruthsLines.walk-truths-lines--typewriter-reveal .walk-truths-line {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}
/* Dot pulse */
@keyframes tl2DotPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.8); }
  100% { transform: scale(1); }
}
:root:not([data-theme="dark"]):not([data-theme="evening"]) #screen-feed #walkWithGod .walk-truths-dot.is-active {
  animation: tl2DotPulse 0.4s ease-out;
}

/* ── Explore cards ── */
#screen-feed .tl2-explore {
  padding: 0 var(--tl2-gutter, 20px);
  margin-bottom: 10px;
}
#screen-feed .tl2-explore-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tl2-muted, #8B7668);
  margin: 0 0 10px;
}
#screen-feed .tl2-explore-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
#screen-feed .tl2-explore-cards::-webkit-scrollbar { display: none; }
#screen-feed .tl2-explore-card[hidden], #homeExploreStatus[hidden] { display: none !important; }
#screen-feed .tl2-explore-card {
  flex: 1 0 calc((100% - 20px) / 3);
  min-width: 96px;
  scroll-snap-align: start;
  background: var(--tl2-ivory, #FDF8F3);
  border: 1px solid rgba(226, 200, 190, 0.45);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
#screen-feed .tl2-explore-card-img {
  height: 80px;
  background: linear-gradient(135deg, #F0E6DC 0%, #E8D5C8 50%, #DCC8B8 100%);
}
#screen-feed .tl2-explore-card-body {
  padding: 8px 10px 10px;
}
#screen-feed .tl2-explore-card-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tl2-heading, #4A3728);
  margin: 0 0 2px;
  line-height: 1.3;
}
#screen-feed .tl2-explore-card-desc {
  font-size: 10px;
  color: var(--tl2-muted, #8B7668);
  margin: 0 0 6px;
  line-height: 1.35;
}
#screen-feed .tl2-explore-card-cta {
  font-size: 10px;
  font-weight: 600;
  color: var(--tl2-cta, #9B7B6A);
}

/* Hide old discovery grid + Together card — replaced by Explore cards */
#screen-feed #homeIntentionGrid,
#screen-feed #homeTogetherCard {
  display: none !important;
}

#screen-feed .tl2-explore-card-img { position: relative; flex: 0 0 80px; }
#screen-feed .tl2-explore-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(253, 248, 243, 0.36);
  pointer-events: none;
}
#screen-feed .tl2-explore-card-img img { display: block; width: 100%; height: 80px; object-fit: cover; }
:root[data-theme="dark"] #screen-feed .tl2-explore-card, :root[data-theme="evening"] #screen-feed .tl2-explore-card { background: var(--surface, #292420); border-color: rgba(226,200,190,.2); }
:root[data-theme="dark"] #screen-feed .tl2-explore-card-name, :root[data-theme="evening"] #screen-feed .tl2-explore-card-name { color: #f3e8df; }
:root[data-theme="dark"] #screen-feed .tl2-explore-card-desc, :root[data-theme="dark"] #screen-feed .tl2-explore-card-cta, :root[data-theme="dark"] #screen-feed .tl2-explore-title, :root[data-theme="evening"] #screen-feed .tl2-explore-card-desc, :root[data-theme="evening"] #screen-feed .tl2-explore-card-cta, :root[data-theme="evening"] #screen-feed .tl2-explore-title { color: #d1bbae; }
