:root {
  --green-900: #123d35;
  --green-950: #0b2a24;
  --green-700: #2f6b4f;
  --ink: #111827;
  --ivory: #fafaf6;
  --mist: #f4f6f3;
  --line: #dfe6e1;
  --muted: #4b5563;
  --red: #b91c1c;
  --gold: #b99a55;
  --white: #ffffff;
  --shadow-sm: 0 10px 24px rgba(17, 17, 17, 0.07);
  --shadow-md: 0 22px 55px rgba(17, 17, 17, 0.11);
  --radius: 8px;
  --title-font: "Noto Kufi Arabic", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --body-font: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(185, 154, 85, 0.08), transparent 30rem),
    linear-gradient(180deg, var(--ivory), var(--mist));
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.85;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1220px, calc(100% - 32px));
  margin-inline: auto;
}

.top-strip {
  background: var(--green-900);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}

.top-strip .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 250, 246, 0.94);
  border-bottom: 1px solid rgba(20, 61, 53, 0.14);
  backdrop-filter: blur(16px);
}

.masthead {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px) auto;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: max-content;
}

.brand img,
.footer-brand img {
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(20, 61, 53, 0.16));
}

.brand img {
  width: 70px;
  height: 70px;
}

.brand strong {
  display: block;
  font-family: var(--title-font);
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--green-900);
}

.brand small {
  display: block;
  color: var(--gold);
  font-weight: 700;
  margin-top: 2px;
}

.top-search,
.inline-search,
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(47, 107, 79, 0.7);
  box-shadow: 0 0 0 4px rgba(47, 107, 79, 0.1);
  background: #fff;
}

.top-search input,
.inline-search input,
.nav-search input,
.contact-form input,
.comment-form input,
.contact-form textarea,
.comment-form textarea,
.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-login input {
  width: 100%;
  padding: 11px 13px;
}

.top-search button,
.inline-search button,
.nav-search button,
.contact-form button,
.comment-form button,
.admin-form button,
.admin-login button,
.share button,
.share a,
.read-more,
.admin-table button,
.admin aside button {
  border: 0;
  border-radius: var(--radius);
  background: var(--green-700);
  color: #fff;
  padding: 10px 15px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:active,
.read-more:active,
.share a:active {
  transform: translateY(1px) scale(0.99);
}

.top-search button:hover,
.inline-search button:hover,
.contact-form button:hover,
.comment-form button:hover,
.admin-form button:hover,
.admin-login button:hover,
.read-more:hover {
  background: var(--green-900);
  box-shadow: 0 10px 24px rgba(20, 61, 53, 0.16);
}

.menu-toggle,
.nav-close {
  border: 1px solid rgba(20, 61, 53, 0.18);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-900);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  font-size: 24px;
}

.nav-shell {
  border-top: 1px solid rgba(20, 61, 53, 0.1);
}

.nav {
  display: block;
}

.nav-drawer-head,
.nav-search {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav a {
  position: relative;
  flex: 0 0 auto;
  padding: 11px 12px 12px;
  color: #25302b;
  font-weight: 700;
  font-size: 14px;
}

.nav a::after {
  content: "";
  position: absolute;
  right: 12px;
  left: 12px;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.nav a:hover {
  color: var(--green-900);
}

.nav a:hover::after {
  transform: scaleX(1);
}

.breaking {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
}

.breaking__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.breaking strong {
  background: var(--red);
  color: #fff;
  padding: 5px 13px;
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(201, 31, 31, 0.18);
}

.ticker {
  overflow: hidden;
  white-space: nowrap;
  color: var(--green-900);
  font-weight: 700;
}

.ticker span {
  display: inline-block;
  min-width: 100%;
  animation: ticker 26s linear infinite;
}

@keyframes ticker {
  from {
    transform: translateX(-20%);
  }
  to {
    transform: translateX(100%);
  }
}

.app {
  opacity: 1;
  transition: opacity 180ms ease;
}

.is-transitioning .app {
  opacity: 0.72;
}

.front-page {
  padding: 26px 0 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), transparent);
}

.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  gap: 20px;
}

.lead-story,
.news-card,
.panel,
.article-detail,
.admin-login form,
.stat-grid article {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 61, 53, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.lead-story {
  display: grid;
  grid-template-rows: minmax(330px, 53vh) auto;
  overflow: hidden;
}

.lead-slider {
  position: relative;
  min-height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.lead-slider .lead-story {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.lead-slider .lead-story.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.slider-dots {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 7px;
  z-index: 2;
}

.slider-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

.slider-dots button.active {
  width: 24px;
  border-radius: 999px;
  background: var(--gold);
}

.lead-story img,
.lead-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lead-story > div:last-child {
  padding: clamp(20px, 3vw, 30px);
  border-top: 4px solid var(--gold);
}

.lead-story b,
.page-kicker,
.meta span:first-child {
  color: var(--gold);
}

.lead-story h1 {
  margin: 9px 0 12px;
  font-family: var(--title-font);
  font-size: clamp(31px, 4vw, 55px);
  line-height: 1.27;
  color: var(--green-900);
}

.lead-story p,
.news-card p,
.summary,
.article-detail p,
.panel p {
  color: var(--muted);
}

.top-stack {
  display: grid;
  gap: 12px;
}

.news-card {
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.news-card:hover,
.lead-story:hover {
  transform: translateY(-3px);
  border-color: rgba(185, 154, 85, 0.55);
  box-shadow: var(--shadow-md);
}

.news-card__image,
.image-placeholder,
.lead-placeholder {
  display: grid;
  place-items: center;
  min-height: 178px;
  background:
    linear-gradient(135deg, rgba(20, 61, 53, 0.08), rgba(185, 154, 85, 0.12)),
    var(--mist);
  color: var(--green-900);
  text-align: center;
  padding: 18px;
}

.news-card__image img {
  width: 100%;
  height: 198px;
  object-fit: cover;
  transition: transform 220ms ease;
}

.news-card:hover img {
  transform: scale(1.035);
}

.image-placeholder strong,
.lead-placeholder strong {
  font-family: var(--title-font);
  font-size: 28px;
  color: var(--green-900);
}

.image-placeholder span,
.lead-placeholder span {
  color: var(--gold);
  font-weight: 700;
}

.news-card__body {
  padding: 16px;
}

.news-card h3 {
  margin: 7px 0 9px;
  font-family: var(--title-font);
  font-size: 19px;
  line-height: 1.55;
  color: #151515;
}

.news-card.compact {
  display: grid;
  grid-template-columns: 116px 1fr;
  align-items: stretch;
}

.news-card.compact .news-card__image {
  min-height: auto;
}

.news-card.compact .news-card__image img {
  height: 100%;
}

.news-card.compact h3 {
  font-size: 15px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.section {
  padding: 32px 0;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 10px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(20, 61, 53, 0.2);
}

.section-title h1,
.section-title h2,
.page-title {
  margin: 0;
  font-family: var(--title-font);
  color: var(--green-900);
}

.section-title h2::before,
.page-title::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 28px;
  margin-left: 9px;
  vertical-align: -7px;
  background: var(--gold);
  border-radius: 4px;
}

.section-title a {
  color: var(--gold);
  font-weight: 700;
}

.news-grid,
.cards-row,
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-section {
  margin-top: 32px;
}

.sidebar {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 17px;
}

.panel h3 {
  margin: 0 0 12px;
  font-family: var(--title-font);
  color: var(--green-900);
}

.link-list {
  display: grid;
  gap: 10px;
}

.link-list a {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  transition: color 160ms ease, padding 160ms ease;
}

.link-list a:hover {
  color: var(--green-700);
  padding-right: 4px;
}

.article-detail {
  padding: clamp(20px, 4vw, 42px);
}

.article-detail h1 {
  margin: 13px 0;
  font-family: var(--title-font);
  font-size: clamp(31px, 5vw, 58px);
  line-height: 1.32;
  color: var(--green-900);
}

.summary {
  font-size: 18px;
}

.main-image {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 20px 0;
}

.article-body {
  max-width: 780px;
  font-size: 20px;
}

.article-body p {
  color: #232323;
  margin: 0 0 22px;
}

.share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.share a:nth-child(1) {
  background: #1c4f95;
}

.share a:nth-child(2) {
  background: #248a57;
}

.comments {
  margin-top: 26px;
}

.comments h2 {
  font-family: var(--title-font);
  color: var(--green-900);
}

.comment-form,
.contact-form,
.admin-form {
  display: grid;
  gap: 12px;
}

.comment-form textarea,
.contact-form textarea,
.admin-form textarea {
  min-height: 130px;
  resize: vertical;
}

.admin-form textarea[name="body"] {
  min-height: 330px;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.comment,
.empty-note {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.comment time {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.narrow {
  width: min(840px, calc(100% - 32px));
  margin-inline: auto;
}

.empty {
  background: rgba(255, 255, 255, 0.86);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  margin-top: 34px;
  background:
    linear-gradient(135deg, rgba(20, 61, 53, 0.97), rgba(12, 34, 30, 0.98)),
    var(--green-900);
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 24px;
  padding: 38px 0;
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.footer-brand img {
  width: 62px;
  height: 62px;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 14px 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.theme-toggle {
  border: 1px solid rgba(20, 61, 53, 0.18);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-900);
  padding: 10px 12px;
  font-weight: 800;
}

.newsletter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.newsletter-form input {
  min-width: 0;
  padding: 10px 12px;
}

.newsletter-panel,
.print-teaser {
  margin: 18px 0;
}

.print-grid,
.author-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.print-card,
.author-card,
.author-profile {
  display: grid;
  gap: 12px;
}

.print-card img,
.print-teaser img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
}

.print-cover {
  object-fit: contain;
  background: var(--mist);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.read-more.ghost {
  background: transparent;
  color: var(--green-900);
  border: 1px solid var(--green-700);
}

.author-card img,
.author-avatar,
.author-profile img {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--green-900);
  color: #fff;
}

.author-avatar {
  display: grid;
  place-items: center;
  font-family: var(--title-font);
  font-size: 34px;
}

.author-profile {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin-bottom: 20px;
}

.ad-strip {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.ad-strip a {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(185, 154, 85, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--green-900);
  font-weight: 800;
}

.ad-strip img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

[data-theme="dark"] body {
  background: linear-gradient(180deg, #0d1715, #111111);
  color: #f7f7f0;
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .breaking,
[data-theme="dark"] .lead-story,
[data-theme="dark"] .news-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .article-detail,
[data-theme="dark"] .ad-strip a {
  background: rgba(18, 35, 31, 0.96);
  color: #f7f7f0;
  border-color: rgba(185, 154, 85, 0.22);
}

[data-theme="dark"] .brand strong,
[data-theme="dark"] .section-title h1,
[data-theme="dark"] .section-title h2,
[data-theme="dark"] .page-title,
[data-theme="dark"] .article-detail h1,
[data-theme="dark"] .panel h3,
[data-theme="dark"] .news-card h3,
[data-theme="dark"] .ticker,
[data-theme="dark"] .read-more.ghost {
  color: #f7f7f0;
}

[data-theme="dark"] .news-card p,
[data-theme="dark"] .lead-story p,
[data-theme="dark"] .article-detail p,
[data-theme="dark"] .panel p,
[data-theme="dark"] .meta,
[data-theme="dark"] .summary {
  color: rgba(247, 247, 240, 0.72);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .theme-toggle {
  background: #15231f;
  color: #fff;
  border-color: rgba(185, 154, 85, 0.28);
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 0%, rgba(185, 154, 85, 0.18), transparent 28rem),
    var(--green-900);
}

.admin-login form {
  width: min(430px, 100%);
  padding: 30px;
  text-align: center;
}

.admin-login img {
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.admin {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
  background: var(--mist);
}

.admin aside {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  background: var(--green-900);
  color: #fff;
}

.admin aside h2 {
  font-family: var(--title-font);
}

.admin aside button {
  width: 100%;
  text-align: right;
  background: rgba(255, 255, 255, 0.1);
}

.admin main {
  padding: 26px;
}

.admin main h1,
.admin main h2 {
  font-family: var(--title-font);
  color: var(--green-900);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-grid article {
  padding: 18px;
}

.stat-grid span {
  display: block;
  color: var(--muted);
}

.stat-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  color: var(--green-900);
}

.admin-section {
  margin-top: 20px;
}

.admin-table {
  display: grid;
  gap: 12px;
}

.admin-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.04);
}

.admin-table p,
.admin-table h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.skeleton-page {
  display: grid;
  gap: 18px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e7ede9;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.15s infinite;
}

.skeleton-hero {
  min-height: 330px;
}

.skeleton-card {
  min-height: 230px;
}

@keyframes shimmer {
  to {
    transform: translateX(-100%);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.is-visible {
  animation: revealUp 420ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1020px) {
  .masthead {
    grid-template-columns: auto 1fr auto;
  }

  .top-search {
    grid-column: 1 / -1;
  }

  .lead-grid,
  .layout {
    grid-template-columns: 1fr;
  }

  .news-grid,
  .cards-row,
  .archive-grid,
  .print-grid,
  .author-grid,
  .footer-grid,
  .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .container {
    width: min(100% - 22px, 1220px);
  }

  .top-strip .container {
    display: block;
    text-align: center;
  }

  .masthead {
    grid-template-columns: 44px 1fr 44px;
    gap: 10px;
    padding: 10px 0;
  }

  .brand {
    justify-self: center;
    grid-column: 2;
  }

  .brand img {
    width: 54px;
    height: 54px;
  }

  .brand strong {
    font-size: 22px;
  }

  .brand small {
    font-size: 11px;
  }

  .menu-toggle {
    display: block;
    grid-column: 1;
    grid-row: 1;
  }

  .top-search {
    display: none;
  }

  .nav-shell {
    border-top: 0;
  }

  .nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 360px);
    margin: 0;
    display: block;
    padding: 18px;
    background: var(--green-900);
    color: #fff;
    box-shadow: -30px 0 70px rgba(17, 17, 17, 0.28);
    transform: translateX(-105%);
    transition: transform 240ms ease;
    overflow-y: auto;
    z-index: 50;
  }

  .nav.open {
    transform: translateX(0);
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(17, 17, 17, 0.42);
    backdrop-filter: blur(2px);
  }

  .nav-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-family: var(--title-font);
    font-size: 22px;
  }

  .nav-close {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    font-size: 26px;
  }

  .nav-search {
    display: flex;
    margin-bottom: 16px;
  }

  .nav-links {
    display: grid;
    gap: 8px;
    overflow: visible;
  }

  .nav a {
    padding: 13px 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    font-size: 16px;
  }

  .nav a::after {
    display: none;
  }

  .breaking__inner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .lead-story {
    grid-template-rows: 245px auto;
  }

  .lead-story h1 {
    font-size: 27px;
  }

  .news-grid,
  .cards-row,
  .archive-grid,
  .footer-grid,
  .sidebar,
  .skeleton-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: grid;
    align-items: start;
  }

  .inline-search {
    width: 100%;
  }

  .theme-toggle {
    display: none;
  }

  .newsletter-form,
  .author-profile {
    grid-template-columns: 1fr;
  }

  .news-card.compact {
    grid-template-columns: 104px 1fr;
  }

  .article-detail h1 {
    font-size: 29px;
  }

  .article-body {
    font-size: 18px;
  }

  .admin {
    grid-template-columns: 1fr;
  }

  .admin aside {
    position: static;
    height: auto;
  }

  .admin-table > div {
    grid-template-columns: 1fr;
  }
}

.header-social,
.footer-social,
.nav-social,
.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.social-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-900);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(20, 61, 53, 0.16);
}

.social-facebook {
  background: #1877f2;
}

.replies {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-right: 14px;
  border-right: 3px solid var(--gold);
}

.comment.reply {
  background: #fff;
}

.social-admin {
  gap: 14px;
}

.social-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 110px auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.permission-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (min-width: 741px) {
  .masthead {
    grid-template-columns: auto minmax(260px, 420px) auto auto;
  }
}

@media (max-width: 740px) {
  body.nav-open::after {
    background: rgba(17, 17, 17, 0.25);
    backdrop-filter: none;
  }

  .header-social {
    display: none;
  }

  .nav-social {
    margin-top: 16px;
  }

  .social-row,
  .permission-form {
    grid-template-columns: 1fr;
  }
}

/* Final drawer fixes for public mobile nav and admin sidebar. */
.admin {
  min-height: 100dvh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin-page .top-strip,
.admin-page .site-header,
.admin-page .site-footer {
  display: none;
}

.admin-page {
  background: var(--mist);
}

.admin aside {
  min-height: 100dvh;
  height: 100dvh;
  overflow-y: auto;
  scrollbar-width: thin;
  background: var(--green-900) !important;
  color: #fff !important;
  z-index: 20;
}

.admin-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-sidebar-head h2 {
  margin: 0;
  color: #fff;
}

.admin aside button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  color: #fff !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: right;
  box-shadow: none;
}

.admin aside button:hover,
.admin aside button.active {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.22);
}

.admin-menu-toggle,
.admin-menu-close {
  display: none;
}

.admin main {
  min-width: 0;
}

@media (max-width: 768px) {
  .masthead {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 10px;
  }

  .brand {
    justify-self: center;
    grid-column: 2;
  }

  .menu-toggle {
    display: block;
    grid-column: 1;
    grid-row: 1;
  }

  .top-search {
    display: none;
  }

  .nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 85vw !important;
    max-width: 360px !important;
    height: 100dvh;
    margin: 0 !important;
    padding: 22px 18px;
    background: var(--green-900) !important;
    color: #fff !important;
    overflow-y: auto;
    transform: translateX(100%) !important;
    transition: transform 260ms ease;
    z-index: 9999 !important;
    box-shadow: -24px 0 54px rgba(0, 0, 0, 0.28);
  }

  body.nav-open .site-header {
    z-index: 10000;
  }

  .nav.open {
    transform: translateX(0) !important;
  }

  .nav-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-family: var(--title-font);
    font-size: 22px;
  }

  .nav-search {
    display: flex;
    margin-bottom: 16px;
  }

  .nav-links {
    display: grid;
    gap: 8px;
    overflow: visible;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9998 !important;
    background: rgba(17, 17, 17, 0.36) !important;
    backdrop-filter: none !important;
    pointer-events: auto;
  }

  .nav-drawer-head,
  .nav-drawer-head span {
    color: #fff;
  }

  .nav-close {
    display: inline-grid;
    place-items: center;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
  }

  .nav a {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.13);
  }

  .nav-search input {
    background: #fff;
    color: var(--ink);
  }

  .admin {
    display: block;
    min-height: 100dvh;
  }

  .admin-menu-toggle {
    display: inline-grid;
    place-items: center;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9997;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(20, 61, 53, 0.18);
    border-radius: var(--radius);
    background: #fff;
    color: var(--green-900);
    box-shadow: var(--shadow-sm);
  }

  .admin aside {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 85vw;
    max-width: 340px;
    min-height: 100dvh;
    height: 100dvh !important;
    padding: 18px 14px;
    transform: translateX(100%);
    transition: transform 260ms ease;
    z-index: 9999;
    box-shadow: -24px 0 54px rgba(0, 0, 0, 0.28);
  }

  .admin aside.open {
    transform: translateX(0);
  }

  .admin-menu-close {
    display: inline-grid !important;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12) !important;
    font-size: 24px;
    line-height: 1;
  }

  body.admin-nav-open {
    overflow: hidden;
  }

  body.admin-nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(17, 17, 17, 0.36);
    backdrop-filter: none;
  }

  .admin main {
    padding: 68px 14px 18px;
  }
}

.card-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.save-button,
.notify-button {
  border: 1px solid rgba(18, 61, 53, 0.18);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-900);
  padding: 9px 13px;
  font-weight: 700;
}

.save-button.saved,
.notify-button::after {
  background: rgba(185, 154, 85, 0.16);
  border-color: rgba(185, 154, 85, 0.55);
  color: var(--green-900);
}

.trend-strip {
  background: #fff;
  border-bottom: 1px solid rgba(18, 61, 53, 0.1);
}

.trend-strip .container {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-top: 10px;
  padding-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.trend-strip .container::-webkit-scrollbar {
  display: none;
}

.trend-strip strong {
  flex: 0 0 auto;
  color: var(--green-900);
}

.trend-strip div div,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-strip a,
.chip-list a {
  display: inline-flex;
  border: 1px solid rgba(18, 61, 53, 0.12);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--ivory);
  color: var(--green-900);
  font-weight: 700;
}

.timeline-list {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 86px auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(18, 61, 53, 0.12);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.timeline-item img {
  width: 86px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
}

.timeline-item span,
.timeline-item b {
  color: var(--muted);
  font-size: 13px;
}

.reader-tools {
  margin-top: 22px;
}

.reader-tools details {
  margin-top: 14px;
}

.notify-popover {
  position: fixed;
  top: 92px;
  left: 18px;
  z-index: 10020;
  display: grid;
  gap: 8px;
  width: min(330px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid rgba(185, 154, 85, 0.34);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.notify-popover a {
  color: var(--green-900);
  font-weight: 700;
}

.stats-band {
  padding: 26px 0;
  background: var(--green-900);
}

.stats-band .stat-grid article {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.stats-band .stat-grid span,
.stats-band .stat-grid strong {
  color: #fff;
}

.fast-mode * {
  animation: none !important;
  transition-duration: 0.01ms !important;
}

.fast-mode .lead-story img,
.fast-mode .news-card__image img,
.fast-mode .main-image {
  filter: none;
}

.fast-mode .lead-story {
  grid-template-rows: 220px auto;
}

@media (max-width: 768px) {
  .timeline-item {
    grid-template-columns: 72px 1fr;
  }

  .timeline-item span,
  .timeline-item b {
    grid-column: 2;
  }

  .timeline-item img {
    grid-row: span 3;
    width: 72px;
    height: 58px;
  }

  .notify-popover {
    top: 74px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 768px) {
  .lead-grid {
    align-items: stretch;
  }

  .lead-slider {
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
  }

  .lead-slider .lead-story,
  .lead-slider .lead-story.active,
  .lead-story {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    grid-template-rows: none !important;
    overflow: hidden !important;
  }

  .lead-slider .lead-story {
    position: absolute;
    inset: 0;
  }

  .lead-slider .lead-story.active {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
  }

  .lead-story img,
  .lead-placeholder {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3 !important;
    min-height: 0 !important;
    object-fit: cover !important;
    display: block !important;
    flex: 0 0 auto !important;
  }

  .lead-placeholder {
    display: grid !important;
    place-items: center !important;
  }

  .lead-story > div:last-child {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 18px 16px 22px !important;
    background: #fff !important;
    color: var(--green-900) !important;
    border-top: 4px solid var(--gold) !important;
    z-index: 2 !important;
  }

  .lead-story b {
    display: inline-flex !important;
    width: fit-content;
    margin-bottom: 8px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: var(--gold) !important;
  }

  .lead-story h1 {
    margin: 0 0 12px !important;
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 1.35 !important;
    color: var(--green-900) !important;
    word-break: break-word !important;
  }

  .lead-story p {
    margin: 0 0 16px !important;
    font-size: 16px !important;
    line-height: 1.9 !important;
    color: var(--muted) !important;
  }

  .lead-story .read-more {
    width: fit-content;
  }

  .slider-dots {
    position: static !important;
    justify-content: center;
    padding: 12px 0 16px;
    background: #fff;
  }

  .slider-dots button {
    background: rgba(20, 61, 53, 0.28);
  }

  .slider-dots button.active {
    background: var(--gold);
  }
}
