/* ============================================
   Mary Carder Memorial — Candlelight Theme
   ============================================ */

:root {
  --accent: #f28663;
  --accent-light: #f9c4b2;
  --accent-dark: #d4603c;
  --bg: #fdfaf7;
  --bg-alt: #f5efe8;
  --text: #3a2e2a;
  --text-light: #7a6e6a;
  --white: #ffffff;
  --shadow: 0 2px 20px rgba(58, 46, 42, 0.08);
  --shadow-lg: 0 8px 40px rgba(58, 46, 42, 0.12);
  --radius: 12px;
  --font-heading: 'Quattrocento', Georgia, serif;
  --font-body: 'Lato', -apple-system, sans-serif;
  --nav-height: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration: none; }

.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(253, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(58, 46, 42, 0.08);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: center;
  height: var(--nav-height);
}
.nav-links {
  list-style: none; display: flex; gap: 4px; flex-wrap: nowrap;
}
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 0.85rem; font-weight: 400; color: var(--text-light);
  transition: all 0.2s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent-dark); background: rgba(242, 134, 99, 0.08);
}
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 30px; height: 22px; position: relative;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px; background: var(--text);
  border-radius: 2px; position: absolute; left: 0;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 10px; }
.nav-toggle span:nth-child(3) { top: 20px; }

@media (max-width: 900px) {
  .nav { background: transparent; border-bottom: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav.scrolled { background: rgba(253, 250, 247, 0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(58, 46, 42, 0.08); }
  .nav-toggle { display: block; }
  .nav-toggle span { background: #ffffff; }
  .nav.scrolled .nav-toggle span { background: var(--text); }
  .nav-links {
    display: none;
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; padding: 16px 24px; gap: 4px;
    background: rgba(253, 250, 247, 0.98); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(58, 46, 42, 0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 16px; font-size: 1.05rem; }
}
@media (max-width: 768px) {
  .hero-content { padding: calc(var(--nav-height) + 40px) 20px 60px; }
  .hero h1 { font-size: 2rem; }
  .hero-candles { bottom: 40px; gap: 40px; }
  .section { padding: 60px 0; }
  .container { padding: 0 16px; }
  .event-card { padding: 32px 24px; }
  .rsvp-form { padding: 24px; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #2a1f1a 0%, #1a1210 100%);
  text-align: center; overflow: hidden;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(242, 134, 99, 0.12) 0%, transparent 70%);
}
.hero-content {
  position: relative; z-index: 2; padding: 120px 24px 80px;
  color: #f5efe8;
}
.hero-photo {
  width: 160px; height: 160px; border-radius: 50%; margin: 0 auto 32px;
  overflow: hidden; border: 3px solid rgba(242, 134, 99, 0.4);
  box-shadow: 0 0 40px rgba(242, 134, 99, 0.2);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: rgba(242, 134, 99, 0.1); color: rgba(245, 239, 232, 0.4);
}
.hero-photo--placeholder svg { width: 64px; height: 64px; }
.hero h1 {
  font-family: var(--font-heading); font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700; margin-bottom: 12px; letter-spacing: 0.02em;
}
.hero-dates {
  font-size: 1.15rem; color: var(--accent-light); font-weight: 300;
  letter-spacing: 0.1em; margin-bottom: 8px;
}
.hero-location {
  font-size: 0.95rem; color: rgba(245, 239, 232, 0.5); margin-bottom: 24px;
}
.hero-quote {
  font-family: var(--font-heading); font-style: italic;
  font-size: 1.1rem; color: rgba(245, 239, 232, 0.7);
  max-width: 500px; margin: 0 auto; line-height: 1.8;
}
.scroll-arrow {
  display: inline-block; margin-top: 48px; color: rgba(245, 239, 232, 0.3);
  animation: bobDown 2s ease-in-out infinite;
}
@keyframes bobDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ---------- CANDLE ANIMATIONS ---------- */
.hero-candles {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 60px; z-index: 1;
}
.candle {
  width: 6px; height: 48px;
  background: linear-gradient(180deg, #f5e6d0 0%, #e8d0b0 100%);
  border-radius: 2px 2px 0 0; position: relative;
}
.candle::after {
  content: ''; position: absolute; bottom: -4px; left: -3px;
  width: 12px; height: 6px; background: #c4a87a; border-radius: 0 0 4px 4px;
}
.flame {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 18px;
  background: radial-gradient(ellipse, #fff8e7 10%, #ffc85c 40%, #ff8c32 70%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 1.5s ease-in-out infinite alternate;
  box-shadow: 0 0 12px 4px rgba(255, 200, 92, 0.4), 0 0 30px 8px rgba(255, 140, 50, 0.15);
}
.flame--small {
  width: 6px; height: 10px;
  top: -12px;
}
@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) rotate(-1deg); opacity: 1; }
  25% { transform: translateX(-50%) scale(1.05, 0.95) rotate(1deg); opacity: 0.95; }
  50% { transform: translateX(-50%) scale(0.95, 1.05) rotate(-0.5deg); opacity: 1; }
  75% { transform: translateX(-50%) scale(1.02, 0.98) rotate(1.5deg); opacity: 0.92; }
  100% { transform: translateX(-50%) scale(1) rotate(0deg); opacity: 1; }
}
.candle-small {
  width: 4px; height: 24px; margin: 0 auto 16px;
  background: linear-gradient(180deg, #f5e6d0, #e8d0b0);
  border-radius: 2px 2px 0 0; position: relative;
}

/* ---------- SECTIONS ---------- */
.section { padding: 80px 0; }
.section--alt { background: var(--bg-alt); }
.section-title {
  font-family: var(--font-heading); font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700; text-align: center; margin-bottom: 12px;
}
.divider {
  width: 60px; height: 2px; background: var(--accent);
  margin: 0 auto 40px; border-radius: 2px;
}

/* ---------- OBITUARY ---------- */
.obituary-text {
  max-width: 700px; margin: 0 auto;
  font-size: 1.05rem; line-height: 1.9; color: var(--text);
}
.obituary-text p { margin-bottom: 1.2em; }

/* ---------- GALLERY ---------- */
.gallery-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-bottom: 32px;
}
.filter-btn {
  padding: 8px 20px; border: 1px solid rgba(58, 46, 42, 0.15);
  border-radius: 24px; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 0.875rem; color: var(--text-light);
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent); color: var(--white); border-color: var(--accent);
}
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.gallery-item {
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  position: relative; aspect-ratio: 4/3; background: var(--bg);
  transition: transform 0.3s, box-shadow 0.3s;
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 8px 12px; font-size: 0.8rem; color: var(--white);
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
}

/* ---------- MAP ---------- */
.map-container {
  max-width: 560px; margin: 0 auto 40px;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); aspect-ratio: 16/9;
}
.map-container iframe {
  width: 100%; height: 100%; border: 0;
}

/* ---------- CELEBRATION / EVENT ---------- */
.event-card {
  max-width: 560px; margin: 0 auto 40px;
  background: var(--white); border-radius: var(--radius);
  padding: 48px 40px; text-align: center;
  box-shadow: var(--shadow);
}
.event-icon { margin-bottom: 20px; }
.event-date {
  font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700;
  margin-bottom: 8px;
}
.event-venue { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.event-address { color: var(--text-light); margin-bottom: 16px; }
.event-details { color: var(--text-light); margin-bottom: 24px; line-height: 1.7; }
.btn {
  display: inline-block; padding: 12px 32px;
  background: var(--accent); color: var(--white);
  border: none; border-radius: 8px; cursor: pointer;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 700;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* RSVP */
.rsvp-form {
  max-width: 480px; margin: 0 auto;
  background: var(--white); border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow);
}
.rsvp-form h3 {
  font-family: var(--font-heading); font-size: 1.3rem;
  text-align: center; margin-bottom: 24px;
}
.rsvp-form input, .rsvp-form select, .rsvp-form textarea {
  display: block; width: 100%; padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid rgba(58, 46, 42, 0.15); border-radius: 8px;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--text);
  background: var(--bg); transition: border-color 0.2s;
}
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.rsvp-form .btn { width: 100%; text-align: center; }

/* ---------- MEMORY WALL ---------- */
.wall-form {
  max-width: 560px; margin: 0 auto 40px;
  background: var(--bg-alt); border-radius: var(--radius);
  padding: 32px;
}
.wall-form input, .wall-form textarea {
  display: block; width: 100%; padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid rgba(58, 46, 42, 0.12); border-radius: 8px;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--text);
  background: var(--white); transition: border-color 0.2s;
}
.wall-form input:focus, .wall-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.wall-form .btn { width: 100%; text-align: center; }

.wall-posts { max-width: 700px; margin: 0 auto; }
.wall-post {
  padding: 24px; margin-bottom: 16px;
  background: var(--bg-alt); border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}
#memory-wall .wall-post { background: var(--white); }
.wall-post-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.wall-post-header strong { color: var(--text); }
.wall-date { font-size: 0.8rem; color: var(--text-light); }
.wall-post p { color: var(--text); line-height: 1.7; }

/* ---------- EMPTY STATES ---------- */
.empty-state {
  text-align: center; color: var(--text-light); font-style: italic;
  padding: 40px 0;
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26, 18, 16, 0.95);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.lightbox.open { display: flex; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  font-size: 2rem; color: #f5efe8; background: none; border: none;
  cursor: pointer; line-height: 1;
}
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 3rem; color: #f5efe8; background: none; border: none;
  cursor: pointer; padding: 16px; opacity: 0.7; transition: opacity 0.2s;
}
.lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-img { max-width: 90vw; max-height: 85vh; border-radius: 8px; }
.lightbox-caption {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(245, 239, 232, 0.7); font-size: 0.9rem;
}

/* ---------- FOOTER ---------- */
.footer {
  background: #1a1210; color: rgba(245, 239, 232, 0.6);
  text-align: center; padding: 48px 24px 32px;
}
.footer p { font-family: var(--font-heading); font-size: 1rem; margin-bottom: 8px; }
.footer-sub { font-size: 0.8rem; opacity: 0.5; }

/* ---------- FORM SUCCESS ---------- */
.form-success {
  text-align: center; color: var(--accent-dark);
  font-weight: 700; padding: 16px;
}

/* ---------- FADE-IN ANIMATION ---------- */
.fade-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ---------- ADMIN LINK ---------- */
.admin-link {
  position: fixed; bottom: 16px; right: 16px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(58, 46, 42, 0.1); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.3; transition: opacity 0.3s;
}
.admin-link:hover { opacity: 0.8; }
