/* ==================================================
   LIGHT SHELL
   Applied only to the homepage and the Open Stories
   listing page (see $isLightShell in includes/head.php).
   Loaded after style.css / open-story.css, and uses
   `body.light-shell` scoping so specificity wins
   regardless of load order.

   Concept: the shell (wayfinding pages) is warm and
   welcoming; the actual reading experience (a story's
   own page) stays dark and close, unchanged. Same
   color family as the dark theme, inverted — day and
   night of the same palette, not two unrelated themes.
================================================== */

body.light-shell {
  --ls-paper: #f6f0e4;
  --ls-paper-card: #efe6d4;
  --ls-ink: #2b2118;
  --ls-ink-soft: #4d4033;
  --ls-muted: #695943;
  --ls-link: #743d18;
  --ls-accent: #a8622c;
  --ls-accent-deep: #8a4e22;
  --ls-hairline: rgba(168,98,44,0.35);
  --ls-field-bg: #fff8ec;
  --ls-field-border: rgba(84,55,30,0.42);
}

/* Specificity bump (html + body.light-shell) is intentional: open-story.css
   has `body.open-story { background: #1c1916 }` at equal specificity to a
   plain `body.light-shell` rule, and it loads after this stylesheet on the
   Open Stories page, so it would otherwise win the tie on source order. */
html body.light-shell {
  background-color: var(--ls-paper);
}

/* Base grain stays (it's subtle/neutral); the dark
   vignette does not suit a light page. */
body.light-shell::after {
  display: none;
}

/* ---------- TEXT ---------- */

body.light-shell h1,
body.light-shell h2,
body.light-shell h3,
body.light-shell h4 {
  color: var(--ls-ink);
}

body.light-shell p,
body.light-shell li {
  color: var(--ls-ink-soft);
}

body.light-shell .subtitle,
body.light-shell .book-subtitle,
body.light-shell .exclusive-label,
body.light-shell .preview-end,
body.light-shell .site-footer {
  color: var(--ls-muted);
}

body.light-shell .tagline {
  color: var(--ls-ink-soft);
}

body.light-shell a {
  color: var(--ls-link);
}

body.light-shell a:hover,
body.light-shell a:focus {
  color: var(--ls-accent-deep);
}

body.light-shell input,
body.light-shell textarea,
body.light-shell select {
  background: var(--ls-field-bg);
  border-color: var(--ls-field-border);
  color: var(--ls-ink);
}

body.light-shell input::placeholder,
body.light-shell textarea::placeholder {
  color: rgba(43,33,24,0.62);
}

body.light-shell input:focus,
body.light-shell textarea:focus,
body.light-shell select:focus {
  outline: none;
  border-color: rgba(138,78,34,0.78);
  box-shadow: 0 0 0 3px rgba(168,98,44,0.16);
}

/* ---------- SITE HEADER (shared photo, lightened) ---------- */

body.light-shell .site-header {
  min-height: 420px;
  background:
    linear-gradient(
      180deg,
      rgba(246,240,228,0.28) 0%,
      rgba(246,240,228,0.06) 30%,
      rgba(246,240,228,0.22) 60%,
      var(--ls-paper) 96%
    ),
    url("/assets/images/img/wide-shot-cover.webp");
  background-size: cover;
  background-position: center 30%;
}

body.light-shell .site-header::before {
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255,255,255,0.22), transparent 40%),
    linear-gradient(90deg, rgba(0,0,0,0.22), transparent 28%, transparent 72%, rgba(0,0,0,0.22));
}

body.light-shell .site-header::after {
  height: 220px;
  background:
    linear-gradient(
      180deg,
      rgba(246,240,228,0) 0%,
      rgba(246,240,228,0.86) 60%,
      var(--ls-paper) 100%
    );
}

body.light-shell .site-title,
body.light-shell .main-nav a {
  color: #22160d;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255,248,236,0.65);
}

body.light-shell .site-title {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 4px;
  background: rgba(255,248,236,0.58);
  box-shadow: 0 4px 18px rgba(43,33,24,0.18);
}

body.light-shell .main-nav {
  gap: 0.65rem;
  padding: 5px;
  border-radius: 4px;
  background: rgba(255,248,236,0.58);
  box-shadow: 0 4px 18px rgba(43,33,24,0.18);
  backdrop-filter: blur(2px);
}

body.light-shell .main-nav a {
  margin-left: 0;
  padding: 3px 9px;
  border-radius: 3px;
}

body.light-shell .main-nav a:hover {
  color: #140c07;
  background: rgba(255,248,236,0.55);
}

body.light-shell .global-search input {
  background: rgba(255,248,236,0.82);
  border-color: rgba(43,33,24,0.55);
  color: #22160d;
  box-shadow: 0 4px 18px rgba(43,33,24,0.16);
}

body.light-shell .global-search input::placeholder {
  color: rgba(34,22,13,0.72);
}

body.light-shell .global-search input:focus {
  background: rgba(255,248,236,0.96);
  border-color: rgba(138,78,34,0.7);
}

/* ---------- HERO ---------- */

body.light-shell .hero h1 {
  color: var(--ls-ink);
  text-shadow: 0 2px 24px rgba(246,240,228,0.9);
}

body.light-shell .hero .positioning {
  color: var(--ls-ink-soft);
  font-style: italic;
}

body.light-shell .eyebrow {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ls-accent-deep);
  margin-bottom: 16px;
}

body.light-shell .hero-cta-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 0 6px;
}

/* ---------- THROUGHLINE ---------- */

body.light-shell .throughline {
  max-width: 780px;
  margin: 56px auto 0;
  padding: 0 20px;
}

body.light-shell .throughline-label {
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ls-muted);
  margin-bottom: 26px;
}

body.light-shell .throughline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ls-hairline);
}

body.light-shell .throughline-item {
  padding: 22px 18px 0;
  border-left: 1px solid var(--ls-hairline);
  text-align: center;
}

body.light-shell .throughline-item:first-child { border-left: none; }

body.light-shell .throughline-item h3 {
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 8px;
}

body.light-shell .throughline-item p {
  font-size: 0.87rem;
  color: var(--ls-muted);
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 640px) {
  body.light-shell .throughline-grid { grid-template-columns: 1fr; }
  body.light-shell .throughline-item {
    border-left: none;
    border-top: 1px solid var(--ls-hairline);
    padding-top: 18px;
  }
  body.light-shell .throughline-item:first-child { border-top: none; }
}

/* ---------- WEEKLY EXCLUSIVE CARD (light) ---------- */

body.light-shell .hero-exclusive {
  background: var(--ls-paper-card);
  border: 1px solid var(--ls-hairline);
}

body.light-shell .hero-exclusive h2,
body.light-shell .hero-exclusive p {
  color: var(--ls-ink-soft);
}

body.light-shell .hero-exclusive h2 {
  color: var(--ls-ink);
}

body.light-shell .hero-alt a {
  color: var(--ls-link);
  opacity: 1;
  text-decoration-color: rgba(116,61,24,0.5);
}

/* ---------- BUTTONS (page-level; dark cards restored below) ---------- */

body.light-shell .btn {
  border-color: var(--ls-hairline);
  color: var(--ls-ink);
}

body.light-shell .btn:hover {
  background: rgba(168,98,44,0.12);
  color: var(--ls-ink);
}

body.light-shell .btn-primary {
  background: #965220;
  border-color: #965220;
  color: #fff8ef;
}

body.light-shell .btn-primary:hover {
  background: var(--ls-accent-deep);
  color: #fff8ef;
}

body.light-shell .btn-disabled {
  border-color: var(--ls-hairline);
  color: var(--ls-muted);
}

/* ---------- DARK ISLANDS: book cards keep their own dark
   treatment regardless of page theme (a deliberate "dark
   card on a light page" pattern, not an oversight). ---------- */

body.light-shell .book-card h3,
body.light-shell .book-card .book-subtitle,
body.light-shell .book-card .description,
body.light-shell .book-card .book-description {
  color: #f3eadc;
}

body.light-shell .book-card .subtitle {
  color: #cbbca8;
}

body.light-shell .book-card .btn {
  border-color: #d2b48c;
  color: #f3eadc;
}

body.light-shell .book-card .btn:hover {
  background: rgba(210,180,140,0.2);
  color: #ffffff;
}

body.light-shell .book-card .btn-primary {
  background: #1f1712;
  border-color: #f3eadc;
  color: #f3eadc;
}

body.light-shell .book-card .btn-primary:hover {
  background: #000;
}

body.light-shell .book-card .btn-disabled {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.7);
}

body.light-shell .badge-exclusive {
  background: rgba(20,14,10,0.94);
  color: #fff8ef;
  opacity: 1;
}

body.light-shell .shelf-nav {
  background: rgba(31,23,18,0.92);
  border-color: rgba(255,248,236,0.35);
  color: #ffffff;
  opacity: 1;
}

body.light-shell .shelf-nav:hover,
body.light-shell .shelf-nav:focus {
  background: rgba(20,14,10,0.98);
  color: #ffffff;
}

/* ---------- READER JOURNEY ---------- */

body.light-shell .reader-doorway,
body.light-shell .mood-guide,
body.light-shell .catalog-guide,
body.light-shell .story-guide {
  max-width: 980px;
  margin: 48px auto 0;
  padding: 0 20px;
}

body.light-shell .doorway-heading,
body.light-shell .catalog-guide-intro,
body.light-shell .story-guide-intro,
body.light-shell .mood-guide-copy {
  max-width: 660px;
  margin: 0 auto 22px;
  text-align: center;
}

body.light-shell .doorway-heading span,
body.light-shell .guide-kicker,
body.light-shell .doorway-label,
body.light-shell .catalog-guide-card span,
body.light-shell .story-guide-card span {
  display: block;
  margin: 0 0 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ls-accent-deep);
}

body.light-shell .doorway-heading h2,
body.light-shell .catalog-guide-intro h2,
body.light-shell .story-guide-intro h2,
body.light-shell .mood-guide-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

body.light-shell .doorway-heading p,
body.light-shell .catalog-guide-intro p,
body.light-shell .mood-guide-copy p {
  margin: 0;
  color: var(--ls-muted);
}

body.light-shell .doorway-grid,
body.light-shell .catalog-guide-grid,
body.light-shell .story-guide-grid,
body.light-shell .mood-paths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body.light-shell .doorway-card,
body.light-shell .catalog-guide-card,
body.light-shell .story-guide-card,
body.light-shell .mood-path {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 20px;
  border: 1px solid var(--ls-hairline);
  border-radius: 6px;
  background: rgba(255,248,236,0.52);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(43,33,24,0.06);
}

body.light-shell .doorway-card h3,
body.light-shell .doorway-card p,
body.light-shell .catalog-guide-card strong,
body.light-shell .catalog-guide-card em,
body.light-shell .story-guide-card strong,
body.light-shell .story-guide-card em,
body.light-shell .mood-path span,
body.light-shell .mood-path em {
  color: var(--ls-ink-soft);
}

body.light-shell .doorway-card h3,
body.light-shell .catalog-guide-card strong,
body.light-shell .story-guide-card strong,
body.light-shell .mood-path span {
  display: block;
  margin: 0 0 8px;
  color: var(--ls-ink);
  font-size: 1.03rem;
  font-style: italic;
  font-weight: 700;
}

body.light-shell .doorway-card p,
body.light-shell .catalog-guide-card em,
body.light-shell .story-guide-card em,
body.light-shell .mood-path em {
  display: block;
  margin: 0;
  font-size: 0.92rem;
  font-style: normal;
  line-height: 1.55;
}

body.light-shell .doorway-card a {
  margin-top: auto;
  padding-top: 18px;
  color: var(--ls-link);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

body.light-shell .doorway-card:hover,
body.light-shell .catalog-guide-card:hover,
body.light-shell .story-guide-card:hover,
body.light-shell .mood-path:hover,
body.light-shell .doorway-card:focus-within,
body.light-shell .catalog-guide-card:focus,
body.light-shell .story-guide-card:focus,
body.light-shell .mood-path:focus {
  border-color: rgba(138,78,34,0.66);
  background: rgba(255,250,240,0.82);
  box-shadow: 0 16px 36px rgba(43,33,24,0.1);
}

body.light-shell .mood-guide {
  margin-top: 0;
  margin-bottom: 42px;
}

body.light-shell .book-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

body.light-shell .book-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255,248,236,0.28);
  border-radius: 999px;
  color: #e8d9c6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  line-height: 1;
}

@media (max-width: 760px) {
  body.light-shell .reader-doorway,
  body.light-shell .mood-guide,
  body.light-shell .catalog-guide,
  body.light-shell .story-guide {
    margin-top: 34px;
    padding: 0 12px;
  }

  body.light-shell .doorway-grid,
  body.light-shell .catalog-guide-grid,
  body.light-shell .story-guide-grid,
  body.light-shell .mood-paths {
    grid-template-columns: 1fr;
  }

  body.light-shell .doorway-card,
  body.light-shell .catalog-guide-card,
  body.light-shell .story-guide-card,
  body.light-shell .mood-path {
    padding: 18px;
  }
}

/* ==================================================
   OPEN STORIES — listing page (the "door")
================================================== */

body.light-shell .open-story-page {
  background: var(--ls-paper);
  color: var(--ls-ink-soft);
}

body.light-shell .open-story-page h1,
body.light-shell .open-story-page h2,
body.light-shell .open-story-page h3 {
  color: var(--ls-ink);
}

body.light-shell .open-story-page .byline,
body.light-shell .open-story-page .library-index {
  color: var(--ls-muted);
}

body.light-shell .open-stories-search input {
  background: var(--ls-field-bg);
  border: 1px solid var(--ls-field-border);
  color: var(--ls-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

body.light-shell #openStoriesSearch {
  background: var(--ls-field-bg);
  border: 1px solid var(--ls-field-border);
  color: var(--ls-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

body.light-shell .open-stories-search input::placeholder,
body.light-shell #openStoriesSearch::placeholder {
  color: rgba(43,33,24,0.62);
}

body.light-shell .open-stories-search input:focus,
body.light-shell #openStoriesSearch:focus {
  background: #fffaf0;
  border-color: rgba(138,78,34,0.78);
  box-shadow: 0 0 0 3px rgba(168,98,44,0.16);
}

body.light-shell #clearSearch {
  color: var(--ls-ink);
  background: rgba(255,248,236,0.72);
  border: 1px solid var(--ls-field-border);
  border-radius: 4px;
  opacity: 0.8;
}

body.light-shell #clearSearch:hover,
body.light-shell #clearSearch:focus {
  color: #140c07;
  background: #fff8ec;
  opacity: 1;
}

body.light-shell .open-story-item {
  border-color: var(--ls-hairline);
}

body.light-shell .open-story-item .title {
  color: var(--ls-ink);
}

body.light-shell .open-story-item:hover .title {
  color: var(--ls-accent-deep);
}

body.light-shell .open-story-item .catalog-number,
body.light-shell .open-story-item .catalog-meta,
body.light-shell .open-story-item .description {
  color: var(--ls-muted);
}

body.light-shell .open-stories-pagination .page-link {
  color: var(--ls-link);
  border-color: var(--ls-hairline);
}

body.light-shell .open-stories-pagination .page-link:hover {
  color: var(--ls-accent-deep);
}

body.light-shell .open-stories-pagination .page-link::after {
  background: var(--ls-accent-deep);
}

body.light-shell .open-stories-pagination .page-link.current {
  color: var(--ls-ink);
  border-color: var(--ls-accent);
}

body.light-shell .open-stories-pagination .page-link.current::after {
  background: var(--ls-accent);
}

body.light-shell .open-stories-note,
body.light-shell .door-see-all {
  color: var(--ls-muted);
}

body.light-shell .door-see-all a {
  color: var(--ls-link);
  border-bottom: 1px solid rgba(116,61,24,0.45);
  text-decoration: none;
  padding-bottom: 1px;
}

body.light-shell .door-see-all a:hover {
  color: var(--ls-accent-deep);
  border-bottom-color: rgba(138,78,34,0.72);
}

body.light-shell .open-story-variant {
  color: var(--ls-muted);
  opacity: 1;
}

body.light-shell .open-story-variant a {
  color: var(--ls-link);
  border-bottom: 1px solid rgba(116,61,24,0.35);
}

body.light-shell .open-story-variant a:hover {
  color: var(--ls-accent-deep);
  border-bottom-color: rgba(138,78,34,0.72);
}

body.light-shell .story-meta-tag {
  color: var(--ls-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
}

/* ==================================================
   WAYFINDING PAGES — about, contact, privacy, notes,
   books catalog, western-news, western-short-stories
================================================== */

body.light-shell .page-standard > p,
body.light-shell .page-standard > h2 {
  color: var(--ls-ink-soft);
}

body.light-shell .authority-page,
body.light-shell .about-page,
body.light-shell .contact-page,
body.light-shell .notes-page,
body.light-shell .books-page,
body.light-shell .news-page {
  color: var(--ls-ink-soft);
}

body.light-shell .trust-note,
body.light-shell .about-note {
  color: var(--ls-muted);
}

/* Story hub blocks (western-short-stories) are already white cards —
   they work unchanged on a light page. Just fix the surrounding copy. */
body.light-shell .story-category,
body.light-shell .story-meta {
  color: var(--ls-muted);
}

body.light-shell .featured-story {
  background: var(--ls-paper-card);
  border-color: var(--ls-hairline);
}

body.light-shell .featured-label {
  color: var(--ls-accent-deep);
}

/* Frontier Dispatches (western-news) */
body.light-shell .dispatch-entry {
  border-bottom-color: var(--ls-hairline);
}

body.light-shell .dispatch-date,
body.light-shell .image-source {
  color: var(--ls-muted);
}

/* ==================================================
   ESSAY PAGES (western.css) — a-different-kind-of-western,
   on-western-silence, if-youre-looking-for-this-kind-of-story,
   stories-about-leaving-without-closure, quiet-western-fiction,
   stories-where-towns-dont-survive-the-future, start-here
================================================== */

body.light-shell .western-page {
  background: none;
}

body.light-shell .western-essay,
body.light-shell .western-essay p {
  color: var(--ls-ink-soft);
}

body.light-shell .essay-header h1 {
  color: var(--ls-ink);
}

body.light-shell .western-essay h2 {
  color: var(--ls-ink);
}

body.light-shell .western-essay h2::before {
  background: var(--ls-hairline);
}

body.light-shell .essay-thesis {
  border-left-color: var(--ls-hairline);
  color: var(--ls-ink-soft);
}

body.light-shell .essay-pause::after,
body.light-shell .essay-audience {
  border-color: var(--ls-hairline);
}

body.light-shell .essay-close {
  color: var(--ls-ink-soft);
}

body.light-shell .western-essay a,
body.light-shell .essay-related a {
  color: var(--ls-link);
  border-bottom-color: var(--ls-hairline);
}

body.light-shell .western-essay a:hover,
body.light-shell .essay-related a:hover {
  color: var(--ls-accent-deep);
}

body.light-shell .email-invite {
  border-top-color: var(--ls-hairline);
}

body.light-shell .email-invite .email-text {
  color: var(--ls-muted);
}

body.light-shell .email-invite input[type="email"] {
  background: var(--ls-field-bg);
  border-color: var(--ls-field-border);
  color: var(--ls-ink);
}

body.light-shell .email-invite input::placeholder {
  color: rgba(43,33,24,0.55);
}

body.light-shell .email-invite button {
  color: var(--ls-accent-deep);
  border-bottom-color: var(--ls-hairline);
}

body.light-shell .email-invite button:hover {
  border-bottom-color: var(--ls-accent-deep);
}

/* ==================================================
   LETTERS (letters/letters.css — loaded after this
   file, so these use the same specificity-bump pattern
   as .open-story-page above)
================================================== */

body.light-shell .letters-page,
body.light-shell .letter-page {
  color: var(--ls-ink-soft);
}

body.light-shell .letters-intro h1,
body.light-shell .letter-page h1 {
  color: var(--ls-ink);
}

body.light-shell .signature {
  color: var(--ls-ink-soft);
}

body.light-shell .letter-link {
  border-color: var(--ls-hairline);
  background-color: var(--ls-paper-card);
}

body.light-shell .letter-link:hover {
  border-color: var(--ls-accent);
  background-color: var(--ls-paper-card);
}

body.light-shell .letter-title {
  color: var(--ls-ink);
}

body.light-shell .letter-meta,
body.light-shell .letters-return a {
  color: var(--ls-muted);
}

body.light-shell .letters-return a:hover {
  color: var(--ls-accent-deep);
}

/* ==================================================
   CERTAINTY / FAF (certainty/style.css — loaded after
   this file; same specificity-bump pattern)
================================================== */

body.light-shell .certainty-page {
  background: none;
}

body.light-shell .hero-certainty h1 {
  color: var(--ls-ink);
}

body.light-shell .hero-certainty .byline,
body.light-shell .hero-certainty .tagline {
  color: var(--ls-ink-soft);
}

body.light-shell .certainty-page h2 {
  color: var(--ls-ink);
}

body.light-shell .certainty-page p,
body.light-shell .critical-statement {
  color: var(--ls-ink-soft);
}

body.light-shell .context-links,
body.light-shell .book-forthcoming,
body.light-shell .discussion-note {
  color: var(--ls-muted);
}

body.light-shell .book-forthcoming a:hover {
  border-bottom-color: var(--ls-accent-deep);
}

body.light-shell .interest-form label {
  color: var(--ls-ink-soft);
}

body.light-shell .interest-form input[type="email"] {
  background: var(--ls-field-bg);
  border-color: var(--ls-field-border);
  color: var(--ls-ink);
}

body.light-shell .discussion p {
  color: var(--ls-ink-soft);
}

body.light-shell .discussion-links a {
  color: var(--ls-link);
}

body.light-shell .discussion-links a:hover {
  color: var(--ls-accent-deep);
}
