html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* ---- Base ---- */
body {
  background-color: #faf9f7;
  color: #1a1a1a;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 60px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #b8860b;
}

/* ---- Navbar ---- */
.navbar {
  padding: 0.75rem 0 !important;
  border-bottom: 1px solid #e8e4e0 !important;
  background-color: #ffffff !important;
}

.nav-link {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.03em;
  padding: 0.4rem 1rem !important;
  transition: color 0.15s ease;
  color: #555 !important;
}

.nav-link:hover {
  color: #8b6914 !important;
}

/* ---- Legacy Hero ---- */
.legacy-hero {
  text-align: center;
  padding: 3.5rem 1rem 3rem;
  margin-bottom: 2.5rem;
}

.legacy-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.75rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.legacy-hero .dates {
  font-size: 1.05rem;
  color: #6b6560;
  letter-spacing: 0.08em;
  margin-bottom: 0;
}

.hero-divider {
  width: 48px;
  height: 3px;
  background: #b8860b;
  border-radius: 2px;
  margin: 1.25rem auto 0;
}

/* ---- Memory Cards ---- */
.memory-card {
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.07) !important;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #ffffff;
  height: 100%;
}

.memory-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.11) !important;
}

.card-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0ece8;
  position: relative;
}

.card-media .carousel,
.card-media .carousel-inner,
.card-media .carousel-item {
  height: 100%;
}

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

.card-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.card-media embed {
  width: 100%;
  height: 100%;
  display: block;
}

.pdf-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.pdf-click-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 1;
}

.pdf-lightbox iframe {
  width: 90vw;
  height: 90vh;
  border: none;
  border-radius: 4px;
  background: #fff;
}

.card-media .audio-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
}

.card-media .audio-wrapper audio {
  width: 100%;
}

.memory-card .card-body {
  padding: 1.1rem 1.25rem 0.75rem;
}

.contributor-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1a1a1a;
  margin-bottom: 0.1rem;
}

.post-date {
  font-size: 0.78rem;
  color: #aaa;
  margin-bottom: 0.65rem;
}

.post-message {
  font-size: 0.93rem;
  color: #555;
  line-height: 1.55;
}

.memory-card .card-footer {
  background: transparent !important;
  border-top: 1px solid #f0ece8 !important;
  padding: 0.65rem 1.25rem;
  display: flex;
  gap: 1.5rem;
}

.memory-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.83rem;
  color: #888;
}

.memory-stat .stat-count {
  font-weight: 700;
  color: #333;
}

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

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  user-select: none;
}

.lightbox-close:hover {
  opacity: 1;
}

.card-media img {
  cursor: pointer;
}

/* ---- Carousel controls ---- */
.carousel-control-prev,
.carousel-control-next {
  width: 3.5rem;
  height: 3.5rem;
  top: 50%;
  transform: translateY(-50%);
  bottom: auto;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  opacity: 1;
  margin: 0 0.5rem;
  transition: background 0.15s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(0, 0, 0, 0.72);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 1.75rem;
  height: 1.75rem;
}

/* ---- Footer ---- */
.footer {
  background: #ffffff;
  border-top: 1px solid #e8e4e0 !important;
  padding: 1rem 0;
  font-size: 0.85rem;
}

/* ---- Modal ---- */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.modal-header {
  border-bottom: 1px solid #f0ece8;
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #f0ece8;
  gap: 0.75rem;
}

.btn-primary {
  background-color: #b8860b;
  border-color: #b8860b;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #8b6914;
  border-color: #8b6914;
}

/* ---- Floating form ---- */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}
