/* =============================================================
   life-at-tis.css — Life @ TIS gallery page styles
   Base: 19px → scaled via global.css media queries
   Design: Figma node 740-2832 "Life @ TIS"
   Reuses: cs-pagination-* classes from global.css
   ============================================================= */

/* ── 1. Page Section ─────────────────────────────────────── */

.lat-section {
  padding-top: 9.474rem;   /* ~180px / 19 — clears navbar */
  padding-bottom: 5.263rem;
  /* background-color: var(--bg-white); */
}

/* .lat-container {
  padding-top: 5.4rem;
} */

/* ── 2. Header Row ───────────────────────────────────────── */

.lat-section .ct-info-header,
.lat-section .lat-header {
  position: relative;
  z-index: 100;
}

.lat-title {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 3.75rem;        /* 60px / 19 */
  color: var(--base-dark);
  line-height: 1.15;
  text-align: center;
}

/* Dropdown pinned to the right of the header bar */
.lat-section .dropdown-wrapper,
.lat-header .dropdown-wrapper {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}

.lat-section .dropdown-wrapper.open,
.lat-header .dropdown-wrapper.open {
  z-index: 101;
}

/* ── 3. Dropdown ─────────────────────────────────────────── */

.lat-section .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  border: 0.053rem solid #d9d9d9;
  border-radius: 1.579rem;
  padding: 0 1.263rem;
  height: 2.474rem;           /* ~47px / 19 */
  min-width: 5.947rem;        /* ~113px / 19 */
  font-family: var(--font-primary);
  font-size: 0.842rem;
  font-weight: 400;
  color: var(--base-dark);
  background-color: var(--bg-white);
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 0.526rem;
}

.lat-section .dropdown-toggle:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 2px 8px rgba(8, 75, 129, 0.05);
}

.lat-section .dropdown-arrow {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.lat-section .dropdown-wrapper.open .dropdown-arrow {
  transform: rotate(180deg);
}

.lat-section .dropdown-menu {
  position: absolute;
  top: 115%;
  right: 0;
  background-color: var(--bg-white);
  border: 0.053rem solid #e8e8ea;
  border-radius: 0.526rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 11rem;
  max-height: 16rem;
  overflow-y: auto;
  z-index: 1000;
  padding: 0.421rem 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lat-section .dropdown-wrapper.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lat-section .dropdown-item {
  font-family: var(--font-primary);
  font-size: 0.842rem;
  color: var(--text-sub);
  padding: 0.526rem 1.053rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lat-section .dropdown-item:hover {
  background-color: rgba(8, 75, 129, 0.06);
  color: var(--primary-blue);
}

.lat-section .dropdown-item.active {
  background-color: rgba(8, 75, 129, 0.1);
  color: var(--primary-blue);
  font-weight: 500;
}

/* ── 4. Photo Grid ───────────────────────────────────────── */

.lat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.947rem;              /* ~18px / 19 — matches Figma gap */
  margin-bottom: 4.211rem;    /* ~80px / 19 */
  transition: opacity 0.3s ease;
  margin-top:6.88rem;
  row-gap: 3.1758rem;
}

/* ── 5. Gallery Item ─────────────────────────────────────── */

.lat-item {
  display: flex;
  flex-direction: column;
  gap: 0.947rem;              /* ~18px / 19 */
  transition: opacity 0.3s ease, transform 0.3s ease;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

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

/* Image wrapper */
.lat-img-wrapper {
  width: 100%;
  height: 20.579rem;          /* ~391px / 19 */
  overflow: hidden;
  background-color: #d9d9d9;
  position: relative;
}

.lat-img-placeholder {
  background-color: #d9d9d9;
}

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

.lat-item:hover .lat-img {
  transform: scale(1.05);
}

/* Caption */
.lat-caption {
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 1rem;        /* ~22px / 19 */
  color: var(--base-dark);
  text-align: center;
  line-height: 1.4;
  margin-top: 0.5rem;
}

/* Expand button on photo items */
.lat-expand-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lat-expand-btn:hover {
  background-color: rgba(0, 0, 0, 0.85);
  transform: scale(1.05);
}

.lat-expand-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}


/* ── 6. Lightbox overlay ─────────────────────────────────── */

.lat-lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 2rem;
}

.lat-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lat-lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lat-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.421rem;
}

.lat-lightbox-caption {
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 1rem;
  color: #ffffff;
  text-align: center;
  margin-top: 1rem;
}

.lat-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lat-lightbox-close:hover {
  opacity: 0.7;
}

/* ── 7. Pagination ───────────────────────────────────────── */

/* Reuse cs-pagination-* classes from global.css */
.lat-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.053rem;
  border-top: 0.053rem solid #eaecf0;
}

body.dark-theme .lat-pagination {
  border-top: 0.053rem solid var(--border-gray);
}

/* ── 8. Responsive ───────────────────────────────────────── */

@media (max-width: 1200px) {
  .lat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .lat-section {
    padding-top: 7.5rem;
    padding-bottom: 4rem;
  }

  .lat-section .ct-info-header,
  .lat-header {
    flex-direction: column;
    align-items: center;
    gap: 1.263rem;
  }

  .lat-title {
    font-size: 2.316rem;
  }

  /* .lat-section .dropdown-wrapper,
  .lat-header .dropdown-wrapper {
    position: static;
    transform: none;
  } */

  .lat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.842rem;
  }

}

@media (max-width: 575px) {
  .lat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .lat-item {
    min-width: 0;
    width: 100%;
  }


  .lat-pagination {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }

  .cs-pagination-pages {
    order: -1;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .lat-img-wrapper {
    width: 24.565rem;
    height: 30.1rem;
  }
}