/* =====================================================================
   Teddy template — soft pastels, teddy bear with balloons, clouds.
   See public/templates/README.md for how templates work.
   ===================================================================== */

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

:root {
  /* Customizable per event (event_colors). These are the defaults. */
  --color-primary: #7fa6c4;     /* dusty blue: buttons, a balloon, the bow */
  --color-accent: #e8b4b8;      /* blush: details, a balloon */
  --color-background: #fdf8f2;  /* cream */
  --color-text: #5a4635;        /* cocoa */
  --color-surface: #ffffff;

  --sage: #b9c9a7;
  --bear: #c99a6e;
  --bear-light: #ecd3b6;
  --bear-dark: #5a4030;
  --muted: #8c7a6b;
  --font-script: 'Pacifico', cursive;
  --font-sans: 'Nunito', system-ui, sans-serif;
  --font-serif: 'Nunito', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--color-background);
  /* Tiny scattered dots */
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--color-accent) 55%, transparent) 2px, transparent 2.5px),
    radial-gradient(circle, color-mix(in srgb, var(--color-primary) 45%, transparent) 2px, transparent 2.5px);
  background-size: 90px 90px, 130px 130px;
  background-position: 0 0, 45px 60px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#main-page { max-width: 520px; margin: 0 auto; padding: 0 16px 28px; opacity: 0; transition: opacity 0.6s ease; }
#main-page.visible { opacity: 1; }

/* ===================== HERO ===================== */
.ted-hero {
  position: relative;
  text-align: center;
  padding: 36px 0 18px;
}

.ted-cloud {
  position: absolute;
  width: 120px;
  height: 40px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(90, 70, 53, 0.06);
  z-index: 0;
}

.ted-cloud::before, .ted-cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.ted-cloud::before { width: 54px; height: 54px; top: -26px; left: 18px; }
.ted-cloud::after { width: 40px; height: 40px; top: -18px; right: 20px; }
.ted-cloud--1 { top: 56px; left: -30px; }
.ted-cloud--2 { top: 150px; right: -40px; transform: scale(0.8); }
.ted-cloud--3 { top: 300px; left: -50px; transform: scale(0.65); opacity: 0.9; }

.ted-bear { position: relative; z-index: 1; width: min(230px, 64vw); height: auto; display: block; margin: 0 auto; overflow: visible; animation: ted-sway 5s ease-in-out infinite; transform-origin: 50% 100%; }

@keyframes ted-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .ted-bear { animation: none; } }

.bear-fur { fill: var(--bear); }
.bear-light { fill: var(--bear-light); }
.bear-dark { fill: var(--bear-dark); }
.bear-mouth { stroke: var(--bear-dark); }
.bear-cheek { fill: var(--color-accent); opacity: 0.6; }
.bear-bow { fill: var(--color-primary); }
.balloon-1 { fill: var(--color-primary); }
.balloon-2 { fill: var(--color-accent); }
.balloon-3 { fill: var(--sage); }
.balloon-shine { fill: #fff; opacity: 0.45; }
.balloon-strings { stroke: color-mix(in srgb, var(--color-text) 45%, transparent); }

.ted-lead { position: relative; z-index: 1; margin-top: 14px; font-weight: 700; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

.ted-headline {
  position: relative;
  z-index: 1;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(46px, 13vw, 66px);
  line-height: 1.1;
  color: var(--color-primary);
  margin-top: 2px;
}

.ted-honoring { margin-top: 14px; font-style: italic; color: var(--muted); }
.ted-name { font-weight: 800; font-size: clamp(30px, 9vw, 40px); line-height: 1.15; }

.ted-label {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 35%, white);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ted-class { margin-top: 8px; font-weight: 700; color: var(--muted); }
.ted-majors { margin-top: 12px; }

/* ===================== PHOTOS ===================== */
.ted-photos { display: flex; justify-content: center; gap: 14px; margin: 22px 0 6px; }

/* Arch-shaped frames */
.ted-photo {
  width: 46%;
  max-width: 220px;
  aspect-ratio: 3 / 4;
  padding: 7px;
  background: #fff;
  border-radius: 999px 999px 18px 18px;
  box-shadow: 0 10px 24px rgba(90, 70, 53, 0.12);
}

.ted-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 999px 999px 13px 13px; }
.ted-photos:has(> :only-child) .ted-photo { width: 64%; max-width: 270px; }

/* ===================== CARDS ===================== */
.ted-card {
  background: var(--color-surface);
  border-radius: 26px;
  padding: 26px 22px;
  margin-top: 18px;
  border: 2px dashed color-mix(in srgb, var(--color-accent) 55%, white);
  box-shadow: 0 6px 18px rgba(90, 70, 53, 0.06);
}

.ted-section-title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  color: var(--color-primary);
  margin-bottom: 14px;
  text-align: center;
}

.ted-details { display: grid; gap: 16px; }
.ted-detail { display: flex; gap: 14px; align-items: flex-start; }
.ted-icon { width: 26px; height: 26px; flex-shrink: 0; fill: none; stroke: var(--color-accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.location-locked { display: block; font-size: 15px; font-style: italic; color: var(--muted); margin-top: 4px; }

.ted-note { font-size: 18px; line-height: 1.65; text-align: center; }

.ted-gifts { display: grid; gap: 10px; }

.ted-gift {
  display: block;
  padding: 16px 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--color-primary) 10%, white);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.ted-gift:active { transform: scale(0.98); }
.ted-gift-name { display: block; font-weight: 800; font-size: 18px; color: var(--color-primary); }
.ted-gift-desc { color: var(--muted); font-size: 15px; }

.ted-count { text-align: center; font-weight: 600; margin-bottom: 14px; }
.ted-count span { font-weight: 800; font-size: 26px; color: var(--color-primary); }
.ted-guest-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.guest-pill { background: color-mix(in srgb, var(--color-primary) 22%, white); color: var(--color-text); font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: 15px; }
.guest-pill:nth-child(3n + 2) { background: color-mix(in srgb, var(--color-accent) 40%, white); }
.guest-pill:nth-child(3n) { background: color-mix(in srgb, var(--sage) 55%, white); }
.no-guests { color: var(--muted); }

/* ===================== FORMS (also used by the shared cancel modal) ===================== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }

.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid #efe4d8;
  border-radius: 16px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--color-text);
  -webkit-appearance: none;
}

.form-input:focus { outline: none; border-color: var(--color-primary); }

.btn-primary, .btn-secondary {
  display: block;
  width: 100%;
  padding: 15px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: 999px;
}

.btn-primary { background: var(--color-primary); color: #fff; border: none; box-shadow: 0 5px 0 color-mix(in srgb, var(--color-primary) 70%, black); margin-top: 6px; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--color-primary) 70%, black); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--muted); border: 2px solid #efe4d8; margin-top: 12px; font-size: 15px; }

.form-message { display: none; margin-top: 12px; padding: 12px 16px; border-radius: 14px; font-weight: 600; }
.form-message.success { display: block; background: color-mix(in srgb, var(--sage) 35%, white); }
.form-message.error { display: block; background: #fde8e8; color: #a03a3a; }

#rsvp-done { text-align: center; }
.rsvp-done-text { font-family: var(--font-script); font-size: 34px; color: var(--color-primary); line-height: 1.25; }
.rsvp-done-status { color: var(--muted); margin: 8px 0 18px; }
.link-button { margin-top: 12px; background: none; border: none; font: inherit; font-size: 15px; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* ===================== PHOTO DUMP ===================== */
.ted-locked { text-align: center; color: var(--muted); font-weight: 600; }

.photos-grid-dump { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.dump-photo { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 18px; background: #f4ece3; cursor: zoom-in; }
.dump-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dump-photo-credit { position: absolute; left: 8px; bottom: 8px; background: rgba(255, 255, 255, 0.92); color: var(--color-text); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }

/* ===================== FOOTER ===================== */
.ted-footer { text-align: center; padding: 30px 0 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 14px; }
.ted-footer-bear { width: 58px; height: auto; margin-bottom: 6px; }
.ted-footer-name { font-family: var(--font-script); font-size: 28px; color: var(--color-primary); line-height: 1.3; }

/* ===================== MAJORS ===================== */
.major-badge--bold { background: var(--color-primary); color: #fff; font-weight: 800; }
.major-badge--bold svg { color: #fff; }
.major-badge--subtle { color: var(--muted); opacity: 1; font-weight: 700; }
.major-badge--subtle svg { color: var(--color-primary); }

/* ===================== ENVELOPE INTRO ===================== */
/* Shared envelope (shared/base.css): cream envelope on dusty blue, blush seal */
:root {
  --env-backdrop: var(--color-primary);
  --env-paper: var(--color-background);
  --env-bottom: #f2e6d8;
  --env-side: #f7eee3;
  --env-flap-top: var(--color-background);
  --env-flap-bottom: #f4e9dc;
  --env-line: rgba(201, 154, 110, 0.25);
  --env-seal-light: color-mix(in srgb, var(--color-accent) 70%, white);
  --env-seal-dark: var(--color-accent);
  --env-seal-text: var(--color-text);
  --env-seal-font: var(--font-script);
  --env-seal-style: normal;
  --env-hint: #ffffff;
  --env-card: #ffffff;
  --env-card-border: color-mix(in srgb, var(--color-accent) 40%, white);
  --env-title-font: var(--font-script);
  --env-title-size: 24px;
  --env-title: var(--color-primary);
  --env-name: var(--color-text);
  --env-lead: var(--muted);
}
