/* =========================================================
   NEWS DETAIL – FULL CSS (includes Gallery Lightbox)
   - Hero: Text left, Image right
   - Click image opens Gallery-style Lightbox
========================================================= */

.news-detail{
  background:#fff;
  direction: rtl;
}

/* outer */
.news-container{
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 10px;
  box-sizing: border-box;
}

/* HERO layout */
.news-hero{
  direction: ltr; /* text left, image right */
  display: grid;
  justify-content: center;
  margin-top: 10px;
  margin-inline: 10px;

  --text-w: 560px;
  --img-w:  440px;
  --hero-h: 360px;

  grid-template-columns: var(--text-w) var(--img-w);
  gap: 0;
}

/* TEXT box */
.news-hero-text{
  direction: rtl;
  height: var(--hero-h);
  background: #063572;
  border-radius: 8px 0 0 8px;
  padding: 28px 32px;
  position: relative;

  display: flex;
  flex-direction: column;
  gap: 14px;

  box-sizing: border-box;
  text-align: right;
}

/* icon */
.news-icon{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  opacity: .95;
  z-index: 5;
}
.news-icon img{
  width: 18px;
  height: 18px;
  display: block;
  filter: brightness(0) saturate(100%) invert(100%);
}

/* excerpt */
.news-excerpt{
  margin: 52px 0 0 0;
  font-family: "Cairo", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 2;
  color: rgba(255,255,255,.92);
  text-align: right;

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

  overflow-wrap: anywhere;
  word-break: break-word;
}

/* meta */
.news-meta{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  direction: rtl;
  margin-top: auto;

  font-family: "Cairo", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
}
.news-meta-sep{ opacity: .8; }

/* MEDIA */
.news-hero-media{
  height: var(--hero-h);
  position: relative;
  overflow: hidden;
  border-radius: 0 8px 8px 0;
  background: #0b2a55;
}

/* ✅ gradient fallback if no image */
.news-hero-media.is-no-image{
  display: block;
}
.news-hero-fallback{
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 85% 10%, rgba(245, 158, 11, .18), transparent 55%),
    radial-gradient(700px 380px at 20% 90%, rgba(37, 99, 235, .35), transparent 60%),
    linear-gradient(135deg, #061a33 0%, #0b3a78 55%, #0b1f3f 100%);
}

/* clickable image link like gallery */
.news-hero-link{
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  cursor: zoom-in;
}

.news-main-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .45s ease;
}

.news-hero-link:hover .news-main-img{
  transform: scale(1.04);
}

/* overlay + zoom circle */
.news-hero-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(6, 53, 114, 0.65) 100%);
  opacity: 0;
  transition: opacity .25s ease;
}

.news-hero-zoom{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  transform: scale(.96);
  pointer-events: none;
}

.news-hero-zoom::before{
  content:"";
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  position: absolute;
}

.news-hero-zoom svg{
  width: 26px;
  height: 26px;
  position: relative;
  color: #063572;
}

.news-hero-link:hover .news-hero-overlay{
  opacity: 1;
}
.news-hero-link:hover .news-hero-zoom{
  opacity: 1;
  transform: scale(1);
}

/* thumbs (as links) */
.news-thumbs{
  position:absolute;
  top: 12px;
  right: 12px;
  display:flex;
  gap: 8px;
  align-items:center;
  z-index: 20;
}

.news-thumbs .thumb{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.15);
  display: block;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}
.news-thumbs .thumb:hover{
  transform: translateY(-1px);
}
.news-thumbs .thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.news-thumbs .thumb.active{
  border-color:#f59e0b;
}

/* BODY */
.news-body{
  max-width: 920px;
  margin: 18px auto 0;
  padding: 0 10px;
  box-sizing: border-box;
  direction: rtl;
  text-align: right;
  font-size: 15px;
  line-height: 2;
  color:#222;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.news-body-title{
  margin: 0 0 16px 0;
  font-family: "Cairo", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.9;
  color: #063572;
  text-align: right;
}

/* BACK */
.news-back{
  text-align: center;
  margin: 24px 10px 50px;
  direction: rtl;
}
.news-back a{
  display:inline-block;
  padding: 10px 24px;
  border: 1px solid #063572;
  border-radius: 999px;
  color: #063572;
  text-decoration: none;
  font-weight: 600;
  font-family:"Cairo", sans-serif;
  transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.news-back a:hover{
  background:#063572;
  color:#fff;
  transform: translateY(-1px);
  border-color:#063572;
}

/* RESPONSIVE */
@media (max-width: 1100px){
  .news-hero{
    grid-template-columns: 1fr;
    --hero-h: 340px;
    gap: 14px;
    margin-inline: 10px;
  }
  .news-hero-text,
  .news-hero-media{
    border-radius: 8px;
  }
}

@media (max-width: 520px){
  .news-hero{ --hero-h: 300px; }
  .news-thumbs .thumb{ width: 38px; height: 38px; }
  .news-body-title{ font-size: 19px; }
}

/* =========================================================
   GALLERY STYLE LIGHTBOX – FULL (same as gallery detail)
========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.lightbox-inner {
  position: relative;
  width: 100%;
  max-width: min(98vw, 1600px);
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
}

.lightbox.is-open .lightbox-inner {
  transform: scale(1);
  opacity: 1;
}

.lightbox-view-label {
  font-family: "Cairo", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.lightbox-img-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
  background: #0a0a0a;
  min-width: 280px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: min(90vh, 1200px);
  width: auto;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 10px;
}

.lightbox-img.is-error {
  visibility: hidden;
  position: absolute;
  width: 0;
  height: 0;
}

/* Loading */
.lightbox-loading {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #111;
  color: rgba(255, 255, 255, 0.8);
  font-family: "Tajawal", sans-serif;
  font-size: 0.9375rem;
}

.lightbox-img-wrap.is-loading .lightbox-loading {
  display: flex;
}

.lightbox-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
  to { transform: rotate(360deg); }
}

/* Fallback */
.lightbox-img-fallback {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: #111;
  color: rgba(255, 255, 255, 0.7);
  font-family: "Tajawal", sans-serif;
  font-size: 0.9375rem;
}

.lightbox-img-wrap.has-fallback .lightbox-img-fallback {
  display: flex;
}

.lightbox-fallback-icon {
  width: 56px;
  height: 56px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.25)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'%3E%3C/circle%3E%3Cpolyline points='21 15 16 10 5 21'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
}

/* Details */
.lightbox-details {
  margin-top: 1rem;
  text-align: center;
  max-width: min(98vw, 800px);
}

.lightbox-counter {
  display: inline-block;
  font-family: "Cairo", sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  white-space: nowrap;
  margin-bottom: 0.5rem;
}

.lightbox-caption {
  margin: 0;
  font-family: "Tajawal", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  padding: 0 0.5rem;
}

/* Buttons */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

.lightbox-close:active,
.lightbox-prev:active,
.lightbox-next:active {
  transform: scale(0.96);
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100001;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lightbox-close svg {
  width: 22px;
  height: 22px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  right: 100%;
  margin-right: 1.25rem;
}

.lightbox-next {
  left: 100%;
  margin-left: 1.25rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev svg,
.lightbox-next svg {
  width: 28px;
  height: 28px;
}

/* Responsive lightbox */
@media (max-width: 900px) {
  .lightbox-inner { max-width: 98vw; }

  .lightbox-prev {
    right: 0.75rem;
    margin-right: 0;
  }

  .lightbox-next {
    left: 0.75rem;
    margin-left: 0;
  }

  .lightbox-close {
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
  }
}

@media (max-width: 600px) {
  .lightbox-img-wrap { min-height: 160px; }

  .lightbox-close {
    top: max(0.875rem, env(safe-area-inset-top));
    right: max(0.875rem, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
  }

  .lightbox-close svg {
    width: 20px;
    height: 20px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 46px;
    height: 46px;
    top: auto;
    bottom: -3.5rem;
    transform: none;
  }

  .lightbox-prev:hover,
  .lightbox-next:hover {
    transform: scale(1.06);
  }

  .lightbox-prev {
    right: 50%;
    margin-right: 2.5rem;
  }

  .lightbox-next {
    left: 50%;
    margin-left: 2.5rem;
  }

  .lightbox-counter {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
  }
}
