/*
Theme Name: Custom Haredi News
Theme URI: https://example.com/custom-haredi-news
Description: ערכת נושא עצמאית לאתר חדשות חרדי. עיצוב נקי ומסורתי, תמיכה מלאה בעברית ו-RTL, מיקומי פרסומות קבועים, ממשק מחולל תוכן AI.
Author: Antigravity AI
Version: 2.1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, responsive, rtl, hebrew, news, ad-placements
Text Domain: custom-haredi-news
*/

/* =========================================================
   GOOGLE FONTS IMPORT – Alef (Hebrew, noble & readable)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Alef:wght@400;700&display=swap');

/* =========================================================
   DESIGN TOKENS – Neutral Haredi News Palette
   ========================================================= */
:root {
  /* Brand colors */
  --color-bg:           #fdfcf9;   /* warm off-white – feels like newsprint */
  --color-surface:      #ffffff;
  --color-surface-2:    #f7f5f0;   /* subtle alt surface for cards */
  --color-border:       #e2ddd6;
  --color-border-soft:  #ede9e1;
  --color-text:         #1a1a1a;   /* near-black – maximum readability */
  --color-text-muted:   #5c5c5c;
  --color-text-light:   #888;
  --color-accent:       #2d5c8a;   /* dignified navy blue */
  --color-accent-hover: #1e3f62;
  --color-accent-light: #e8f0f9;
  --color-ad-bg:        #f5f3ef;
  --color-breaking:     #b22222;   /* deep red for breaking news label */
  --color-category:     #2d5c8a;

  /* Typography */
  --font-primary: 'Alef', 'Arial Hebrew', Arial, sans-serif;
  --font-size-base: 1.0625rem;    /* 17px */
  --font-size-sm:   0.875rem;     /* 14px */
  --font-size-xs:   0.8125rem;    /* 13px */
  --line-height-base: 1.85;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  2rem;
  --space-xl:  3rem;

  /* Layout */
  --content-max-width: 860px;
  --radius:     4px;
  --radius-lg:  8px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);

  /* Transitions */
  --transition: 0.2s ease;
}

/* =========================================================
   BASE RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  direction: rtl;
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; height: auto; display: block; }
ul, ol { padding-right: 1.5rem; padding-left: 0; }

/* =========================================================
   ACCESSIBILITY – WCAG 2.1 AA
   ========================================================= */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}
/* Hide outline for mouse users, show for keyboard */
:focus:not(:focus-visible) { outline: none; }

.screen-reader-text {
  border: 0;
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}

.skip-link {
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-primary);
  padding: 0.75rem 1.5rem;
  position: absolute;
  top: -100%;
  right: var(--space-md);
  z-index: 99999;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus { top: var(--space-md); }

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}
h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); }
h3 { font-size: clamp(1.05rem, 2.5vw, 1.25rem); }
h4 { font-size: 1.05rem; }

p { margin-bottom: var(--space-md); }

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
a:hover { color: var(--color-accent-hover); text-decoration-color: var(--color-accent-hover); }

strong, b { font-weight: 700; }

blockquote {
  border-right: 4px solid var(--color-accent);
  border-left: none;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: var(--color-accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

/* =========================================================
   LAYOUT – MOBILE FIRST
   ========================================================= */
.site-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}
@media (min-width: 640px) {
  .site-wrapper { padding: 0 var(--space-lg); }
}

.content-wrapper { padding-top: var(--space-lg); padding-bottom: var(--space-xl); }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  background: var(--color-surface);
  border-bottom: 3px solid var(--color-accent);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.site-branding { flex: 1 1 auto; }

.site-title-link {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: block;
}
.site-title-link:hover { color: var(--color-accent-hover); text-decoration: none; }

.site-description {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  margin: 0;
  line-height: 1.4;
}

/* Custom logo */
.custom-logo { max-height: 60px; width: auto; }

/* =========================================================
   HAMBURGER / MOBILE MENU TOGGLE
   ========================================================= */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.menu-toggle:hover { background: var(--color-accent-light); }
.menu-toggle[aria-expanded="true"] { background: var(--color-accent-light); }

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 767px) {
  .menu-toggle { display: flex; }
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.main-navigation {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 73px; /* below sticky header */
  z-index: 999;
}

.main-navigation .site-wrapper { padding-top: 0; padding-bottom: 0; }

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0;
}

.main-navigation li {
  position: relative;
}

.main-navigation li a {
  display: block;
  padding: 0.7rem var(--space-md);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--font-size-sm);
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.main-navigation li a:hover,
.main-navigation li.current-menu-item > a,
.main-navigation li.current-menu-ancestor > a {
  background: var(--color-accent);
  color: #fff;
}

/* Dropdown sub-menu */
.main-navigation ul ul {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius) var(--radius);
  min-width: 200px;
  display: none;
  box-shadow: var(--shadow-hover);
  z-index: 100;
}
.main-navigation ul li:hover > ul,
.main-navigation ul li:focus-within > ul { display: block; }
.main-navigation ul ul li a { font-weight: 400; font-size: var(--font-size-sm); }

/* Mobile nav */
@media (max-width: 767px) {
  .main-navigation { position: static; }
  .main-navigation ul {
    display: none;
    flex-direction: column;
  }
  .main-navigation.menu-open ul { display: flex; }
  .main-navigation li a { padding: var(--space-md); border-bottom: 1px solid var(--color-border-soft); }
  .main-navigation ul ul { position: static; box-shadow: none; border: none; padding-right: var(--space-lg); display: block; }
}

/* =========================================================
   BREAKING NEWS TICKER
   ========================================================= */
.breaking-news-bar {
  background: var(--color-breaking);
  color: #fff;
  overflow: hidden;
}

.ticker-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.ticker-label {
  background: #fff;
  color: var(--color-breaking);
  font-weight: 700;
  font-size: var(--font-size-xs);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.ticker-track {
  display: flex;
  gap: var(--space-xl);
  animation: ticker-scroll 35s linear infinite;
  white-space: nowrap;
}
.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
  color: #fff;
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: opacity var(--transition);
}
.ticker-item:hover { opacity: 0.85; color: #fff; text-decoration: underline; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =========================================================
   HERO SECTION (Homepage presenter)
   ========================================================= */
.hero-section {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  color: #fff;
  padding: var(--space-xl) 0;
  margin-bottom: var(--space-lg);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.hero-text { flex: 1 1 auto; }

.hero-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: var(--space-xs);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #fff;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.hero-description {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 560px;
  margin-bottom: 0;
  line-height: 1.6;
}

/* =========================================================
   ARTICLE CARD GRID
   ========================================================= */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

@media (max-width: 600px) {
  .articles-grid { grid-template-columns: 1fr; gap: var(--space-md); }
}

.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
}
.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-thumb-link { display: block; overflow: hidden; aspect-ratio: 16/9; }
.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-card:hover .card-thumb { transform: scale(1.04); }

.card-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: var(--font-size-xs);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  text-decoration: none;
  margin-bottom: var(--space-sm);
  transition: background var(--transition), color var(--transition);
}
.card-category:hover { background: var(--color-accent); color: #fff; }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}
.card-title a {
  color: var(--color-text);
  text-decoration: none;
}
.card-title a:hover { color: var(--color-accent); }

.card-excerpt {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: var(--space-sm);
  flex: 1;
}

.card-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  border-top: 1px solid var(--color-border-soft);
  padding-top: var(--space-sm);
  margin-top: auto;
}

/* =========================================================
   PAGINATION
   ========================================================= */
.posts-pagination {
  text-align: center;
  margin: var(--space-lg) 0;
}
.posts-pagination .nav-links { display: flex; gap: var(--space-sm); justify-content: center; flex-wrap: wrap; }
.posts-pagination .page-numbers {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-accent);
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: background var(--transition), color var(--transition);
}
.posts-pagination .page-numbers:hover { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.posts-pagination .page-numbers.current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* =========================================================
   ARCHIVE HEADER
   ========================================================= */
.archive-header {
  border-bottom: 2px solid var(--color-border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}
.archive-header .page-title { color: var(--color-accent); }
.archive-description { color: var(--color-text-muted); font-size: var(--font-size-sm); margin-top: var(--space-xs); }

/* =========================================================
   BREADCRUMB
   ========================================================= */
.breadcrumb {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
  list-style: none;
  padding: 0;
}
.breadcrumb li::after { content: '›'; margin-right: var(--space-xs); color: var(--color-border); }
.breadcrumb li:last-child::after { content: none; }
.breadcrumb a { color: var(--color-accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* =========================================================
   SINGLE POST LAYOUT
   ========================================================= */
.single-post .entry-header { margin-bottom: var(--space-lg); }

.single-post .entry-title {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  line-height: 1.25;
  margin-bottom: var(--space-sm);
}

.single-post .entry-meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}
.single-post .entry-meta .byline::before { content: '|'; margin-left: var(--space-sm); opacity: 0.4; }

.single-post .entry-content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  font-size: var(--font-size-base);
}
.single-post .entry-content p { margin-bottom: 1.4rem; }
.single-post .entry-content img { max-width: 100%; height: auto; border-radius: var(--radius); margin: var(--space-md) 0; }
.single-post .entry-content h2 { margin-top: var(--space-lg); }

/* Featured image */
.post-thumbnail { margin-bottom: var(--space-lg); }
.post-thumbnail img { width: 100%; height: auto; border-radius: var(--radius-lg); display: block; }

/* =========================================================
   AD SLOTS – Fixed positions: top / middle / bottom
   ========================================================= */
.ad-slot {
  background: var(--color-ad-bg);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-xs);
  position: relative;
}

/* Subtle "ad" label */
.ad-slot::before {
  content: attr(data-label);
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.7rem;
  color: var(--color-text-light);
  background: var(--color-border-soft);
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.ad-slot--top    { min-height: 90px; }  /* Leaderboard */
.ad-slot--middle { min-height: 250px; } /* Rectangle */
.ad-slot--bottom { min-height: 90px; }

/* =========================================================
   COMMENTS
   ========================================================= */
.comments-area {
  max-width: var(--content-max-width);
  margin: var(--space-xl) auto 0;
  padding-top: var(--space-lg);
  border-top: 2px solid var(--color-border);
}
.comments-title { margin-bottom: var(--space-lg); }
.comment-list { list-style: none; padding: 0; }
.comment-body { background: var(--color-surface-2); border-radius: var(--radius); padding: var(--space-md); margin-bottom: var(--space-md); }
.comment-author .fn { font-weight: 700; }
.comment-metadata { font-size: var(--font-size-xs); color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.comment-content p { font-size: var(--font-size-sm); margin-bottom: 0; }
.children { padding-right: var(--space-lg); padding-left: 0; }

/* Comment form */
.comment-form label { display: block; font-weight: 700; margin-bottom: var(--space-xs); font-size: var(--font-size-sm); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  direction: rtl;
  transition: border-color var(--transition);
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--color-accent); }
.comment-form .form-submit { margin-top: var(--space-md); }
.comment-form .submit {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: background var(--transition);
}
.comment-form .submit:hover { background: var(--color-accent-hover); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--color-surface);
  border-top: 3px solid var(--color-accent);
  padding: var(--space-xl) 0 var(--space-lg);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}
.site-footer a { color: var(--color-accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.footer-widgets {
  margin-bottom: var(--space-lg);
  text-align: right;
}

.footer-links nav ul {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  list-style: none;
  padding: 0;
}
.footer-links nav ul li a {
  font-weight: 600;
  color: var(--color-text);
}
.footer-links nav ul li a:hover { color: var(--color-accent); }

.site-copyright { margin-bottom: var(--space-xs); }
.footer-accessibility { font-size: var(--font-size-xs); }

/* =========================================================
   LEGAL PAGES
   ========================================================= */
.legal-page .entry-content {
  max-width: 760px;
  margin: 0 auto;
}
.legal-page .entry-content h2 {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-soft);
  color: var(--color-accent);
}
.legal-page .entry-content h2:first-child { border-top: none; padding-top: 0; }
.legal-page .entry-content ul,
.legal-page .entry-content ol { margin-bottom: var(--space-md); }
.legal-page .entry-content li { margin-bottom: var(--space-xs); }

/* =========================================================
   404 / ERROR PAGE
   ========================================================= */
.error-404 { text-align: center; padding: var(--space-xl) 0; }
.error-404 .page-title { font-size: clamp(1.5rem, 4vw, 2.2rem); color: var(--color-accent); margin-bottom: var(--space-lg); }
.button-primary-link {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition);
}
.button-primary-link:hover { background: var(--color-accent-hover); color: #fff; }

/* =========================================================
   SEARCH FORM
   ========================================================= */
.search-form { display: flex; gap: var(--space-sm); direction: rtl; }
.search-form .search-field {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  direction: rtl;
}
.search-form .search-submit {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: background var(--transition);
}
.search-form .search-submit:hover { background: var(--color-accent-hover); }

/* =========================================================
   NO RESULTS
   ========================================================= */
.no-results { text-align: center; padding: var(--space-xl) 0; }
.no-results h2 { color: var(--color-text-muted); margin-bottom: var(--space-md); }

/* =========================================================
   PAGE HEADER (archive / search)
   ========================================================= */
.page-header {
  border-bottom: 2px solid var(--color-border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}
.page-title { color: var(--color-accent); }

/* =========================================================
   WIDGETS
   ========================================================= */
.widget { margin-bottom: var(--space-lg); }
.widget-title { font-size: 1rem; font-weight: 700; margin-bottom: var(--space-sm); padding-bottom: var(--space-xs); border-bottom: 2px solid var(--color-accent); color: var(--color-accent); }
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-border-soft); font-size: var(--font-size-sm); }
.widget ul li a { color: var(--color-text); text-decoration: none; }
.widget ul li a:hover { color: var(--color-accent); }

/* =========================================================
   ENTRY TAGS (single post footer)
   ========================================================= */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.entry-tag {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.entry-tag:hover { background: var(--color-accent); color: #fff; }

/* =========================================================
   ENTRY CATEGORIES (single post header badges)
   ========================================================= */
.entry-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

/* =========================================================
   THUMBNAIL CAPTION
   ========================================================= */
.thumbnail-caption {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-xs);
  font-style: italic;
}

/* =========================================================
   EDIT LINK
   ========================================================= */
.edit-link a {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}
.edit-link a:hover { color: var(--color-accent); }

/* =========================================================
   PAGE LINKS (multi-page posts)
   ========================================================= */
.page-links {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: var(--space-lg) 0;
}
.page-links a {
  background: var(--color-accent);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  margin: 0 2px;
  text-decoration: none;
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS (legacy selectors)
   ========================================================= */
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .hero-section { padding: var(--space-lg) 0; }
  .hero-title { font-size: 1.8rem; }
  .site-footer .footer-links nav ul { flex-direction: column; align-items: center; gap: var(--space-sm); }
  .ticker-track { animation-duration: 20s; }
}

@media (min-width: 768px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(3, 1fr); }
  .site-wrapper { max-width: var(--content-max-width); }
}


/* =========================================================
   CHN COMPONENT SYSTEM  (.chn-* naming convention)
   Matches classes used in index.php, header.php, footer.php.
   ========================================================= */

/* --- Container ------------------------------------------ */
.chn-container {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}
@media (max-width: 600px) {
  .chn-container { padding-left: var(--space-md); padding-right: var(--space-md); }
}

/* --- Main content area ---------------------------------- */
.chn-main { display: block; }
.chn-page-body { padding-top: var(--space-lg); padding-bottom: var(--space-xl); }

/* --- Header alias --------------------------------------- */
/* .chn-header maps to .site-header — both apply identical rules */
.chn-header {
  background: var(--color-surface);
  border-bottom: 3px solid var(--color-accent);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* --- Ticker alias --------------------------------------- */
.chn-ticker {
  background: var(--color-breaking);
  color: #fff;
  overflow: hidden;
}
.chn-ticker__label {
  background: #fff;
  color: var(--color-breaking);
  font-weight: 700;
  font-size: var(--font-size-xs);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.chn-ticker__track {
  display: flex;
  gap: var(--space-xl);
  animation: ticker-scroll 35s linear infinite;
  white-space: nowrap;
}
.chn-ticker__track:hover { animation-play-state: paused; }
.chn-ticker__item {
  color: #fff;
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 600;
}
.chn-ticker__item:hover { opacity: 0.85; color: #fff; text-decoration: underline; }

/* --- Hero ----------------------------------------------- */
.chn-hero {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  color: #fff;
  padding: var(--space-xl) 0;
  margin-bottom: var(--space-lg);
}
.chn-hero__inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.chn-hero__text { flex: 1 1 auto; }
.chn-hero__eyebrow {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: var(--space-xs);
}
.chn-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #fff;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}
.chn-hero__desc {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 560px;
  margin-bottom: 0;
  line-height: 1.6;
}
@media (max-width: 600px) {
  .chn-hero { padding: var(--space-lg) 0; }
  .chn-hero__title { font-size: 1.8rem; }
}

/* --- Article Grid --------------------------------------- */
.chn-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
@media (min-width: 640px) {
  .chn-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .chn-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
  .chn-grid { gap: var(--space-md); }
}

/* --- Article Card --------------------------------------- */
.chn-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
  list-style: none;
}
.chn-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.chn-card__thumb-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.chn-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.chn-card:hover .chn-card__thumb { transform: scale(1.04); }

.chn-card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-xs);
}

.chn-card__category {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: var(--font-size-xs);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  align-self: flex-start;
}
.chn-card__category:hover { background: var(--color-accent); color: #fff; }

.chn-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}
.chn-card__title a { color: var(--color-text); text-decoration: none; }
.chn-card__title a:hover { color: var(--color-accent); }

.chn-card__excerpt {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0;
  flex: 1;
}

.chn-card__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  border-top: 1px solid var(--color-border-soft);
  padding-top: var(--space-sm);
  margin-top: var(--space-sm);
}

/* --- Ad slots ------------------------------------------- */
.chn-ad {
  margin: var(--space-lg) 0;
}
.chn-ad--leaderboard        .ad-slot { min-height: 90px; }
.chn-ad--rectangle          .ad-slot { min-height: 250px; }
.chn-ad--leaderboard-bottom .ad-slot { min-height: 90px; }

/* --- Pagination ----------------------------------------- */
.chn-pagination {
  text-align: center;
  margin: var(--space-lg) 0;
}
.chn-pagination .nav-links {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}
.chn-pagination .page-numbers {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-accent);
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: background var(--transition), color var(--transition);
}
.chn-pagination .page-numbers:hover { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.chn-pagination .page-numbers.current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* --- Breadcrumb ----------------------------------------- */
.chn-breadcrumb {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}
.chn-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}
.chn-breadcrumb li { display: flex; align-items: center; gap: var(--space-xs); }
.chn-breadcrumb li::after { content: '‹'; color: var(--color-border); }
.chn-breadcrumb li:last-child::after { content: none; }
.chn-breadcrumb a { color: var(--color-accent); text-decoration: none; }
.chn-breadcrumb a:hover { text-decoration: underline; }

/* --- Page header (archive / search) --------------------- */
.chn-page-header {
  border-bottom: 2px solid var(--color-border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}
.chn-page-header__title { color: var(--color-accent); }
.chn-page-header__desc { color: var(--color-text-muted); font-size: var(--font-size-sm); margin-top: var(--space-xs); }
.chn-search-term { color: var(--color-accent); }

/* --- No results ----------------------------------------- */
.chn-no-results { text-align: center; padding: var(--space-xl) 0; }
.chn-no-results h2 { color: var(--color-text-muted); margin-bottom: var(--space-md); }

/* --- Navigation alias ----------------------------------- */
/* .chn-nav is the primary navigation wrapper */
.chn-nav,
.main-navigation {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 73px;
  z-index: 999;
}


/* =========================================================
   CATEGORY QUICK-NAV  (.chn-cat-nav)
   Homepage horizontal scrollable category bar.
   ========================================================= */
.chn-cat-nav {
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chn-cat-nav::-webkit-scrollbar { display: none; }
.chn-cat-nav__list {
  display: flex;
  gap: var(--space-sm);
  list-style: none;
  padding: var(--space-sm) 0;
  margin: 0;
  flex-wrap: nowrap;
}
.chn-cat-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.4rem 1rem;
  background: var(--color-accent-light);
  color: var(--color-accent);
  border: 1px solid transparent;
  border-radius: 100px;
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.chn-cat-nav__link:hover,
.chn-cat-nav__link:focus-visible {
  background: var(--color-accent);
  color: #fff;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.chn-cat-nav__count {
  background: rgba(0,0,0,0.1);
  border-radius: 100px;
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
  font-weight: 400;
}

/* --- Card author ---------------------------------------- */
.chn-card__author {
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
}

/* =========================================================
   ELEMENTOR COMPATIBILITY
   Prevents theme containers from constraining Elementor layouts.
   ========================================================= */

/* Full-width: remove max-width so Elementor sections span 100% */
.elementor-page .chn-main--full-width,
.elementor-page .chn-main--full-width .chn-container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Canvas: hide any injected admin bar offset */
.elementor-page-type-canvas {
  margin-top: 0 !important;
}

/* Ensure Elementor widgets inherit RTL direction */
.elementor-widget-wrap,
.elementor-section,
.elementor-container {
  direction: rtl;
  text-align: right;
}

/* Let Elementor control its own column gaps */
.elementor-row {
  flex-direction: row-reverse;
}
