.gallery-hero {
  min-height: 0;
  padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-lg);
  background: var(--white);
}

.gallery-hero .container {
  max-width: var(--container-narrow);
  text-align: center;
}

.gallery-hero h1 {
  max-width: none;
  margin: 0 auto;
  color: var(--text-primary);
  font-size: clamp(2.15rem, 3.2vw, 3.1rem);
  white-space: nowrap;
}

.gallery-hero__copy {
  max-width: 560px;
  margin: var(--space-sm) auto 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.gallery-landing {
  padding: var(--space-xl) 0 var(--space-2xl);
  background: var(--bg-secondary);
}

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

.event-card {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(26, 26, 26, 0.12);
  border-radius: var(--border-radius);
  background: var(--white);
  box-shadow: none;
  text-align: left;
  transition: border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.event-card:hover,
.event-card:focus-visible {
  border-color: rgba(155, 35, 53, 0.62);
  box-shadow: 0 16px 30px rgba(26, 26, 26, 0.1);
  outline: none;
  transform: translateY(-3px);
}

.event-card__image-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--charcoal);
}

.event-card__image-wrap::after {
  position: absolute;
  inset: 0;
  content: '';
  background: rgba(26, 26, 26, 0.46);
  transition: background var(--duration-base) var(--ease-out);
}

.event-card:hover .event-card__image-wrap::after,
.event-card:focus-visible .event-card__image-wrap::after {
  background: rgba(26, 26, 26, 0.3);
}

.event-card__image {
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.08);
  transition: transform 0.65s var(--ease-out);
}

.event-card:hover .event-card__image,
.event-card:focus-visible .event-card__image {
  transform: scale(1.045);
}

/* Keep the card at the thumbnail's aspect ratio while trimming the empty strip above the backdrop. */
.event-card[data-event-slug="angelikas-50th"] .event-card__image,
.event-card[data-event-slug="aarattu-2026"] .event-card__image {
  transform: scale(1.1);
  transform-origin: center;
}

.event-card[data-event-slug="angelikas-50th"]:hover .event-card__image,
.event-card[data-event-slug="angelikas-50th"]:focus-visible .event-card__image,
.event-card[data-event-slug="aarattu-2026"]:hover .event-card__image,
.event-card[data-event-slug="aarattu-2026"]:focus-visible .event-card__image {
  transform: scale(1.14);
}

/* Remove the left-hand room corner without changing the card's natural aspect ratio. */
.event-card[data-event-slug="annies-18th"] .event-card__image {
  transform: scale(1.12);
  transform-origin: 65% center;
}

.event-card[data-event-slug="annies-18th"]:hover .event-card__image,
.event-card[data-event-slug="annies-18th"]:focus-visible .event-card__image {
  transform: scale(1.16);
}

.event-card__lock {
  position: absolute;
  z-index: 2;
  top: 0.85rem;
  right: 0.85rem;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.78);
  color: var(--white);
}

.event-card__lock svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.event-card__enter {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: inline-flex;
  padding: 0.95rem 2.2rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: var(--text-inverse);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 30px -14px rgba(155, 35, 53, 0.7);
  text-transform: uppercase;
  transform: translate(-50%, -50%) scale(0.84);
  transition: background var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.event-card:hover .event-card__enter,
.event-card:focus-visible .event-card__enter {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 20px 38px -14px rgba(155, 35, 53, 0.85);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.event-card__enter svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform var(--duration-fast) var(--ease-out);
}

.event-card:hover .event-card__enter svg,
.event-card:focus-visible .event-card__enter svg {
  transform: translateX(3px);
}

.event-card__body {
  display: flex;
  z-index: 2;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1.55rem;
}

.event-card__date {
  margin: 0 0 0.5rem;
  color: rgba(255, 255, 255, 0.76);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.event-card__title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--white);
  font-family: var(--font-accent);
  font-size: clamp(1.45rem, 2.2vw, 2.1rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-card__venue {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
  margin: 0.7rem 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.4;
}

.event-card__venue svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.event-grid__message {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-lg) 0;
  color: var(--text-secondary);
  text-align: center;
}

.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-lg);
}

.gallery-pagination[hidden] {
  display: none;
}

.gallery-pagination__button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(26, 26, 26, 0.18);
  border-radius: 50%;
  background: var(--white);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.gallery-pagination__button:hover,
.gallery-pagination__button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.gallery-pagination__button[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.gallery-fotoshare-note {
  display: grid;
  gap: 0.35rem;
  max-width: 680px;
  margin: var(--space-xl) auto var(--space-lg);
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(26, 26, 26, 0.18);
  border-bottom: 1px solid rgba(26, 26, 26, 0.18);
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.55;
  text-align: center;
}

.gallery-fotoshare-note[hidden] {
  display: none;
}

.gallery-fotoshare-note strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.gallery-pagination__ellipsis {
  display: grid;
  width: 28px;
  height: 40px;
  place-items: center;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.gallery-pagination__button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.gallery-pagination__button:disabled {
  cursor: default;
  opacity: 0.32;
}

.gallery-pagination__button:disabled:hover {
  border-color: rgba(26, 26, 26, 0.18);
  color: var(--text-primary);
}

.gallery-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  width: min(100% - 2rem, 720px);
  max-height: min(760px, calc(100vh - 2rem));
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.gallery-modal::backdrop,
.gallery-lightbox::backdrop {
  background: rgba(12, 12, 12, 0.78);
}

.gallery-modal__close,
.gallery-stack-dialog__close,
.gallery-lightbox__close,
.gallery-lightbox__nav {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(26, 26, 26, 0.12);
  border-radius: 50%;
  background: var(--white);
  color: var(--text-primary);
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.gallery-modal__close {
  position: absolute;
  z-index: 3;
  top: 1rem;
  right: 1rem;
}

.gallery-modal__close:hover,
.gallery-modal__close:focus-visible,
.gallery-stack-dialog__close:hover,
.gallery-stack-dialog__close:focus-visible,
.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
  background: var(--black);
  color: var(--white);
  outline: none;
}

.gallery-modal__close svg,
.gallery-stack-dialog__close svg,
.gallery-lightbox__close svg,
.gallery-lightbox__nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.gallery-gate {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 1.08fr);
  min-height: 430px;
}

.gallery-gate__event {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 2.25rem;
  background: var(--charcoal);
  color: var(--white);
}

.gallery-gate__eyebrow {
  margin: 0 0 var(--space-sm);
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.gallery-gate__event h2 {
  color: var(--white);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

.gallery-gate__event-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.55rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

.gallery-gate__event-detail svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.gallery-gate__form {
  padding: 2.25rem;
  background: var(--white);
}

.gallery-gate__form h3 {
  margin: 0;
  font-size: 1.42rem;
}

.gallery-gate__form > p {
  margin: 0.5rem 0 1.45rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.gallery-gate__form .form-group {
  margin-bottom: 1rem;
}

.gallery-gate__form label {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-gate__form input {
  width: 100%;
  padding: 0.82rem 0.9rem;
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: 3px;
  color: var(--text-primary);
  font: inherit;
}

.gallery-gate__form input:focus {
  outline: 2px solid rgba(155, 35, 53, 0.25);
  border-color: var(--accent);
}

.gallery-gate__form input[name="pin"] {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
}

.gallery-gate__form input[name="pin"]::placeholder {
  font-family: var(--font-body);
  font-size: 0.88rem;
  letter-spacing: normal;
}

.gallery-gate__submit {
  width: 100%;
  margin-top: 0.35rem;
}

.gallery-gate__status {
  min-height: 1.4rem;
  margin: 0.8rem 0 0;
  color: var(--accent);
  font-size: 0.84rem;
  line-height: 1.4;
}

.gallery-gate__status.is-success {
  color: #167044;
}

.gallery-gate__privacy {
  margin: 0.8rem 0 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.gallery-gate__privacy a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gallery-view__header {
  padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-lg);
  background: var(--white);
}

.gallery-view__header .container {
  max-width: var(--container-narrow);
  text-align: center;
}

.gallery-view__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-view__back:hover,
.gallery-view__back:focus-visible {
  color: var(--accent);
  outline: none;
}

.gallery-view__back svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.gallery-view__header h1 {
  max-width: 820px;
  margin: 0 auto;
  color: var(--text-primary);
  font-size: clamp(2.15rem, 3.2vw, 3.1rem);
}

.gallery-view__meta {
  margin: var(--space-sm) auto 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.gallery-view__content {
  padding: 1rem 0 var(--space-2xl);
  background: var(--bg-secondary);
}

.gallery-view__content .container {
  width: 100%;
  max-width: none;
  padding-inline: clamp(0.75rem, 2vw, 2rem);
}

.gallery-view__count {
  margin: 0;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-view__toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gallery-view__toolbar .gallery-view__count {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.gallery-view__modes {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(155, 35, 53, 0.38);
  border-radius: 12px;
  background: rgba(155, 35, 53, 0.07);
  box-shadow: 0 10px 24px -18px rgba(26, 26, 26, 0.8);
}

.gallery-view__mode {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  transition: background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.gallery-view__mode svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.gallery-view__mode:hover,
.gallery-view__mode:focus-visible {
  background: var(--white);
  color: var(--accent);
  outline: 2px solid var(--accent-hover);
  outline-offset: -2px;
}

.gallery-view__mode.is-active {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 6px 14px -8px rgba(155, 35, 53, 0.9);
}

.gallery-view__mode.is-active:hover,
.gallery-view__mode.is-active:focus-visible {
  background: var(--accent-hover);
  color: var(--white);
}

.gallery-view__grid {
  display: grid;
  gap: 1rem;
}

.gallery-view__grid.is-photo-sets {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(0.8rem, 1.5vw, 1.4rem);
}

.gallery-view__grid.is-all-photos {
  grid-template-columns: 1fr;
  gap: 0;
}

.gallery-view__group {
  padding: 0;
}

.gallery-stack-card {
  min-width: 0;
  padding: 0 0 0.4rem;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.gallery-stack-card__visual {
  position: relative;
  display: block;
  width: calc(100% - 10px);
  margin: 0 10px 10px 0;
}

.gallery-stack-card__layer,
.gallery-stack-card__visual img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(26, 26, 26, 0.14);
  background: #dedede;
  object-fit: cover;
}

.gallery-stack-card__layer--back { transform: translate(10px, 10px); }
.gallery-stack-card__layer--middle { transform: translate(5px, 5px); }

.gallery-stack-card__visual img {
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}

.gallery-stack-card.is-loaded .gallery-stack-card__visual img { opacity: 1; }
.gallery-stack-card.is-error .gallery-stack-card__visual { background: #dedede; }

.gallery-stack-card:hover .gallery-stack-card__visual img,
.gallery-stack-card:focus-visible .gallery-stack-card__visual img {
  box-shadow: 0 12px 24px rgba(26, 26, 26, 0.16);
  transform: translateY(-3px);
}

.gallery-stack-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.gallery-view__group-grid {
  display: grid;
  gap: clamp(0.45rem, 0.8vw, 0.8rem);
}

.gallery-view__group[data-orientation="portrait"] .gallery-view__group-grid {
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
}

.gallery-view__group[data-orientation="landscape"] .gallery-view__group-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.gallery-view__group[data-orientation="square"] .gallery-view__group-grid,
.gallery-view__group[data-orientation="unknown"] .gallery-view__group-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.gallery-view__image {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: 2px;
  background: #e6e6e6;
  line-height: 0;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.gallery-view__image:hover,
.gallery-view__image:focus-visible {
  border-color: rgba(155, 35, 53, 0.55);
  box-shadow: 0 8px 18px rgba(26, 26, 26, 0.12);
  outline: none;
  transform: translateY(-2px);
}

.gallery-view__image img {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: contain;
  transition: opacity var(--duration-base) var(--ease-out);
}

.gallery-view__image.is-loaded img {
  opacity: 1;
}

.gallery-view__image.is-error {
  min-height: 140px;
  border-color: rgba(155, 35, 53, 0.35);
}

.gallery-view__sentinel {
  display: grid;
  min-height: 64px;
  place-items: center;
}

.gallery-view__sentinel[hidden] {
  display: none;
}

.gallery-view__sentinel.is-loading::after {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(26, 26, 26, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  content: '';
  animation: gallery-spin 0.7s linear infinite;
}

.gallery-view__retry {
  margin: var(--space-sm) auto;
}

@keyframes gallery-spin {
  to { transform: rotate(360deg); }
}

.gallery-view__empty {
  padding: var(--space-xl);
  border: 1px solid rgba(26, 26, 26, 0.11);
  background: var(--grey-light);
  color: var(--text-secondary);
  text-align: center;
}

.gallery-view__empty h2 {
  font-size: 1.2rem;
}

.gallery-view__empty p {
  margin: 0.5rem auto 0;
  font-size: 0.9rem;
}

.gallery-stack-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(calc(100vw - 2rem), 1040px);
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  overflow: auto;
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 0;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.gallery-stack-dialog::backdrop,
.gallery-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(3px);
}

.gallery-stack-dialog__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.gallery-stack-dialog__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.gallery-stack-dialog__grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) repeat(2, minmax(0, 1fr));
  gap: clamp(0.5rem, 1vw, 0.9rem);
  margin-top: 3.25rem;
}

.gallery-stack-dialog__grid[aria-busy="true"] {
  min-height: 320px;
}

.gallery-stack-dialog__grid[aria-busy="true"]::after {
  align-self: center;
  justify-self: center;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(26, 26, 26, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  content: '';
  animation: gallery-spin 0.7s linear infinite;
}

.gallery-stack-dialog__photo {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(26, 26, 26, 0.12);
  background: #dedede;
  line-height: 0;
}

.gallery-stack-dialog__photo--photostrip {
  grid-row: span 2;
}

.gallery-stack-dialog__photo img {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.gallery-stack-dialog__photo.is-loaded img { opacity: 1; }

.gallery-stack-dialog__photo:hover img,
.gallery-stack-dialog__photo:focus-visible img {
  transform: scale(1.025);
}

.gallery-stack-dialog__photo:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.gallery-stack-dialog__error {
  grid-column: 1 / -1;
  padding: 2rem;
  background: var(--white);
  color: var(--text-secondary);
  text-align: center;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(calc(100vw - 2rem), 1180px);
  height: min(calc(100dvh - 2rem), 840px);
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: var(--black);
}

.gallery-lightbox__figure {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  place-items: center;
}

.gallery-lightbox__figure.is-loading::after {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(155, 35, 53, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  content: '';
  animation: gallery-lightbox-spin 0.75s linear infinite;
}

.gallery-lightbox__figure.is-loading img {
  visibility: hidden;
}

@keyframes gallery-lightbox-spin {
  to { transform: rotate(360deg); }
}

.gallery-lightbox__figure img {
  width: auto;
  height: auto;
  max-width: min(calc(100vw - 2rem), 1180px);
  max-height: min(calc(100dvh - 2rem), 840px);
  object-fit: contain;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(26, 26, 26, 0.88);
  color: var(--white);
}

.gallery-lightbox__close {
  top: 1rem;
  right: 1rem;
}

.gallery-lightbox__nav--previous {
  top: calc(50% - 21px);
  left: 1rem;
}

.gallery-lightbox__nav--next {
  top: calc(50% - 21px);
  right: 1rem;
}

.gallery-lightbox__download {
  position: absolute;
  z-index: 2;
  bottom: 1.5rem;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.78rem 1rem;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 30px -10px rgba(155, 35, 53, 0.72);
  transform: translateX(-50%);
  text-transform: uppercase;
  transition: background var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.gallery-lightbox__download:hover,
.gallery-lightbox__download:focus-visible {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--white);
  box-shadow: 0 20px 38px -10px rgba(155, 35, 53, 0.88);
  outline: none;
  transform: translate(-50%, -2px);
}

.gallery-lightbox__download.is-loading {
  cursor: wait;
  opacity: 0.55;
  pointer-events: none;
}

.gallery-lightbox__mobile-actions {
  display: none;
}

.gallery-lightbox__download-status {
  position: absolute;
  z-index: 3;
  right: 1rem;
  bottom: 4.6rem;
  max-width: min(320px, calc(100% - 2rem));
  margin: 0;
  color: var(--white);
  font-size: 0.8rem;
  text-align: right;
}

.gallery-lightbox__download-status.is-error { color: #ffb4b4; }

.gallery-lightbox__download svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

@media (max-width: 900px) {
  .gallery-gate { grid-template-columns: 1fr; }
  .gallery-gate__event { min-height: 190px; }
}

@media (max-width: 640px) {
  .event-grid { grid-template-columns: 1fr; }
  .gallery-hero h1 { white-space: normal; }
  .gallery-modal { width: min(100% - 1rem, 560px); max-height: calc(100dvh - 1rem); }
  .gallery-gate__event, .gallery-gate__form { padding: 1.5rem; }
  .gallery-view__content { padding-top: 0.75rem; }
  .gallery-view__content .container { padding-inline: 0.5rem; }
  .gallery-view__toolbar { align-items: flex-start; flex-direction: column; }
  .gallery-view__toolbar .gallery-view__count { position: static; margin-left: 0.25rem; transform: none; }
  .gallery-view__modes { width: 100%; }
  .gallery-view__grid.is-photo-sets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .gallery-view__group-grid { gap: 0.4rem; }
  .gallery-view__group[data-orientation="portrait"] .gallery-view__group-grid,
  .gallery-view__group[data-orientation="square"] .gallery-view__group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gallery-view__group[data-orientation="landscape"] .gallery-view__group-grid,
  .gallery-view__group[data-orientation="unknown"] .gallery-view__group-grid {
    grid-template-columns: 1fr;
  }
  .gallery-lightbox { width: calc(100vw - 1rem); height: calc(100dvh - 1rem); max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); }
  .gallery-lightbox__figure { height: calc(100% - 72px); }
  .gallery-lightbox__figure img { max-width: calc(100vw - 1rem); max-height: calc(100dvh - 5.5rem); }
  .gallery-lightbox__nav--previous { left: 0.6rem; }
  .gallery-lightbox__nav--next { right: 0.6rem; }
  .gallery-lightbox__download { display: none; }
  .gallery-lightbox__mobile-actions {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .gallery-lightbox__mobile-actions button {
    display: inline-flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.7rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: var(--accent);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0;
  }
  .gallery-lightbox__mobile-actions button[hidden] { display: none; }
  #gallery-lightbox-save-photos[hidden] + #gallery-lightbox-save-files { grid-column: 1 / -1; }
  .gallery-lightbox__mobile-actions button.is-loading { cursor: wait; opacity: 0.55; }
  .gallery-lightbox__mobile-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .gallery-lightbox__download-status { right: 0.75rem; bottom: 4.35rem; left: 0.75rem; text-align: center; }
  .gallery-stack-dialog { width: calc(100vw - 1rem); max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); padding: 1rem; }
  .gallery-stack-dialog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
}
