/*
  modern.css
  Override-layer: modernizes the look without changing HTML placeholders or template structure.
  Load AFTER style.css.
*/

:root {
  /* Light, WP-like UI */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.65);
  --border: rgba(15, 23, 42, 0.10);
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --accent: #2563eb; /* blue */
  --accent-2: #16a34a; /* green */
  --link: #2563eb;
  --max: 1200px;
}

/* Base */
html, body {
  background: radial-gradient(1000px 600px at 18% -15%, rgba(37, 99, 235, 0.08), transparent 55%),
              radial-gradient(900px 540px at 85% -10%, rgba(22, 163, 74, 0.06), transparent 52%),
              var(--bg);
}

body {
  color: var(--text);
  font-family: Inter, Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  background: transparent;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
  color: #1d4ed8;
}

/* Improve focus styles */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

/* Layout constraints */
.shell {
  max-width: var(--max);
}

/* Header / Navbar */
.page-head {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.rd-navbar {
  background: transparent !important;
}

.navbar-container {
  padding: 14px 16px;
}

.rd-navbar-brand img {
  max-height: 42px;
  width: auto;
}

.rd-navbar-nav.menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rd-navbar-nav.menu-list > li > a {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text) !important;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.rd-navbar-static .rd-navbar-nav > li > a:hover,
.rd-navbar-fullwidth .rd-navbar-nav > li > a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text);
}

/* Burger (keeps existing checkbox/label mechanics) */
.burger {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
}

/* Content spacing */
.page-content {
  padding-top: 18px;
}

.section-top-15,
.section-top-26 {
  padding-top: 18px;
}

/* Labels / category pills */
.label,
.label-warning {
  background: rgba(37, 99, 235, 0.10) !important;
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: #1e3a8a !important;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Hero (top 5 posts on main) */
.post-variant-1 .post-inner {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--surface);
}

.post-variant-1 .post-image {
  border-radius: 0 !important;
  width: 100% !important;
  height: auto !important;
  display: block;
}

/* Make small hero thumbs consistent even if inline width/height exists in HTML */
.post-variant-1 img[style] {
  width: 100% !important;
  height: auto !important;
}

/* Caption overlay */
.cell-lg-6 .post-caption {
  background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.55));
  color: var(--text);
  border: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 16px;
  inset: auto 0 0 0;
}

.cell-lg-6 .post-caption .h1 a,
.cell-lg-6 .post-caption .h5 a {
  color: var(--text) !important;
}

/* Cards grid (category + posts list) */
.grid-container {
  gap: 18px;
}

.grid-container .post-card,
.post-variant-2 {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-soft) !important;
  padding: 14px !important;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.grid-container .post-card:hover,
.post-variant-2:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(37, 99, 235, 0.28) !important;
}

.post-image-wrapper {
  border-radius: calc(var(--radius-lg) - 6px);
  overflow: hidden;
}

.post-image {
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border-radius: 0 !important;
  margin-bottom: 0;
}

.post-body {
  padding: 14px 8px 8px;
}

.post-body p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.h1, .h5 {
  color: var(--text);
}

.h5 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.post-link {
  color: var(--text) !important;
}

.post-link:hover {
  color: #1d4ed8 !important;
}

/* Pagination */
.pagination,
.subpagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination a,
.subpagination a,
.pagination span,
.subpagination span {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
}

.pagination a:hover,
.subpagination a:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.08);
}

/* Post detail (article page) */
.post-container,
.related-articles,
.related-article {
  background: var(--surface) !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft) !important;
}

.post-container {
  border-radius: var(--radius-lg);
}

.post-container h1 {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.3px;
}

.article-content p {
  color: var(--muted);
}

.post-container img {
  width: 100% !important;
  max-width: 860px;
  border-radius: var(--radius-md);
}

.related-articles {
  border-radius: var(--radius-lg);
}

.related-article {
  border-radius: var(--radius-md);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.related-article:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.28);
  background: #ffffff !important;
}

.related-article-title {
  color: var(--text);
}

.related-article-category {
  color: #2563eb;
}

/* Footer */
.page-footer {
  margin-top: 32px;
  background: rgba(255, 255, 255, 0.86);
  border-top: 1px solid var(--border);
}

.page-footer h6 {
  color: var(--text);
  font-weight: 800;
}

.footer-categories a {
  color: var(--muted);
}

.footer-categories a:hover {
  color: var(--text);
}

/* Make content readable on small screens */
@media (max-width: 991px) {
  .range.justify-content-center {
    width: 100% !important;
    min-width: 0 !important;
  }

  .post-container {
    width: 100% !important;
    margin-right: 0 !important;
  }

  .related-articles {
    width: 100% !important;
    margin-right: 0 !important;
  }
}
