.page-events .page-body {
  width: 100%;
  max-width: none;
  padding: 0;
  background: #ffffff;
}

.memories-page {
  position: relative;
  max-width: 1460px;
  margin: 0 auto;
  padding: 1.35rem 3.9rem 2.45rem;
  color: #061735;
  overflow: hidden;
}

.memories-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 1.05rem;
}

.memories-title {
  position: relative;
  display: inline-block;
  margin: 0;
  font-size: clamp(2.1rem, 2.7vw, 3.05rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #123d9c;
}

.memories-title::after {
  content: "";
  position: absolute;
  left: 0.12rem;
  bottom: -0.2rem;
  width: 3.2rem;
  height: 0.28rem;
  border-radius: 999px;
  background: #f3d21b;
}

.memories-lead {
  margin: 0.9rem 0 0;
  max-width: 690px;
  color: #071936;
  font-size: clamp(0.95rem, 1vw, 1.08rem);
  line-height: 1.45;
  font-weight: 500;
}

.memories-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.88rem;
  margin: 0 0 1.1rem;
}

.memory-tab {
  min-width: 5.85rem;
  height: 2.38rem;
  padding: 0 1.34rem;
  border: 1px solid #d9e4f2;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #07389a;
  box-shadow: 0 12px 28px rgba(13, 49, 100, 0.04);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.memory-tab:hover,
.memory-tab.active {
  border-color: #0b43b3;
  background: linear-gradient(180deg, #0c49bd, #073896);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(8, 53, 148, 0.14);
}

.memories-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
}

.memory-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  min-height: 0;
  overflow: hidden;
  border-radius: 0.48rem;
  background: #d9e4f2;
  box-shadow: 0 12px 28px rgba(13, 49, 100, 0.04);
  isolation: isolate;
  color: inherit;
  text-decoration: none;
}

.memory-card img,
.memory-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.26s ease;
}

.memory-card:hover img,
.memory-card:hover .memory-fallback {
  transform: scale(1.045);
}

.memory-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(4, 9, 27, 0.03) 0%, rgba(4, 9, 27, 0.08) 45%, rgba(0, 0, 0, 0.72) 100%);
}

.memory-caption {
  position: absolute;
  left: 0.72rem;
  right: 0.72rem;
  bottom: 0.6rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.33rem;
  margin: 0;
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1.15;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.memory-calendar {
  width: 0.93rem;
  height: 0.93rem;
  flex: 0 0 auto;
  color: #ffffff;
}

.memory-calendar svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.memory-card[hidden] {
  display: none;
}

.memory-empty {
  grid-column: 1 / -1;
  min-height: 11rem;
  display: grid;
  place-items: center;
  border: 1px solid #d9e4f2;
  border-radius: 0.6rem;
  color: #061735;
  background: #f8fbff;
  font-weight: 700;
}

.memory-detail-page {
  max-width: 1460px;
  margin: 0 auto;
  padding: 1.35rem 3.9rem 2.8rem;
}

.memory-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  margin-bottom: 1rem;
  color: #0b43b3;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.memory-back-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.memory-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(1.4rem, 4vw, 4rem);
  align-items: center;
  margin-bottom: 1.6rem;
}

.memory-detail-kicker {
  margin: 0 0 0.75rem;
  color: #0b43b3;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.memory-detail-title {
  position: relative;
  display: inline-block;
  margin: 0;
  color: #123d9c;
  font-size: clamp(2rem, 4.6vw, 4.7rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.memory-detail-title::after {
  content: "";
  position: absolute;
  left: 0.12rem;
  bottom: -0.45rem;
  width: 4.2rem;
  height: 0.32rem;
  border-radius: 999px;
  background: #f3d21b;
}

.memory-detail-date,
.memory-detail-lead {
  color: #061735;
  font-weight: 600;
}

.memory-detail-date {
  margin: 1.25rem 0 0;
  font-size: 1rem;
}

.memory-detail-lead {
  max-width: 760px;
  margin: 0.85rem 0 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

.memory-detail-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  border-radius: 0.55rem;
  box-shadow: 0 12px 28px rgba(13, 49, 100, 0.04);
}

.memory-detail-cover-link {
  display: block;
  color: inherit;
  cursor: zoom-in;
}

.memory-detail-cover-link .memory-detail-cover {
  display: block;
}

.memory-detail-cover-fallback {
  display: block;
  background:
    radial-gradient(circle at 26% 30%, rgba(255, 240, 0, 0.75) 0 12%, transparent 12.5%),
    linear-gradient(135deg, #9db2ca, #263348);
}

.memory-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: stretch;
}

.gallery-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #d9e4f2;
  box-shadow: 0 12px 28px rgba(13, 49, 100, 0.04);
  aspect-ratio: 4 / 3;
}

.gallery-photo-featured {
  grid-column: auto;
  grid-row: auto;
}

.gallery-photo-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  cursor: zoom-in;
}

.gallery-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.22s ease;
}

.gallery-photo:hover img {
  transform: scale(1.035);
}

.gallery-photo figcaption {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.65rem;
  pointer-events: none;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.memory-fallback {
  display: block;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.02)),
    linear-gradient(135deg, #8596ad 0%, #263348 100%);
}

.memory-card-1 .memory-fallback {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(0,0,0,0.08)),
    linear-gradient(8deg, transparent 0 32%, rgba(6,12,31,0.45) 32% 48%, transparent 48%),
    linear-gradient(90deg, #f4f7fb 0 22%, #d5473e 22% 24%, #ffffff 24% 42%, #164d9b 42% 45%, #f7f7f7 45% 100%);
}

.memory-card-2 .memory-fallback {
  background:
    radial-gradient(circle at 38% 36%, #f0d2b4 0 7%, transparent 7.5%),
    radial-gradient(circle at 63% 35%, #d6a67f 0 7%, transparent 7.5%),
    linear-gradient(155deg, rgba(21,42,65,0.86), rgba(9,21,35,0.78)),
    linear-gradient(90deg, #314c5f, #c9d5dc);
}

.memory-card-3 .memory-fallback {
  background:
    radial-gradient(circle at 50% 55%, #dffbff 0 9%, #37a75f 9.5% 18%, transparent 18.5%),
    linear-gradient(180deg, rgba(78, 141, 79, 0.75), rgba(29, 67, 36, 0.85)),
    linear-gradient(90deg, #465f36, #cfd7b0);
}

.memory-card-4 .memory-fallback {
  background:
    radial-gradient(circle at 35% 58%, #e9dcc1 0 5%, transparent 5.5%),
    linear-gradient(130deg, rgba(13, 42, 82, 0.76), rgba(15, 77, 139, 0.82)),
    linear-gradient(90deg, #1c5ea5, #8eb3d5);
}

.memory-card-5 .memory-fallback {
  background:
    radial-gradient(circle at 78% 47%, #d8b189 0 8%, transparent 8.5%),
    linear-gradient(90deg, rgba(26, 37, 60, 0.95), rgba(232, 223, 206, 0.55)),
    linear-gradient(180deg, #27405f, #f2d2b3);
}

.memory-card-6 .memory-fallback {
  background:
    radial-gradient(circle at 23% 30%, #d7a37c 0 7%, transparent 7.5%),
    radial-gradient(circle at 52% 30%, #c99372 0 7%, transparent 7.5%),
    radial-gradient(circle at 79% 31%, #dfb48f 0 7%, transparent 7.5%),
    linear-gradient(180deg, #98b0c2, #172941);
}

.memory-card-7 .memory-fallback {
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 222, 122, 0.65) 0 18%, transparent 18.5%),
    linear-gradient(95deg, #704328, #c23f3c 42%, #203d35);
}

.memory-card-8 .memory-fallback {
  background:
    linear-gradient(180deg, rgba(61, 45, 20, 0.1), rgba(10, 18, 29, 0.55)),
    linear-gradient(90deg, #9c784d 0 18%, #d7c0a1 18% 36%, #4b6d87 36% 100%);
}

.memory-card-9 .memory-fallback {
  background:
    radial-gradient(circle at 36% 48%, rgba(255, 63, 132, 0.48) 0 14%, transparent 14.5%),
    radial-gradient(circle at 58% 46%, rgba(255, 197, 66, 0.5) 0 16%, transparent 16.5%),
    linear-gradient(135deg, #63a36b, #ee7a90 55%, #e7cf60);
}

.memory-card-10 .memory-fallback {
  background:
    radial-gradient(circle at 80% 42%, #c79a76 0 8%, transparent 8.5%),
    linear-gradient(90deg, #d8e4e6, #596b77 45%, #101f31);
}

@media (max-width: 1180px) {
  .memories-page {
    padding-inline: 2rem;
  }

  .memory-detail-page {
    padding-inline: 2rem;
  }

  .memories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .memory-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-width: 1366px) {
  .memories-page,
  .memory-detail-page {
    max-width: 1180px;
    padding-inline: clamp(1.5rem, 3vw, 2.6rem);
  }

  .memories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .memory-card {
    aspect-ratio: 4 / 3;
  }

  .memory-detail-header {
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.9fr);
    gap: clamp(1.25rem, 3vw, 2.4rem);
  }

  .memory-detail-cover {
    aspect-ratio: 4 / 3;
  }

  .memory-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .memories-page {
    padding: 1.1rem 1rem 2rem;
  }

  .memory-detail-page {
    padding: 1.1rem 1rem 2rem;
  }

  .memory-detail-header {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .memory-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-photo,
  .gallery-photo-featured {
    grid-column: auto;
    grid-row: auto;
  }

  .memories-header {
    margin-bottom: 1rem;
  }

  .memories-tabs {
    gap: 0.55rem;
    margin-bottom: 0.95rem;
  }

  .memory-tab {
    min-width: 0;
    height: 2.2rem;
    padding: 0 0.9rem;
    font-size: 0.76rem;
  }

  .memories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .memory-card {
    aspect-ratio: 4 / 3;
  }

  .memory-detail-cover,
  .gallery-photo {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 520px) {
  .memories-grid {
    grid-template-columns: 1fr;
  }

  .memory-gallery-grid {
    grid-template-columns: 1fr;
  }

  .memory-card {
    aspect-ratio: 4 / 3;
  }
}
