/* ================================================================
   FACILITY DETAIL PAGE
   ================================================================ */
.facd-page-header {
  background: linear-gradient(135deg, var(--navy, #0d1b2a) 0%, #1a2f4a 100%);
  padding: 3.5rem 0 2.8rem;
  position: relative; overflow: hidden;
}
.facd-page-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(232,160,32,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.facd-breadcrumb a { color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.2s; }
.facd-breadcrumb a:hover { color: rgba(255,255,255,0.85); }
.facd-breadcrumb span { color: rgba(255,255,255,0.25); margin: 0 6px; }
.facd-breadcrumb .cur { color: rgba(255,255,255,0.8); }

/* Section */
.facd-section {
  background: #f3f5f8;
  padding: 3rem 0 4rem;
}
.facd-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 28px rgba(13,27,42,0.08);
}
.facd-desc-block {
  padding: 1.6rem 2rem 1.75rem;
  margin: 1.75rem 1.75rem 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5fb 100%);
  border: 1px solid rgba(13,27,42,0.07);
  position: relative;
  overflow: hidden;
}
/* Gold top accent stripe */
.facd-desc-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #c8952a 15%, #f5c842 50%, #c8952a 85%, transparent);
}
/* Subtle corner ornament */
.facd-desc-block::after {
  content: '';
  position: absolute;
  bottom: -18px; right: -18px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: rgba(13,27,42,0.035);
  pointer-events: none;
}
.facd-desc-block h2 {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.1rem; font-weight: 700; color: var(--navy, #0d1b2a);
  margin: 0 0 0.6rem; letter-spacing: 0.04em; text-transform: uppercase;
  font-size: 0.78rem;
}
.facd-desc-block p {
  font-size: 0.97rem; color: #374151; line-height: 1.85; margin: 0;
  text-align: justify;
  hyphens: auto;
  text-indent: 2.5em;
}

/* Gallery — reuse same layouts from facilities.php */
.facd-gallery { padding: 1.5rem 1.75rem 2rem; }
.facd-gallery-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #9ca3af; margin: 0 0 1rem;
}

/* ── Image layouts (identical to facilities.php) ── */
.fac-layout-1 { display: grid; grid-template-columns: 1fr; gap: 8px; }
.fac-layout-1 .fac-img-item { height: 500px; }

.fac-layout-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fac-layout-2 .fac-img-item { height: 340px; }

.fac-layout-3 { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: 420px; }
.fac-layout-3 .fac-img-item:first-child { grid-row: 1 / 3; height: 100%; }
.fac-layout-3 .fac-img-item { height: 100%; }

.fac-layout-4 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: 520px; }
.fac-layout-4 .fac-img-item { height: 100%; }

.fac-layout-5 { display: grid; grid-template-rows: 300px 200px; gap: 8px; }
.fac-layout-5-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.fac-layout-5-top .fac-img-item { height: 300px; }
.fac-layout-5-bottom { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fac-layout-5-bottom .fac-img-item { height: 200px; }

.fac-layout-many { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fac-layout-many .fac-img-item { height: 220px; }
/* First spans full width */
.fac-layout-many .fac-img-item:first-child { grid-column: 1 / 4; height: 340px; }
/* 2nd, 3rd, 4th — uniform row */
.fac-layout-many .fac-img-item:nth-child(2),
.fac-layout-many .fac-img-item:nth-child(3),
.fac-layout-many .fac-img-item:nth-child(4) { height: 220px; }

.fac-img-item {
  position: relative; border-radius: 10px;
  overflow: hidden; background: #e2eaf3; cursor: pointer;
}
.fac-img-item img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: transform 0.45s ease; }
.fac-img-item:hover img { transform: scale(1.05); }
.fac-img-overlay { position: absolute; inset: 0; background: rgba(13,27,42,0); display: flex; align-items: center; justify-content: center; transition: background 0.3s ease; }
.fac-img-item:hover .fac-img-overlay { background: rgba(13,27,42,0.32); }
.fac-img-item:hover .fac-no-image { background: linear-gradient(135deg, #f0f4f8, #e2eaf3); border-radius: 12px; height: 260px; display: flex; align-items: center; justify-content: center; font-size: 4rem; opacity: 0.3; }

/* Prev / Next navigation */
.facd-nav {
  display: flex; gap: 1rem; margin-top: 2.5rem;
  justify-content: space-between; flex-wrap: wrap;
}
.facd-nav-btn {
  display: flex; align-items: center; gap: 0.75rem;
  background: #fff; border-radius: 12px;
  padding: 0.9rem 1.4rem;
  box-shadow: 0 2px 16px rgba(13,27,42,0.08);
  text-decoration: none; color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  flex: 1; min-width: 200px; max-width: 340px;
}
.facd-nav-btn:hover { box-shadow: 0 6px 24px rgba(13,27,42,0.14); transform: translateY(-2px); }
.facd-nav-btn.next { margin-left: auto; text-align: right; flex-direction: row-reverse; }
.facd-nav-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #9ca3af; }
.facd-nav-title { font-weight: 700; font-size: 0.9rem; color: var(--navy, #0d1b2a); line-height: 1.3; margin-top: 2px; }
.facd-nav-icon { width: 36px; height: 36px; border-radius: 50%; background: #f0f2f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }

/* ── Lightbox ── */
#facLightbox { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(5,10,20,0.94); backdrop-filter: blur(8px); align-items: center; justify-content: center; padding: 1.5rem; }
#facLightbox.open { display: flex; }
.lb-inner { position: relative; max-width: 1100px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.lb-img-wrap { width: 100%; max-height: 75vh; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.lb-img-wrap img { max-width: 100%; max-height: 75vh; object-fit: contain; display: block; border-radius: 10px; transition: opacity 0.15s ease, transform 0.15s ease; }
.lb-caption { color: rgba(255,255,255,0.7); font-size: 0.85rem; text-align: center; }
.lb-counter { color: rgba(255,255,255,0.4); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; }
.lb-close { position: absolute; top: -0.25rem; right: 0; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; z-index: 10; font-size: 1.3rem; }
.lb-nav:hover { background: rgba(255,255,255,0.2); color: #fff; }
.lb-prev { left: -58px; }
.lb-next { right: -58px; }

/* Responsive */
@media (max-width: 900px) {
  .fac-layout-3 { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .fac-layout-3 .fac-img-item:first-child { grid-row: auto; height: 260px; }
  .fac-layout-3 .fac-img-item { height: 200px; }
  .fac-layout-4 { height: auto; }
  .fac-layout-4 .fac-img-item { height: 180px; }
  .fac-layout-5-top { grid-template-columns: 1fr; }
  .fac-layout-5-top .fac-img-item { height: 220px; }
  .fac-layout-many { grid-template-columns: 1fr 1fr; }
  .fac-layout-many .fac-img-item:first-child { grid-column: 1 / 3; height: 260px; }
  .fac-layout-many .fac-img-item:nth-child(2),
  .fac-layout-many .fac-img-item:nth-child(3) { height: 180px; }
  .fac-layout-many .fac-img-item:nth-child(4),
  .fac-layout-many .fac-img-item:nth-child(5) { height: 180px; }
  .lb-prev { left: 0; top: auto; bottom: -3.5rem; transform: none; }
  .lb-next { right: 0; top: auto; bottom: -3.5rem; transform: none; }
  .lb-inner { padding-bottom: 4rem; }
}
@media (max-width: 600px) {
  .fac-layout-2 { grid-template-columns: 1fr; }
  .fac-layout-2 .fac-img-item { height: 240px; }
  .fac-layout-1 .fac-img-item { height: 280px; }
  .facd-desc-block { margin: 1.25rem 0.75rem 0; padding: 1rem 1.25rem; }
  .facd-desc-block p {
    font-size: 0.93rem;
    text-align: justify !important;
    hyphens: auto !important;
    text-indent: 2em !important;
    line-height: 1.8 !important;
  }
  .facd-gallery { padding: 1.25rem 1rem 1.75rem; }
  .facd-nav-btn { max-width: 100%; }
}