/* ─── styles-screens-entry.css: first of three files split from the former
   styles-screens.css (entry/reference/participant/reflect screens and their
   content — everything outside the Pocketbook module itself, see
   styles-pocketbook.css, and outside site chrome, see styles-base.css).
   This file: entry screen, section screen, modules, reference filter chips
   + contraindications, module-as-page, activities, deep link highlight,
   copy link. Loads before styles-screens-reflect.css and
   styles-screens-reference.css — the three keep the original file's rule
   order across the split, so cascade/specificity-tie outcomes are
   unchanged. ─── */

/* ── SCREENS ── */
#entry-screen { animation: fadeUp 0.5s ease both; }

.screen { display: none; }
.screen.active { display: block; animation: fadeUp 0.4s ease backwards; }

/* ── ENTRY ── */
.entry-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest-soft-text);
  margin-bottom: 18px;
}

.entry-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 36px;
  font-weight: 500;
  color: var(--forest-ink);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
  max-width: 560px;
}

.entry-sub {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 300;
  margin-bottom: 48px;
  max-width: 480px;
  line-height: 1.65;
}

.pathways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.pathway-card {
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  padding: 28px 28px 24px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pathway-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--forest-deep);
  transform: scaleY(0);
  transition: transform 0.25s ease;
  transform-origin: top;
}

.pathway-card:hover {
  border-color: var(--forest-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pathway-card:hover::before { transform: scaleY(1); }

.pathway-icon {
  font-size: 22px;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-sm);
  color: var(--forest-deep);
}
.pathway-icon svg { width: 20px; height: 20px; }

.pathway-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--forest-ink);
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}

.pathway-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  font-weight: 300;
}

.pathway-arrow {
  display: inline-block;
  margin-top: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--forest-deep);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── SECTION SCREEN ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-faint);
  cursor: pointer;
  margin-bottom: 32px;
  padding: 6px 0;
  border: none;
  background: none;
  font-family: 'Open Sans', sans-serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--forest-deep); }

.section-header { margin-bottom: 40px; }

.section-header .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-deep);
  background: transparent;
  border: 1px solid var(--forest-mist);
  padding: 5px 12px 5px 10px;
  border-radius: var(--r-pill);
  margin-bottom: 18px;
}
.section-header .badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--forest-deep);
  display: inline-block;
}

.section-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: var(--fs-h1);
  font-weight: 500;
  color: var(--forest-ink);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.section-header p {
  font-size: var(--fs-sub);
  color: var(--ink-soft);
  font-weight: 300;
  line-height: 1.65;
  max-width: 560px;
}

.section-sub {
  font-size: var(--fs-sub);
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 560px;
}

/* ── MODULES ── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  align-items: start;
}
/* "What is FBT?", "Before your first session", "Learn More", and Implement
   in Practice's tool cards all stack single-column at every viewport width
   instead of the auto-fit default above, which would otherwise sit cards
   side by side on wider screens (only naturally collapsing to one column
   on narrow/mobile widths, where auto-fit runs out of room anyway). */
#pwhat-screen .modules-grid,
#pbefore-screen .modules-grid,
#learn-screen .modules-grid,
#implement-screen .modules-grid {
  grid-template-columns: 1fr;
}
/* Reflect's remaining module-cards (self-reflection, indicators — glossary
   was removed) stack single-column too, and drop the boxed card look
   entirely: no border/background/radius, just open content separated by a
   rule, since this is working reflection material feeding the report, not
   reference cards to browse. */
#reflect-screen .modules-grid {
  grid-template-columns: 1fr;
  gap: 28px;
}
#reflect-screen .module-card {
  background: none;
  border: none;
  border-radius: 0;
  overflow: visible;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--forest-mist);
}
#reflect-screen .module-card:last-child { border-bottom: none; padding-bottom: 0; }
#reflect-screen .module-card .module-body { padding: 0; }

/* Reference page's own search — distinct from the global ⌘K dialog's
   .search-input, but same visual language (bordered pill, icon inline). */
.reference-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  padding: 0 14px;
  min-height: 44px;
  background: var(--paper-pure);
  margin-bottom: 18px;
  color: var(--ink-faint);
}
.reference-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  min-height: 42px;
}
.reference-search-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-faint);
  margin: 4px 0 18px;
}
/* Same-specificity author rule above would otherwise beat the UA
   stylesheet's [hidden] { display: none }, since author origin wins ties
   — this one line is what actually lets refApplyFilter() hide the
   message by toggling the hidden attribute. */
.reference-search-empty[hidden] { display: none; }
.ref-clear-btn {
  padding: 6px 12px;
  min-height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  color: var(--forest-deep);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.ref-clear-btn:hover { border-color: var(--forest-soft); background: var(--paper); }

/* ── REFERENCE: type filter chips + result count ── */
.ref-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ref-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  min-height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  color: var(--ink-faint);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.ref-filter-chip:hover { border-color: var(--forest-soft); color: var(--ink-soft); }
.ref-filter-chip[aria-pressed="true"] {
  background: var(--forest-ink);
  border-color: var(--forest-ink);
  color: var(--paper-pure);
}
.ref-count { font-size: 12px; color: var(--ink-faint); margin: 0 0 18px; }

/* ── REFERENCE: absolute contraindications — always visible, never
   collapsible, never touched by refApplyFilter(). Kept visually distinct
   (safety-tinted heading + badge) so it reads as categorically different
   from the filterable list below it, not just "first in the list". ── */
.ref-absolute { margin-bottom: 28px; }
.ref-absolute-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ref-absolute-head h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--safety-ink);
  margin: 0;
}
.ref-absolute-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ember);
  background: var(--paper-pure);
  border: 1px solid #E5C7B2;
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

.module-card {
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.module-card:hover { border-color: var(--forest-soft); box-shadow: var(--shadow-sm); }
.module-card.open { border-color: var(--forest-mid); box-shadow: var(--shadow-md); }

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
}

.module-header-left { display: flex; align-items: center; gap: 12px; }

.module-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.module-title {
  font-family: 'Montserrat', sans-serif;
  font-size: var(--fs-h3);
  font-weight: 500;
  color: var(--forest-ink);
  letter-spacing: -0.005em;
}
.module-tag { font-size: 10.5px; color: var(--ink-faint); font-weight: 400; margin-top: 2px; letter-spacing: 0.04em; }

.module-toggle {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--forest-mist);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-faint);
  transition: all 0.2s; flex-shrink: 0;
  background: var(--paper);
}

.module-card.open .module-toggle {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: var(--paper-pure);
  transform: rotate(45deg);
}

/* Door modules: show an arrow rather than a toggle */
.module-card.is-door .module-toggle {
  font-size: 0;
  border-color: transparent;
  background: transparent;
  width: 28px; height: 28px;
  position: relative;
}
.module-card.is-door .module-toggle::before {
  content: '→';
  font-size: 17px;
  color: var(--ink-faint);
  transform: none;
  transition: transform 0.2s, color 0.2s;
  display: inline-block;
}
.module-card.is-door:hover .module-toggle::before {
  color: var(--forest-deep);
  transform: translateX(3px);
}
.module-card.is-door.open .module-toggle {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.module-body { display: none; padding: 0 20px 20px; border-top: 1px solid var(--forest-mist); }
.module-card.open .module-body { display: block; }

/* ── MODULE-AS-PAGE (door mode) ── */
.screen.focus-mode .section-header,
.screen.focus-mode > .back-btn { display: none; }
.screen.focus-mode .modules-grid { display: block; grid-template-columns: 1fr; }
.screen.focus-mode .module-card:not(.is-focused) { display: none; }
.screen.focus-mode .module-card.is-focused {
  grid-column: 1 / -1;
  border: none;
  background: transparent;
  box-shadow: none;
  margin-top: 4px;
}
.screen.focus-mode .module-card.is-focused .module-header {
  padding: 0 0 20px 0;
  cursor: default;
  border-bottom: 1px solid var(--forest-mist);
  margin-bottom: 28px;
}
.screen.focus-mode .module-card.is-focused .module-header .module-toggle { display: none; }
.screen.focus-mode .module-card.is-focused .module-header-right { display: none; }
/* Pocketbook in focus mode: hide the redundant "Pocket Guide to Activities
   / 12 activities · select to expand" title strip — the injected back-link
   already provides navigation context. */
.screen.focus-mode #mod-pocket.is-focused .module-header { display: none; }
.screen.focus-mode .module-card.is-focused .module-icon {
  width: 48px; height: 48px; font-size: 22px;
  background: var(--paper-card);
}
.screen.focus-mode .module-card.is-focused .module-title {
  font-size: 28px; font-weight: 500;
  letter-spacing: -0.012em;
}
.screen.focus-mode .module-card.is-focused .module-tag {
  font-size: 11.5px; margin-top: 4px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.screen.focus-mode .module-card.is-focused .module-body {
  display: block; padding: 0; border: none;
}
.module-back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-soft);
  background: none; border: none;
  cursor: pointer; padding: 0;
  margin-bottom: 22px;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.module-back-link:hover { color: var(--forest-deep); }
.module-back-link::before { content: '←'; font-size: 15px; }

/* ── ACTIVITIES ── */
.activities-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.activity-item {
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper-pure);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.activity-item:hover { border-color: var(--forest-soft); }
.activity-item.open { border-color: var(--forest-mid); box-shadow: var(--shadow-sm); }

.activity-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  background: var(--paper-card);
  user-select: none;
  transition: background 0.18s;
}
.activity-item.open .activity-trigger { background: var(--paper-pure); border-bottom: 1px solid var(--forest-mist); }

.activity-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  letter-spacing: -0.005em;
}

.activity-duration {
  font-size: 10.5px;
  color: var(--ink-soft);
  background: var(--paper);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--forest-mist);
  white-space: nowrap;
  margin-left: 8px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.activity-detail { display: none; padding: 18px 18px 20px; background: var(--paper-pure); }
.activity-item.open .activity-detail { display: block; }

/* ── DEEP LINK HIGHLIGHT ── */
.activity-item.highlight {
  border-color: var(--forest-mid);
  box-shadow: 0 0 0 3px rgba(127,163,150,0.18);
}

.detail-section { margin-bottom: 14px; }
.detail-section:last-child { margin-bottom: 0; }

.detail-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft-text);
  margin-bottom: 6px;
}

.detail-text { font-size: 13px; color: var(--ink); line-height: 1.65; font-weight: 300; }

.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.detail-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--forest-deep);
  border: 1px solid var(--forest-mist);
  font-weight: 400;
}

.detail-text--example {
  font-style: italic;
  color: var(--ink-soft);
  padding: 10px 14px;
  background: var(--paper);
  border-left: 2px solid var(--forest-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ── COPY LINK ── */
.copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-weight: 500;
  margin-top: 12px;
  transition: all 0.15s;
}
.copy-link-btn:hover { border-color: var(--forest-soft); color: var(--forest-deep); }
.copy-link-btn.copied { background: var(--forest-deep); color: var(--paper-pure); border-color: var(--forest-deep); }

