/* ════════════════════════════════════════════════════════════════════
 * Kindtemp Editorial App CSS
 *
 * Shared tokens and utility classes for the app-screens editorial port
 * (rotation list, intent selection, protocol result, active session).
 *
 * Binding spec: Screen Updates/BRAND_VOICE.md
 * Priority screens source from: Screen Updates/app_*_redesigned.html
 *
 * Loaded from base.html alongside output.css. Pages opt in by overriding
 * the `body_class` and `main_class` template blocks.
 * ════════════════════════════════════════════════════════════════════ */

:root {
  /* FOREST tones — atmospheric darks (for nav + footer continuity) */
  --ed-forest-deep: #0E1810;
  --ed-forest-950: #141C14;
  --ed-forest-900: #1E281E;
  --ed-forest-850: #253025;
  --ed-forest-mid: #2C3D2F;
  --ed-forest-800: #3A4A3A;
  --ed-forest-200: #A0B0A0;

  /* PAPER tones */
  --ed-paper: #EFE9DB;
  --ed-paper-deep: #E8E0CC;
  --ed-paper-warm: #F2EBDC;

  /* INK tones (text on paper) */
  --ed-ink: #1E281E;
  --ed-ink-soft: #3A4A3A;
  --ed-ink-muted: #6B7A6B;
  --ed-rule: rgba(30, 40, 30, 0.15);
  --ed-rule-soft: rgba(30, 40, 30, 0.08);

  /* ACCENTS — mid + -bright + -deep per BRAND_VOICE.md mid-tone rule */
  --ed-sunset: #F27D52;
  --ed-peach: #E8B4A0;
  --ed-peach-deep: #C88A72;
  --ed-eucalyptus: #2A9D8F;
  --ed-eucalyptus-bright: #5DCBBE;
  --ed-eucalyptus-deep: #1F7A6F;
  --ed-amber: #D4A053;
  --ed-cream: #F0EDE6;
}

/* ═══ BODY MODE OVERRIDE ═══════════════════════════════════════════
 * Applied via `{% block body_class %}editorial-body{% endblock %}`
 * Replaces the default atmospheric-bg + text-forest-text.
 * ═══════════════════════════════════════════════════════════════════ */
body.editorial-body {
  background: var(--ed-paper);
  color: var(--ed-ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.6;
}

/* ═══ PAGE BACKGROUND LAYERS ═══════════════════════════════════════
 * Two fixed divs dropped in per page: page-bg (ambient wash)
 * and paper-grain (mandatory SVG fractalNoise, 18%, multiply).
 * ═══════════════════════════════════════════════════════════════════ */
.editorial-page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 15% 15%, rgba(232, 180, 160, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 85%, rgba(42, 157, 143, 0.06) 0%, transparent 60%),
    var(--ed-paper);
}

.editorial-paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch' type='fractalNoise'/%3E%3CfeColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 320px;
}

/* ═══ MAIN CONTAINER OVERRIDE ══════════════════════════════════════
 * base.html's <main> default is `flex-1 max-w-4xl w-full mx-auto px-4 py-8`.
 * Editorial pages override to editorial-main for 1080px + compressed padding.
 * ═══════════════════════════════════════════════════════════════════ */
main.editorial-main {
  max-width: 1080px;
  padding: 32px 24px 64px;
}

/* ═══ TYPOGRAPHY PRIMITIVES ════════════════════════════════════════ */
.ed-heading {
  font-family: 'DM Serif Display', Georgia, serif;
  color: var(--ed-ink);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.ed-serif-italic {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
}

/* ═══ GENETICS PILLS (editorial, paper-friendly) ═══════════════════ */
.ed-genetics-pill {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 50px;
  flex-shrink: 0;
  display: inline-block;
}
.ed-genetics-sativa {
  background: rgba(234, 179, 8, 0.12);
  color: #8A6508;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.ed-genetics-hybrid {
  background: rgba(59, 130, 246, 0.08);
  color: #3A5F9E;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.ed-genetics-indica {
  background: rgba(147, 51, 234, 0.08);
  color: #6E43AD;
  border: 1px solid rgba(147, 51, 234, 0.2);
}

/* ═══ FILTER PILLS ══════════════════════════════════════════════════ */
.ed-filter-pill {
  font-size: 0.72rem;
  padding: 5px 14px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
  border: 1px solid var(--ed-rule);
  background: transparent;
  color: var(--ed-ink-muted);
  display: inline-block;
  line-height: 1.5;
}
.ed-filter-pill:hover {
  background: rgba(30, 40, 30, 0.05);
  color: var(--ed-ink);
}
.ed-filter-pill.active {
  background: var(--ed-ink);
  color: var(--ed-cream);
  border-color: var(--ed-ink);
}
.ed-filter-sep {
  width: 1px;
  height: 16px;
  background: var(--ed-rule);
  margin: 0 6px;
  display: inline-block;
}

/* ═══ FLAVOR TAGS (retuned for paper backgrounds) ═══════════════════
 * Keyed on the same color field emitted by FLAVOR_COLORS in
 * engine/protocol_engine.py — template picks ed-ft-{{ tag.color }}.
 * ═══════════════════════════════════════════════════════════════════ */
.ed-flavor-tag {
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-block;
  line-height: 1.5;
  border: 1px solid transparent;
}
.ed-ft-yellow { background: rgba(234, 179, 8, 0.10); color: #8A6508; border-color: rgba(234, 179, 8, 0.25); }
.ed-ft-brown  { background: rgba(120, 100, 60, 0.10); color: #5A4A28; border-color: rgba(120, 100, 60, 0.25); }
.ed-ft-sage   { background: rgba(34, 120, 80, 0.10); color: #1F5E3E; border-color: rgba(34, 120, 80, 0.25); }
.ed-ft-purple { background: rgba(168, 85, 247, 0.08); color: #6E43AD; border-color: rgba(168, 85, 247, 0.20); }
.ed-ft-red    { background: rgba(180, 83, 9, 0.10); color: #7A3B06; border-color: rgba(180, 83, 9, 0.25); }
.ed-ft-amber  { background: rgba(200, 160, 80, 0.12); color: #7A5F20; border-color: rgba(200, 160, 80, 0.25); }
.ed-ft-olive  { background: rgba(140, 160, 80, 0.12); color: #5A6A28; border-color: rgba(140, 160, 80, 0.25); }
.ed-ft-teal   { background: rgba(42, 157, 143, 0.10); color: #1F7A6F; border-color: rgba(42, 157, 143, 0.25); }
.ed-ft-peach  { background: rgba(232, 180, 160, 0.15); color: #A55D42; border-color: rgba(232, 180, 160, 0.35); }
.ed-ft-pink   { background: rgba(236, 72, 153, 0.08); color: #9C2858; border-color: rgba(236, 72, 153, 0.20); }
.ed-ft-gray   { background: rgba(160, 160, 160, 0.12); color: #5A5A5A; border-color: rgba(160, 160, 160, 0.25); }

/* ═══ SUNSET CTA PILL ══════════════════════════════════════════════ */
.ed-btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 50px;
  background: var(--ed-sunset);
  color: var(--ed-cream);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(242, 125, 82, 0.2);
  font-family: inherit;
  border: none;
  cursor: pointer;
  line-height: 1.2;
}
.ed-btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(242, 125, 82, 0.3);
}
.ed-btn-cta .ph {
  font-size: 0.85rem;
}

/* ═══ NAV + FOOTER CHROME (match landing page exactly) ═════════════
 * Mirrors templates/landing.html `nav`+`.logo`+`.nav-i` for the header
 * and `footer`+`.colophon` for the footer. In-app base.html wraps the
 * nav in a solid-bg container (since in-app pages don't have a hero
 * backdrop underneath the absolute-positioned landing nav), but the
 * logo/wordmark sizing and typography match landing exactly.
 * ═══════════════════════════════════════════════════════════════════ */
nav.kt-nav {
  background: var(--ed-forest-950);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 0;
  position: relative;
  z-index: 10000;
}
.kt-nav-i {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kt-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.kt-logo img {
  height: 32px;
  filter: brightness(1.2);
  transition: transform 0.15s;
}
.kt-logo:hover img { transform: scale(1.05); }
.kt-logo-mark {
  color: var(--ed-cream);
  font-family: 'Sofia Pro', system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.kt-nav-r {
  display: flex;
  gap: 20px;
  align-items: center;
  color: rgba(240, 237, 230, 0.7);
}
.kt-nav-r a,
.kt-nav-r button {
  color: rgba(240, 237, 230, 0.75);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
  font-family: inherit;
}
.kt-nav-r a:hover,
.kt-nav-r button:hover { color: var(--ed-cream); }
.kt-nav-r .ph { font-size: 1.3rem; }
.kt-nav-r .ph-lifebuoy { color: var(--ed-peach); }
.kt-nav-r .ph-list { font-size: 1.5rem; color: var(--ed-cream); }

/* ═══ SLIDE-OUT MENU PANEL (dark, brand-consistent) ════════════════ */
.kt-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 272px;
  background: var(--ed-forest-950);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 50;
}
.kt-menu-panel.hidden { display: none; }
.kt-menu-inner { padding: 6px 0; }
.kt-menu-user {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.kt-menu-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ed-cream);
  margin: 0;
  line-height: 1.3;
}
.kt-menu-user-email {
  font-size: 0.75rem;
  color: rgba(240, 237, 230, 0.55);
  margin: 2px 0 0 0;
  line-height: 1.3;
}
.kt-menu-item {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  font-size: 0.88rem;
  color: rgba(240, 237, 230, 0.88);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.kt-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ed-cream);
}
.kt-menu-item .ph {
  font-size: 1.15rem;
  margin-right: 12px;
  width: 20px;
  text-align: center;
  color: var(--ed-eucalyptus-bright);
}
/* Care-coded icons (Kind Kit) use peach — the brand's "care bridge" color */
.kt-menu-item.kt-menu-item-kind .ph { color: var(--ed-peach); }
/* Neutral items (Profile, Preferences, Sign In) use muted cream for icons */
.kt-menu-item.kt-menu-item-neutral .ph { color: rgba(240, 237, 230, 0.55); }
/* Sign out uses sunset (warm exit) */
.kt-menu-item.kt-menu-item-signout { color: var(--ed-sunset); }
.kt-menu-item.kt-menu-item-signout .ph { color: var(--ed-sunset); }
.kt-menu-item.kt-menu-item-signout:hover { background: rgba(242, 125, 82, 0.08); color: var(--ed-sunset); }
/* Sign up CTA — eucalyptus-bright accent */
.kt-menu-item.kt-menu-item-cta { font-weight: 600; color: var(--ed-eucalyptus-bright); }
.kt-menu-item.kt-menu-item-cta:hover { background: rgba(93, 203, 190, 0.08); }
.kt-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

/* ═══ COLOPHON FOOTER (match landing page) ═══════════════════════════
 * Mirrors templates/landing.html `footer`+`.colophon` styles exactly.
 * Base.html uses this on every in-app page for footer consistency.
 * ═══════════════════════════════════════════════════════════════════ */
footer.colophon-footer {
  background: var(--ed-forest-deep);
  padding: 56px 0 32px;
  text-align: center;
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.colophon-footer .colophon {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 40px;
}
.colophon-footer .colophon-mark-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.colophon-footer .colophon-mark-row img {
  height: 30px;
  filter: brightness(1.2);
}
.colophon-footer .colophon-mark {
  font-family: 'Sofia Pro', system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--ed-cream);
  line-height: 1;
}
.colophon-footer .colophon-tagline {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ed-peach);
  font-weight: 600;
  margin-bottom: 32px;
  margin-top: 0;
}
.colophon-footer .colophon-line {
  color: rgba(160, 176, 160, 0.6);
  font-size: 0.85rem;
  line-height: 1.6;
  font-style: italic;
  font-family: 'DM Serif Display', Georgia, serif;
  margin: 0;
}
.colophon-footer .colophon-meta {
  font-size: 0.75rem;
  color: rgba(160, 176, 160, 0.6);
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.6;
}
.colophon-footer .colophon-meta a {
  color: rgba(160, 176, 160, 0.7);
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.15s;
}
.colophon-footer .colophon-meta a:hover { color: var(--ed-cream); }
.colophon-footer .colophon-meta .sep { color: rgba(160, 176, 160, 0.3); }

/* ═══ REDUCED MOTION ═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ed-btn-cta:hover { transform: none; }
  * { transition: none !important; }
}
