*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --leaf: #2f6f4e;
  --leaf-dark: #17452f;
  --moss: #8aa46b;
  --ink: #1d2a22;
  --muted: #647066;
  --line: rgba(29, 42, 34, 0.14);
  --bg-light: #f8f9fa;
  --bg-dark-subtle: #f2f4f2;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--ink);
  background-color: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header & Back Button */
.facility-header {
  padding: 40px 20px 20px;
  max-width: 1000px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--leaf);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: color 0.2s ease;
  margin-bottom: 24px;
}

.back-link:hover {
  color: var(--leaf-dark);
}

.header-title-group h1 {
  font-family: 'Song Myung', serif;
  font-size: clamp(28px, 4vw, 36px);
  color: var(--leaf-dark);
  margin: 0 0 8px 0;
  font-weight: 800;
}

.header-title-group p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

/* Sections General */
.facility-section {
  padding: 80px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.facility-section:nth-of-type(even) {
  background-color: var(--bg-light);
  max-width: 100%;
}

.facility-section-content {
  max-width: 1000px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(20px, 3vw, 24px);
  color: var(--leaf-dark);
  margin: 0 0 32px 0;
  font-weight: 800;
  border-left: 4px solid var(--leaf);
  padding-left: 12px;
}

/* Section 1: History / Timeline */
.timeline {
  position: relative;
  padding: 10px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--line);
}

.timeline-item {
  position: relative;
  padding-left: 40px;
  margin-bottom: 30px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-badge {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--leaf);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px var(--leaf);
}

.timeline-date {
  font-weight: 800;
  color: var(--leaf);
  font-size: 15px;
  margin-bottom: 4px;
}

.timeline-text {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

/* Section 2: Environment Info */
.info-intro {
  margin-bottom: 40px;
}

.info-intro ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
}

.info-intro li {
  font-size: 16px;
}

.info-intro strong {
  color: var(--leaf-dark);
  font-weight: 700;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.gallery-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(44, 63, 51, 0.08);
}

.gallery-img-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #e9ecef;
  overflow: hidden;
  position: relative;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-label {
  padding: 16px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  background-color: #ffffff;
  border-top: 1px solid var(--line);
}

/* Section 3: Operating Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #ffffff;
}

.facility-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
}

.facility-table th, 
.facility-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.facility-table th {
  background-color: #f8f9fa;
  color: var(--leaf-dark);
  font-weight: 700;
}

.facility-table tr:last-child td {
  border-bottom: none;
}

.highlight-num {
  font-weight: 700;
  color: var(--leaf);
}

/* Table Responsive: Transform to Cards on Mobile */
@media (max-width: 768px) {
  .table-wrapper {
    border: none;
    background: transparent;
  }
  
  .facility-table, 
  .facility-table tbody, 
  .facility-table tr, 
  .facility-table td {
    display: block;
    width: 100%;
  }
  
  .facility-table thead {
    display: none;
  }
  
  .facility-table tr {
    background-color: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.01);
  }
  
  .facility-table td {
    text-align: right;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    position: relative;
  }
  
  .facility-table td:last-child {
    border-bottom: none;
  }
  
  .facility-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: 700;
    color: var(--muted);
  }
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: rgba(29, 42, 34, 0.9);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  margin-top: 16px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #ffffff;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.2s ease;
}

.lightbox-close:hover {
  color: var(--moss);
}

/* Footer Section styling for facility page */
.facility-footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--line);
  background-color: var(--bg-light);
  color: var(--muted);
  font-size: 14px;
}
