/* =========================================================
   Detail Pages / Gallery / Lightbox
   ใช้กับ: news_detail.php, announcement_detail.php, gallery_album.php
========================================================= */

.detail-page{
  width:min(1180px,94%);
  margin:0 auto;
  padding:92px 0 70px;
}

.detail-card{
  max-width:980px;
  margin:auto;
  background:#fff;
  border-radius:26px;
  overflow:hidden;
  border:1px solid rgba(123,0,28,.08);
  box-shadow:0 22px 60px rgba(20,35,70,.12);
}

.detail-image{
  width:100%;
  padding:0;
  margin:0;
  background:transparent;
  text-align:center;
}

.detail-image img{
  width:100%;
  max-width:none;
  height:auto;
  display:block;
  margin:0;
  border-radius:0;
  object-fit:cover;
}

.detail-body{
  padding:50px;
}

.detail-date{
  color:#8a8f98;
  font-size:15px;
  margin-bottom:15px;
}

.detail-body h1{
  margin:0 0 30px;
  color:#8b001f;
  font-size:42px;
  line-height:1.35;
  font-weight:900;
}

.detail-content{
  font-size:19px;
  line-height:2;
  color:#444;
  white-space:pre-line;
}

.detail-footer{
  margin-top:45px;
  text-align:center;
}

.detail-footer .btn-main{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:12px 28px;
  border-radius:999px;
  background:linear-gradient(135deg,#8b001f,#b00030);
  color:#fff;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 10px 22px rgba(139,0,31,.22);
}

.detail-footer .btn-main:hover{
  color:#fff;
  transform:translateY(-1px);
  box-shadow:0 14px 28px rgba(139,0,31,.30);
}

/* ==============================
   Announcement Gallery
============================== */

.announcement-gallery{
  padding:28px 28px 0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:20px;
  margin:0;
}

.announcement-gallery img{
  width:100%;
  height:280px;
  object-fit:cover;
  display:block;
  border-radius:18px;
  cursor:pointer;
  background:#eef5fb;
  box-shadow:0 12px 30px rgba(20,35,70,.12);
  transition:transform .3s ease, box-shadow .3s ease;
}

.announcement-gallery img:hover{
  transform:translateY(-4px);
  box-shadow:0 16px 36px rgba(20,35,70,.18);
}

.announcement-card-image{
  width:100%;
  height:220px;
  overflow:hidden;
  border-radius:18px;
  margin-bottom:18px;
}

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

/* ==============================
   Gallery Album Detail
============================== */

.gallery-album-page{
  padding-top:100px;
}

.gallery-album-card{
  max-width:1180px;
}

.album-subtitle{
  text-align:center;
  color:#666;
  font-size:18px;
  margin:-20px 0 35px;
}

.album-photo-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:22px;
}

.album-photo{
  position:relative;
  border:0;
  padding:0;
  height:220px;
  border-radius:18px;
  overflow:hidden;
  background:#eef5fb;
  cursor:pointer;
  box-shadow:0 8px 22px rgba(0,0,0,.08);
}

.album-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .35s ease;
}

.album-photo:hover img{
  transform:scale(1.08);
}

.album-photo span{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:14px 16px;
  color:#fff;
  font-size:16px;
  font-weight:700;
  text-align:left;
  background:linear-gradient(to top,rgba(0,0,0,.65),transparent);
}

.btn-gallery-back{
  margin-left:12px;
  background:#0d4f91;
}

/* ==============================
   Modern Image Lightbox
============================== */

body.lightbox-open{
  overflow:hidden;
}

.image-lightbox,
.lightbox{
  position:fixed !important;
  inset:0 !important;
  width:100vw !important;
  height:100vh !important;
  background:rgba(0,0,0,.82) !important;
  display:none !important;
  align-items:center !important;
  justify-content:center !important;
  padding:24px !important;
  z-index:999999 !important;
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
}

.image-lightbox.show,
.lightbox.show{
  display:flex !important;
}

.image-lightbox img,
.lightbox img{
  max-width:min(92vw,1100px) !important;
  max-height:88vh !important;
  width:auto !important;
  height:auto !important;
  object-fit:contain !important;
  border-radius:18px !important;
  background:#fff !important;
  box-shadow:0 24px 70px rgba(0,0,0,.50) !important;
  animation:lightboxZoom .18s ease-out;
}

@keyframes lightboxZoom{
  from{transform:scale(.96); opacity:.65;}
  to{transform:scale(1); opacity:1;}
}

.lightbox-close{
  position:absolute !important;
  top:22px !important;
  right:24px !important;
  width:56px !important;
  height:56px !important;
  border:0 !important;
  border-radius:50% !important;
  background:rgba(255,255,255,.95) !important;
  color:#7b001c !important;
  font-size:36px !important;
  line-height:1 !important;
  cursor:pointer !important;
  z-index:1000000 !important;
  box-shadow:0 12px 30px rgba(0,0,0,.28) !important;
  transition:transform .22s ease, background .22s ease, color .22s ease !important;
}

.lightbox-close:hover{
  background:#7b001c !important;
  color:#fff !important;
  transform:scale(1.08) !important;
}

.lightbox-arrow{
  position:absolute !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  width:64px !important;
  height:64px !important;
  border:0 !important;
  border-radius:50% !important;
  background:rgba(255,255,255,.95) !important;
  color:#7b001c !important;
  font-size:44px !important;
  line-height:1 !important;
  font-weight:800 !important;
  cursor:pointer !important;
  z-index:1000000 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow:0 12px 30px rgba(0,0,0,.28) !important;
  transition:transform .22s ease, background .22s ease, color .22s ease !important;
}

.lightbox-arrow:hover{
  background:#7b001c !important;
  color:#fff !important;
  transform:translateY(-50%) scale(1.12) !important;
}

.lightbox-prev{
  left:32px !important;
}

.lightbox-next{
  right:32px !important;
}

.lightbox-counter{
  position:absolute !important;
  bottom:24px !important;
  left:50% !important;
  transform:translateX(-50%) !important;
  padding:8px 18px !important;
  border-radius:999px !important;
  background:rgba(0,0,0,.68) !important;
  color:#fff !important;
  font-size:15px !important;
  font-weight:700 !important;
  z-index:1000000 !important;
  box-shadow:0 8px 22px rgba(0,0,0,.22) !important;
}

@media(max-width:700px){
  .image-lightbox,
  .lightbox{
    padding:14px !important;
  }

  .image-lightbox img,
  .lightbox img{
    max-width:94vw !important;
    max-height:82vh !important;
    border-radius:14px !important;
  }

  .lightbox-close{
    top:14px !important;
    right:14px !important;
    width:46px !important;
    height:46px !important;
    font-size:32px !important;
  }

  .lightbox-arrow{
    width:46px !important;
    height:46px !important;
    font-size:34px !important;
    background:rgba(255,255,255,.92) !important;
  }

  .lightbox-prev{
    left:10px !important;
  }

  .lightbox-next{
    right:10px !important;
  }

  .lightbox-counter{
    bottom:14px !important;
    font-size:13px !important;
    padding:7px 14px !important;
  }
}

/* ==============================
   Responsive
============================== */

@media(max-width:900px){
  .detail-page{
    padding:50px 0;
  }

  .detail-body{
    padding:28px;
  }

  .detail-body h1{
    font-size:30px;
  }

  .detail-content{
    font-size:17px;
    line-height:1.9;
  }

  .gallery-album-page{
    padding-top:60px;
  }

  .album-photo-grid{
    grid-template-columns:1fr 1fr;
    gap:14px;
  }

  .album-photo{
    height:165px;
    border-radius:14px;
  }

  .detail-footer{
    display:flex;
    flex-direction:column;
    gap:12px;
  }

  .btn-gallery-back{
    margin-left:0;
  }
}

@media(max-width:760px){
  .announcement-gallery{
    grid-template-columns:1fr;
    padding:18px 18px 0;
  }

  .announcement-gallery img{
    height:230px;
  }
}
