/* =========================================================
   NEWS UI (clean rewrite)
   - Works with Bootstrap
   - Includes: News List Cards + Coming Soon + News Detail + Gallery
   ========================================================= */

/* ---------- Base helpers ---------- */
:root{
  --news-primary: #2b78c5;
  --news-accent: #e56b2d;
  --news-text: #111;
  --news-muted: #777;
  --news-border: #eee;
  --news-soft: #f7f7f7;
  --news-shadow: 0 10px 25px rgba(0,0,0,.05);
  --news-shadow-hover: 0 16px 35px rgba(0,0,0,.10);
  --news-radius: 14px;
}

.news-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background:#fff;
  color:#333;
  text-decoration:none;
  transition: .2s ease;
}
.news-btn:hover{ background: var(--news-soft); color:#333; }

.news-btn--primary{
  background: var(--news-primary);
  border-color: var(--news-primary);
  color:#fff;
  font-weight: 800;
}
.news-btn--primary:hover{ opacity:.92; color:#fff; }

.news-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.20);
  color:#fff;
  backdrop-filter: blur(6px);
}

/* =========================================================
   1) NEWS LIST (Cards grid + Coming Soon)
   Usage:
     <div class="news-list">
       <div class="news-grid"> ...cards... </div>
     </div>
   ========================================================= */
.news-list{
  padding: 10px 0 40px;
}
.news-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 991px){
  .news-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px){
  .news-grid{ grid-template-columns: 1fr; }
}

/* Card */
.news-card{
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius);
  overflow: hidden;
  background:#fff;
  box-shadow: var(--news-shadow);
  transition: all .25s ease;
  display:flex;
  flex-direction: column;
  height:100%;
}
.news-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--news-shadow-hover);
}

.news-card__thumb{
  position: relative;
  height: 200px;             /* ปรับได้ */
  background:#f3f3f3;
  overflow:hidden;
}
.news-card__thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.news-card__badge{
  position:absolute;
  top:12px;
  left:12px;
}

.news-card__body{
  padding: 14px 16px 12px;
  flex:1;
  display:flex;
  flex-direction: column;
}
.news-card__meta{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  font-size: 13px;
  color: var(--news-muted);
}
.news-card__meta i{ color:#999; }

.news-card__title{
  margin: 10px 0 8px;
  font-size: 18px;
  font-weight: 900;
  color: var(--news-text);
  line-height: 1.35;

  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}
.news-card__excerpt{
  margin:0;
  font-size: 14px;
  color:#666;
  line-height: 1.7;

  display:-webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.news-card__footer{
  margin-top:auto;
  padding: 12px 16px 16px;
  border-top: 1px solid #f2f2f2;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* Coming Soon card (in grid) */
.news-card--coming{
  border: none;
  color:#fff;
  background:
    radial-gradient(1200px 300px at 10% 0%, rgba(255,255,255,.18), transparent 55%),
    radial-gradient(900px 260px at 90% 10%, rgba(255,255,255,.12), transparent 55%),
    linear-gradient(135deg, #111 0%, #2a2a2a 45%, #111 100%);
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.news-card--coming .news-card__body{ padding: 18px; }
.news-card--coming .news-card__meta{ color: rgba(255,255,255,.75); }
.news-card--coming .news-card__title{ color:#fff; }
.news-card--coming .news-card__excerpt{ color: rgba(255,255,255,.82); }
.news-card--coming .news-card__footer{
  border-top: 1px solid rgba(255,255,255,.12);
}

/* chips in coming soon */
.news-coming__chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 12px;
}
.news-coming__chips span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.85);
  font-size: 13px;
}

/* =========================================================
   2) NEWS DETAIL (Read page)
   Usage:
     <article class="nd">
       <div class="nd__hero">...</div>
       <div class="nd__body">...</div>
       <div class="nd__bottom">...</div>
     </article>
   ========================================================= */
.nd-wrap{ padding: 26px 0 80px; }
.nd-breadcrumb{
  font-size: 13px;
  color:#8a8a8a;
  margin-bottom: 12px;
}
.nd-breadcrumb a{
  color: var(--news-primary);
  text-decoration:none;
}
.nd-breadcrumb a:hover{ text-decoration: underline; }

.nd{
  border: 1px solid var(--news-border);
  border-radius: 16px;
  overflow:hidden;
  background:#fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

/* hero */
.nd__hero{
  position: relative;
  height: 430px;
  background:#f2f2f2;
}
.nd__hero img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.nd__hero::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to top, rgba(0,0,0,.70) 0%, rgba(0,0,0,.18) 55%, rgba(0,0,0,0) 100%);
}
.nd__heroContent{
  position:absolute;
  left:22px;
  right:22px;
  bottom:18px;
  z-index: 2;
  color:#fff;
}
.nd__title{
  margin: 10px 0 10px;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
}
.nd__meta{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  font-size: 13px;
  color: rgba(255,255,255,.88);
}
.nd__meta i{ color: rgba(255,255,255,.88); }

/* body text */
.nd__body{
  padding: 22px;
  border-top: 1px solid #f1f1f1;
}
.nd__prose{
  max-width: 760px;
  font-size: 16px;
  line-height: 1.95;
  color:#333;
}
.nd__prose p{ margin: 0 0 14px; }
.nd__prose ul{ margin: 0 0 14px 18px; }
.nd__prose li{ margin: 6px 0; }

.nd__lead{
  font-size: 17px;
  color:#222;
  line-height: 1.9;
  padding: 12px 14px;
  border-radius: 12px;
  background:#f7fbff;
  border: 1px solid #e8f2ff;
  margin-bottom: 14px;
}

/* inline images */
.nd__figure{ margin: 18px 0; }
.nd__figure img{
  width:100%;
  border-radius: 14px;
  border: 1px solid var(--news-border);
  display:block;
}
.nd__caption{
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--news-muted);
}
.nd__two{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* bottom actions */
.nd__bottom{
  padding: 16px 22px 22px;
  border-top: 1px solid #f1f1f1;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content: space-between;
  align-items:center;
}
.nd__actions{ display:flex; gap:10px; flex-wrap:wrap; }
.nd__share{ display:flex; gap:8px; flex-wrap:wrap; }

/* =========================================================
   3) GALLERY (Masonry + Lightbox trigger)
   Usage:
     <div class="ndg">
       <div class="ndg__grid">
         <div class="ndg__item" data-img="..." data-caption="..."><img ...></div>
       </div>
     </div>
   ========================================================= */
.ndg{
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f1f1f1;
}
.ndg__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom: 12px;
}
.ndg__title{
  margin:0;
  font-size: 16px;
  font-weight: 900;
  color: var(--news-text);
}
.ndg__note{
  margin:0;
  font-size: 13px;
  color: var(--news-muted);
}

/* Masonry columns */
.ndg__grid{
  column-count: 3;
  column-gap: 12px;
}
@media (max-width: 991px){ .ndg__grid{ column-count: 2; } }
@media (max-width: 575px){ .ndg__grid{ column-count: 1; } }

.ndg__item{
  break-inside: avoid;
  margin: 0 0 12px;
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid var(--news-border);
  background:#f2f2f2;
  cursor:pointer;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.ndg__item:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0,0,0,.10);
}
.ndg__item img{
  width:100%;
  height:auto;
  display:block;
}
.ndg__item::after{
  content:"\f00e"; /* fa-search-plus */
  font-family: FontAwesome;
  position:absolute;
  right:10px;
  bottom:10px;
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
  background: rgba(0,0,0,.55);
  color:#fff;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
}

/* =========================================================
   4) SIDEBAR (Related)
   Usage: wrap in .nd-side
   ========================================================= */
.nd-side .side-card{
  border: 1px solid var(--news-border);
  border-radius: 16px;
  overflow:hidden;
  background:#fff;
  box-shadow: 0 10px 25px rgba(0,0,0,.04);
  margin-bottom: 16px;
}
.nd-side .side-head{
  padding: 14px 16px;
  border-bottom: 1px solid #f1f1f1;
  font-weight: 900;
  color: var(--news-text);
}
.nd-side .side-body{ padding: 14px 16px; }

.nd-rel{
  display:flex;
  gap:10px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f3f3;
  text-decoration:none;
}
.nd-rel:last-child{ border-bottom:none; }
.nd-rel__thumb{
  width: 84px;
  height: 62px;
  border-radius: 12px;
  overflow:hidden;
  background:#f2f2f2;
  flex:0 0 auto;
}
.nd-rel__thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.nd-rel__title{
  margin:0 0 6px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--news-text);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.nd-rel__meta{ margin:0; font-size:12px; color: var(--news-muted); }

/* Responsive */
@media (max-width: 767px){
  .nd__hero{ height: 260px; }
  .nd__title{ font-size: 22px; }
  .nd__body{ padding: 18px; }
  .nd__two{ grid-template-columns: 1fr; }
}

/* ===== Detail page: make it not full width + nicer spacing ===== */
.nd-wrap{
  padding: 22px 0 70px;
}

/* จำกัดความกว้างของหน้าอ่านข่าวให้สวย (ไม่เต็มจอ) */
.nd-shell{
  max-width: 980px;          /* ปรับได้: 920 / 980 / 1040 */
  margin: 0 auto;
}

/* ใช้ full width ภายใน shell (เพราะเราจะไม่ใช้ sidebar แล้ว) */
.nd-main{
  float: none;
  margin: 0 auto;
}

/* ทำการ์ดดูนุ่มขึ้น */
.nd{
  border-radius: 18px;
}

/* Hero ไม่ให้สูงเกินไป และ responsive */
.nd__hero{
  height: 360px;
  border-radius: 18px;
}
@media (max-width: 991px){
  .nd-shell{ max-width: 900px; }
  .nd__hero{ height: 300px; }
}
@media (max-width: 767px){
  .nd-wrap{ padding: 18px 0 55px; }
  .nd-shell{ max-width: 100%; padding: 0 12px; }
  .nd__hero{ height: 230px; }
  .nd__title{ font-size: 20px; }
  .nd__heroContent{ left: 16px; right: 16px; bottom: 14px; }
  .nd__body{ padding: 16px; }
  .nd__bottom{ padding: 14px 16px 16px; }
}

/* ทำให้เนื้อหาอ่านง่ายขึ้น */
.nd__prose{
  max-width: 720px;          /* บีบให้ไม่กว้างเกินไป */
}

/* Gallery spacing */
.ndg__grid{ column-gap: 14px; }
.ndg__item{ border-radius: 16px; }

/* Modal caption */
#ndModalCap{
  color:#fff;
  font-weight: 700;
  padding: 10px 14px;
  background: rgba(0,0,0,.55);
}

/* ===== FORCE FINAL NEWS CARD (put at very bottom) ===== */
#news .news-card{ border:1px solid #eee; border-radius:14px; overflow:hidden; background:#fff; box-shadow:0 10px 25px rgba(0,0,0,.05); transition:.25s; }
#news .news-card:hover{ transform:translateY(-4px); box-shadow:0 16px 35px rgba(0,0,0,.10); }

#news .news-thumb{ position:relative; height:190px; overflow:hidden; background:#f3f3f3; }
#news .news-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }

#news .news-badge{ position:absolute; top:12px; left:12px; padding:6px 10px; border-radius:999px;
  background:rgba(0,0,0,.60); color:#fff; font-size:12px; border:1px solid rgba(255,255,255,.20); }

#news .news-body{ padding:14px 16px 12px; }
#news .news-meta{ font-size:13px; color:#777; display:flex; gap:12px; flex-wrap:wrap; }
#news .news-title{ margin:10px 0 8px; font-size:18px; font-weight:800; color:#111; line-height:1.35; }
#news .news-excerpt{ margin:0; color:#666; font-size:14px; line-height:1.7; }
#news .news-footer{ padding:12px 16px 16px; border-top:1px solid #f2f2f2; }

#news .news-card.coming{
  color:#fff; border:none;
  background:
    radial-gradient(1200px 300px at 10% 0%, rgba(255,255,255,.18), transparent 55%),
    radial-gradient(900px 260px at 90% 10%, rgba(255,255,255,.12), transparent 55%),
    linear-gradient(135deg, #111 0%, #2a2a2a 45%, #111 100%);
}
#news .news-card.coming .news-title,
#news .news-card.coming .news-meta{ color:#fff; }
#news .news-card.coming .news-excerpt{ color:rgba(255,255,255,.82); }
#news .news-card.coming .btn.btn-primary{ background:#fff; color:#111; border:none; font-weight:800; }
#news .news-card.coming .btn.btn-default{ background:transparent; color:#fff; border:1px solid rgba(255,255,255,.35); }
#news .news-card.coming .btn.btn-default:hover{ background:rgba(255,255,255,.10); }

