/* Memories page. Colours and fonts come from style.css. */

.topbar-nav a[aria-current="page"],
.topbar-mobile-nav a[aria-current="page"] {
  color: var(--gold-bright);
}

.memory-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3 200px;
  column-gap: 24px;
}

.memory-item {
  break-inside: avoid;
  margin: 0 0 24px;
}

.memory-print {
  display: block;
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--paper-edge);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(14, 25, 66, 0.1);
  cursor: zoom-in;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.memory-print img {
  display: block;
  width: 100%;
  height: auto;
}

.memory-print:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(14, 25, 66, 0.18);
}

.memory-print:focus-visible,
.memory-control:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

/* ---------- One classmate's memories ---------- */
.memory-empty {
  text-align: center;
  color: var(--ink-soft);
}

.memory-person {
  padding: 40px 0;
  border-top: 1px solid var(--navy-line);
}

.memory-person-head {
  margin-bottom: 24px;
}

.memory-person-name {
  margin: 0;
  color: var(--navy);
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
}

.memory-person-about {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.memory-photo-story {
  margin: 0 0 24px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-style: italic;
}

.memory-photo-story span {
  font-style: normal;
  font-weight: 700;
  color: var(--navy);
}

.memory-stories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px 32px;
  margin: 0;
}

.memory-stories dt {
  margin-bottom: 6px;
  color: var(--gold-deep);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.memory-stories dd {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ---------- Photo viewer ---------- */
html:has(.memory-lightbox[open]) {
  overflow: hidden;
}

.memory-lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.memory-lightbox::backdrop {
  background: rgba(5, 10, 37, 0.98);
}

.memory-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 64px 72px 24px;
}

.memory-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  margin: 0;
}

.memory-figure img {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  object-fit: contain;
}

.memory-count {
  flex: none;
  color: var(--paper-edge);
  font-family: var(--sans);
  font-size: 15px;
}

.memory-control {
  position: absolute;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(5, 10, 37, 0.6);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.memory-control:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.memory-close { top: 12px; right: 12px; }
.memory-prev  { left: 12px; top: 50%; margin-top: -24px; }
.memory-next  { right: 12px; top: 50%; margin-top: -24px; }

@media (max-width: 640px) {
  .memory-stage { padding: 64px 12px 72px; }
  .memory-prev,
  .memory-next { top: auto; bottom: 12px; margin-top: 0; }
  .memory-prev { left: calc(50% - 60px); }
  .memory-next { right: calc(50% - 60px); }
}

@media (prefers-reduced-motion: reduce) {
  .memory-print { transition: none; }
  .memory-print:hover { transform: none; }
}

/* ---------- Share form (same styles as the /memories page) ---------- */
.memories-title { font-weight: 700; }
#memoriesForm .form-row { align-items: end; }   /* keep inputs level when one label wraps */
.memories-sign { display: block; margin-top: 10px; font-style: normal; font-weight: 700; color: var(--gold-bright); letter-spacing: 0.04em; }

/* Photo picker - same paper/ink language as the booking form fields */
.photo-drop {
  border: 1.5px dashed var(--navy-line-strong);
  border-radius: 3px;
  background: var(--paper-cool);
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.photo-drop.is-drag { border-color: var(--gold); background: var(--gold-tint); }
.photo-drop.is-full .photo-add { opacity: 0.45; pointer-events: none; }
.photo-drop-hint { margin: 12px 0 0; font-size: 0.9rem; font-style: italic; color: var(--ink-soft); }
.photo-count { margin: 6px 0 0; font-size: 0.9rem; font-weight: 700; color: var(--navy); }
.photo-count:empty { display: none; }

.photo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.photo-list:empty { display: none; }
.photo-item {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--navy-line);
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper-warm);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item.is-done::after {
  content: '\2713';
  position: absolute; left: 6px; bottom: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-bright); color: var(--navy-deep);
  font-size: 0.8rem; font-weight: 700;
}
.photo-name { display: none; }
.photo-item.is-noprev .photo-name {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 10px;
  font-size: 0.75rem; line-height: 1.3; text-align: center; word-break: break-all;
  color: var(--ink-soft);
}
.photo-remove {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(5, 10, 37, 0.75); color: #fff;
  font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.photo-remove:hover { background: var(--navy-deep); color: var(--gold-bright); }
.is-uploading .photo-remove { display: none; }
