/* Shared design system for the HTML5 app previews.
   Mirrors the Expo app's light editorial theme at the app's real design
   width (390px). preview.js zooms the body to fit whatever size the phone
   mockup iframe actually is, so proportions always match the real app.
   Client colors map to these CSS variables. */

:root {
  --primary: #b08d8d;
  --accent: #97a487;
  --bg: #faf6f0;
  --surface: #ffffff;
  --text: #6f6560;
  --ink: #3b3230;
  --line: #e6ddd4;
  --rose-soft: #eee2de;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Dancing Script', cursive;
  --sans: 'Montserrat', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }
body {
  width: 390px;                       /* app's design width */
  height: calc(100vh / var(--z, 1));  /* so scaled height fills the iframe */
  zoom: var(--z, 1);                  /* set by preview.js = iframeW / 390 */
  background: var(--bg);
  font-family: var(--sans);
  font-weight: 400;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== App chrome (mirrors src/AppShell.tsx) ===== */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 48px 18px 14px;            /* app uses paddingTop 52 (status bar hidden) */
  flex-shrink: 0;
}
.app-header .brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.app-header .brand svg { width: 18px; height: 18px; fill: var(--primary); }
.app-header .brand span { font-family: var(--script); font-size: 24px; color: var(--ink); white-space: nowrap; }
.app-header .back {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--ink);
  white-space: nowrap;
}
.app-header .burger { width: 26px; height: 26px; color: var(--ink); display: block; flex-shrink: 0; }
.app-header .burger svg { width: 100%; height: 100%; }

.app-body { flex: 1; overflow-y: auto; scrollbar-width: none; }
.app-body::-webkit-scrollbar { display: none; }
.app-body > section { padding: 0 20px 30px; }

.tab-bar {
  display: flex; flex-shrink: 0;
  background: var(--surface); border-top: 1px solid var(--line);
  height: 62px; padding: 6px 0 8px;
}
.tab-bar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--text); justify-content: center;
}
.tab-bar a.active { color: var(--primary); }
.tab-bar svg { width: 24px; height: 24px; }

/* ===== Typography ===== */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); }
h2 { font-size: 26px; line-height: 1.15; }
h3 { font-size: 20px; }
.script { font-family: var(--script); font-size: 22px; color: var(--primary); font-weight: 600; }
.kicker { font-size: 11px; letter-spacing: 1.5px; font-weight: 500; color: var(--primary); text-transform: uppercase; }

/* ===== Cards & controls ===== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
}
.btn {
  display: block; background: var(--primary); color: #fff; text-align: center;
  border-radius: 26px; padding: 15px 16px; font-weight: 500; font-size: 16px;
}
.btn.outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn.small { padding: 10px 12px; font-size: 13px; border-radius: 20px; }

.chip {
  display: inline-block; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 20px; padding: 9px 16px; font-size: 13px;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.on.accent { background: var(--accent); border-color: var(--accent); }
/* the two big attend/decline pills */
.chip.pill { border-radius: 24px; padding: 12px 10px; font-size: 14px; font-weight: 500; text-align: center; }

.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 14px; padding: 12px 14px; font-family: var(--sans);
  font-size: 14px; color: var(--ink); outline: none;
}
.input::placeholder { color: var(--text); }
textarea.input { resize: none; min-height: 90px; }

.stepper {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 14px; padding: 10px 16px;
}
.stepper .ctrl { display: flex; align-items: center; gap: 12px; }
.stepper .ctrl button {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--primary);
  color: var(--primary); font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.stepper .ctrl b { font-family: var(--serif); font-size: 19px; color: var(--ink); min-width: 24px; text-align: center; }
.stepper .lbl { color: var(--ink); font-size: 15px; }

/* ===== Bubbles (messages) ===== */
.bubble {
  max-width: 82%; border-radius: 18px; padding: 14px; margin-bottom: 12px;
  background: var(--rose-soft); color: var(--ink); font-size: 14px; line-height: 21px;
}
.bubble .b-title { font-family: var(--serif); font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.bubble .b-meta { font-size: 11px; color: var(--text); margin-top: 6px; }
.bubble.mine { background: var(--accent); color: #fff; margin-left: auto; }
.bubble.mine .b-meta { color: rgba(255,255,255,.85); }

.composer {
  flex-shrink: 0; border-top: 1px solid var(--line); background: var(--surface);
  padding: 12px 12px 20px; display: flex; gap: 10px; align-items: flex-end;
}
.composer .input { border-radius: 14px; padding: 10px 14px; }
.composer .send {
  width: 44px; height: 44px; border-radius: 50%; background: var(--primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.composer .send svg { width: 18px; height: 18px; fill: #fff; }

/* ===== Nav drawer ===== */
.drawer-veil {
  position: fixed; inset: 0; background: rgba(43,36,34,.35);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 280px;
  background: var(--surface); z-index: 21;
  transform: translateX(100%); transition: transform .28s ease;
  overflow-y: auto; box-shadow: -10px 0 30px rgba(0,0,0,.12);
}
body.nav-open .drawer-veil { opacity: 1; pointer-events: auto; }
body.nav-open .drawer { transform: none; }
.drawer .d-top { display: flex; justify-content: space-between; align-items: center; padding: 54px 20px 14px; }
.drawer .d-top h3 { font-size: 26px; }
.drawer .d-top button { font-size: 26px; color: var(--ink); line-height: 1; }
.drawer .d-couple {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0 16px 12px;
}
.drawer .d-couple img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.drawer .d-couple b { font-family: var(--serif); font-size: 18px; color: var(--ink); display: block; }
.drawer .d-couple small { font-size: 12px; color: var(--primary); margin-top: 2px; display: block; }
.drawer a.d-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 24px; font-size: 15px; color: var(--ink); border-radius: 8px;
}
.drawer a.d-item:hover { background: var(--bg); }
.drawer a.d-item svg { width: 20px; height: 20px; color: var(--primary); }

/* ===== Screen-specific ===== */
.hero { position: relative; height: 300px; margin: 0 -20px; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .veil {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: rgba(250,246,240,.55);
  text-align: center; padding: 14px;
}
.hero .veil h1 { font-size: 38px; }
.hero .veil .date { font-size: 15px; letter-spacing: 1px; color: var(--primary); margin-top: 8px; }
.days-pill {
  margin-top: 14px; background: var(--primary); color: #fff;
  border-radius: 20px; padding: 8px 18px; font-size: 13px; font-weight: 500;
}
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.quick-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 8px; font-size: 14px; font-weight: 500; color: var(--ink);
}
.quick-grid a svg { width: 26px; height: 26px; color: var(--primary); }

.next-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--rose-soft); border-radius: 16px; padding: 18px; margin-top: 20px;
}
.next-card .n-title { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink); margin-top: 4px; }
.next-card .n-meta { font-size: 13px; color: var(--text); margin-top: 4px; }
.next-card .chev { margin-left: auto; color: var(--primary); font-size: 22px; }

.ev-card {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
}
.ev-card .time {
  font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--primary);
  border-right: 1px solid var(--line); padding-right: 14px; margin-right: 14px; min-width: 62px;
}
.ev-card .e-title { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--ink); }
.ev-card .e-loc { font-size: 12px; color: var(--text); margin-top: 4px; }
.ev-card .chev { margin-left: auto; color: var(--primary); font-size: 22px; }

.gal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gal-grid img { border-radius: 16px; aspect-ratio: 1; object-fit: cover; width: 100%; cursor: pointer; }
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 30;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 88%; border-radius: 12px; }
.lightbox .lb-close {
  position: absolute; top: 20px; right: 22px; color: #fff; font-size: 30px;
}

.gift-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 14px; }
.gift-card img.g-img { width: 100%; height: 160px; object-fit: cover; }
.gift-card .g-body { padding: 16px; }
.gift-card .g-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gift-card .g-title { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--ink); }
.gift-card .g-cat { font-size: 11px; color: var(--text); margin-top: 3px; }
.gift-card .g-desc { font-size: 13px; color: var(--text); margin-top: 8px; }
.price-pill {
  background: var(--rose-soft); color: var(--primary); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.gift-card .g-btns { display: flex; gap: 10px; margin-top: 14px; }
.gift-card .g-btns .btn { flex: 1; padding: 10px; font-size: 13px; border-radius: 20px; }
.reserved-tag { margin-top: 12px; font-size: 13px; font-weight: 500; color: var(--accent); }

.menu-course .m-script { font-family: var(--script); font-size: 22px; color: var(--primary); font-weight: 600; margin: 16px 0 8px; }
.menu-course .card { padding: 0; }
.menu-course .m-item { padding: 12px 14px; }
.menu-course .m-item + .m-item { border-top: 1px solid var(--line); }
.menu-course .m-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.menu-course .m-detail { font-size: 11px; color: var(--text); margin-top: 3px; }

.venue-hero { border-radius: 16px; overflow: hidden; height: 220px; margin-top: 6px; }
.venue-hero img { width: 100%; height: 100%; object-fit: cover; }
.map-tile {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 16px;
}
.map-tile .pin { color: var(--primary); }
.map-tile .pin svg { width: 22px; height: 22px; }
.map-tile span { flex: 1; font-size: 15px; font-weight: 500; color: var(--ink); }

.note-card { background: var(--rose-soft); border-radius: 16px; padding: 18px; font-size: 14px; color: var(--ink); }

.sec-label { font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--ink); margin: 22px 0 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stack > * + * { margin-top: 10px; }
.member-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 8px; background: var(--surface); }
.member-label { font-family: var(--sans); font-weight: 500; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.member-sub { font-family: var(--sans); font-size: 12px; color: var(--text); margin: 8px 0 8px; }

/* ===== Standalone desktop mode (body.sim) =====
   preview.js wraps the whole app in .sim-frame when the page is opened
   directly on a wide screen — the body becomes a page backdrop and the
   app renders at its real 390px design size inside a phone frame. */
body.sim {
  width: auto; height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 24px;
  background:
    radial-gradient(900px 620px at 50% -8%, #ffffff 0%, rgba(255,255,255,0) 70%),
    linear-gradient(180deg, #faf6f0 0%, #f0e7dc 100%);
}
.sim-frame {
  width: 390px;
  height: min(844px, 100vh - 120px);
  min-height: 480px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 11px solid #2b2422;
  border-radius: 46px;
  box-shadow:
    0 44px 90px -34px rgba(43, 36, 34, .5),
    0 0 0 2px #4a423e;
  overflow: hidden;
  position: relative;
  transform: translateZ(0); /* fixed children (drawer/veil/lightbox) anchor to the frame */
}
.sim-caption {
  font-family: var(--script); font-size: 22px; color: var(--ink);
  text-align: center; line-height: 1.3;
}
.sim-caption:hover { color: var(--primary); }
.sim-caption small {
  display: block; font-family: var(--sans); font-weight: 400;
  font-size: 11.5px; letter-spacing: .8px; color: var(--text); margin-top: 2px;
}
