/* Sample for LSA — tokens sourced from LSA's actual brand file and
   from the LSA tenant already defined in Candle Pay's design system
   (src/lib/tenant/tenants/lsa.ts), not invented for this sample. */
:root {
  --brand: #e72419;
  --brand-hover: #c41a11;
  --brand-foreground: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f7f4f3;
  --text: #1a1a1a;
  --text-muted: #6a6260;
  --border: #e6dedc;
  --radius-sm: 0.625rem;
  --radius-lg: 1rem;
  --shadow: 0 1px 2px rgba(26,26,26,0.06), 0 8px 24px rgba(26,26,26,0.08);
  --font: "Cairo", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
/* Light only for now — dark mode intentionally not built yet. */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface-muted);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; }

/* ---------- Candle meta bar (not LSA branded — identifies the sample) ---------- */
.meta {
  background: #1a1a1a; color: #e9e4e2;
  font-size: 13px; padding: 10px 20px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.meta b { color: #fff; }
.meta .sep { opacity: 0.35; }
.meta-flame { flex-shrink: 0; }
.meta-lsa-icon { width: 15px; height: 15px; object-fit: contain; flex-shrink: 0; }
.meta .tag {
  margin-inline-start: auto; background: #2a2a2a; border: 1px solid #3d3d3d;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; color: #c9c2bf;
}

/* ---------- Intro / framing copy ---------- */
.intro { padding-block: 44px 28px; text-align: center; }
.intro h1 { font-size: 26px; margin: 0 0 10px; font-weight: 800; }
.intro p { color: var(--text-muted); max-width: 640px; margin: 0 auto; font-size: 15px; }

.compare-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.compare-label.before { background: #efe9e7; color: #6a6260; }
.compare-label.after { background: #fdeceb; color: var(--brand); }

/* ---------- Device switch (the "after" panel only) ---------- */
.device-switch-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.device-switch-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.device-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.device-btn {
  border: none; background: transparent; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; font-family: var(--font); cursor: pointer; color: var(--text-muted);
}
.device-btn.active { background: var(--brand); color: var(--brand-foreground); }

/* ---------- Device frame: chrome bar + fixed-height scrollable viewport ---------- */
.device-frame {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); background: var(--surface);
  width: 100%; margin: 0 auto; transition: max-width 0.25s ease;
}
.device-frame[data-frame="after"] { border: 2px solid var(--brand); }
/* The mobile/desktop toggle only affects the new sketch — the "today"
   screenshot is a single desktop capture either way (see its caption). */
body.mode-mobile .device-frame[data-frame="after"] { max-width: 400px; }

.browser-chrome {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--surface-muted); border-bottom: 1px solid var(--border);
}
.browser-dots { display: flex; gap: 6px; flex-shrink: 0; }
.browser-dots span { width: 9px; height: 9px; border-radius: 999px; background: #d8d2d0; }
.browser-url {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 14px; font-size: 12.5px; color: var(--text-muted); text-align: center;
  font-family: ui-monospace, monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fullscreen-btn {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.fullscreen-btn:hover { color: var(--brand); border-color: var(--brand); }

.frame-viewport { height: 560px; overflow-y: auto; overflow-x: hidden; background: var(--surface); }
body.mode-mobile .frame-viewport { height: 680px; }
.frame-viewport img { width: 100%; }

.device-frame:fullscreen { max-width: none; width: 100vw; display: flex; flex-direction: column; }
.device-frame:fullscreen .frame-viewport { flex: 1; height: auto; }
.device-frame:-webkit-full-screen { max-width: none; width: 100vw; }
.device-frame:-webkit-full-screen .frame-viewport { height: calc(100vh - 47px); }

/* Fallback when the real Fullscreen API is unavailable (e.g. a sandboxed
   preview iframe) — a fixed overlay that behaves the same way. */
body.pseudo-fullscreen-lock { overflow: hidden; }
.device-frame.pseudo-fullscreen {
  position: fixed; inset: 0; z-index: 9000; max-width: none !important; width: 100vw;
  border-radius: 0; display: flex; flex-direction: column; margin: 0;
}
.device-frame.pseudo-fullscreen .frame-viewport { flex: 1; height: auto; }
.device-frame.pseudo-fullscreen .fullscreen-btn::before { content: "✕"; }
.device-frame.pseudo-fullscreen .fullscreen-btn { font-size: 0; }
.device-frame.pseudo-fullscreen .fullscreen-btn::before { font-size: 13px; }

.frame-caption { font-size: 12px; color: var(--text-muted); text-align: center; margin: 10px 0 0; }

.critique { margin-top: 18px; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.critique li { display: flex; gap: 10px; font-size: 14px; color: var(--text-muted); align-items: flex-start; }
.critique li .mark { color: var(--brand); font-weight: 800; flex-shrink: 0; }

/* ---------- After: the built mockup ---------- */
.mockup { font-family: var(--font); }
.mockup[dir="rtl"] { direction: rtl; }

/* header — sticky within the frame's own scroll area */
.m-header {
  display: flex; align-items: center; gap: 24px; padding: 14px 24px;
  border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 30; flex-wrap: wrap;
}
/* Safe zone so a nav jump doesn't land a section's heading right under the
   sticky header — scroll-margin-top is honoured by scrollIntoView too. */
#m-about, #m-branches, #m-donate, #m-stories, #m-blood, #m-resources, #m-footer {
  scroll-margin-top: 76px;
}
body.mode-mobile #m-about, body.mode-mobile #m-branches, body.mode-mobile #m-donate,
body.mode-mobile #m-stories, body.mode-mobile #m-blood, body.mode-mobile #m-resources,
body.mode-mobile #m-footer {
  scroll-margin-top: 96px;
}
.m-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.m-brand img { height: 32px; width: 32px; object-fit: contain; }
.m-nav { display: flex; align-items: center; gap: 18px; font-size: 13.5px; flex-wrap: wrap; }
.m-nav-link { color: var(--text-muted); text-decoration: none; cursor: pointer; background: none; border: none; font-family: var(--font); font-size: 13.5px; }
.m-nav a.m-nav-link:hover, .m-dropdown-btn:hover { color: var(--brand); }
.m-header-right { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.m-lang-toggle {
  font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px;
  background: var(--surface); color: var(--text); cursor: pointer; font-family: var(--font);
}
.m-donate-btn {
  background: var(--brand); color: var(--brand-foreground); border: none; border-radius: var(--radius-sm);
  padding: 9px 18px; font-weight: 700; font-size: 13.5px; cursor: pointer; font-family: var(--font);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.m-donate-btn:hover { background: var(--brand-hover); }

/* Resources dropdown */
.m-dropdown { position: relative; }
.m-dropdown-btn { padding: 0; }
.m-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 10px); left: 0; min-width: 150px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; flex-direction: column; z-index: 40;
}
.mockup[dir="rtl"] .m-dropdown-menu { left: auto; right: 0; }
.m-dropdown.open .m-dropdown-menu { display: flex; }
.m-dropdown-menu .m-nav-link { padding: 7px 9px; border-radius: 7px; }
.m-dropdown-menu .m-nav-link:hover { background: var(--surface-muted); }

/* Mobile burger + panel */
.m-burger {
  display: none; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px; cursor: pointer; align-items: center; justify-content: center;
}
.m-mobile-menu {
  display: none; flex-direction: column; gap: 2px; width: 100%;
  border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px;
}
.m-mobile-menu.open { display: flex; }
.m-mobile-menu .m-nav-link { padding: 9px 4px; }
body.mode-mobile .m-burger { display: flex; }

/* hero — real photography, dark overlay baked into the inline background-image */
.m-hero {
  background-size: cover; background-position: center;
  padding: 72px 24px; text-align: center; color: #fff;
}
.m-hero h2 { font-size: 30px; font-weight: 800; max-width: 560px; margin: 0 auto 12px; text-wrap: balance; }
.m-hero p { color: #f1f1f1; max-width: 460px; margin: 0 auto 24px; font-size: 14.5px; }
.m-hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.m-btn-outline {
  border: 1.5px solid var(--brand); color: var(--brand); background: transparent;
  padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px;
  font-family: var(--font); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.m-btn-outline-light {
  border: 1.5px solid #fff; color: #fff; background: rgba(255,255,255,0.08);
  padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px;
  font-family: var(--font); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}

/* impact strip */
.m-impact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); }
.m-impact-cell { background: var(--surface); padding: 26px 14px; text-align: center; }
.m-impact-cell .num { font-size: 24px; font-weight: 800; color: var(--brand); }
.m-impact-cell .lbl { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.m-impact-note { text-align: center; font-size: 11px; color: var(--text-muted); padding: 8px; background: var(--surface-muted); }

/* donate teaser */
.m-donate {
  padding: 40px 24px; background: var(--surface);
  display: flex; gap: 32px; align-items: center; flex-wrap: wrap; justify-content: center;
}
.m-donate-copy { flex: 1; min-width: 220px; max-width: 320px; }
.m-donate-copy h3 { font-size: 19px; margin: 0 0 8px; font-weight: 800; }
.m-donate-copy p { color: var(--text-muted); font-size: 13.5px; margin: 0; }
.m-donate-card {
  background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; width: 100%; max-width: 300px;
}
.m-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.m-amounts span { text-align: center; padding: 10px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; background: var(--surface); }
.m-amounts span.active { border-color: var(--brand); color: var(--brand); background: var(--surface); }

/* blood teaser — photo accent fading into the panel on the left */
.m-blood {
  display: flex; gap: 18px; align-items: center; padding: 30px 24px; min-height: 120px;
  background-size: cover; background-position: center;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.m-blood-icon { font-size: 26px; flex-shrink: 0; }
.m-blood-copy { flex: 1; }
.m-blood-copy h4 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
.m-blood-copy p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* about */
.m-about { padding: 40px 24px; text-align: center; }
.m-about h3 { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
.m-about > p { color: var(--text-muted); max-width: 520px; margin: 0 auto 20px; font-size: 13.5px; }
.m-programs { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.m-program-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 130px; font-size: 12.5px; font-weight: 700;
}
.m-program-icon { color: var(--brand); display: flex; }

/* branches */
.m-branches { padding: 36px 24px; text-align: center; background: var(--surface-muted); }
.m-branches h3 { font-size: 19px; font-weight: 800; margin: 0 0 6px; }
.m-branches > p { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }
.m-map-note {
  display: flex; align-items: center; gap: 10px; text-align: left;
  max-width: 480px; margin: 0 auto 22px; padding: 12px 14px;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 12.5px;
}
.m-map-note svg { color: var(--brand); flex-shrink: 0; }
.mockup[dir="rtl"] .m-map-note { text-align: right; }
.m-branch-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.m-branch-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 150px; padding: 16px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font);
}
.m-branch-card:hover { border-color: var(--brand); }
.m-branch-card img { width: 28px; height: 28px; object-fit: contain; }
.m-branch-city { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.m-branch-phone { font-size: 11.5px; color: var(--brand); font-weight: 700; min-height: 15px; }

/* stories */
.m-stories { padding: 36px 24px; background: var(--surface-muted); text-align: center; }
.m-stories h3 { font-size: 19px; font-weight: 800; margin: 0 0 18px; }
.m-story-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.m-story-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; max-width: 280px; text-align: left;
}
.mockup[dir="rtl"] .m-story-card { text-align: right; }
.m-story-card p { font-size: 13px; margin: 0 0 10px; }
.m-story-byline { display: flex; align-items: center; gap: 8px; }
.m-story-avatar {
  width: 28px; height: 28px; border-radius: 999px; background: var(--surface-muted);
  color: var(--brand); border: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
}
.m-story-who { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.m-sample-note { font-size: 11px; color: var(--text-muted); font-style: italic; margin: 16px 0 0; }

/* join CTA — one line, not a nav item */
.m-join {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px; background: var(--surface-muted); font-size: 13.5px; flex-wrap: wrap; text-align: center;
}
.m-join-link { color: var(--brand); font-weight: 700; }

/* resources */
.m-resources { padding: 40px 24px; text-align: center; }
.m-resources h3 { font-size: 19px; font-weight: 800; margin: 0 0 18px; }
.m-resource-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.m-resource-card {
  background: var(--surface-muted); border-radius: var(--radius-sm); padding: 16px; width: 200px; text-align: left;
}
.mockup[dir="rtl"] .m-resource-card { text-align: right; }
.m-resource-label { font-weight: 800; font-size: 13.5px; color: var(--brand); }
.m-resource-card p { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 10px; }
.m-resource-link { font-size: 12.5px; font-weight: 700; }

/* partners */
.m-partners { padding: 32px 24px; text-align: center; background: var(--surface-muted); }
.m-partners-label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 14px; }
.m-partner-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.m-partner-box { width: 90px; height: 40px; background: var(--border); border-radius: 6px; }

/* newsletter */
.m-newsletter {
  padding: 34px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--border);
}
.m-newsletter h3 { font-size: 17px; font-weight: 800; margin: 0 0 4px; }
.m-newsletter p { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.m-newsletter-form { display: flex; gap: 8px; }
.m-newsletter-form input {
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-family: var(--font); font-size: 13px; min-width: 180px;
}

/* final appeal */
.m-final-appeal {
  padding: 44px 24px; text-align: center; background: var(--brand); color: var(--brand-foreground);
}
.m-final-appeal h3 { font-size: 19px; font-weight: 800; max-width: 420px; margin: 0 auto 18px; }
.m-final-appeal .m-donate-btn { background: #fff; color: var(--brand); }

body.mode-mobile .m-newsletter { flex-direction: column; text-align: center; }
body.mode-mobile .m-resource-row, body.mode-mobile .m-story-row { flex-direction: column; align-items: center; }

/* footer */
.m-footer { background: var(--text); color: var(--surface); padding: 26px 24px; font-size: 12.5px; }
.m-footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; opacity: 0.85; }

.note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 10px; }

/* The device-frame toggle fakes a narrow viewport without actually resizing
   the browser, so these rules key off body.mode-mobile, not a media query —
   a real @media query below still covers genuinely narrow browsers/phones. */
body.mode-mobile .m-nav { display: none; }
body.mode-mobile .m-impact { grid-template-columns: repeat(2, 1fr); }
body.mode-mobile .m-header { flex-wrap: wrap; }
body.mode-mobile .m-donate { padding: 28px 18px; }

@media (max-width: 760px) {
  .m-nav { display: none; }
  .m-impact { grid-template-columns: repeat(2, 1fr); }
  .m-header { flex-wrap: wrap; }
}

/* ---------- Gate ---------- */
#sample-gate {
  position: fixed; inset: 0; z-index: 10000; background: #1a1a1a; color: #f5f5f5;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.gate-card {
  width: 100%; max-width: 360px; text-align: center; background: #242424;
  border: 1px solid #3d3d3d; border-radius: 14px; padding: 32px 28px;
}
.gate-logo { height: 40px; width: auto; margin: 0 auto 16px; }
.gate-card h1 { font-family: var(--font); font-size: 17px; margin-bottom: 6px; }
.gate-card p { color: #a09a98; font-size: 13px; margin-bottom: 16px; }
.gate-card form { display: flex; gap: 8px; }
.gate-card input {
  flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid #3d3d3d;
  background: #1a1a1a; color: #f5f5f5; font-size: 14px; font-family: var(--font);
}
.gate-card button {
  padding: 10px 16px; border-radius: 8px; border: none; background: #e72419; color: #fff;
  font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--font);
}
#gate-error { color: #f4564c !important; margin: 10px 0 0; font-size: 12.5px; }
.gate-by {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid #3d3d3d;
  color: #a09a98; font-size: 11.5px; text-decoration: none;
}
.gate-by:hover { color: #e9e4e2; }

.m-footer-credit {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 11px; opacity: 0.7;
}
