/* =============================================================
   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-title {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 3.158rem;        /* 60px / 19 */
  color: var(--base-dark);
  line-height: 1.15;
  text-align: center;
}

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

/* ── 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.08);
  min-width: 11rem;
  z-index: 100;
  padding: 0.421rem 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  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;
  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;
}

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

.lat-item {
  display: flex;
  flex-direction: column;
  gap: 0.947rem;              /* ~18px / 19 */
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.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: 1.158rem;        /* ~22px / 19 */
  color: var(--base-dark);
  text-align: center;
  line-height: 1.4;
  margin-top: 0.5rem;
}

/* ── 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: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0.421rem;
  line-height: 1;
  transition: opacity 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;
}

/* ── 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-header {
    flex-direction: column;
    align-items: center;
    gap: 1.263rem;
  }

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

  .lat-header .dropdown-wrapper {
    position: static;
    transform: none;
  }

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

  .lat-img-wrapper {
    height: 14rem;
  }
}

@media (max-width: 575px) {
  .lat-grid {
    grid-template-columns: 1fr;
  }

  .lat-img-wrapper {
    height: 16rem;
  }

  .lat-pagination {
    flex-direction: column;
    gap: 1.053rem;
    align-items: center;
  }

  .cs-pagination-pages {
    order: -1;
    flex-wrap: wrap;
    justify-content: center;
  }
}