/* =========================================================
   MILANDILA GALLERY PAGE
   Works with the existing styles.css from the main project.
   ========================================================= */

.gallery-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(251,233,233,.96), rgba(255,250,250,.98) 42%, rgba(255,255,255,.98));
  padding: 48px 0 74px;
}

.gallery-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(39,108,119,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39,108,119,.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  pointer-events: none;
}

.gallery-hero-grid {
  min-height: 620px;
  display: grid;
  grid-template-columns: 1fr .86fr;
  align-items: center;
  gap: 64px;
  position: relative;
}

.gallery-hero-copy {
  max-width: 650px;
  position: relative;
  z-index: 2;
}

.gallery-hero-copy h1 {
  max-width: 620px;
  margin-bottom: 18px;
  letter-spacing: -.045em;
}

.gallery-hero-copy h1 span {
  color: var(--blue);
  position: relative;
}

.gallery-hero-copy h1 span::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 0;
  height: 9px;
  bottom: 1px;
  background: rgba(244,194,194,.72);
  border-radius: 999px;
  z-index: -1;
  transform: rotate(-2deg);
}

.gallery-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.gallery-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.gallery-hero-meta span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid rgba(39,108,119,.14);
  background: rgba(255,255,255,.78);
  border-radius: 999px;
  font-size: .78rem;
  color: var(--ink-soft);
}

.gallery-hero-meta strong {
  color: var(--blue);
  font-size: .95rem;
}

.gallery-hero-visual {
  position: relative;
  z-index: 1;
  will-change: transform;
}

.gallery-hero-photo {
  margin: 0;
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  min-height: 560px;
  background: var(--ink);
  box-shadow: 0 24px 70px rgba(36,32,33,.18);
  transform: rotate(1.5deg);
}

.gallery-hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36,32,33,0) 45%, rgba(36,32,33,.72) 100%);
  pointer-events: none;
}

.gallery-hero-photo img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
  transition: transform .9s cubic-bezier(.22,1,.36,1), filter .6s ease;
}

.gallery-hero-photo:hover img {
  transform: scale(1.045);
  filter: saturate(1.05);
}

.gallery-hero-photo figcaption {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 24px;
  z-index: 2;
  color: var(--white);
}

.gallery-hero-photo figcaption span {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f9e5e6;
  margin-bottom: 5px;
}

.gallery-hero-photo figcaption strong {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  line-height: 1.1;
}

.gallery-hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(.2px);
}

.gallery-hero-orb-one {
  width: 460px;
  height: 460px;
  right: -190px;
  top: -170px;
  background: radial-gradient(circle, rgba(39,108,119,.18), rgba(39,108,119,0) 68%);
  animation: galleryFloatOne 11s ease-in-out infinite;
}

.gallery-hero-orb-two {
  width: 260px;
  height: 260px;
  left: -110px;
  bottom: -100px;
  border: 1px solid rgba(39,108,119,.13);
  animation: galleryFloatTwo 13s ease-in-out infinite;
}

@keyframes galleryFloatOne {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-18px, 24px, 0) scale(1.05); }
}

@keyframes galleryFloatTwo {
  0%, 100% { transform: translate3d(0,0,0) rotate(0); }
  50% { transform: translate3d(16px,-12px,0) rotate(12deg); }
}

/* Gallery section */
.gallery-section-head {
  margin-bottom: 28px;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 26px rgba(36,32,33,.035);
}

.gallery-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.gallery-filter {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--ink-soft);
  background: transparent;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}

.gallery-filter:hover {
  transform: translateY(-2px);
  border-color: var(--line);
  background: var(--off-white);
}

.gallery-filter.is-active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.gallery-result-count {
  margin: 0;
  white-space: nowrap;
  padding: 0 7px 0 0;
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 700;
}

.gallery-result-count span {
  color: var(--blue);
  font-size: .95rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.gallery-item {
  grid-column: span 4;
  min-width: 0;
}

.gallery-item-featured {
  grid-column: span 8;
}

.gallery-item-tall {
  grid-column: span 4;
  grid-row: span 2;
}

.gallery-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--white);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 26px rgba(36,32,33,.055);
  transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s ease, border-color .35s ease;
}

.gallery-item-featured .gallery-card {
  min-height: 420px;
}

.gallery-item-tall .gallery-card {
  min-height: 618px;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-7px);
  border-color: rgba(39,108,119,.28);
  box-shadow: 0 24px 50px rgba(36,32,33,.13);
}

.gallery-card:focus-visible {
  outline: 3px solid rgba(39,108,119,.18);
  outline-offset: 3px;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.22,1,.36,1), filter .6s ease;
}

.gallery-card:hover img,
.gallery-card:focus-visible img {
  transform: scale(1.055);
  filter: saturate(1.04);
}

.gallery-card-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px 22px 21px;
  color: var(--white);
  background: linear-gradient(180deg, transparent 0%, rgba(36,32,33,.83) 72%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.gallery-card-category {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  color: #f7dfe0;
}

.gallery-card-overlay strong {
  font-size: 1.1rem;
  line-height: 1.25;
}

.gallery-card-view {
  margin-top: 6px;
  font-size: .74rem;
  font-weight: 800;
  color: #f8f4f4;
  opacity: .88;
}

.gallery-card-view span {
  display: inline-block;
  margin-left: 3px;
  transition: transform .25s ease;
}

.gallery-card:hover .gallery-card-view span,
.gallery-card:focus-visible .gallery-card-view span {
  transform: translate(3px, -2px);
}

.gallery-item.is-hidden {
  display: none;
}

.gallery-empty {
  text-align: center;
  padding: 72px 20px;
  border: 1px dashed #d8cccf;
  border-radius: 20px;
  margin-top: 8px;
  background: var(--off-white);
}

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

.gallery-empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--pink-soft);
  color: var(--blue);
  font-size: 1.5rem;
}

.gallery-empty h3 {
  margin-bottom: 8px;
}

.gallery-empty p {
  margin: 0;
  color: var(--ink-soft);
}

/* Privacy / publishing note */
.gallery-note-section {
  padding-top: 50px;
}

.gallery-note-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.gallery-note-card h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  margin-bottom: 10px;
}

.gallery-note-card p:last-child {
  color: var(--ink-soft);
  max-width: 780px;
  margin: 0;
  font-size: .9rem;
}

.gallery-note-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--pink-soft);
  color: var(--blue);
  font-size: 1.3rem;
  flex: none;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20,18,19,.88);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .35s ease, visibility .35s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
}

.gallery-lightbox-dialog {
  position: relative;
  width: min(1160px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 40px 100px rgba(0,0,0,.35);
  transform: translateY(18px) scale(.98);
  transition: transform .45s cubic-bezier(.22,1,.36,1);
}

.gallery-lightbox.is-open .gallery-lightbox-dialog {
  transform: translateY(0) scale(1);
}

.gallery-lightbox-media {
  position: relative;
  min-height: 640px;
  background: #161415;
  display: grid;
  place-items: center;
}

.gallery-lightbox-media img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
}

.gallery-lightbox-details {
  padding: 34px 30px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gallery-lightbox-details .eyebrow {
  color: var(--blue);
}

.gallery-lightbox-details h3 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  line-height: 1.15;
  margin-bottom: 12px;
}

.gallery-lightbox-description {
  color: var(--ink-soft);
  margin: 0;
  font-size: .9rem;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  position: absolute;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(36,32,33,.56);
  color: var(--white);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform .25s ease, background .25s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
  transform: translateY(-2px);
  background: rgba(36,32,33,.82);
}

.gallery-lightbox-close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.1rem;
  z-index: 4;
}

.gallery-lightbox-nav {
  top: 50%;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 1.15rem;
  transform: translateY(-50%);
  z-index: 3;
}

.gallery-lightbox-nav:hover {
  transform: translateY(-50%) translateY(-2px);
}

.gallery-lightbox-prev { left: 16px; }
.gallery-lightbox-next { right: 16px; }

.gallery-lightbox-counter {
  display: inline-flex;
  width: fit-content;
  margin-top: 20px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--blue);
  font-size: .74rem;
  font-weight: 800;
}

/* Mobile */
@media (max-width: 980px) {
  .gallery-hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 40px;
    padding: 28px 0 10px;
  }

  .gallery-hero-copy {
    max-width: 760px;
  }

  .gallery-hero-visual {
    width: min(720px, 100%);
    margin-inline: auto;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-item,
  .gallery-item-featured,
  .gallery-item-tall {
    grid-column: span 1;
    grid-row: auto;
  }

  .gallery-item-featured .gallery-card,
  .gallery-item-tall .gallery-card {
    min-height: 340px;
  }

  .gallery-lightbox-dialog {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 28px);
  }

  .gallery-lightbox-media {
    min-height: 60vh;
    max-height: 62vh;
  }

  .gallery-lightbox-media img {
    max-height: 62vh;
  }

  .gallery-lightbox-details {
    max-height: 38vh;
    overflow: auto;
    padding: 24px 24px 26px;
  }

  .gallery-note-card {
    grid-template-columns: auto 1fr;
  }

  .gallery-note-card .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 680px) {
  .gallery-hero {
    padding-top: 28px;
  }

  .gallery-hero-grid {
    gap: 26px;
  }

  .gallery-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .gallery-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-hero-meta span:last-child {
    grid-column: 1 / -1;
  }

  .gallery-hero-photo,
  .gallery-hero-photo img {
    min-height: 420px;
  }

  .gallery-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-filters {
    gap: 6px;
  }

  .gallery-filter {
    padding: 9px 11px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .gallery-card,
  .gallery-item-featured .gallery-card,
  .gallery-item-tall .gallery-card {
    min-height: 360px;
  }

  .gallery-note-card {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .gallery-note-icon {
    width: 48px;
    height: 48px;
  }

  .gallery-note-card .btn {
    grid-column: auto;
    width: 100%;
    text-align: center;
  }

  .gallery-lightbox {
    padding: 14px;
  }

  .gallery-lightbox-dialog {
    border-radius: 18px;
  }

  .gallery-lightbox-media {
    min-height: 50vh;
    max-height: 52vh;
  }

  .gallery-lightbox-media img {
    max-height: 52vh;
  }

  .gallery-lightbox-details {
    max-height: 48vh;
  }

  .gallery-lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-prev { left: 10px; }
  .gallery-lightbox-next { right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-hero-orb-one,
  .gallery-hero-orb-two {
    animation: none !important;
  }

  .gallery-card,
  .gallery-card img,
  .gallery-hero-photo img,
  .gallery-lightbox,
  .gallery-lightbox-dialog {
    transition: none !important;
  }
}
