/*
Theme Name: Media Inak
Theme URI: https://www.mediainak.sk
Author: Media Inak
Author URI: https://www.mediainak.sk
Description: Moderny spravodajsky theme pre Media Inak - nezavisly slovensky spravodajsky portal.
Version: 2.1.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mediainak
Tags: news, blog, custom-colors, custom-logo, featured-images, translation-ready, two-columns
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4

Changelog:
2.1.5 (2026-04-23) — SEO + A11Y + Performance fixes (nad v2.1.3 base; preskakuje neuspesnu v2.1.4 so Svet-AI shortcode v teme)
  SEO:
  - Odstranena duplicitna custom JSON-LD NewsArticle schema (AIOSEO to riesi kompletnejsie)
  - REST API: povolene GET/HEAD/OPTIONS pre crawlery (fix 401 v Google Search Console)
  - Noindex,follow pre kategorie 'domov-a-kazdodenny-zivot' a 'nezaradene'
  - Canonical duplicity prevention (remove_action wp_head rel_canonical)
  - 301 redirecty /home, /ukazkova-stranka -> riesene v Redirection plugin (cistejsie)
  Security / A11Y:
  - XSS fix v archive.php (esc_html pri get_search_query)
  - XSS hardening vo footer.php (wp_kses pre social SVG ikony)
  - isset() guard pre $_SERVER['REMOTE_ADDR'] (mediainak_client_ip helper)
  - Newsletter form: label + aria-label + required (WCAG 2.1 AA)
  Performance:
  - Lazy-load -> riesene v EWWW Image Optimizer plugin (sofistikovanejsi nez nas filter)
2.1.4 — (neuspesna vetva, integrovala Svet-AI shortcode do temy — revertnute)
2.1.3 — Security hardening (XMLRPC off, hidden login URL, rate limit, REST API block, honeypot)
*/

/* ═══════════════════════════════════════════
   MEDIA INAK — WordPress Theme v2.0
   ═══════════════════════════════════════════ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --accent: #ef4444;
  --accent-orange: #f97316;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --max-width: 1280px;
  --header-height: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Category colors */
  --cat-slovensko: #2563eb;
  --cat-ekonomika: #059669;
  --cat-technologie: #7c3aed;
  --cat-lifestyle: #ec4899;
  --cat-testy: #f59e0b;
  --cat-nazory: #6366f1;
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

[data-theme="dark"] img { filter: brightness(0.92); }
[data-theme="dark"] .logo img { filter: brightness(0) invert(1); }
[data-theme="dark"] .footer-logo-invert { filter: brightness(0) invert(1); }

/* Dark mode icon toggle */
.theme-toggle .icon-sun,
.dark-mode-fab .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon,
[data-theme="dark"] .dark-mode-fab .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun,
[data-theme="dark"] .dark-mode-fab .icon-sun { display: block; }

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

/* ── RESET & BASE ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── BREAKING NEWS BAR ── */
.breaking-bar {
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}

.breaking-label {
  background: rgba(0,0,0,0.2);
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
}

.breaking-label svg { flex-shrink: 0; }

.breaking-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}

.breaking-ticker-track {
  display: inline-flex;
  gap: 0;
  white-space: nowrap;
  align-items: center;
  animation: ticker-scroll var(--ticker-duration, 30s) linear infinite;
  will-change: transform;
  padding: 0 16px;
}

.breaking-ticker-track:hover,
.breaking-ticker-track.dragging {
  animation-play-state: paused;
}

.breaking-dot {
  margin: 0 20px;
  opacity: 0.4;
  flex-shrink: 0;
  user-select: none;
}

.breaking-ticker-track a {
  color: #fff;
  transition: opacity var(--transition);
  flex-shrink: 0;
  display: inline-block;
}

.breaking-ticker-track a:hover { opacity: 0.8; }

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

/* ── HEADER ── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.logo img,
.logo svg {
  width: 40px;
  height: 40px;
}

.logo .media { color: var(--text); }
.logo .inak { color: var(--primary); }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.search-toggle:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* ── NAVIGATION ── */
.site-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
}

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

.nav-list a {
  display: block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
}

.nav-list a:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.nav-list .current-menu-item a,
.nav-list a.active {
  background: var(--primary);
  color: #fff;
}

.mobile-nav-extras { display: none; }

/* ── SEARCH OVERLAY ── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.search-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 8px;
  width: 90%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.search-overlay.active .search-box {
  transform: translateY(0);
}

.search-box input[type="search"],
.search-box input[type="text"] {
  width: 100%;
  padding: 16px 20px;
  font-size: 18px;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font-family: var(--font);
}

.search-box input::placeholder { color: var(--text-muted); }

/* ── HERO GRID ── */
.hero-section {
  padding: 32px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  aspect-ratio: 2.2/1;
}

.hero-main {
  grid-row: 1 / -1;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
}

.hero-main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-main .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
}

/* ── CATEGORY BADGES ── */
.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: fit-content;
  color: #fff;
}

.hero-main .hero-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-top: 12px;
}

.hero-main .hero-excerpt {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  margin-top: 10px;
  line-height: 1.5;
  max-width: 600px;
}

.hero-main .hero-meta,
.hero-side-card .hero-meta {
  margin-top: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-sidebar {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  min-height: 0;
}

.hero-side-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}

.hero-side-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-side-card .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.15) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.hero-side-card .hero-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-top: 8px;
}

.hero-side-card .hero-meta {
  font-size: 12px;
}

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: var(--primary);
  display: inline-block;
}

.section-title[data-color="green"]::before { background: var(--cat-ekonomika); }
.section-title[data-color="purple"]::before { background: var(--cat-technologie); }
.section-title[data-color="pink"]::before { background: var(--cat-lifestyle); }
.section-title[data-color="orange"]::before { background: var(--cat-testy); }

.section-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}

.section-more:hover { gap: 8px; }

/* ── ARTICLE CARDS GRID ── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: block;
}

.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.article-card .card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.article-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .card-image img {
  transform: scale(1.05);
}

.article-card .card-body {
  padding: 16px;
}

.article-card .card-category,
.card-category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
  display: inline-block;
}

.article-card .card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* ── FEATURED + LIST LAYOUT ── */
.featured-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.featured-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: block;
}

.featured-card:hover { box-shadow: var(--shadow-lg); }

.featured-card .card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.featured-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-card:hover .card-image img { transform: scale(1.03); }

.featured-card .card-body { padding: 24px; }

.featured-card .card-category {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.featured-card .card-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.featured-card .card-excerpt {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

/* ── ARTICLE LIST ── */
.article-list {
  display: flex;
  flex-direction: column;
}

.article-list-item {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.article-list-item:first-child { padding-top: 0; }
.article-list-item:last-child { border-bottom: none; }
.article-list-item:hover { padding-left: 8px; }

.article-list-item .list-image {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.article-list-item .list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-list-item .list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-list-item .list-category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.article-list-item .list-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.article-list-item .list-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── CONTENT + SIDEBAR ── */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  padding: 32px 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.widget-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title svg { color: var(--accent); }

/* ── TRENDING LIST ── */
.trending-list {
  list-style: none;
}

.trending-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
  cursor: pointer;
}

.trending-item:last-child { border-bottom: none; }
.trending-item:hover { padding-left: 4px; }

.trending-number {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  min-width: 32px;
}

.trending-content .trending-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.trending-content .trending-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2px;
}

/* ── NEWSLETTER ── */
.newsletter-section {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1e293b 100%);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  color: #fff;
  margin: 48px 0;
}

.newsletter-section h3 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
}

.newsletter-section p {
  color: #94a3b8;
  font-size: 16px;
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}

.newsletter-form input:focus { border-color: var(--primary); }
.newsletter-form input::placeholder { color: #64748b; }

.newsletter-form button {
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: background var(--transition);
  white-space: nowrap;
}

.newsletter-form button:hover { background: var(--primary-dark); }

/* ── CATEGORY SECTIONS ── */
.category-section {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

/* ── SINGLE POST ── */
.single-post-header {
  max-width: 800px;
  margin: 48px auto 32px;
  text-align: center;
}

.single-post-header .card-category {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
}

.single-post-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.single-post-header .post-meta {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.post-meta-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.post-meta-author { font-weight: 600; color: var(--text); }

.single-post-featured {
  max-width: 960px;
  margin: 0 auto 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.single-post-featured img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.single-post-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 40px;
  max-width: 960px;
  margin: 0 auto;
}

.single-post-content {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.single-post-content h2,
.single-post-content h3 {
  color: var(--text);
  margin: 32px 0 16px;
  font-weight: 700;
}

.single-post-content h2 { font-size: 28px; }
.single-post-content h3 { font-size: 22px; }
.single-post-content p { margin-bottom: 20px; }

.single-post-content img {
  border-radius: var(--radius);
  margin: 24px 0;
}

.single-post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.single-post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text);
}

.single-post-content ul,
.single-post-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.single-post-content li { margin-bottom: 8px; }

/* ── EMBEDS / VIDEO ── */
.single-post-content { min-width: 0; }

.single-post-content iframe,
.single-post-content video,
.single-post-content embed,
.single-post-content object {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px 0;
  border-radius: var(--radius);
}

.single-post-content .wp-block-embed {
  margin: 24px 0;
  max-width: 100%;
}

.single-post-content .wp-block-embed__wrapper {
  position: relative;
  max-width: 100%;
}

.single-post-content .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper {
  aspect-ratio: 16 / 9;
}

.single-post-content .wp-block-embed.wp-has-aspect-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.single-post-content .wp-embed-aspect-4-3 .wp-block-embed__wrapper { aspect-ratio: 4 / 3; }
.single-post-content .wp-embed-aspect-1-1 .wp-block-embed__wrapper { aspect-ratio: 1 / 1; }
.single-post-content .wp-embed-aspect-9-16 .wp-block-embed__wrapper { aspect-ratio: 9 / 16; }
.single-post-content .wp-embed-aspect-1-2 .wp-block-embed__wrapper { aspect-ratio: 1 / 2; }

/* ── SHARE WIDGET ── */
.single-post-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 80px);
  align-self: start;
}

.share-widget h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  font-size: 12px;
}

.share-btn:hover { border-color: var(--primary); color: var(--primary); }
.share-facebook:hover { color: #1877f2; border-color: #1877f2; }
.share-whatsapp:hover { color: #25d366; border-color: #25d366; }
.share-twitter:hover { color: #0f172a; border-color: #0f172a; }
[data-theme="dark"] .share-twitter:hover { color: #e2e8f0; border-color: #e2e8f0; }

/* ── SINGLE POST FOOTER ── */
.single-post-footer {
  max-width: 720px;
  margin: 40px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ── AUTHOR BOX ── */
.author-box {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin: 32px 0;
}

.author-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.author-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.author-name {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}

.author-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 6px;
}

/* ── POST NAVIGATION ── */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}

.post-nav-link {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-nav-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.post-nav-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-nav-next .post-nav-label { justify-content: flex-end; }
.post-nav-next { text-align: right; }

.post-nav-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── RELATED ARTICLES ── */
.related-articles {
  margin-top: 48px;
}

.related-articles .section-title { margin-bottom: 24px; }

.related-articles .articles-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* ── COMMENTS ── */
.comments-section { margin-top: 48px; }

/* ── PAGE TEMPLATE ── */
.page-content {
  max-width: 800px;
  margin: 48px auto;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 32px;
}

/* ── SEARCH RESULTS ── */
.search-results-header {
  text-align: center;
  padding: 32px 0 40px;
}

.search-results-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.search-results-query {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
  margin: 8px 0;
}

.search-results-count {
  font-size: 14px;
  color: var(--text-muted);
}

.search-no-results {
  text-align: center;
  padding: 80px 20px;
}

.search-no-results h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 16px 0 8px;
}

.search-no-results p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── 404 PAGE ── */
.error-404 {
  text-align: center;
  padding: 60px 20px 80px;
}

.error-404-icon { margin-bottom: 16px; }

.error-404 h1 {
  font-family: var(--font-serif);
  font-size: 80px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 16px;
}

.error-404-text {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.error-404-search {
  max-width: 400px;
  margin: 0 auto 24px;
}

.error-404-search input[type="search"] {
  width: 100%;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}

.error-404-search input:focus { border-color: var(--primary); }

.error-404-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  transition: background var(--transition);
}

.error-404-btn:hover { background: var(--primary-dark); }

.error-404-recent {
  margin-top: 64px;
  text-align: left;
}

.error-404-recent .section-title { margin-bottom: 24px; }

/* ── SIDEBAR WIDGETS (WordPress default) ── */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.widget h2 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 20px;
}

/* ── TAGS ── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-alt);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.tag-cloud a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 48px 0;
}

.pagination .nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── FOOTER ── */
.site-footer {
  background: var(--bg-dark);
  color: #cbd5e1;
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid #1e293b;
}

.footer-brand .logo { margin-bottom: 16px; }
.footer-brand .logo .media { color: #fff; }
.footer-logo-invert { filter: brightness(0) invert(1); }

.footer-brand > p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #1e293b;
  color: #94a3b8;
  transition: all var(--transition);
}

.footer-social a:hover {
  background: var(--primary);
  color: #fff;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }

.footer-col a {
  font-size: 14px;
  color: #64748b;
  transition: color var(--transition);
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #475569;
}

/* WordPress footer menu */
.footer-col .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── DARK MODE FAB ── */
.dark-mode-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
  z-index: 51;
  border: none;
  cursor: pointer;
}

.dark-mode-fab:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

/* ── BACK TO TOP ── */
.back-to-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ── MOBILE NAV ── */
.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.mobile-nav-toggle .icon-close { display: none; }
.mobile-nav-toggle.active .icon-menu { display: none; }
.mobile-nav-toggle.active .icon-close { display: block; }

/* ── PLACEHOLDER IMAGES ── */
.placeholder-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
}

[data-theme="dark"] .placeholder-img {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #64748b;
}

/* ── READING PROGRESS BAR ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  z-index: 9999;
  transition: width 0.1s linear;
  width: 0;
}

/* ── FOCUS STATES ── */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
input:focus-visible,
textarea:focus-visible { outline-offset: 0; }

/* ── TRENDING LINK ── */
.trending-link {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: inherit;
  transition: padding-left var(--transition);
}
.trending-link:hover { padding-left: 4px; }

/* ── COMMENTS ── */
.comments-area { margin-top: 48px; }
.comments-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 24px;
}
.comment-list {
  list-style: none;
  padding: 0;
}
.comment-list .comment {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.comment-list .comment-author {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}
.comment-list .comment-author img {
  border-radius: 50%;
}
.comment-list .comment-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.comment-list .comment-content p { margin-bottom: 8px; }
.comment-respond { margin-top: 32px; }
.comment-respond .comment-reply-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}
.comment-form label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--primary); }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form .submit {
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background var(--transition);
}
.comment-form .submit:hover { background: var(--primary-dark); }
.no-comments {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── PRINT ── */
@media print {
  .site-header, .site-nav, .breaking-bar, .search-overlay,
  .back-to-top, .dark-mode-fab, .site-footer, .share-widget,
  .post-navigation, .related-articles, .newsletter-section,
  .sidebar, .comments-section { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .single-post-layout { grid-template-columns: 1fr; }
  .single-post-content { max-width: 100%; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; }
}

/* ── ANIMATION ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .hero-grid { display: grid; grid-template-columns: 1fr; grid-template-rows: auto; aspect-ratio: auto; }
  .hero-main { grid-row: auto; aspect-ratio: 16/9; }
  .hero-main img { position: absolute; }
  .hero-sidebar { grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .hero-side-card { aspect-ratio: 16/9; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .related-articles .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .content-with-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .single-post-layout { grid-template-columns: 1fr; }
  .single-post-sidebar {
    position: static;
    flex-direction: row;
  }
  .share-buttons { flex-direction: row; }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* Mobile nav toggle */
  .mobile-nav-toggle { display: flex; }

  /* Mobile nav slide-down */
  .site-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    border-bottom: none;
  }

  .site-nav.mobile-open {
    max-height: 500px;
    overflow-y: auto;
    border-bottom: 1px solid var(--border);
  }

  .site-nav .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .site-nav .nav-list a {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 16px;
  }

  /* Grid adjustments */
  .hero-sidebar { grid-template-columns: 1fr; }
  .hero-side-card { aspect-ratio: 16/9; }

  /* Center content on mobile */
  .section-header { text-align: center; flex-direction: column; align-items: center; }
  .card-body { text-align: center; }
  .card-meta { justify-content: center; }
  .articles-grid { grid-template-columns: 1fr; }
  .related-articles .articles-grid { grid-template-columns: 1fr; }
  .featured-layout { grid-template-columns: 1fr; }
  .post-navigation { grid-template-columns: 1fr; }

  /* Newsletter */
  .newsletter-section { padding: 32px 20px; }
  .newsletter-form { flex-direction: column; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* Breaking news — fix overflow */
  .breaking-bar { height: 32px; font-size: 12px; }
  .breaking-label { font-size: 10px; padding: 0 10px; }
  .breaking-ticker-track a { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
  .breaking-dot { margin: 0 12px; }

  /* Hero — constrain height, prevent overflow */
  .hero-grid { gap: 12px; }
  .hero-main { aspect-ratio: 4/3; min-height: 0; }
  .hero-main .hero-overlay { padding: 16px; }
  .hero-main .hero-title { font-size: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-main .hero-excerpt { display: none; }
  .hero-main .hero-meta { font-size: 11px; gap: 6px; flex-wrap: wrap; }
  .hero-main .category-badge { font-size: 10px; padding: 3px 10px; }

  .hero-sidebar { grid-template-columns: 1fr; }
  .hero-side-card { aspect-ratio: 16/9; }
  .hero-side-card .hero-overlay { padding: 12px; }
  .hero-side-card .hero-title { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  /* Single post */
  .single-post-header { margin-top: 32px; }
  .single-post-header h1 { font-size: 28px; }

  /* Author box */
  .author-box { flex-direction: column; text-align: center; align-items: center; }

  /* Hero */
  .hero-section { padding: 20px 0; }
}

@media (max-width: 480px) {
  .hero-main { aspect-ratio: 4/3; }
  .hero-main .hero-title { font-size: 18px; -webkit-line-clamp: 4; }
  .hero-main .hero-overlay { padding: 14px; }
  .hero-main .hero-meta { font-size: 10px; }
  .hero-main .category-badge { font-size: 9px; padding: 3px 8px; }
  .hero-side-card .hero-title { font-size: 14px; }
  .section-title { font-size: 18px; }
  .error-404 h1 { font-size: 56px; }
  .newsletter-section h3 { font-size: 24px; }

  /* Increase small text for readability */
  .card-category { font-size: 12px; }
  .card-meta { font-size: 13px; }
  .trending-cat { font-size: 12px; }

  /* Touch targets */
  .tag-cloud a { padding: 10px 16px; font-size: 14px; }
  .pagination .page-numbers { width: 44px; height: 44px; font-size: 15px; }
}
