/* ============================================================
   Memorial Website Stylesheet
   In loving memory — designed with warmth, dignity, and grace.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  background-color: #F5F0EB;
  color: #2C1810;
  font-size: 18px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  color: #2C1810;
  line-height: 1.3;
  font-weight: 400;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #C9A96E;
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  text-decoration: none;
  color: #b8944f;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ------------------------------------------------------------
   Layout — Container
   ------------------------------------------------------------ */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 4rem 0;
}

/* ------------------------------------------------------------
   Hero Section
   ------------------------------------------------------------ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(180deg, #F5F0EB 0%, #e8dccb 60%, #d9c4a8 100%);
  position: relative;
}

.hero .subtitle {
  color: #C9A96E;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 3.5rem;
  color: #2C1810;
  margin-bottom: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hero .dates {
  font-size: 1.5rem;
  color: #8B7355;
  margin: 1rem 0;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-style: italic;
}

.hero .divider {
  width: 60px;
  height: 2px;
  background-color: #C9A96E;
  margin: 2rem auto;
  border: none;
}

.hero .portrait-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 3px solid #C9A96E;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 2rem auto;
  background: linear-gradient(135deg, #8B7355 0%, #C9A96E 100%);
  box-shadow: 0 8px 30px rgba(44, 24, 16, 0.15);
}

.hero .portrait-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .portrait-placeholder .initials {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 3.5rem;
  color: #F5F0EB;
  letter-spacing: 0.05em;
}

.hero .quote {
  max-width: 600px;
  margin: 1.5rem auto 0;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 1.15rem;
  color: #5a4332;
  line-height: 1.6;
}

/* ------------------------------------------------------------
   Section Headings
   ------------------------------------------------------------ */
.section-title {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 2.2rem;
  color: #2C1810;
  text-align: center;
  margin: 3rem 0 2rem;
  font-weight: 400;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background-color: #C9A96E;
}

.section-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
  color: #5a4332;
  font-size: 1.05rem;
}

/* ------------------------------------------------------------
   Timeline — Life Story
   ------------------------------------------------------------ */
.timeline {
  position: relative;
  padding: 2rem 0;
  max-width: 900px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #C9A96E;
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 3rem;
  width: 100%;
}

.timeline-item.left {
  flex-direction: row;
}

.timeline-item.right {
  flex-direction: row-reverse;
}

.timeline-item.left .timeline-content {
  margin-right: auto;
}

.timeline-item.right .timeline-content {
  margin-left: auto;
}

.timeline-content {
  width: 45%;
  padding: 2rem;
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  border-left: 3px solid #C9A96E;
  position: relative;
}

.timeline-content h3 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.4rem;
  color: #2C1810;
  margin-bottom: 0.5rem;
}

.timeline-content .year {
  color: #C9A96E;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.timeline-content p {
  color: #5a4332;
  line-height: 1.7;
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #C9A96E;
  transform: translate(-50%, -50%);
  border: 3px solid #F5F0EB;
  box-shadow: 0 0 0 2px #C9A96E;
  z-index: 2;
}

/* ------------------------------------------------------------
   Gallery Carousel
   ------------------------------------------------------------ */
.carousel {
  position: relative;
  max-width: 100%;
  margin: 2rem 0 3rem;
  padding: 0 0 2.5rem;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  will-change: scroll-position;
  padding: 0.5rem 0;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex: 0 0 300px;
  height: 225px;
  margin-right: 1rem;
  border-radius: 8px;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #FFFFFF;
  display: block;
  text-decoration: none;
}

.carousel-slide:hover,
.carousel-slide:focus {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  outline: none;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-slide:last-child {
  margin-right: 0;
}

/* Navigation arrows */
.carousel-arrow {
  position: absolute;
  top: calc(50% - 1.25rem);
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(44, 24, 16, 0.55);
  color: #F5F0EB;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.carousel-arrow:hover,
.carousel-arrow:focus {
  background: rgba(44, 24, 16, 0.85);
  outline: none;
}

.carousel-arrow-prev { left: 0.75rem; }
.carousel-arrow-next { right: 0.75rem; }

.carousel:hover .carousel-arrow,
.carousel:focus-within .carousel-arrow {
  opacity: 1;
}

/* Always show on touch devices */
@media (hover: none) {
  .carousel-arrow {
    opacity: 0.85;
  }
}

/* Dots */
.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  flex-wrap: wrap;
  max-width: 100%;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(201, 169, 110, 0.35);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot:hover {
  background: rgba(201, 169, 110, 0.65);
}

.carousel-dot.active {
  background: #C9A96E;
  transform: scale(1.4);
}

.gallery-link {
  text-align: center;
  display: block;
  margin: 2rem 0;
  color: #C9A96E;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.gallery-link:hover {
  color: #b8944f;
  text-decoration: underline;
}

/* ------------------------------------------------------------
   Guest Book / Messages
   ------------------------------------------------------------ */
.messages {
  max-width: 700px;
  margin: 0 auto;
}

.message-card {
  background-color: #FFFFFF;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  border-left: 3px solid #C9A96E;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  animation: fadeIn 0.6s ease forwards;
}

.message-card .name {
  font-weight: 700;
  color: #2C1810;
  font-size: 1.05rem;
  display: block;
}

.message-card .date {
  font-size: 0.8rem;
  color: #8B7355;
  margin-bottom: 0.75rem;
  display: block;
  letter-spacing: 0.03em;
}

.message-card .text {
  line-height: 1.7;
  color: #333;
  margin-bottom: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.messages-empty {
  text-align: center;
  color: #8B7355;
  font-style: italic;
  padding: 2rem;
}

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */
.form-container {
  max-width: 700px;
  margin: 2rem auto;
  background-color: #FFFFFF;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #2C1810;
  font-weight: 600;
  font-size: 0.95rem;
}

input,
textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #d4c5b2;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  background-color: #F5F0EB;
  color: #2C1810;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #a8957f;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #C9A96E;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
  background-color: #FFFFFF;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.btn {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background-color: #C9A96E;
  color: #2C1810;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus {
  background-color: #b8944f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.3);
  outline: none;
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(201, 169, 110, 0.25);
}

.btn-secondary {
  background-color: transparent;
  color: #C9A96E;
  border: 2px solid #C9A96E;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #C9A96E;
  color: #2C1810;
}

/* ------------------------------------------------------------
   Upload Section
   ------------------------------------------------------------ */
.upload-section {
  background-color: #FFFFFF;
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 700px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.upload-section h3 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.3rem;
  color: #2C1810;
  margin-bottom: 1rem;
}

.upload-section p {
  color: #5a4332;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

input[type="file"] {
  padding: 0.5rem 0;
  background-color: transparent;
  border: none;
  font-size: 0.95rem;
  color: #2C1810;
}

input[type="file"]::file-selector-button {
  padding: 0.6rem 1.25rem;
  background-color: #C9A96E;
  color: #2C1810;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 1rem;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
  background-color: #b8944f;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer {
  text-align: center;
  padding: 3rem 0;
  color: #8B7355;
  font-size: 0.9rem;
  margin-top: 2rem;
}

.footer .divider {
  width: 40px;
  height: 1px;
  background-color: #C9A96E;
  margin: 1.5rem auto;
  border: none;
}

.footer p {
  margin-bottom: 0.5rem;
}

.footer .heart {
  color: #C9A96E;
}

/* ------------------------------------------------------------
   Animations
   ------------------------------------------------------------ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes gentleGlow {
  0%,
  100% {
    box-shadow: 0 0 0 2px #C9A96E;
  }
  50% {
    box-shadow: 0 0 0 2px #C9A96E, 0 0 12px rgba(201, 169, 110, 0.4);
  }
}

/* ------------------------------------------------------------
   Responsive — Tablet (≤ 768px)
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  body {
    font-size: 17px;
  }

  .container {
    padding: 0 1rem;
    max-width: 100%;
  }

  section {
    padding: 3rem 0;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero .dates {
    font-size: 1.25rem;
  }

  .hero .portrait-placeholder {
    width: 160px;
    height: 160px;
  }

  .hero .portrait-placeholder .initials {
    font-size: 2.75rem;
  }

  .section-title {
    font-size: 1.9rem;
    margin: 2rem 0 1.5rem;
  }

  /* Timeline — single column, line on left */
  .timeline::before {
    left: 20px;
    transform: none;
  }

  .timeline-item,
  .timeline-item.left,
  .timeline-item.right {
    flex-direction: row;
    padding-left: 50px;
  }

  .timeline-item.left .timeline-content,
  .timeline-item.right .timeline-content,
  .timeline-content {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .timeline-dot {
    left: 20px;
    transform: translate(-50%, -50%);
  }

  /* Carousel — slightly smaller on tablet */
  .carousel-slide {
    flex: 0 0 260px;
    height: 195px;
  }

  .form-container {
    padding: 1.75rem;
  }

  .upload-section {
    padding: 1.5rem;
  }
}

/* ------------------------------------------------------------
   Responsive — Mobile (≤ 480px)
   ------------------------------------------------------------ */
@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .dates {
    font-size: 1.1rem;
  }

  .hero .subtitle {
    font-size: 0.8rem;
  }

  .hero .portrait-placeholder {
    width: 140px;
    height: 140px;
  }

  .hero .portrait-placeholder .initials {
    font-size: 2.25rem;
  }

  .hero .quote {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  /* Carousel — smaller slides on mobile */
  .carousel-slide {
    flex: 0 0 220px;
    height: 165px;
    margin-right: 0.75rem;
  }

  .carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .message-card {
    padding: 1rem;
  }

  .timeline-content {
    padding: 1.25rem;
  }

  .form-container {
    padding: 1.25rem;
  }

  .btn {
    padding: 0.85rem 2rem;
    width: 100%;
    text-align: center;
  }

  input,
  textarea {
    padding: 0.85rem;
    font-size: 0.95rem;
  }
}

/* ------------------------------------------------------------
   Print Styles — for memorial keepsake printouts
   ------------------------------------------------------------ */
@media print {
  *,
  *::before,
  *::after {
    background: #FFFFFF !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  .hero {
    min-height: auto;
    page-break-after: always;
  }

  .hero .portrait-placeholder {
    border-color: #000000;
  }

  /* Hide interactive elements */
  form,
  .form-container,
  .upload-section,
  .btn,
  button,
  input,
  textarea,
  input[type="file"],
  .gallery-link {
    display: none !important;
  }

  /* Show all text content */
  .messages,
  .message-card,
  .timeline,
  .timeline-content,
  .carousel,
  .carousel-track {
    display: block !important;
    page-break-inside: avoid;
  }

  .carousel-arrow,
  .carousel-dots { display: none !important; }

  .message-card,
  .timeline-content {
    border: 1px solid #ccc !important;
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .timeline::before,
  .timeline-dot {
    display: none;
  }

  .timeline-item,
  .timeline-item.left,
  .timeline-item.right {
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 1.5rem;
  }

  .timeline-content {
    width: 100%;
  }

  .carousel-track {
    flex-wrap: wrap;
    overflow: visible;
  }

  .carousel-slide {
    flex: 0 0 45%;
    height: auto;
    margin-bottom: 1rem;
  }

  .section-title::after {
    background-color: #000000 !important;
  }

  a {
    color: #000000 !important;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555 !important;
  }

  .footer {
    page-break-before: always;
  }
}

/* ------------------------------------------------------------
   Accessibility — Reduced Motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  .carousel-slide:hover {
    transform: none;
  }

  .carousel-track {
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------
   Focus visibility — keyboard navigation
   ------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid #C9A96E;
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Selection styling
   ------------------------------------------------------------ */
::selection {
  background-color: rgba(201, 169, 110, 0.4);
  color: #2C1810;
}

/* ============================================================
   Inline-editable content (edit mode)
   ============================================================ */
.edit-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  background: rgba(44, 24, 16, 0.85);
  color: #F5F0EB;
  border: 1px solid #C9A96E;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: none;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.edit-toggle:hover {
  background: rgba(44, 24, 16, 0.95);
  transform: translateY(-1px);
}
.edit-toggle.show { display: inline-block; }
.edit-toggle.active {
  background: #C9A96E;
  color: #2C1810;
  border-color: #b8944f;
}

body.editing [contenteditable="true"] {
  outline: 1px dashed transparent;
  outline-offset: 4px;
  border-radius: 3px;
  transition: outline-color 0.15s ease, background-color 0.15s ease;
  cursor: text;
}
body.editing [contenteditable="true"]:hover {
  outline-color: rgba(201, 169, 110, 0.6);
}
body.editing [contenteditable="true"]:focus {
  outline: 2px solid #C9A96E;
  background-color: rgba(255, 255, 255, 0.5);
}
body.editing [contenteditable="true"].dirty {
  background-color: rgba(255, 245, 200, 0.5);
}
body.editing [contenteditable="true"].saved {
  background-color: rgba(180, 240, 180, 0.4);
  transition: background-color 1s ease;
}

/* Section photo upload buttons (edit mode only) */
.section-photo-btn {
  display: none;
  margin-top: 0.5rem;
  background: transparent;
  border: 1px dashed #C9A96E;
  color: #6b5a3e;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.section-photo-btn:hover { background: rgba(201, 169, 110, 0.12); }
body.editing .section-photo-btn { display: inline-block; }

/* Inline section photo display */
.section-photo {
  margin-top: 1rem;
  border-radius: 6px;
  overflow: hidden;
  max-height: 360px;
}
.section-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(44, 24, 16, 0.12);
}

/* Hero photo (replaces placeholder when set) */
.portrait.has-photo {
  background: none;
  border: none;
}
.portrait.has-photo .portrait-label { display: none; }
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* Save status pill */
.save-status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2C1810;
  color: #F5F0EB;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}
.save-status.visible { opacity: 1; transform: translateY(0); }
.save-status.error { background: #8a2a2a; }

/* ============================================================
   Memory Wall — comments / messages with media
   ============================================================ */
.messages {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.message-card {
  background: #ffffff;
  border-left: 4px solid #C9A96E;
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 2px 12px rgba(44, 24, 16, 0.07);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.message-card:hover {
  box-shadow: 0 4px 18px rgba(44, 24, 16, 0.10);
}

.message-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.message-name {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: #2C1810;
  font-weight: 600;
}
.message-date {
  font-size: 0.85rem;
  color: #8a7c6a;
  letter-spacing: 0.03em;
}
.message-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #3a2818;
  margin: 0 0 0.75rem;
  line-height: 1.7;
}
.message-body:last-child { margin-bottom: 0; }

.message-media {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.comment-photo {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  cursor: zoom-in;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.comment-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.comment-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.messages-empty {
  text-align: center;
  color: #8a7c6a;
  font-style: italic;
  padding: 2rem 1rem;
}

/* Updated form layout */
.message-form .form-row,
.upload-form .form-row {
  margin-bottom: 1rem;
}
.message-form .form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .message-form .form-row-split { grid-template-columns: 1fr; }
}

.optional {
  color: #8a7c6a;
  font-weight: normal;
  font-size: 0.85em;
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 8, 0.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}
