/* In Their Words — celebratory message-list design */
:root {
  --wine: #2b0611;
  --wine2: #430b1b;
  --wine3: #5d1027;
  --gold: #efbd43;
  --gold2: #d89427;
  --paper: #fff0cf;
  --paper2: #f8dfad;
  --ink: #4c1424;
  --muted: #76513e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--wine);
}

body {
  margin: 0;
  min-height: 100vh;
  color: #fff4e9;
  font-family: "DM Sans", Arial, sans-serif;
  background:
    radial-gradient(
      circle at 3% 24%,
      rgba(241, 173, 49, 0.2) 0 1px,
      transparent 3px
    ),
    radial-gradient(
      circle at 88% 15%,
      rgba(241, 173, 49, 0.28) 0 1px,
      transparent 3px
    ),
    radial-gradient(
      ellipse at 50% 35%,
      rgba(117, 15, 42, 0.42),
      transparent 58%
    ),
    radial-gradient(
      circle at 16% 80%,
      rgba(233, 159, 43, 0.18) 0 1px,
      transparent 3px
    ),
    linear-gradient(120deg, #21040d, #400819 52%, #21040d);
  background-attachment: fixed;
}

.memory-section {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow-x: clip;
  padding: 24px 22px 28px;
}

.memory-section::before,
.memory-section::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(244, 177, 54, 0.18),
    rgba(244, 177, 54, 0.035) 38%,
    transparent 70%
  );
  filter: blur(8px);
}

.memory-section::before {
  width: 260px;
  height: 260px;
  left: -100px;
  top: 18%;
}

.memory-section::after {
  width: 300px;
  height: 300px;
  right: -130px;
  bottom: 4%;
}

.memory-back {
  position: absolute;
  left: 48px;
  top: 23px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #fff0d4;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.memory-back span:first-child {
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
}

.memory-back:hover {
  color: var(--gold);
  transform: translateX(-3px);
}

.memory-heading {
  text-align: center;
  margin: 2px auto 25px;
  max-width: 760px;
}

.memory-eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  font-weight: 700;
  color: var(--gold);
}

.memory-heading h1 {
  margin: 8px 0 0;
  font:
    600 clamp(42px, 5vw, 62px)/1.03 "Playfair Display",
    Georgia,
    serif;
  color: #fff5e8;
}

.memory-heading h1 em {
  color: var(--gold);
  font-weight: 500;
}

.memory-heading p {
  margin: 3px 0 0;
  font:
    italic 17px "Playfair Display",
    Georgia,
    serif;
  color: #f3d9c5;
}

.memory-heading-rule {
  position: relative;
  width: 190px;
  height: 1px;
  margin: 15px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.memory-heading-rule i {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 12px;
  background: #3c0919;
  color: var(--gold);
  font-style: normal;
  font-size: 17px;
}

.memory-showcase {
  width: min(1060px, calc(100% - 24px));
  margin: 0 auto;
}

.memory-featured {
  position: relative;
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  min-height: 275px;
  padding: 20px 24px;
  border-radius: 23px;
  background:
    radial-gradient(
      ellipse at 20% 15%,
      rgba(255, 255, 255, 0.5),
      transparent 48%
    ),
    linear-gradient(135deg, #fff1d2, #f8dfae 58%, #ffefce);
  color: var(--ink);
  border: 1px solid rgba(255, 222, 160, 0.95);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(167, 103, 42, 0.15);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.memory-featured::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(176, 119, 55, 0.2);
  border-radius: 17px;
  pointer-events: none;
}

.memory-featured.is-changing.from-right {
  animation: mem-in-right 0.28s ease both;
}

.memory-featured.is-changing.from-left {
  animation: mem-in-left 0.28s ease both;
}

@keyframes mem-in-right {
  from {
    opacity: 0.55;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mem-in-left {
  from {
    opacity: 0.55;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.memory-feature-author {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 18px 6px 4px;
  border-right: 1px solid rgba(181, 111, 44, 0.5);
  min-height: 205px;
  justify-content: center;
}

.memory-feature-avatar {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e3a72d;
  padding: 3px;
  background: #fff5dc;
  box-shadow: 0 5px 12px rgba(74, 32, 15, 0.22);
}

.memory-feature-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.memory-feature-avatar img[hidden],
.memory-initials[hidden] {
  display: none;
}

.memory-initials {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #7a1733, #350817);
  color: #ffe7b2;
  font:
    600 54px "Playfair Display",
    Georgia,
    serif;
}

.memory-feature-author h2 {
  margin: 8px 0 0;
  color: #6b142b;
  font:
    700 28px/1.05 "Playfair Display",
    Georgia,
    serif;
}

.memory-feature-author p {
  margin: 4px 0 0;
  color: #684a37;
  font:
    italic 13px "Playfair Display",
    Georgia,
    serif;
}

.memory-signature {
  margin-top: 6px;
  color: #c77b19;
  font:
    italic 30px "Playfair Display",
    Georgia,
    serif;
  transform: rotate(-12deg);
}

.memory-feature-message {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0 10px 0 12px;
}

.memory-quote-mark {
  position: absolute;
  left: 0;
  top: -12px;
  color: #d18a1c;
  font:
    700 57px/1 Georgia,
    serif;
}

.memory-message-scroll {
  min-height: 160px;
  max-height: min(72vh, 760px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #a76b43 rgba(148, 91, 48, 0.12);
  padding: 2px 16px 6px 14px;
}

.memory-message-scroll::-webkit-scrollbar {
  width: 7px;
}

.memory-message-scroll::-webkit-scrollbar-track {
  background: rgba(148, 91, 48, 0.12);
  border-radius: 8px;
}

.memory-message-scroll::-webkit-scrollbar-thumb {
  background: #a76b43;
  border-radius: 8px;
}

.memory-feature-message h3 {
  margin: 0 0 11px;
  color: #75142d;
  font:
    700 26px/1.18 "Playfair Display",
    Georgia,
    serif;
}

.memory-message-copy {
  display: block;
  visibility: visible;
  opacity: 1;
  color: #241912;
  font-size: 14px;
  line-height: 1.62;
}

.memory-message-copy h4 {
  margin: 0 0 12px;
  color: #75142d;
  font:
    700 20px/1.25 "Playfair Display",
    Georgia,
    serif;
}

.memory-message-copy h5 {
  margin: 22px 0 9px;
  color: #7a1830;
  font:
    700 17px "Playfair Display",
    Georgia,
    serif;
}

.memory-message-copy p {
  margin: 0 0 13px;
}

.memory-message-copy .memory-title {
  margin-top: 24px;
}

.memory-message-copy .hindi-verse {
  margin: 18px auto;
  max-width: 560px;
  padding: 18px;
  background: rgba(188, 129, 55, 0.12);
  border-left: 3px solid #c58b35;
  font:
    17px/2 Georgia,
    serif;
  text-align: center;
}

.memory-inline-photo {
  width: min(100%, 440px);
  margin: 18px auto 20px;
  padding: 9px 9px 24px;
  background: #fffaf0;
  border: 1px solid #dfc18b;
  box-shadow: 0 7px 18px rgba(65, 35, 14, 0.22);
  transform: rotate(-0.6deg);
}

.memory-inline-photo:nth-of-type(even) {
  transform: rotate(0.7deg);
}

.memory-inline-photo img {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  background: #f4e5c9;
}

.memory-inline-photo figcaption {
  padding-top: 7px;
  text-align: center;
  color: #97734e;
  font:
    italic 12px "Playfair Display",
    Georgia,
    serif;
}

.memory-closing {
  margin-top: 20px !important;
  color: #75142d;
  font:
    700 18px/1.45 "Playfair Display",
    Georgia,
    serif;
  text-align: center;
}

.memory-counter {
  position: absolute;
  right: 22px;
  top: 12px;
  color: #a56b39;
  font-size: 9px;
  letter-spacing: 0.2em;
  font-weight: 700;
}

.memory-feature-gallery {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
}

.memory-gallery-item {
  margin: 0;
  padding: 4px;
  background: #fffaf0;
  border: 1px solid #dfc18b;
  box-shadow: 0 3px 9px rgba(65, 35, 14, 0.16);
  transform: rotate(-1deg);
}

.memory-gallery-item:nth-child(even) {
  transform: rotate(1.5deg);
}

.memory-gallery-item img {
  display: block;
  width: 90px;
  height: 66px;
  object-fit: cover;
}

.memory-message-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.memory-row {
  width: 100%;
  min-height: 69px;
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr) 100px;
  align-items: center;
  gap: 16px;
  padding: 7px 18px 7px 14px;
  border: 1px solid rgba(255, 228, 174, 0.8);
  border-radius: 16px;
  background: linear-gradient(100deg, #fff0cf, #f6dfb1 55%, #ffefcf);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 11px rgba(0, 0, 0, 0.17);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.memory-row:hover,
.memory-row.is-active {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  filter: brightness(1.035);
}

.memory-row-author {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border-right: 1px solid rgba(181, 111, 44, 0.48);
  height: 52px;
  padding-right: 12px;
}

.memory-row-avatar {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid #dca53b;
  background: #fff8e9;
  box-shadow: 0 2px 5px #0002;
}

.memory-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-row-avatar .memory-initials {
  width: 100%;
  height: 100%;
  font-size: 20px;
}

.memory-row-author strong {
  font:
    700 18px/1.1 "Playfair Display",
    Georgia,
    serif;
  color: #6b142b;
}

.memory-row-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-left: 22px;
}

.memory-row-quote {
  position: absolute;
  left: 0;
  top: -6px;
  color: #d18a1c;
  font:
    700 31px/1 Georgia,
    serif;
}

.memory-row-title {
  font:
    700 17px/1.15 "Playfair Display",
    Georgia,
    serif;
  color: #74152d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memory-row-excerpt {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
  color: #241912;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.memory-row-thumb {
  justify-self: end;
  width: 90px;
  height: 50px;
  overflow: hidden;
  border: 2px solid #fff9e9;
  border-radius: 7px;
  background: #e7c88e;
  box-shadow: 0 2px 6px #0002;
  display: grid;
  place-items: center;
}

.memory-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-row-thumb .memory-row-monogram {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font:
    700 25px "Playfair Display",
    Georgia,
    serif;
  color: #7b1a34;
}

.memory-navigation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 17px auto 0;
}

.memory-dots {
  display: flex;
  align-items: center;
  gap: 13px;
}

.memory-dot {
  width: 15px;
  height: 15px;
  padding: 0;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition:
    transform 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

.memory-dot.is-active {
  background: var(--gold);
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(239, 189, 67, 0.55);
}

.memory-page-count {
  color: #f2c85e;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.memory-controls {
  position: absolute;
  left: -9999px;
}

.memory-controls button {
  border: 0;
}

@media (max-width: 900px) {
  .memory-showcase {
    width: min(760px, 100%);
  }

  .memory-featured {
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .memory-feature-avatar {
    width: 110px;
    height: 110px;
  }

  .memory-row {
    grid-template-columns: 145px minmax(0, 1fr) 90px;
    gap: 10px;
  }
}

@media (max-width: 650px) {
  .memory-section {
    padding: 68px 12px 24px;
  }

  .memory-back {
    left: 14px;
    top: 13px;
    font-size: 9px;
  }

  .memory-back span:first-child {
    font-size: 24px;
  }

  .memory-heading {
    margin-bottom: 18px;
  }

  .memory-eyebrow {
    font-size: 8px;
    letter-spacing: 0.22em;
  }

  .memory-heading h1 {
    font-size: 43px;
  }

  .memory-heading p {
    font-size: 14px;
  }

  .memory-showcase {
    width: 100%;
  }

  .memory-featured {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    padding: 14px 10px;
    min-height: 0;
  }

  .memory-feature-author {
    min-height: 0;
    padding: 5px 7px 5px 0;
  }

  .memory-feature-avatar {
    width: 68px;
    height: 68px;
  }

  .memory-feature-author h2 {
    font-size: 17px;
  }

  .memory-feature-author p {
    font-size: 9px;
  }

  .memory-signature {
    font-size: 18px;
  }

  .memory-feature-message {
    padding-left: 7px;
    padding-right: 5px;
  }

  .memory-quote-mark {
    font-size: 39px;
    top: -7px;
  }

  .memory-message-scroll {
    max-height: 72vh;
    padding-left: 10px;
    padding-right: 5px;
  }

  .memory-feature-message h3 {
    font-size: 20px;
  }

  .memory-message-copy {
    font-size: 12px;
  }

  .memory-message-copy h4 {
    font-size: 17px;
  }

  .memory-inline-photo {
    width: 100%;
    padding: 6px 6px 19px;
  }

  .memory-inline-photo img {
    max-height: 240px;
  }

  .memory-counter {
    right: 12px;
    top: 8px;
  }

  .memory-row {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 9px;
    padding: 8px 10px;
    min-height: 65px;
  }

  .memory-row-author {
    gap: 5px;
    height: auto;
    border: 0;
    padding: 0;
  }

  .memory-row-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .memory-row-avatar .memory-initials {
    font-size: 15px;
  }

  .memory-row-author strong {
    font-size: 12px;
  }

  .memory-row-copy {
    padding-left: 15px;
  }

  .memory-row-quote {
    font-size: 24px;
  }

  .memory-row-title {
    font-size: 14px;
  }

  .memory-row-excerpt {
    font-size: 10px;
    -webkit-line-clamp: 2;
  }

  .memory-row-thumb {
    display: none;
  }

  .memory-navigation {
    margin-top: 15px;
  }

  .memory-dots {
    gap: 10px;
  }

  .memory-dot {
    width: 12px;
    height: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
