#references {
  --gallery-columns: 2;
  --gallery-gap: 10px;
}

#references .gallery-albums {
  margin-bottom: var(--space-xl);
}

#references .gallery-albums-title {
  margin-bottom: var(--space-md);
  font-family: var(--font-body);
  font-size: var(--font-size-label);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-strong);
}

#references .gallery-albums-toggle {
  display: none;
}

#references .gallery-album-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#references .filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
  min-height: 48px;
  padding: 10px var(--space-sm) 10px var(--space-md);
  font-size: var(--font-size-label);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  color: var(--color-text-strong);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: inset 0 0 0 0 var(--color-primary-accent);
  transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-base);
}

@media (hover: hover) {
  #references .filter-btn:hover {
    color: var(--color-primary-accent-strong);
    background-color: rgba(var(--color-primary-accent-rgb), 0.04);
  }
}

#references .filter-btn[aria-pressed="true"] {
  font-weight: 600;
  color: var(--color-text-strong);
  background-color: var(--color-accent-tint);
  box-shadow: inset 3px 0 0 0 var(--color-primary-accent);
}

#references .filter-btn:focus-visible {
  outline-offset: -2px;
}

#references .filter-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

#references .filter-count {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 1.75rem;
  padding: 0 var(--space-sm);
  font-size: var(--font-size-label);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-strong);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

@media (hover: hover) {
  #references .filter-btn:hover .filter-count {
    border-color: var(--color-primary-accent);
  }
}

#references .filter-btn[aria-pressed="true"] .filter-count {
  color: var(--color-white);
  background-color: var(--color-primary-accent-strong);
  border-color: var(--color-primary-accent-strong);
}

#references .filter-btn-all .filter-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

#references .filter-btn-all .filter-label::before {
  content: '';
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  color: var(--color-primary-accent);
  background:
    linear-gradient(currentColor 0 0) 0 0 / 42% 42% no-repeat,
    linear-gradient(currentColor 0 0) 100% 0 / 42% 42% no-repeat,
    linear-gradient(currentColor 0 0) 0 100% / 42% 42% no-repeat,
    linear-gradient(currentColor 0 0) 100% 100% / 42% 42% no-repeat;
}

#references .gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gallery-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

#references .gallery-item {
  flex: 0 0 calc((100% - (var(--gallery-columns) - 1) * var(--gallery-gap)) / var(--gallery-columns));
  min-width: 0;
}

html.js:not(.gallery-off) #references .gallery-item.is-filtered-out {
  display: none;
}

#references .gallery-grid.is-switching .gallery-item {
  animation: gallery-item-in var(--duration-reveal) cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes gallery-item-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

#references .gallery-trigger {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

#references .gallery-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

#references .gallery-trigger:focus-visible img {
  transform: scale(1.06);
}

@media (hover: hover) {
  #references .gallery-trigger:hover img {
    transform: scale(1.06);
  }
}

#references .gallery-trigger:focus-visible {
  outline-offset: 3px;
}

#references .gallery-overlay {
  position: absolute;
  inset: 6%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(var(--space-sm), 44% - 1.375rem, var(--space-md));
  text-align: center;
  color: var(--color-white);
  background-color: var(--color-accent-overlay);
  border-radius: var(--radius-md);
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 300ms ease, transform 300ms ease;
}

#references .gallery-trigger:focus-visible .gallery-overlay {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  #references .gallery-trigger:hover .gallery-overlay {
    opacity: 1;
    transform: none;
  }
}

#references .gallery-overlay-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  line-height: 1.3;
}

html:not(.js) #references .gallery-albums,
html.gallery-off #references .gallery-albums {
  display: none;
}

@media not all and (min-width: 64em) {
  #references .gallery-albums {
    position: relative;
  }

  #references .gallery-albums-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  #references .gallery-albums-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    min-height: 64px;
    padding: 10px var(--space-md) 10px var(--space-lg);
    text-align: left;
    color: var(--color-text-strong);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary-accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  }

  @media (hover: hover) {
    #references .gallery-albums-toggle:hover {
      border-color: var(--color-primary-accent);
      box-shadow: var(--shadow-md);
    }
  }

  #references .gallery-albums-toggle-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
  }

  #references .gallery-albums-toggle-label {
    font-size: var(--font-size-label);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary-accent-strong);
  }

  #references .gallery-albums-toggle-current {
    font-size: var(--font-size-label);
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  #references .gallery-albums-toggle .filter-count {
    color: var(--color-white);
    background-color: var(--color-primary-accent-strong);
    border-color: var(--color-primary-accent-strong);
  }

  #references .gallery-albums-toggle-icon {
    flex: none;
    color: var(--color-primary-accent-strong);
    transition: transform var(--transition-base);
  }

  #references .gallery-albums-toggle[aria-expanded="true"] .gallery-albums-toggle-icon {
    transform: rotate(180deg);
  }

  #references .gallery-album-list {
    margin-top: var(--space-sm);
    padding: var(--space-xs) 0;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
  }

  #references .gallery-albums.is-collapsed .gallery-album-list {
    display: none;
  }

  #references .gallery-album-list li:last-child .filter-btn {
    border-bottom: 0;
  }
}

@media (max-width: 19.9375em) {
  #references .gallery-albums-toggle,
  #references .filter-btn {
    flex-wrap: wrap;
    row-gap: var(--space-xs);
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
  }

  #references .gallery-albums-toggle .filter-count,
  #references .filter-btn .filter-count {
    margin-left: auto;
  }
}

@media (min-width: 36em) {
  #references {
    --gallery-gap: 12px;
  }
}

@media (min-width: 48em) {
  #references {
    --gallery-columns: 3;
    --gallery-gap: 16px;
  }

  #references .gallery-overlay-title {
    -webkit-line-clamp: 5;
  }
}

@media (min-width: 64em) {
  #references {
    --gallery-columns: 4;
  }

  #references .gallery-albums {
    margin-bottom: var(--space-2xl);
  }

  #references .gallery-album-list {
    --album-columns: 3;
    --album-count: 18;
    column-count: var(--album-columns);
    column-gap: var(--space-xl);
    border-top: 1px solid var(--color-border-light);
  }

  #references .gallery-album-list li {
    break-inside: avoid;
  }

  #references .gallery-grid {
    justify-content: flex-start;
  }

  #references .gallery-overlay-title {
    font-size: var(--font-size-md);
  }
}

@media (min-width: 120em) {
  #references {
    --gallery-columns: 5;
  }

  #references .gallery-album-list {
    --album-columns: 4;
  }
}

@supports (grid-template-rows: repeat(round(up, 5 / 2), auto)) {
  @media (min-width: 64em) {
    #references .gallery-album-list {
      display: grid;
      grid-template-columns: repeat(var(--album-columns), minmax(0, 1fr));
      grid-template-rows: repeat(round(up, var(--album-count) / var(--album-columns)), auto);
      grid-auto-flow: column;
    }

    #references .gallery-album-list li {
      display: flex;
    }
  }
}

#kind-words .kind-words-intro {
  max-width: 760px;
  white-space: pre-line;
  text-wrap: pretty;
}

#kind-words .kind-words-carousel {
  max-width: 920px;
  margin: 0 auto;
}

#kind-words .carousel-slide {
  display: flex;
}

#kind-words .testimonial {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  width: 100%;
  margin: 0;
  padding: var(--space-2xl) var(--space-lg) var(--space-xl);
  text-align: center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-top: 3px solid var(--color-primary-accent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

#kind-words .testimonial-quote {
  margin: 0;
}

#kind-words .testimonial-text {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--color-text-strong);
  white-space: pre-line;
  text-wrap: balance;
}

#kind-words .testimonial-text-long {
  text-wrap: pretty;
}

#kind-words .testimonial-text:lang(hu) {
  quotes: "\201E" "\201D" "\00BB" "\00AB";
}

#kind-words .testimonial-text:lang(en) {
  quotes: "\201C" "\201D" "\2018" "\2019";
}

#kind-words .testimonial-text:lang(de) {
  quotes: "\201E" "\201C" "\201A" "\2018";
}

#kind-words .testimonial-text::before {
  content: open-quote;
  color: var(--color-primary-accent-strong);
}

#kind-words .testimonial-text::after {
  content: close-quote;
  color: var(--color-primary-accent-strong);
}

#kind-words .testimonial-signature {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--font-size-label);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--color-text-strong);
}

#kind-words .testimonial-signature::before {
  content: "";
  display: block;
  width: 32px;
  height: 0;
  margin-bottom: var(--space-md);
  border-top: 2px solid var(--color-primary-accent);
}

#kind-words .carousel-controls {
  margin-top: var(--space-xl);
}

@media (max-width: 22.1875em) {
  #kind-words .carousel-controls {
    flex-wrap: wrap;
    row-gap: var(--space-sm);
  }

  #kind-words .carousel-dots {
    order: -1;
    flex: 1 0 100%;
    justify-content: center;
  }

  html.js:not(.carousel-off) #kind-words .carousel:not(.is-static) .carousel-controls[data-carousel-controls]:empty {
    min-height: calc(88px + var(--space-sm));
  }
}

@media (min-width: 48em) {
  #kind-words .testimonial {
    padding: var(--space-3xl) var(--space-3xl) var(--space-2xl);
  }

  #kind-words .testimonial-text {
    font-size: var(--font-size-xl);
  }
}

@media (min-width: 64em) {
  #kind-words .testimonial {
    padding: var(--space-3xl) var(--space-4xl) var(--space-2xl);
  }

  #kind-words .testimonial-text {
    font-size: 1.75rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  #kind-words .testimonial {
    gap: 12px;
    padding: var(--space-md) var(--space-lg);
  }

  #kind-words .testimonial-text {
    font-size: clamp(1rem, 4.4vh, 1.1875rem);
    line-height: 1.5;
  }

  #kind-words .testimonial-signature {
    line-height: 1.5;
  }

  #kind-words .testimonial-signature::before {
    margin-bottom: var(--space-sm);
  }

  #kind-words .carousel-controls {
    margin-top: var(--space-md);
  }
}

@media (max-height: 340px) and (orientation: landscape) {
  #kind-words .testimonial {
    gap: 6px;
    padding: 8px var(--space-md);
  }

  #kind-words .testimonial-signature::before {
    margin-bottom: 4px;
  }

  #kind-words .carousel-controls {
    margin-top: 8px;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "bar bar"
    "stage stage"
    "prev next";
  padding-bottom: var(--space-md);
  color: var(--color-white);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility 0s linear 200ms;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--transition-base), visibility 0s;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--color-lightbox-backdrop);
}

.lightbox-bar,
.lightbox-stage,
.lightbox-btn {
  position: relative;
}

.lightbox-bar {
  grid-area: bar;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-lg);
}

.lightbox-counter {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin: 0;
  font-size: var(--font-size-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-light-muted);
}

.lightbox-counter [data-lightbox-index] {
  color: var(--color-white);
}

.lightbox-stage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  min-height: 0;
  margin: 0;
  padding: 0 var(--space-md);
}

.lightbox-frame {
  position: relative;
  display: flex;
  flex: 0 1000000 content;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  height: 50%;
  max-height: calc(100vh - 230px);
  max-height: calc(100dvh - 230px);
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transition: opacity var(--transition-base);
}

.lightbox-frame.is-loading .lightbox-image {
  opacity: 0;
}

.lightbox-frame.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--color-primary-accent);
  border-radius: var(--radius-full);
  animation: lightbox-spin 500ms linear infinite;
}

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

.lightbox-caption {
  flex: 0 1 auto;
  max-width: 48rem;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  line-height: 1.35;
  text-align: center;
  color: var(--color-white);
}

.lightbox-caption.has-more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.35em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.35em), transparent);
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--color-white);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

@media (hover: hover) {
  .lightbox-btn:hover {
    background-color: var(--color-primary-accent-strong);
    border-color: var(--color-primary-accent-strong);
  }
}

.lightbox-btn[hidden] {
  display: none;
}

.lightbox :focus-visible {
  outline: 2px solid var(--color-focus-on-dark);
  outline-offset: 3px;
}

.lightbox-prev {
  grid-area: prev;
  justify-self: start;
  margin-left: var(--space-lg);
}

.lightbox-next {
  grid-area: next;
  justify-self: end;
  margin-right: var(--space-lg);
}

@media (min-width: 48em) {
  .lightbox {
    grid-template-columns: 96px minmax(0, 1fr) 96px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "bar bar bar"
      "prev stage next";
    padding-bottom: var(--space-xl);
  }

  .lightbox-bar {
    padding: var(--space-md) var(--space-lg) var(--space-md) var(--space-xl);
  }

  .lightbox-stage {
    padding: 0;
  }

  .lightbox-frame {
    max-height: calc(100vh - 190px);
    max-height: calc(100dvh - 190px);
  }

  .lightbox-prev,
  .lightbox-next {
    align-self: center;
    justify-self: center;
    margin: 0;
    width: 56px;
    height: 56px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .lightbox {
    grid-template-columns: 4.5rem minmax(0, 1fr) 4.5rem;
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "prev stage next";
    padding-bottom: 0;
  }

  .lightbox-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm);
    pointer-events: none;
  }

  .lightbox-bar > * {
    pointer-events: auto;
  }

  .lightbox-counter {
    gap: var(--space-xs);
  }

  .lightbox-stage {
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
  }

  .lightbox-frame {
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
  }

  .lightbox-caption {
    font-size: var(--font-size-md);
  }

  .lightbox-prev,
  .lightbox-next {
    align-self: center;
    justify-self: center;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox * {
    transition: none !important;
  }

  #references .gallery-trigger:hover img,
  #references .gallery-trigger:focus-visible img {
    transform: none;
  }

  #references .gallery-grid.is-switching .gallery-item {
    animation: none;
  }

  #references .gallery-overlay {
    transform: none;
  }
}

@media (forced-colors: active) {
  #references .filter-btn[aria-pressed="true"] {
    forced-color-adjust: none;
    color: HighlightText;
    background-color: Highlight;
    border-bottom-color: CanvasText;
    box-shadow: none;
  }

  #references .filter-btn[aria-pressed="true"]:focus-visible {
    outline-color: HighlightText;
  }

  #references .filter-btn[aria-pressed="true"] .filter-count {
    color: Highlight;
    background-color: HighlightText;
    border-color: HighlightText;
  }

  #references .filter-btn-all .filter-label::before {
    forced-color-adjust: none;
    color: CanvasText;
  }

  #references .filter-btn[aria-pressed="true"] .filter-label::before {
    color: HighlightText;
  }
}

@media print {
  .lightbox,
  #references .gallery-album-list,
  #references .gallery-albums-title,
  #references .gallery-albums-toggle-icon,
  #references .gallery-albums-toggle .filter-count,
  #kind-words .carousel-controls {
    display: none !important;
  }

  #references {
    --gallery-columns: 4;
  }

  #references .gallery.is-ready .gallery-albums {
    margin-bottom: var(--space-md);
    break-after: avoid;
  }

  #references .gallery.is-ready .gallery-albums-toggle {
    display: block;
    width: auto;
    min-height: 0;
    padding: 0;
    text-align: left;
    border: 0;
  }

  #references .gallery-albums-toggle-text {
    display: block;
  }

  #references .gallery-albums-toggle-label::after {
    content: ": ";
  }

  #references .gallery-albums-toggle-label,
  #references .gallery-albums-toggle-current {
    display: inline;
    font-size: inherit;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
  }

  #kind-words .testimonial {
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
  }

  #kind-words .testimonial-text {
    font-size: 13pt;
  }

  #kind-words .testimonial-signature::before {
    margin-bottom: var(--space-sm);
  }
}
