/* =====================================================
   Reilly Family — Design System
   Warm, photography-forward. Airbnb-inspired.
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=DM+Serif+Display:ital@0;1&display=swap');

/* ---- Tokens ---- */
:root {
  --color-bg:              #ffffff;
  --color-surface:         #fdf9f7;
  --color-surface-2:       #f5f0ec;
  --color-text:            #222222;
  --color-text-secondary:  #6a6a6a;
  --color-text-muted:      #9e9e9e;
  --color-accent:          #c0392b;
  --color-accent-hover:    #a93226;
  --color-accent-light:    #fdf0ee;
  --color-border:          rgba(0,0,0,0.08);
  --color-border-strong:   rgba(0,0,0,0.15);

  --shadow-card:
    rgba(0,0,0,0.02) 0px 0px 0px 1px,
    rgba(0,0,0,0.04) 0px 2px 6px,
    rgba(0,0,0,0.08) 0px 4px 12px;
  --shadow-hover:
    rgba(0,0,0,0.02) 0px 0px 0px 1px,
    rgba(0,0,0,0.08) 0px 4px 20px;
  --shadow-nav:
    rgba(0,0,0,0.04) 0px 1px 0px,
    rgba(0,0,0,0.06) 0px 2px 8px;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --space-7: 48px; --space-8: 64px; --space-9: 96px;

  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --transition:   0.2s ease;

  --nav-height: 72px;
  --container:  1200px;
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }

/* ---- Layout ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-nav);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

.nav-brand .brand-crest {
  width: 38px; height: 38px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--font-display);
  font-size: 18px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
}

.nav-links a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.nav-links a.active { color: var(--color-accent); }

.nav-upload-btn {
  background: var(--color-accent);
  color: white !important;
  border-radius: var(--radius-full) !important;
  padding: var(--space-2) var(--space-4) !important;
  font-weight: 600 !important;
  transition: background var(--transition), transform var(--transition) !important;
}
.nav-upload-btn:hover {
  background: var(--color-accent-hover) !important;
  color: white !important;
  transform: translateY(-1px);
}

.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text);
  padding: var(--space-2);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px var(--space-5);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192,57,43,0.3);
}

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.btn-secondary:hover {
  background: #ebe5e0;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}
.btn-outline:hover {
  background: var(--color-accent-light);
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(160deg, #fdf9f7 0%, #f5ede8 50%, #ede0d8 100%);
  padding: var(--space-9) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(192,57,43,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 640px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.hero h1 em {
  font-style: italic;
  color: var(--color-accent);
}

.hero-sub {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ---- Stats Strip ---- */
.stats-strip {
  background: var(--color-text);
  color: white;
  padding: var(--space-5) 0;
}

.stats-inner {
  display: flex;
  gap: var(--space-7);
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Section Headers ---- */
.section {
  padding: var(--space-8) 0;
}

.section-header {
  margin-bottom: var(--space-6);
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.5px;
  color: var(--color-text);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
  max-width: 560px;
}

/* ---- Cards ---- */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* ---- Latest Reunion Card ---- */
.latest-reunion-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  max-width: 560px;
}

.latest-reunion-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--color-accent);
}

.latest-reunion-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.latest-reunion-card h3 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.3px;
  margin-bottom: var(--space-2);
}

.latest-date {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.latest-location {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.latest-desc {
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.65;
  margin-bottom: var(--space-4);
}

.latest-stat {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-accent-light);
  color: var(--color-accent);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: 120px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 60px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-border));
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-7);
  animation: fadeInUp 0.4s ease both;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -64px;
  top: 28px;
  width: 12px; height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-date-badge {
  position: absolute;
  left: -120px;
  top: 16px;
  width: 52px;
  text-align: center;
}

.timeline-date-badge .month {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-accent);
}

.timeline-date-badge .day {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: var(--color-text);
}

.timeline-date-badge .year {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
}

.timeline-card {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-5) var(--space-6);
  transition: box-shadow var(--transition);
}

.timeline-card:hover { box-shadow: var(--shadow-hover); }

.reunion-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.3px;
  margin-bottom: var(--space-2);
}

.reunion-location {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.reunion-description {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.reunion-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
}

/* ---- Gallery ---- */
.filter-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.filter-tab {
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tab:hover {
  background: #ebe5e0;
  color: var(--color-text);
}

.filter-tab.active {
  background: var(--color-accent);
  color: white;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.photo-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
  aspect-ratio: 4/3;
  background: var(--color-surface-2);
  cursor: pointer;
}

.photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-card:hover img { transform: scale(1.04); }

.photo-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--transition);
}

.photo-card:hover .photo-card-overlay { opacity: 1; }

.photo-caption {
  color: white;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.photo-uploader {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}

.photo-reunion-tag {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

.gallery-empty {
  text-align: center;
  padding: var(--space-9) var(--space-5);
  color: var(--color-text-secondary);
}

.gallery-empty-icon { font-size: 48px; margin-bottom: var(--space-4); }
.gallery-empty h3 { font-family: var(--font-display); font-size: 24px; color: var(--color-text); margin-bottom: var(--space-2); }

/* ---- Upload Section ---- */
.upload-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) 0;
}

.upload-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-7);
  max-width: 640px;
  margin: 0 auto;
}

.upload-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: var(--space-2);
  letter-spacing: -0.3px;
}

.upload-card .upload-sub {
  color: var(--color-text-secondary);
  font-size: 15px;
  margin-bottom: var(--space-6);
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--color-accent);
  margin-left: 2px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px var(--space-4);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.dropzone {
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-7);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--color-surface);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.dropzone-icon { font-size: 36px; margin-bottom: var(--space-3); }
.dropzone-text { font-size: 15px; color: var(--color-text-secondary); }
.dropzone-text strong { color: var(--color-accent); }
.dropzone-hint { font-size: 12px; color: var(--color-text-muted); margin-top: var(--space-1); }

#file-input { display: none; }

#file-preview {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.preview-thumb {
  width: 80px;
}

.preview-thumb img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border);
}

.preview-thumb span {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-status {
  display: none;
  padding: 12px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-top: var(--space-4);
}

.upload-status.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.upload-status.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.upload-status.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---- CTA Banner ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-text) 0%, #3d2b1f 100%);
  color: white;
  padding: var(--space-8) 0;
  text-align: center;
}

.cta-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 38px);
  margin-bottom: var(--space-3);
  letter-spacing: -0.5px;
}

.cta-banner p {
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  margin-bottom: var(--space-5);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta-banner .btn-primary {
  background: var(--color-accent);
}

.cta-banner .btn-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
}

.cta-banner .btn-secondary:hover {
  background: rgba(255,255,255,0.25);
}

.cta-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Page Header ---- */
.page-header {
  background: linear-gradient(160deg, #fdf9f7 0%, #f5ede8 100%);
  padding: var(--space-8) 0 var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.8px;
  margin-bottom: var(--space-2);
}

.page-header p {
  font-size: 17px;
  color: var(--color-text-secondary);
  max-width: 520px;
}

/* ---- Footer ---- */
.footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.6);
  padding: var(--space-7) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 18px;
  color: white;
}

.footer-tagline {
  font-size: 13px;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

.footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  transition: color var(--transition);
}

.footer-links a:hover { color: white; }

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* ---- Lightbox ---- */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#lightbox.open { display: flex; }

#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ---- Utility ---- */
.loading { color: var(--color-text-muted); font-size: 15px; padding: var(--space-5); }
.error   { color: #c0392b; font-size: 15px; padding: var(--space-5); }
.empty   { color: var(--color-text-muted); font-size: 15px; padding: var(--space-5); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.5s ease both; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: white;
    box-shadow: var(--shadow-card);
    padding: var(--space-4);
    gap: var(--space-1);
  }
  .nav-menu-btn { display: block; }

  .timeline { padding-left: 80px; }
  .timeline-date-badge { left: -80px; width: 60px; }

  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .stats-inner { gap: var(--space-5); }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero { padding: var(--space-7) 0; }
  .section { padding: var(--space-6) 0; }
  .timeline { padding-left: 0; margin-top: var(--space-5); }
  .timeline::before { display: none; }
  .timeline-item::before { display: none; }
  .timeline-date-badge {
    position: static;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }
  .timeline-date-badge .day { font-size: 20px; }
}
