/**
 * Photo gallery listing — Nuxt /gallery parity.
 */

body.page-template-page-gallery-php,
body.page-template-page-gallery {
  background: #fff !important;
}

body.page-template-page-gallery-php .site-main--content .artek-content-entry::before,
body.page-template-page-gallery .site-main--content .artek-content-entry::before,
body.page-template-page-gallery-php .site-main--inner > .entry::before,
body.page-template-page-gallery .site-main--inner > .entry::before {
  background: #fff !important;
}

.artek-gallery-page {
  --artek-gallery-base: #001330;
  --artek-gallery-faint: #808997;
  --artek-gallery-accent: #ee712b;
  --artek-gallery-gradient: linear-gradient(226deg, #d80960 0%, #fec200 100%);
  --artek-gallery-shadow: drop-shadow(0 20px 13px rgba(0, 0, 0, 0.03)) drop-shadow(0 8px 5px rgba(0, 0, 0, 0.08));

  position: relative;
  z-index: 4;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0 0 var(--artek-content-footer-clearance, 5rem);
  color: var(--artek-gallery-base);
  background: #fff;
}

.artek-gallery-page *,
.artek-gallery-page *::before,
.artek-gallery-page *::after {
  box-sizing: border-box;
}

.artek-gallery-page__filters {
  width: min(100% - 2.5rem, 87.5rem);
  margin: 0 auto 2rem;
}

@media (min-width: 768px) {
  body.page-template-page-gallery-php .artek-page-title,
  body.page-template-page-gallery .artek-page-title {
    margin-bottom: 5rem;
  }
}

.artek-gallery-page__list-wrap {
  width: min(100% - 2.5rem, 87.5rem);
  margin: 0 auto;
}

.artek-gallery-page__empty {
  margin: 2rem 0 0;
  color: var(--artek-gallery-faint);
  font-family: "Lato-Medium", Lato, sans-serif;
  font-size: 1.5rem;
  line-height: 1.3;
  text-align: center;
}

.artek-gallery-page__empty[hidden] {
  display: none !important;
}

.artek-gallery-page__list {
  display: block;
  margin-top: 2rem;
}

.artek-gallery-page__block {
  display: block;
  margin-bottom: 3rem;
}

.artek-gallery-page__item {
  display: block;
  margin-bottom: 3rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.artek-gallery-page__item:hover,
.artek-gallery-page__item:focus-visible {
  outline: none;
}

.artek-gallery-page__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 0;
  background: #001330;
}

.artek-gallery-page__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.artek-gallery-page__item:hover .artek-gallery-page__image,
.artek-gallery-page__item:focus-visible .artek-gallery-page__image {
  transform: scale(1.25);
}

.artek-gallery-page__title {
  display: block;
  margin: 1.5rem 0 0;
  color: var(--artek-gallery-base);
  font-family: "Lato-Bold", Lato, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.artek-gallery-page__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.artek-gallery-page__date {
  font-family: "Lato-Medium", Lato, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  color: #d6617d;
  background-image: var(--artek-gallery-gradient);
  background-size: contain;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.artek-gallery-page__count {
  color: var(--artek-gallery-faint);
  font-family: "Lato-Medium", Lato, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
}

.artek-gallery-page__year-nav {
  display: none;
  width: min(100% - 2.5rem, 87.5rem);
  margin: 4rem auto 0;
  justify-content: space-between;
  align-items: center;
}

.artek-gallery-page__year-nav-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 7rem;
  height: 7rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--artek-gallery-base);
  font-family: "Lato-Medium", Lato, sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  filter: none;
  box-shadow: none;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.artek-gallery-page__year-nav-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background-image: var(--artek-gallery-gradient);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.artek-gallery-page__year-nav-btn > * {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.artek-gallery-page__year-nav-btn:hover,
.artek-gallery-page__year-nav-btn:focus-visible {
  color: #fff;
  outline: none;
  filter: var(--artek-gallery-shadow);
}

.artek-gallery-page__year-nav-btn:hover::after,
.artek-gallery-page__year-nav-btn:focus-visible::after {
  transform: scale(1);
}

.artek-gallery-page__year-nav-btn.is-disabled,
.artek-gallery-page__year-nav-btn:disabled {
  opacity: 0.5;
  cursor: default;
  filter: none;
}

.artek-gallery-page__year-nav-btn.is-disabled:hover,
.artek-gallery-page__year-nav-btn:disabled:hover,
.artek-gallery-page__year-nav-btn.is-disabled:focus-visible,
.artek-gallery-page__year-nav-btn:disabled:focus-visible {
  color: var(--artek-gallery-base);
  filter: none;
}

.artek-gallery-page__year-nav-btn.is-disabled:hover::after,
.artek-gallery-page__year-nav-btn:disabled:hover::after,
.artek-gallery-page__year-nav-btn.is-disabled:focus-visible::after,
.artek-gallery-page__year-nav-btn:disabled:focus-visible::after {
  transform: scale(0);
}

.artek-gallery-page__sentinel {
  height: 1px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.artek-gallery-page__loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem auto 0;
  color: var(--artek-gallery-faint);
}

.artek-gallery-page__loader[hidden] {
  display: none !important;
}

.artek-gallery-page__loader-spin {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  animation: artek-gallery-loader-spin 0.8s linear infinite;
}

.artek-gallery-page__loader-spin svg {
  width: 100%;
  height: 100%;
}

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

@media (min-width: 768px) {
  .artek-gallery-page__list {
    margin-top: 5rem;
  }

  /*
   * Mosaic: Nuxt PhotoGallerySection parity.
   * 8×2 grid, grid-area placement, container ≈ 2:1 → cells ≈ square.
   * Media fills the cell (h-full + object-cover on live); title/meta overflow
   * below into md:mb-44.
   */
  .artek-gallery-page__block {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 11rem; /* md:mb-44 */
    aspect-ratio: 2 / 1;
    width: 100%;
    min-height: 0;
    height: auto;
    align-items: stretch;
  }

  .artek-gallery-page__item {
    display: block;
    height: 100%;
    margin-bottom: 0;
    min-width: 0;
    overflow: visible;
  }

  .artek-gallery-page__media {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 0;
  }

  .artek-gallery-page__title {
    margin-top: 1.5rem;
  }

  .artek-gallery-page__block--first > .artek-gallery-page__item:first-child {
    grid-area: 2 / 1 / 3 / 3;
  }

  .artek-gallery-page__block--first > .artek-gallery-page__item:nth-child(2) {
    grid-area: 1 / 3 / 3 / 7;
  }

  .artek-gallery-page__block--first > .artek-gallery-page__item:nth-child(3) {
    grid-area: 1 / 7 / 2 / 9;
  }

  .artek-gallery-page__block--second > .artek-gallery-page__item:first-child {
    grid-area: 1 / 1 / 2 / 3;
  }

  .artek-gallery-page__block--second > .artek-gallery-page__item:nth-child(2) {
    grid-area: 2 / 3 / 3 / 5;
  }

  .artek-gallery-page__block--second > .artek-gallery-page__item:nth-child(3) {
    grid-area: 1 / 5 / 3 / 9;
  }

  .artek-gallery-page__block--third > .artek-gallery-page__item:first-child {
    grid-area: 1 / 1 / 3 / 5;
  }

  .artek-gallery-page__block--third > .artek-gallery-page__item:nth-child(2) {
    grid-area: 2 / 5 / 3 / 7;
  }

  .artek-gallery-page__block--third > .artek-gallery-page__item:nth-child(3) {
    grid-area: 1 / 7 / 2 / 9;
  }

  .artek-gallery-page__year-nav {
    display: flex;
  }

  .artek-gallery-page__empty {
    margin-top: 5rem;
    font-size: 2.25rem;
  }
}
