/* Gallery and its menu layout share the existing Balaton Quad palette. */
#navbar .gallery-desktop-menu { display: none; gap: 22px; }
#navbar .gallery-desktop-menu > :not([hidden]) ~ :not([hidden]) { margin-left: 0; margin-right: 0; }
#navbar .gallery-mobile-toggle { display: flex; }
@media (min-width: 1180px) {
  #navbar .gallery-desktop-menu { display: flex; }
  #navbar .gallery-mobile-toggle { display: none; }
  #navbar #mobile-menu { display: none; }
}
@media (max-width: 1179px) {
  #navbar #mobile-menu:not(.hidden) { display: block; }
}
.quad-gallery { padding: 56px 0 80px; background: #f8fafc; }
.gallery-wrap { max-width: 1280px; margin: auto; padding: 0 32px; }
.gallery-intro { max-width: 760px; margin-bottom: 32px; }
.gallery-eyebrow { color: #15803d; font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 12px; }
.gallery-intro h1 { color: #0f172a; font-size: clamp(32px, 4vw, 52px); line-height: 1.1; font-weight: 800; letter-spacing: -.035em; margin-bottom: 16px; }
.gallery-intro h1 span { color: #16a34a; }
.gallery-intro p:last-child { color: #64748b; font-size: 17px; line-height: 1.7; max-width: 630px; }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-filter { border: 1px solid #e2e8f0; border-radius: 999px; padding: 10px 20px; color: #475569; background: white; font-size: 14px; font-weight: 700; transition: background .2s, color .2s; }
.gallery-filter:hover { border-color: #16a34a; color: #15803d; }
.gallery-filter[aria-pressed="true"] { background: #16a34a; border-color: #16a34a; color: white; }
.gallery-count { color: #64748b; font-size: 14px; white-space: nowrap; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; grid-auto-rows: 240px; }
.gallery-card { position: relative; overflow: hidden; border-radius: 20px; background: #e2e8f0; text-align: left; min-width: 0; isolation: isolate; }
.gallery-card:first-child { grid-column: span 2; grid-row: span 2; }
.gallery-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.gallery-card:hover img { transform: scale(1.035); }
.gallery-card::after { content: ''; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(2, 6, 23, .65)); pointer-events: none; }
.gallery-card-label { position: absolute; bottom: 18px; left: 20px; color: white; font-size: 14px; font-weight: 700; z-index: 1; }
.gallery-card-zoom { position: absolute; bottom: 14px; right: 16px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #ffffff60; color: white; background: #ffffff20; z-index: 1; }
.gallery-card-zoom svg { width: 18px; height: 18px; }
.gallery-empty { color: #64748b; background: white; border: 1px dashed #cbd5e1; border-radius: 20px; padding: 48px 24px; text-align: center; }
.gallery-empty[hidden] { display: none; }
.gallery-lightbox { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 72px 76px 64px; background: rgba(2, 6, 23, .96); color: white; z-index: 200; }
.gallery-lightbox::backdrop { background: rgba(2, 6, 23, .96); }
.gallery-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.gallery-lightbox figure { display: flex; flex-direction: column; gap: 16px; align-items: center; width: 100%; height: 100%; }
.gallery-lightbox img { min-height: 0; max-height: calc(100% - 40px); max-width: 100%; width: auto; height: auto; object-fit: contain; margin: auto; border-radius: 8px; }
.gallery-lightbox figcaption { color: #cbd5e1; font-size: 14px; text-align: center; }
.gallery-lightbox button { position: absolute; display: grid; place-items: center; height: 48px; min-width: 48px; border-radius: 999px; border: 1px solid #ffffff30; background: #ffffff10; color: white; font-size: 26px; }
.gallery-lightbox button:hover { background: #ffffff25; }
.gallery-close { top: 16px; right: 20px; }
.gallery-prev { left: 16px; top: calc(50% - 24px); }
.gallery-next { right: 16px; top: calc(50% - 24px); }
.gallery-filter:focus-visible, .gallery-card:focus-visible, .gallery-lightbox button:focus-visible { outline: 3px solid #22c55e; outline-offset: 4px; }
@media (max-width: 767px) {
  .quad-gallery { padding: 36px 0 48px; }
  .gallery-wrap { padding: 0 16px; }
  .gallery-intro { margin-bottom: 24px; }
  .gallery-intro p:last-child { font-size: 15px; }
  .gallery-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .gallery-filter { padding: 9px 15px; font-size: 13px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 170px; gap: 10px; }
  .gallery-card { border-radius: 14px; }
  .gallery-card:first-child { grid-column: span 2; grid-row: span 1; }
  .gallery-card-label { left: 12px; bottom: 14px; font-size: 12px; }
  .gallery-card-zoom { width: 28px; height: 28px; right: 10px; bottom: 10px; }
  .gallery-card-zoom svg { width: 15px; height: 15px; }
  .gallery-lightbox { padding: 72px 12px 104px; }
  .gallery-prev, .gallery-next { top: auto; bottom: 24px; }
  .gallery-prev { left: calc(50% - 60px); }
  .gallery-next { right: calc(50% - 60px); }
}
@media (max-width: 380px) {
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 210px; }
  .gallery-card:first-child { grid-column: span 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-card img, .gallery-filter { transition: none; }
}
