/* The second gallery shares the structure cards; only its direction and captions differ. */
.modality-carousel { margin-top: var(--gallery-gap); scroll-margin-top: 110px; }
.modality-carousel.is-gallery-ready .gallery-track { animation-direction: reverse; }
.modality-carousel figcaption { right: 25px; }
.modality-carousel figcaption h3 { font: inherit; letter-spacing: inherit; }
.review-activity-icons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  margin: 24px 0 0;
  border-block: 1px solid var(--line);
  padding: 0;
  background: #f8f8f6;
  list-style: none;
}
.review-activity-icons > li {
  display: grid;
  grid-template-columns: auto minmax(0, max-content);
  place-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  min-width: 0;
  min-height: 120px;
  padding: 16px clamp(16px, 3vw, 48px);
}
.review-activity-icons > li + li { border-left: 1px solid var(--line); }
.review-activity-icons svg {
  display: block;
  width: 40px;
  height: 40px;
  color: var(--gold-dark);
}
.review-activity-icons h3 { font: 400 clamp(24px, 2.6vw, 36px)/1.1 var(--serif); }

.life-rotator {
  --life-line: #ded9cf;
  --life-accent: #947441;
  display: grid;
  grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr);
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
}
.life-rotation-list { min-width: 0; }
.life-rotation-item {
  position: relative;
  border-top: 1px solid var(--life-line);
}
.life-rotation-item:last-of-type { border-bottom: 1px solid var(--life-line); }
.life-rotation-item h3 { margin: 0; }
.life-rotation-trigger {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  padding: 15px 0;
  color: #615d56;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: clamp(29px, 3.25vw, 43px);
  line-height: 1.05;
  cursor: pointer;
}
.life-rotation-number {
  color: #775e37;
  font: 600 .69rem var(--sans);
  letter-spacing: .12em;
}
.life-rotation-arrow {
  width: 20px;
  height: 20px;
  color: #775e37;
  transition: transform .25s ease;
}
.life-rotation-item[data-life-active] .life-rotation-trigger { color: #161512; }
.life-rotation-item[data-life-active] .life-rotation-arrow { transform: rotate(90deg); }
.life-rotation-copy { padding: 0 14px 18px 36px; }
.life-rotation-copy p { color: #52514e; font-size: .9rem; }
.life-rotation-progress {
  position: absolute;
  z-index: 1;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--life-accent);
  transform: scaleX(var(--life-progress, 0));
  transform-origin: left center;
}
.life-rotator:not([data-life-ready]) .life-rotation-trigger { cursor: default; }
.life-rotation-item:not([data-life-active]) .life-rotation-progress { visibility: hidden; }
.life-rotation-copy[hidden] { display: none; }
.life-rotation-visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 1.35;
  background: #efebe3;
}
.life-rotation-panel, .life-rotation-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease, visibility 0s linear .6s;
  pointer-events: none;
}
.life-rotation-panel[data-life-active], .life-rotation-frame[data-life-active] {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.life-rotation-panel[data-life-entering] .life-rotation-frame { transition: none; }
.life-rotation-frame > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.life-rotation-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 22px;
  color: #65583f;
  background: linear-gradient(135deg, #f8f5ee, #e9e1d2);
  text-align: center;
}
.life-rotation-placeholder img { width: 60px; height: 60px; }
.life-rotation-placeholder span { font-size: .81rem; }

@media (max-width: 760px) {
  .review-activity-icons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-activity-icons > li { gap: 10px; min-height: 92px; padding: 12px 14px; }
  .review-activity-icons > li:nth-child(odd) { border-left: 0; }
  .review-activity-icons > li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .review-activity-icons svg { width: 32px; height: 32px; }
  .review-activity-icons h3 { font-size: clamp(22px, 5vw, 30px); }
  .life-rotator { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .life-rotation-list { min-height: 290px; }
  .life-rotation-visual { aspect-ratio: 4 / 3; }
}
@media (max-width: 700px) {
  .review-activity-icons { margin-top: 14px; }
  .modality-carousel { scroll-margin-top: 100px; }
  .modality-carousel figcaption { right: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .life-rotation-arrow,
  .life-rotation-panel,
  .life-rotation-frame { transition: none; }
}

/* November photo gallery; independent from the continuous structure carousel. */
.structure-photo-section { padding-block: 36px 64px; }
.structure-photo-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.structure-photo-grid + .structure-photo-grid { margin-top: 12px; }
.structure-photo-grid [data-structure-photo] {
  display: block;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #efebe3;
}
.structure-photo-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.structure-photo-grid [data-structure-photo]:focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 4px;
}
.structure-photo-section [data-photos-more] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 48px;
  margin: 26px auto 0;
  border: 1px solid var(--gold-dark);
  padding: 12px 24px;
  color: var(--ink);
  background: transparent;
  font: 600 .8rem var(--sans);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.structure-photo-section [data-photos-more]:hover {
  color: white;
  background: var(--gold-dark);
}
.structure-photo-grid[hidden],
.structure-photo-section [data-photos-more][hidden] { display: none; }
.structure-photo-section .sr-only,
[data-photo-dialog] .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
html.is-photo-dialog-open,
html.is-photo-dialog-open body { overflow: hidden; overscroll-behavior: none; }
[data-photo-dialog] {
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow: auto;
  border: 1px solid #80632e;
  padding: 56px 16px 18px;
  color: white;
  background: #111;
}
[data-photo-dialog]::backdrop { background: rgb(0 0 0 / .86); }
[data-photo-dialog]:not([open]) { display: none; }
[data-photo-dialog][open],
[data-photo-dialog] [data-photo-panel] {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
}
[data-photo-dialog] [data-photo-panel] { grid-column: 1 / -1; }
[data-photo-image] {
  display: block;
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  height: min(72dvh, 760px);
  max-height: calc(100dvh - 180px);
  object-fit: contain;
}
[data-photo-dialog] button {
  z-index: 1;
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #ae8e54;
  padding: 10px;
  color: white;
  background: rgb(17 17 17 / .8);
  font: 400 24px/1 var(--sans);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
[data-photo-dialog] button:hover { color: #111; background: #d4bd92; }
[data-photo-dialog] button:focus-visible { outline-color: #d4bd92; outline-offset: 3px; }
[data-photo-dialog] button:disabled { visibility: hidden; }
[data-photo-dialog] button svg { width: 22px; height: 22px; }
[data-photo-close] { position: absolute; top: 10px; right: 16px; }
[data-photo-prev] { grid-column: 1; grid-row: 1; }
[data-photo-next] { grid-column: 3; grid-row: 1; }
[data-photo-count] {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  color: #d4bd92;
  font: 500 .75rem/1.5 var(--sans);
  text-align: center;
}
[data-photo-caption] {
  grid-column: 1 / -1;
  grid-row: 3;
  max-width: 800px;
  margin: 0 auto;
  font: 400 clamp(21px, 2.5vw, 28px)/1.15 var(--serif);
  text-align: center;
}
@media (hover: hover) and (pointer: fine) {
  .structure-photo-grid [data-structure-photo]:hover img { transform: scale(1.025); }
}
@media (max-width: 760px) {
  .structure-photo-section { padding-block: 24px 44px; }
  .structure-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .structure-photo-grid + .structure-photo-grid { margin-top: 10px; }
  /* Keep complete pairs, including across the two grids when expanded. */
  #galeria:has(#galeria-restante[hidden]) > .structure-photo-grid:not(#galeria-restante) > [data-structure-photo]:nth-child(15) { display: none; }
  #galeria:has(#galeria-restante:not([hidden])) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #galeria:has(#galeria-restante:not([hidden])) > .container { grid-column: 1 / -1; }
  #galeria:has(#galeria-restante:not([hidden])) > .structure-photo-grid { display: contents; }
  /* The initial grid has 15 photos: an even remainder makes the total odd. */
  #galeria-restante:not([hidden]) > [data-structure-photo]:last-child:nth-child(even) { display: none; }
  [data-photo-dialog] { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding-inline: 10px; }
  [data-photo-close] { right: 10px; }
  [data-photo-image] { height: min(65dvh, 600px); }
}
@media (prefers-reduced-motion: reduce) {
  .structure-photo-grid img,
  .structure-photo-section [data-photos-more],
  [data-photo-dialog] button { transition: none; }
}
