/* ── Preloader ── */
.thm-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: opacity 0.4s ease;
}

.thm-preloader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.thm-preloader__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #eee;
  border-top-color: var(--thm-accent, #d4a047);
  border-radius: 50%;
  animation: thm-spin 0.7s linear infinite;
}

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

:root {
  --thm-accent: #d4a047;
  --thm-bg: #f4f1ea;
  --thm-surface: #eae6de;
  --thm-text: #000000;
  --thm-muted: #8b8680;
  --thm-border: #e0dbd3;
  --thm-font-base: "IBM Plex Sans Arabic", sans-serif;
  --thm-font-heading: "IBM Plex Sans Arabic", sans-serif;
  --thm-font-size-base: 16px;
  --thm-site-width: 1120px;
  --thm-card-radius: 16px;
  --thm-logo-height: 40px;
  --thm-space: 20px;
  --thm-space-lg: 40px;
  --thm-space-xl: 64px;
  --thm-nav-active-bg: #e5e0d8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--thm-bg) !important;
  color: var(--thm-text);
  font-family: var(--thm-font-base);
  font-size: var(--thm-font-size-base);
  line-height: 1.75;
  text-align: left;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* Simple color transition for links */
.thm-card__title a:hover,
.thm-pro-link:hover {
  color: var(--thm-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--thm-accent);
  outline-offset: 2px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.thm-skip-link {
  position: absolute;
  inset-inline-start: 10px;
  top: -100px;
  z-index: 1000;
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
}

.thm-skip-link:focus {
  top: 10px;
}

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

iframe,
video,
embed,
object {
  max-width: 100%;
}

.thm-container {
  width: min(100% - 40px, var(--thm-site-width));
  margin-inline: auto;
}

/* ── Header ── */
.thm-header {
  border-bottom: 1px solid var(--thm-border);
  background: var(--thm-bg);
}

.thm-header.is-sticky {
  position: sticky;
  top: 0;
  z-index: 40;
}

.thm-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.thm-brand {
  flex-shrink: 0;
}

.thm-brand img {
  max-height: var(--thm-logo-height);
  width: auto;
}

.thm-brand__demo {
  display: inline-flex;
  align-items: center;
}

.thm-brand__demo img {
  display: block;
  width: auto;
  max-height: calc(var(--thm-logo-height) + 10px);
}

/* ── Navigation ── */
.thm-nav {
  min-width: 0;
  margin-inline-end: auto;
}

.thm-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.thm-nav>ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.thm-nav li {
  position: relative;
}

.thm-nav a {
  display: block;
  font-weight: 500;
  text-decoration: none;
  font-size: 15px;
  color: var(--thm-text);
  padding: 8px 16px;
  border-radius: 24px;
  transition: background 0.2s ease, color 0.15s ease;
}

.thm-nav a:hover {
  background: var(--thm-nav-active-bg);
}

.thm-nav li.current-menu-item>a,
.thm-nav li.current_page_item>a {
  background: var(--thm-nav-active-bg);
  font-weight: 600;
}

/* ── Header Actions ── */
.thm-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.thm-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--thm-text);
  border-radius: 50%;
  transition: background 0.2s ease;
}

.thm-search-toggle:hover {
  background: var(--thm-nav-active-bg);
}

/* ── Buttons ── */
.thm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.thm-btn:hover {
  opacity: 0.85;
}

.thm-btn--subscribe {
  background: #000;
  color: #fff;
}

.thm-btn--subscribe svg {
  color: var(--thm-accent);
}

.thm-btn--login {
  background: transparent;
  color: var(--thm-text);
  border: 1.5px solid var(--thm-border);
}

.thm-btn--login:hover {
  border-color: var(--thm-text);
}

.thm-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--thm-text);
}

/* Dropdown Sub-menu */
.thm-nav .sub-menu {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  z-index: 50;
  min-width: 220px;
  max-width: 90vw;
  background: var(--thm-bg);
  border: 1px solid #eaeaea;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.25s ease;
  overflow: hidden;
}

/* Show Sub-menu on Hover/Focus */
.thm-nav li:hover>.sub-menu,
.thm-nav li:focus-within>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Deeply Nested Sub-menus */
.thm-nav .sub-menu .sub-menu {
  top: 0;
  inset-inline-start: 100%;
  transform: translateX(12px);
}

.thm-nav li:hover>.sub-menu .sub-menu {
  transform: translateX(0);
}

/* Sub-menu Items */
.thm-nav .sub-menu a {
  padding: 8px 24px;
  font-size: 14.5px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

.thm-nav .sub-menu a:hover,
.thm-nav .sub-menu li:focus-within>a {
  background: #fdfdfd;
  color: var(--thm-accent);
}

/* Caret for items with children */
.thm-nav .menu-item-has-children>a {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thm-nav .menu-item-has-children>a::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
  margin-top: 2px;
}

.thm-nav .sub-menu .menu-item-has-children>a::after {
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 4px solid currentColor;
  margin-top: 0;
  margin-inline-start: auto;
}

.thm-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 100px;
  padding: 8px 14px;
}

.thm-search-toggle {
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 100px;
  padding: 8px 14px;
  white-space: nowrap;
}

.thm-search-overlay {
  border-bottom: 1px solid #ebebeb;
  background: #fff;
  padding: 16px 0;
}

.thm-breaking {
  border-bottom: 1px solid #eee;
  background: #fafafa;
  font-size: 14px;
}

.thm-breaking__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.thm-breaking__items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.thm-breaking__items a {
  color: var(--thm-muted);
}

.thm-search-form {
  display: flex;
  gap: 10px;
}

.thm-search-form .search-field {
  width: 100%;
  border: 1px solid var(--thm-border);
  border-radius: 24px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--thm-bg);
  font-size: 15px;
}

.thm-search-form .search-field:focus {
  outline: none;
  border-color: var(--thm-text);
}

.search-submit {
  min-height: 44px;
  border: 0;
  background: var(--thm-text);
  color: var(--thm-bg);
  font-weight: 600;
  border-radius: 24px;
  padding: 0 20px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.search-submit:hover {
  opacity: 0.85;
}

.thm-main {
  padding: var(--thm-space-lg) 0 var(--thm-space-xl);
}

.thm-hero {
  border-radius: 36px;
  margin-bottom: var(--thm-space-xl);
  overflow: hidden;
  background: #1a1a1a;
  color: #ffffff;
  padding: 56px 48px;
  position: relative;
}

.thm-hero h1 {
  margin: 0 0 10px;
  font-family: var(--thm-font-heading);
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.14;
  text-wrap: balance;
  color: #ffffff;
}

.thm-hero p {
  margin: 0;
  max-width: 70ch;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
}

.thm-section {
  margin-top: 48px;
}

.thm-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: none;
}

.thm-section__head h2,
.thm-page-header h1,
.thm-podcast-card__title,
.thm-card__title,
.thm-news-card__title,
.thm-episode h1 {
  font-family: var(--thm-font-heading);
  letter-spacing: -0.01em;
  font-weight: 700;
}

.thm-section__head h2 {
  font-size: 22px;
  margin: 0;
}

.thm-page-header {
  margin-bottom: var(--thm-space-lg);
}

.thm-page-header h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3.5vw, 48px);
}

.thm-page-header p {
  color: var(--thm-muted);
  margin: 0;
}

.thm-archive-header {
  margin-bottom: var(--thm-space-lg);
  border-radius: var(--thm-card-radius);
  padding: var(--thm-space) var(--thm-space);
  border: 1px solid var(--thm-border);
  background: var(--thm-surface);
}

.thm-archive-header h1 {
  margin: 0;
  font-family: var(--thm-font-heading);
  font-size: clamp(24px, 3vw, 40px);
}

.thm-archive-header p {
  margin: 8px 0 0;
  color: var(--thm-muted);
}

.thm-archive-header--immersive {
  background: var(--thm-surface);
  padding: var(--thm-space-lg) var(--thm-space);
}

.thm-archive-header--minimal {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--thm-border);
  border-radius: 0;
  padding: 0 0 12px;
}

.thm-podcast-grid,
.thm-news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 40px;
}

.thm-news-grid--cols-1 {
  grid-template-columns: 1fr;
}

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

.thm-news-grid--cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.thm-news-grid--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Card Interactivity */
.thm-card {
  transition: box-shadow 0.3s ease, background-color 0.2s ease;
}

/* Swup Page Transitions */
.transition-fade {
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 1;
  transform: translateY(0);
}

html.is-animating .transition-fade {
  opacity: 0;
  transform: translateY(10px);
}

html.is-leaving .transition-fade {
  opacity: 0;
  transform: translateY(-10px);
}


.thm-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  background-color: var(--thm-surface);
}

.thm-card--horizontal:hover,
.thm-lead-featured .thm-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* ── Lead Stories (Thmanyah Style – Row Layout) ── */

/* Row 1: Featured card – full-width horizontal */
.thm-lead-featured {
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.thm-lead-featured .thm-card.thm-card--lead {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 12px;
}

.thm-lead-featured .thm-card.thm-card--lead .thm-card__media {
  flex-shrink: 0;
  width: 40%;
  height: auto;
  aspect-ratio: 16/10;
  border-radius: var(--thm-card-radius);
  overflow: hidden;
  order: 0;
}

.thm-lead-featured .thm-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--thm-card-radius);
}

.thm-lead-featured .thm-card__body {
  flex: 1;
  min-width: 0;
}

.thm-lead-featured .thm-card__title {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.thm-lead-featured .thm-card__excerpt {
  font-size: 15px;
  color: var(--thm-muted);
  margin-bottom: 12px;
}

/* Row 2: Remaining cards in 2-column grid */
.thm-lead-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 32px;
}

.thm-lead-grid .thm-card.thm-card--horizontal {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 12px;
  border-radius: 0;
}

.thm-lead-grid .thm-card:hover {
  background-color: var(--thm-surface);
}

.thm-lead-grid .thm-card.thm-card--horizontal .thm-card__media {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  order: 0;
}

.thm-lead-grid .thm-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.thm-lead-grid .thm-card__body {
  flex: 1;
  min-width: 0;
}

.thm-lead-grid .thm-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

/* ── Article Card (Thmanyah Style) ── */
.thm-card,
.thm-news-card,
.thm-podcast-card {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 8px;
  transition: background-color 0.2s ease;
}

.thm-card:hover {
  background-color: var(--thm-surface);
}

.thm-card--horizontal {
  display: flex;
  gap: var(--thm-space);
  align-items: flex-start;
}

.thm-card--horizontal .thm-card__media {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  order: 0;
}

.thm-card--lead.thm-card--horizontal .thm-card__media {
  width: 280px;
  height: 200px;
  border-radius: var(--thm-card-radius);
}

/* ── Vertical Card (Documentaries / Podcasts) ── */
.thm-card--vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thm-card--vertical .thm-card__media {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--thm-card-radius);
  overflow: hidden;
}

.thm-card--vertical .thm-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thm-card--vertical .thm-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.thm-card__media--square {
  aspect-ratio: 1/1;
}

.thm-card__media--landscape {
  aspect-ratio: 4/3;
}

.thm-card__media img,
.thm-news-card__media img,
.thm-podcast-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.35s ease;
}

.thm-card:hover img {
  transform: scale(1.04);
}

.thm-card__body {
  flex: 1;
  min-width: 0;
}

.thm-card__category {
  display: inline-flex;
  margin-bottom: 6px;
  border-radius: 999px;
  background: var(--thm-surface);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--thm-muted);
}

.thm-card__title,
.thm-news-card__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.thm-card--lead .thm-card__title {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.3;
}

.thm-card__title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.15s ease;
}

.thm-card__title a:hover {
  text-decoration: underline;
  color: var(--thm-accent);
}

.thm-card__excerpt,
.thm-news-card__excerpt {
  margin: 0 0 8px;
  color: var(--thm-muted);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thm-card__meta,
.thm-news-card__meta {
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--thm-muted);
  font-size: 13px;
}

.thm-card__author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.thm-card__author strong {
  color: var(--thm-text);
  font-weight: 600;
}

.thm-card__avatar,
.thm-card__author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.thm-card__date::before {
  content: "·";
  margin-inline-end: 4px;
}

/* ── Vertical Card ── */
.thm-card--vertical {
  display: flex;
  flex-direction: column;
}

.thm-card--vertical .thm-card__media {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--thm-card-radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.thm-card--vertical .thm-card__media img {
  border-radius: var(--thm-card-radius);
}

/* ── Compact Card (Timeline) ── */
.thm-card--compact {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
}

.thm-card--compact .thm-card__media {
  width: 100px;
  height: 100px;
  border-radius: 10px;
}

.thm-card--compact .thm-card__title {
  font-size: 15px;
}

/* ── Legacy aliases ── */
.thm-news-card__content {
  padding: 0;
}

.thm-podcast-card__content {
  padding: 12px;
}

.thm-news-card__media,
.thm-podcast-card__media {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 1/1;
}

/* ── Lead Grid (Homepage) ── */
.thm-home-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.thm-home-lead__rail {
  display: grid;
  gap: 16px;
  align-content: start;
  grid-auto-rows: min-content;
}

.thm-news-archive {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

.thm-news-archive.has-sidebar {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.thm-news-archive__sidebar .widget {
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.thm-news-grid--list {
  grid-template-columns: 1fr;
}

.thm-news-grid--list .thm-news-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.thm-news-grid--list .thm-news-card__media {
  aspect-ratio: auto;
  min-height: 100%;
}

.thm-news-grid--masonry {
  column-count: 3;
  column-gap: 20px;
  display: block;
}

.thm-news-grid--masonry .thm-news-card,
.thm-news-grid--masonry .thm-ad-slot {
  break-inside: avoid;
  margin: 0 0 20px;
  display: inline-block;
  width: 100%;
}

.thm-news-grid--overlay .thm-news-card {
  position: relative;
  min-height: 320px;
}

.thm-news-grid--overlay .thm-news-card__media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

.thm-news-grid--overlay .thm-news-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.2));
}

.thm-news-grid--overlay .thm-news-card__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  color: #fff;
}

.thm-news-grid--overlay .thm-news-card__category {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.thm-news-grid--overlay .thm-news-card__meta {
  color: rgba(255, 255, 255, 0.85);
}

.thm-news-grid--timeline {
  grid-template-columns: 1fr;
  position: relative;
  gap: 18px;
}

.thm-news-grid--timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 14px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: #e8e8e8;
}

.thm-news-grid--timeline .thm-news-card {
  margin-inline-start: 32px;
  position: relative;
}

.thm-news-grid--timeline .thm-news-card::before {
  content: "";
  position: absolute;
  inset-inline-start: -24px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--thm-accent);
}

.thm-news-headline-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 22px;
}

.thm-news-headline-hero__hero .thm-news-card__title {
  font-size: clamp(26px, 3.5vw, 48px);
  line-height: 1.13;
}

.thm-news-headline-hero__rail {
  display: grid;
  gap: 12px;
}

.thm-news-split-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
}

.thm-news-split-feature__hero .thm-news-card__title {
  font-size: clamp(28px, 3.8vw, 52px);
  line-height: 1.12;
}

.thm-news-split-feature__stack {
  display: grid;
  gap: 12px;
}

.thm-news-river-mix {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.thm-news-river-mix>.thm-news-card {
  grid-column: span 4;
}

.thm-news-river-mix>.thm-news-card.thm-news-card--lead {
  grid-column: span 8;
}

.thm-news-river-mix>.thm-news-card.thm-news-card--compact {
  grid-column: span 4;
}

.thm-news-river-mix>.thm-ad-slot {
  grid-column: 1 / -1;
}

.thm-news-dual-lead-stack {
  display: grid;
  gap: 18px;
}

.thm-news-dual-lead-stack__leads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.thm-news-dual-lead-stack__stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.thm-news-editorial-chess {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.thm-news-editorial-chess__item {
  grid-column: span 6;
}

.thm-news-editorial-chess__item.is-lead {
  grid-column: span 12;
}

.thm-news-editorial-chess__item .thm-news-card--lead .thm-news-card__title {
  font-size: clamp(24px, 3.4vw, 44px);
}

.thm-news-editorial-chess__item--ad {
  grid-column: 1 / -1;
}

.thm-news-numbers-strip {
  display: grid;
  gap: 10px;
}

.thm-news-numbers-strip__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.thm-news-numbers-strip__rank {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.thm-news-topic-tabs {
  display: grid;
  gap: 14px;
}

.thm-topic-tabs__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thm-topic-tab-btn {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 13px;
}

.thm-topic-tab-btn.is-active {
  border-color: var(--thm-accent);
  background: #f8f2e6;
}

.thm-topic-tab-panel {
  display: block;
}

.thm-topic-tab-panel[hidden] {
  display: none;
}

.thm-ad-slot {
  border: 1px dashed #cfcfcf;
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
  background: #fcfcfc;
}

.thm-ad-slot--infeed {
  grid-column: 1 / -1;
}

.thm-podcast-meta {
  margin-top: 10px;
  color: var(--thm-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}

.thm-podcast-single .thm-episode {
  max-width: 840px;
}

.thm-episode__header h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.15;
}

.thm-episode__cover {
  margin: 18px 0 20px;
}

.thm-episode__cover img {
  border-radius: var(--thm-card-radius);
}

.thm-episode__player {
  margin-bottom: 20px;
}

.thm-episode__player audio {
  width: 100%;
}

/* ── Footer ── */
.thm-footer {
  border-top: 1px solid var(--thm-border);
  padding: var(--thm-space-lg) 0;
  margin-top: var(--thm-space-xl);
}

.thm-footer__grid {
  display: grid;
  gap: 24px;
  margin-bottom: var(--thm-space-lg);
}

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

.thm-footer__grid.columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.thm-footer__grid.columns-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.thm-footer__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  border-top: 1px solid var(--thm-border);
  padding-top: var(--thm-space);
}

.thm-footer__meta p {
  margin: 0;
  color: var(--thm-muted);
  font-size: 14px;
}

.thm-footer__social {
  display: flex;
  gap: 20px;
  align-items: center;
}

.thm-footer__social a {
  color: var(--thm-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.thm-footer__social a:hover {
  color: var(--thm-text);
}

.thm-footer__menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}

.thm-footer__menu a {
  color: var(--thm-muted);
  font-size: 14px;
  text-decoration: none;
}

.thm-footer__menu a:hover {
  color: var(--thm-text);
}

/* ── Section Headings (Thmanyah Style) ── */
.thm-section {
  margin-bottom: var(--thm-space-xl);
}

.thm-section__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 700;
  margin-bottom: var(--thm-space-lg);
}

.thm-section__heading svg {
  flex-shrink: 0;
}

/* ── Hero ── */
.thm-hero {
  border-radius: var(--thm-card-radius);
  margin-bottom: var(--thm-space-xl);
  overflow: hidden;
}

.thm-hero h1 {
  text-wrap: balance;
}

/* ── Article Feed 2-Column ── */
.thm-article-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--thm-space-lg) var(--thm-space-xl);
}

.thm-article-feed .thm-card {
  padding-bottom: var(--thm-space);
  border-bottom: 1px solid var(--thm-border);
}

/* ── Category Filter Tabs ── */
.thm-news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--thm-space-lg);
}

.thm-filter-btn {
  padding: 8px 18px;
  border: 1px solid var(--thm-border);
  border-radius: 24px;
  background: transparent;
  color: var(--thm-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.thm-filter-btn:hover {
  background: var(--thm-nav-active-bg);
}

.thm-filter-btn.is-active {
  background: var(--thm-text);
  color: var(--thm-bg);
  border-color: var(--thm-text);
}

/* ── Load More & Pagination ── */
.thm-news-actions {
  text-align: center;
  margin-top: var(--thm-space-lg);
}

.thm-load-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: 1.5px solid var(--thm-border);
  border-radius: 24px;
  background: transparent;
  color: var(--thm-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.thm-load-more:hover {
  background: var(--thm-surface);
}

.thm-pagination {
  margin-top: var(--thm-space-lg);
}

.thm-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.thm-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--thm-text);
  transition: background 0.15s ease;
}

.thm-pagination .page-numbers:hover {
  background: var(--thm-nav-active-bg);
}

.thm-pagination .page-numbers.current {
  background: var(--thm-text);
  color: var(--thm-bg);
}

/* ── News Archive + Sidebar ── */
.thm-news-archive.has-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--thm-space-lg);
  align-items: start;
}

.thm-news-archive__sidebar {
  position: sticky;
  top: 100px;
}

/* ── 404 Page ── */
.thm-main:has(> h1:first-child) {
  text-align: center;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Search Overlay ── */
.thm-search-overlay {
  background: var(--thm-bg);
  padding: var(--thm-space-lg) 0;
  border-bottom: 1px solid var(--thm-border);
}

.thm-back-to-top {
  position: fixed;
  inset-inline-end: 24px;
  inset-block-end: 24px;
  border: 0;
  border-radius: 99px;
  min-height: 44px;
  padding: 0 16px;
  background: #111;
  color: #fff;
  display: none;
}

.thm-back-to-top.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.thm-pagination {
  margin-top: 28px;
}

.thm-pagination.is-hidden {
  display: none;
}

.thm-news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.thm-filter-btn {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}

.thm-filter-btn.is-active {
  border-color: var(--thm-accent);
  background: #f8f2e6;
}

.thm-news-actions {
  margin-top: 18px;
}

.thm-load-more {
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 0 18px;
  background: #111;
  color: #fff;
  font-weight: 600;
}

@media (max-width: 980px) {
  .thm-header__inner {
    grid-template-columns: auto auto;
    justify-content: space-between;
    row-gap: 10px;
  }

  .thm-menu-toggle {
    display: inline-block;
  }

  .thm-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--thm-bg);
    z-index: 1001;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--thm-space-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), visibility 0.4s;
    border: none;
    pointer-events: none;
  }

  .thm-nav.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .thm-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
  }

  .thm-nav a {
    font-size: 24px;
    font-weight: 700;
  }

  /* Submenus on mobile */
  .thm-nav ul ul {
    position: static;
    display: block;
    box-shadow: none;
    background: transparent;
    border: none;
    padding: 0;
    margin-top: 12px;
    text-align: center;
  }

  .thm-nav ul ul a {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.8;
  }

  /* Hamburger to X or Overlay context padding */
  .thm-menu-toggle {
    z-index: 1002;
  }

  .thm-home-lead {
    grid-template-columns: 1fr;
  }

  /* Lead Featured: stack vertically on tablet */
  .thm-lead-featured .thm-card.thm-card--lead {
    flex-direction: column;
    gap: 16px;
  }

  .thm-lead-featured .thm-card.thm-card--lead .thm-card__media {
    width: 100%;
    aspect-ratio: 16/9;
  }

  .thm-lead-featured .thm-card__title {
    font-size: 22px;
  }

  /* Lead Grid: single column on tablet */
  .thm-lead-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Documentaries: 2-col on tablet */
  .thm-news-grid--cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Hero: reduce padding */
  .thm-hero {
    padding: 28px 24px;
    border-radius: 20px;
  }

  .thm-hero__title {
    font-size: 28px;
  }

  /* Reduce section spacing */
  .thm-section {
    margin-top: 36px;
  }

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

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

  .thm-news-grid--cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thm-news-archive.has-sidebar {
    grid-template-columns: 1fr;
  }

  .thm-news-grid--list .thm-news-card {
    grid-template-columns: 1fr;
  }

  .thm-news-grid--masonry {
    column-count: 2;
  }

  .thm-news-headline-hero {
    grid-template-columns: 1fr;
  }

  .thm-news-split-feature {
    grid-template-columns: 1fr;
  }

  .thm-news-river-mix>.thm-news-card,
  .thm-news-river-mix>.thm-news-card.thm-news-card--lead,
  .thm-news-river-mix>.thm-news-card.thm-news-card--compact {
    grid-column: span 6;
  }

  .thm-news-dual-lead-stack__leads,
  .thm-news-dual-lead-stack__stack {
    grid-template-columns: 1fr;
  }

  .thm-news-editorial-chess__item {
    grid-column: span 12;
  }

  .thm-news-numbers-strip__item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .thm-container {
    width: min(100% - 24px, var(--thm-site-width));
  }

  .thm-main {
    padding-top: 30px;
  }

  .thm-search-form {
    flex-direction: column;
  }

  .thm-podcast-grid,
  .thm-news-grid,
  .thm-footer__grid.columns-2,
  .thm-footer__grid.columns-3,
  .thm-footer__grid.columns-4 {
    grid-template-columns: 1fr;
  }

  .thm-news-grid--cols-2,
  .thm-news-grid--cols-4 {
    grid-template-columns: 1fr;
  }

  .thm-news-grid--masonry {
    column-count: 1;
  }

  .thm-news-grid--timeline::before {
    display: none;
  }

  .thm-news-grid--timeline .thm-news-card {
    margin-inline-start: 0;
  }

  .thm-news-grid--timeline .thm-news-card::before {
    display: none;
  }

  .thm-news-river-mix {
    grid-template-columns: 1fr;
  }

  .thm-news-river-mix>.thm-news-card,
  .thm-news-river-mix>.thm-news-card.thm-news-card--lead,
  .thm-news-river-mix>.thm-news-card.thm-news-card--compact {
    grid-column: span 1;
  }

  .thm-footer__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Lead Featured: tighter spacing on mobile */
  .thm-lead-featured {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  .thm-lead-featured .thm-card.thm-card--lead {
    padding: 8px;
    gap: 12px;
  }

  .thm-lead-featured .thm-card__title {
    font-size: 20px;
  }

  /* Lead Grid: smaller images on mobile */
  .thm-lead-grid .thm-card.thm-card--horizontal .thm-card__media {
    width: 90px;
    height: 90px;
  }

  .thm-lead-grid .thm-card.thm-card--horizontal {
    padding: 14px 8px;
  }

  /* Documentaries: single column on mobile */
  .thm-news-grid--cols-3 {
    grid-template-columns: 1fr;
  }

  /* Cards: adjust padding and sizes */
  .thm-card--horizontal .thm-card__media {
    width: 100px !important;
    height: 100px !important;
  }

  .thm-card__title {
    font-size: 16px;
  }

  .thm-card__excerpt {
    -webkit-line-clamp: 2;
  }

  /* Hero: compact on mobile */
  .thm-hero {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .thm-hero__title {
    font-size: 22px;
  }

  .thm-hero__text {
    font-size: 14px;
  }

  /* Section spacing */
  .thm-section {
    margin-top: 28px;
  }

  .thm-section__head h2 {
    font-size: 18px;
  }

  /* Vertical cards: smaller on mobile */
  .thm-card--vertical .thm-card__title {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
