/* ============================================================
   news.css — News page styles
   ------------------------------------------------------------
   Specific to news.html. Loaded AFTER styles.css, which provides
   the design tokens (--primary, --secondary, --line, --r-lg,
   --ease, etc.), reset, container, announcement bar, nav,
   buttons, popup, and footer.

   This file covers only what's unique to the news page:
     • Page header (breadcrumb, hero title)
     • Search + count toolbar
     • Category filter tabs
     • Featured news banner (16:9 large card)
     • News grid + cards (16:10 images)
     • Loading skeletons
     • Load more button
     • Empty / error states
     • Article read-more modal
============================================================ */

/* ============================================================
   PAGE HEADER
============================================================ */
.page-header {
  padding: clamp(48px, 7vw, 84px) 0 clamp(40px, 5vw, 56px);
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  top: -120px; right: -100px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: var(--primary-soft);
  opacity: 0.7;
  filter: blur(40px);
  z-index: 0;
}
.page-header .container { position: relative; z-index: 1; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-mute);
  margin-bottom: 22px;
  font-weight: 500;
}
.breadcrumb a { transition: color 0.3s; }
.breadcrumb a:hover { color: var(--secondary); }
.breadcrumb .sep { color: var(--ink-soft); }
.breadcrumb .current { color: var(--secondary); font-weight: 600; }

.page-header h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-bottom: 18px;
  max-width: 22ch;
}
.page-header h1 .serif-em { color: var(--secondary-soft); }
.page-header .sub {
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--ink-mute);
  max-width: 60ch;
  line-height: 1.6;
}

/* ============================================================
   SEARCH + COUNT
============================================================ */
.toolbar {
  padding-bottom: 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
@media (max-width: 760px) {
  .toolbar { grid-template-columns: 1fr; }
}

.search-bar {
  position: relative;
  max-width: 540px;
}
.search-bar svg {
  position: absolute;
  left: 20px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--ink-soft);
  pointer-events: none;
}
.search-bar input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--secondary);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.search-bar input::placeholder { color: var(--ink-soft); }
.search-bar input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(0, 50, 98, 0.08);
}
.search-clear {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--secondary);
  display: none;
  align-items: center;
  justify-content: center;
}
.search-clear.show { display: inline-flex; }
.search-clear svg { width: 11px; height: 11px; }

.count {
  font-size: 13px;
  color: var(--ink-mute);
  font-weight: 500;
  white-space: nowrap;
}
.count strong { color: var(--secondary); font-weight: 700; }

/* ============================================================
   CATEGORY FILTER TABS
============================================================ */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.cat-tab {
  padding: 9px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--secondary);
  white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.cat-tab:hover {
  background: var(--primary-soft);
  border-color: var(--secondary-soft);
}
.cat-tab.active {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}
.cat-tab.active:hover { background: var(--secondary-soft); }

/* On small screens, allow horizontal scroll to keep tabs on one row */
@media (max-width: 540px) {
  .category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding: 4px var(--gutter);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .category-tabs::-webkit-scrollbar { display: none; }
}

/* ============================================================
   FEATURED NEWS BANNER (16:9 large card)
============================================================ */
.news-featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 30px 70px -40px rgba(0, 50, 98, 0.3);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.news-featured:hover {
  transform: translateY(-4px);
  box-shadow: 0 40px 90px -45px rgba(0, 50, 98, 0.4);
}
.nf-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--primary-soft);
}
.nf-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.news-featured:hover .nf-image img { transform: scale(1.04); }
.nf-image.no-img {
  background: radial-gradient(circle at 30% 30%, var(--primary-deep), var(--primary-soft));
}
.nf-badge {
  position: absolute;
  top: 18px; left: 18px;
  background: var(--accent-gradient);
  color: var(--secondary);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.2);
}
.nf-content {
  padding: clamp(28px, 3.5vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nf-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nf-date { color: var(--secondary-soft); }
.nf-cat {
  background: var(--primary-soft);
  color: var(--secondary);
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.1em;
  font-size: 10.5px;
}
.nf-title {
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--secondary);
  margin-bottom: 14px;
}
.nf-desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-mute);
  margin-bottom: 24px;
}
.nf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 12px 24px;
  background: var(--secondary);
  color: var(--primary);
  border: 0;
  border-radius: 100px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.24s ease;
}
.nf-link:hover {
  background: var(--accent-gradient);
  color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(0, 50, 98, 0.3);
}
.nf-link svg { width: 16px; height: 16px; }

@media (max-width: 880px) {
  .news-featured { grid-template-columns: 1fr; }
  .nf-image { aspect-ratio: 16 / 10; }
}

/* ============================================================
   NEWS GRID + CARDS
============================================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
@media (max-width: 1000px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .news-grid { grid-template-columns: 1fr; gap: 20px; } }

.news-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
  opacity: 0;
  animation: cardIn 0.6s var(--ease) forwards;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px -28px rgba(0, 50, 98, 0.3);
  border-color: var(--line);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Stagger by nth-child up to 12 */
.news-card:nth-child(1)  { animation-delay: 0.00s; }
.news-card:nth-child(2)  { animation-delay: 0.05s; }
.news-card:nth-child(3)  { animation-delay: 0.10s; }
.news-card:nth-child(4)  { animation-delay: 0.15s; }
.news-card:nth-child(5)  { animation-delay: 0.20s; }
.news-card:nth-child(6)  { animation-delay: 0.25s; }
.news-card:nth-child(n+7) { animation-delay: 0.30s; }

.card-img {
  aspect-ratio: 16 / 10;
  background: var(--primary-soft);
  overflow: hidden;
  position: relative;
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.news-card:hover .card-img img { transform: scale(1.05); }
/* Fallback when image is missing or fails */
.card-img.no-img {
  background:
    radial-gradient(circle at 30% 30%, var(--primary-deep), var(--primary-soft));
  display: flex; align-items: center; justify-content: center;
}
.card-img.no-img::after {
  content: '';
  width: 56px; height: 56px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A4A85' stroke-width='1.4'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.4;
}

.card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary-soft);
  font-weight: 700;
  margin-bottom: 10px;
}
.card-cat {
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--secondary);
  background: var(--primary-soft);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
}
.meta-sep {
  opacity: 0.4;
  font-weight: 400;
}
/* Legacy alias (kept for backwards compatibility if any code references it) */
.card-date {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary-soft);
  font-weight: 700;
  margin-bottom: 10px;
}
.card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  color: var(--secondary);
}
.card-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-mute);
  margin-bottom: 20px;
  flex: 1;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--secondary);
  align-self: flex-start;
  padding: 4px 0;
  transition: gap 0.3s var(--ease);
}
.card-link:hover { gap: 12px; }
.card-link svg { width: 12px; height: 12px; transition: transform 0.3s; }

/* ============================================================
   LOADING SKELETONS
============================================================ */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--line-soft) 0%,
    var(--primary-soft) 50%,
    var(--line-soft) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-img {
  aspect-ratio: 16 / 10;
  width: 100%;
  border-radius: 0;
}
.skeleton-body { padding: 22px 24px 24px; }
.skeleton-line {
  height: 10px;
  margin-bottom: 12px;
}
.skeleton-line.short  { width: 30%; }
.skeleton-line.title  { width: 90%; height: 16px; margin-top: 4px; margin-bottom: 16px; }
.skeleton-line.title2 { width: 60%; height: 16px; margin-bottom: 18px; }
.skeleton-line.desc1  { width: 100%; }
.skeleton-line.desc2  { width: 95%; }
.skeleton-line.desc3  { width: 70%; margin-bottom: 22px; }
.skeleton-line.btn    { width: 35%; height: 12px; margin-bottom: 0; }

/* ============================================================
   LOAD MORE
============================================================ */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 48px;
}
.load-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  background: var(--secondary);
  color: var(--primary);
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.load-more:hover {
  background: var(--secondary-soft);
  transform: translateY(-1px);
  box-shadow: 0 18px 32px -16px rgba(0, 50, 98, 0.5);
}
.load-more svg { width: 13px; height: 13px; }

/* ============================================================
   EMPTY / ERROR STATES
============================================================ */
.state {
  padding: 60px 24px 80px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.state-ico {
  width: 72px; height: 72px;
  background: var(--primary-soft);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
}
.state.error .state-ico { background: rgba(194, 74, 74, 0.1); }
.state-ico svg { width: 30px; height: 30px; color: var(--secondary); }
.state.error .state-ico svg { color: var(--danger); }
.state h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.state p {
  font-size: 14.5px;
  color: var(--ink-mute);
  line-height: 1.6;
  margin-bottom: 24px;
}
.state .btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--secondary);
  color: var(--primary);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.3s;
}
.state .btn-retry:hover { background: var(--secondary-soft); }
.state .btn-retry svg { width: 13px; height: 13px; }

/* ============================================================
   MODAL (Read more)
============================================================ */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 31, 66, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.modal.open { opacity: 1; visibility: visible; }

.modal-card {
  background: var(--surface);
  width: 100%;
  max-width: 640px;
  border-radius: var(--r-xl);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  position: relative;
  transform: scale(0.94) translateY(20px);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.4s;
  box-shadow: 0 40px 80px -20px rgba(0, 31, 66, 0.5);

  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal-card::-webkit-scrollbar { display: none; }
.modal.open .modal-card { transform: scale(1) translateY(0); opacity: 1; }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--secondary);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 2;
  transition: background 0.3s, transform 0.3s;
}
.modal-close:hover { background: var(--surface); transform: rotate(90deg); }
.modal-close svg { width: 14px; height: 14px; }

.modal-image-wrap {
  aspect-ratio: 16 / 9;
  background: var(--primary-soft);
  overflow: hidden;
}
.modal-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.modal-image-wrap.no-img { display: none; }

.modal-body { padding: clamp(24px, 4vw, 36px); }
.modal-date {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary-soft);
  font-weight: 700;
  margin-bottom: 14px;
}
.modal-title {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.modal-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-mute);
  white-space: pre-wrap;
}

/* ============================================================
   LATEST UPDATES — categories overview card
============================================================ */
.latest-section {
  padding: 0 0 clamp(40px, 5vw, 64px);
}

.latest-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: clamp(18px, 2.2vw, 24px);
  padding: clamp(28px, 3.2vw, 48px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}

.latest-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  border: 1px solid var(--line);
  color: var(--secondary);
  padding: 6px 13px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.latest-pill::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent-gradient);
  border-radius: 50%;
}

.latest-head h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--secondary);
  margin-bottom: 12px;
}
.latest-head p {
  font-size: 14.5px;
  line-height: 1.6;
  color: #4a6885;
  margin: 0;
}

.latest-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.latest-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--primary-soft);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  transition: all 0.24s ease;
}
.latest-list li:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateX(4px);
}
.ll-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-gradient);
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .latest-card { grid-template-columns: 1fr; }
}
