/* ===========================
   News / Blogs Page Styles (scoped)
   =========================== */

/* Scope custom properties to the page section only */
.blog-modern {
  --brand: #6d28d9;
  --accent: #0ea5e9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6eaf0;
  --card: #ffffff;
  --bg: #f8fafc;
  --bg2: #eef2f7;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(2, 6, 23, .10);

  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--ink);
}

/* ===== Hero ===== */
.blog-modern .hero {
  position: relative;
  padding: clamp(2rem, 4vw, 4rem) 0 clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
}

.blog-modern .hero::before {
  content: "";
  position: absolute;
  inset: -10% -5% auto -5%;
  height: 320px;
  background:
    radial-gradient(600px 200px at 10% -20%, rgba(109, 40, 217, .25), transparent 60%),
    radial-gradient(500px 150px at 90% -10%, rgba(14, 165, 233, .25), transparent 60%);
  filter: blur(20px);
  z-index: 0;
}

.blog-modern .container {
  width: min(1200px, 92vw);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.blog-modern .hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
  color: #7a1f1f;
}

.blog-modern .hero p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
}

/* ===== Sticky Filters (no search) ===== */
.blog-modern .filters {
  position: sticky;
  top: 64px;
  z-index: 5;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  margin: 14px auto 22px;
  padding: .75rem;
}

.blog-modern .filters form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  /* adjusted because search is removed */
  gap: .6rem;
  align-items: center;
}

/* Select (split from .btn so we don't accidentally style all buttons) */
.blog-modern .select {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0;
  display: flex;
  align-items: center;
  font: inherit;
  color: var(--ink);
}

.blog-modern .select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  height: 100%;
  padding: 0 .9rem;
  background: transparent;
  border: 0;
  outline: 0;
}

/* Button (scoped to blog-modern only) */
.blog-modern .btn {
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  color: #fff;
  border: 0;
  padding: 0 .9rem;
  font: inherit;
}

.blog-modern .btn:hover {
  filter: brightness(.98);
}

/* ===== Featured Roundup ===== */
.blog-modern .roundup {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.blog-modern .roundup .media {
  aspect-ratio: 16/9;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.blog-modern .roundup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .5s ease;
}

.blog-modern .roundup:hover img {
  transform: scale(1.06);
}

.blog-modern .roundup .body {
  padding: clamp(1rem, 2.2vw, 1.5rem);
  display: grid;
  gap: .6rem;
  align-content: center;
}

.blog-modern .badge {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  padding: .35rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  color: #0b1220;
  background: linear-gradient(90deg, #e9d5ff, #dbeafe);
}

.blog-modern .roundup h2 {
  margin: .1rem 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.blog-modern .roundup p {
  color: var(--muted);
  margin: 0;
}

.blog-modern .meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .9rem;
}

/* ===== Grid of cards ===== */
.blog-modern .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.blog-modern .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.blog-modern .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(2, 6, 23, .12);
  border-color: #d7dde6;
}

.blog-modern .thumb {
  aspect-ratio: 16/9;
  width: 100%;
  background: #f1f5f9;
  overflow: hidden;
}

.blog-modern .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.blog-modern .card:hover .thumb img {
  transform: scale(1.04);
}

.blog-modern .body {
  padding: .9rem .95rem 1.05rem;
  display: grid;
  gap: .55rem;
}

.blog-modern .title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 800;
}

.blog-modern .excerpt {
  color: var(--muted);
  margin: 0;
}

.blog-modern .kv {
  color: var(--muted);
  font-size: .88rem;
  display: flex;
  gap: .6rem .9rem;
  flex-wrap: wrap;
}

.blog-modern .tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

.blog-modern .tag {
  font-size: .75rem;
  color: #334155;
  background: #eef2f7;
  border: 1px solid #e5eaf0;
  padding: .18rem .5rem;
  border-radius: 999px;
}

/* ===== Pagination ===== */
.blog-modern .pagination {
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin: 1.25rem 0 2rem;
}

.blog-modern .pagination a,
.blog-modern .pagination span {
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}

.blog-modern .pagination .current {
  background: linear-gradient(90deg, var(--brand), var(--accent));
  color: #fff;
  border-color: transparent;
}

/* ===== Empty state ===== */
.blog-modern .empty {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed #d9e1eb;
  border-radius: var(--radius);
  background: #fff;
}

.blog-modern .empty h3 {
  margin: .2rem 0 .4rem;
}

.blog-modern .empty p {
  color: var(--muted);
  margin: 0;
}

/* ===== Section headings ===== */
.blog-modern .section-title {
  margin: 1.25rem 0 .75rem;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
}

/* --- News cards: override link colour --- */
.blog-modern .card .title a {
  color: #000;
  /* black text */
  text-decoration: none;
  /* remove underline */
}

.blog-modern .card .title a:hover {
  color: #b20a0a;
  /* your brand red on hover */
  text-decoration: underline;
  /* optional hover underline */
}

/* ===== Loading spinner & states ===== */
/* Loading text + animated dots */
.blog-modern .loading-msg {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-weight: 700;
  color: var(--ink);
}

.blog-modern .loading-msg .muted {
  font-weight: 500;
  color: var(--muted);
}

.blog-modern .loading-dots {
  display: inline-block;
  position: relative;
  width: 3ch;
  /* fixed width so text never moves */
  height: 1em;
  line-height: 1;
  vertical-align: -0.15em;
  /* nudge down so it aligns with text */
}

/* Absolute, so width animation doesn't affect layout */
.blog-modern .loading-dots::after {
  content: '...';
  position: absolute;
  left: 0;
  top: 0.05em;
  /* fine-tune vertical alignment */
  width: 0ch;
  /* start hidden */
  overflow: hidden;
  animation: atpEllipsis 1.2s steps(4, end) infinite;
}

/* typewriter-style reveal with no reflow */
@keyframes atpEllipsis {
  0% {
    width: 0ch;
  }

  /*   */
  25% {
    width: 1ch;
  }

  /* . */
  50% {
    width: 2ch;
  }

  /* .. */
  75% {
    width: 3ch;
  }

  /* ... */
  100% {
    width: 0ch;
  }

  /* reset */
}


/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .blog-modern .loading-dots::after {
    animation: none;
    width: 3ch;
  }
}

/* ===== Loading spinner & states (fixed ellipsis, no layout shift) ===== */
.blog-modern .news-loading {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 0;
  line-height: 1.2;
}

.blog-modern .news-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(15, 23, 42, .15);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: atpSpin .8s linear infinite;
}

@keyframes atpSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Optional: skeleton cards while loading */
.blog-modern .skeleton {
  display: block;
  position: relative;
  overflow: hidden;
  background: #eef2f7;
}

.blog-modern .skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .4), rgba(255, 255, 255, 0));
  transform: translateX(-100%);
  animation: atpShimmer 1.2s infinite;
}

@keyframes atpShimmer {
  to {
    transform: translateX(100%);
  }
}

.blog-modern .skeleton-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: #fff;
}

.blog-modern .skeleton-thumb {
  aspect-ratio: 16/9;
}

.blog-modern .skeleton-line {
  height: 12px;
  margin: .5rem 0;
  border-radius: 6px;
}

.blog-modern .skeleton-body {
  padding: .9rem .95rem 1.05rem;
}

/* Utility: visually hidden (for screen readers) */
.blog-modern .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Alerts (error/info) ===== */
.blog-modern .alert {
  background: #fff;
  border: 1px solid #ffd9d9;
  color: #7a1f1f;
  padding: .75rem 1rem;
  border-radius: 12px;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .blog-modern .news-spinner {
    animation: none;
  }

  .blog-modern .skeleton::after {
    animation: none;
  }

  .blog-modern .thumb img,
  .blog-modern .card:hover .thumb img,
  .blog-modern .card {
    transition: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .blog-modern .filters form {
    grid-template-columns: 1fr 1fr auto;
  }

  .blog-modern .roundup {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .blog-modern .filters form {
    grid-template-columns: 1fr;
  }
}

.new-clickable-titles {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.new-clickable-titles a {
  text-decoration: none !important;
}

.new-clickable-titles .section-title {
  cursor: pointer;
  color: var(--primary-color);
  text-decoration: none !important;
}

.new-clickable-titles .section-title:hover {
  text-decoration: underline 0.25rem !important;
}

.new-clickable-titles a.active .section-title {
  text-decoration: underline 0.25rem !important;
}