/* ============================================================
   Hamra Services Blog — Stylesheet v2
   Brand: Hamra (حمرا) = Red  |  Mobile-first  |  Dark mode ready
   ============================================================ */

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens (Light Mode) ───────────────────────────── */
:root {
  /* Brand Red */
  --red-700:    #7B241C;
  --red-600:    #C0392B;
  --red-500:    #E74C3C;
  --red-100:    #FADBD8;
  --red-50:     #FEF5F4;

  /* Neutral scale */
  --gray-900:   #111827;
  --gray-800:   #1F2937;
  --gray-700:   #374151;
  --gray-600:   #4B5563;
  --gray-500:   #6B7280;
  --gray-400:   #9CA3AF;
  --gray-300:   #D1D5DB;
  --gray-200:   #E5E7EB;
  --gray-100:   #F3F4F6;
  --gray-50:    #F9FAFB;
  --white:      #FFFFFF;

  /* Fonts */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing scale */
  --sp-1: .25rem; --sp-2: .5rem;  --sp-3: .75rem;
  --sp-4: 1rem;   --sp-5: 1.25rem; --sp-6: 1.5rem;
  --sp-8: 2rem;   --sp-10: 2.5rem; --sp-12: 3rem;
  --sp-16: 4rem;

  /* Radius */
  --r-sm: 4px; --r: 8px; --r-lg: 12px; --r-xl: 16px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.10);
  --shadow-red: 0 4px 16px rgba(192,57,43,.25);

  /* Transitions */
  --ease: .2s ease;
  --ease-slow: .35s ease;
}

/* ── Dark Mode Overrides ──────────────────────────────────── */
[data-theme="dark"] {
  --white:    #0F1117;
  --gray-50:  #161B28;
  --gray-100: #1E2537;
  --gray-200: #253047;
  --gray-300: #374151;
  --gray-400: #6B7280;
  --gray-500: #9CA3AF;
  --gray-600: #B8BEC9;
  --gray-700: #CDD2DB;
  --gray-800: #E2E6ED;
  --gray-900: #F3F5F9;
  --red-50:   #2C1414;
  --red-100:  #3D1E1E;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.35);
  --shadow:     0 4px 12px rgba(0,0,0,.50);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.60);
}

/* ── Base ─────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Prevent horizontal scroll globally */
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
  width: 100%;
  /* position: relative + overflow-x: hidden is the reliable iOS Safari fix */
  position: relative;
  overflow-x: hidden;
  /* Smooth color transitions when toggling dark mode */
  transition: background-color var(--ease-slow), color var(--ease-slow);
}

img { max-width: 100%; height: auto; display: block; }
/* Prevent main content from ever causing page-level horizontal scroll */
main { overflow-x: hidden; }
a   { color: var(--red-600); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--red-700); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--gray-900);
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}
@media (min-width: 640px)  { .container { padding: 0 var(--sp-6); } }
@media (min-width: 1024px) { .container { padding: 0 var(--sp-8); } }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--red-600);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
  transition: background var(--ease-slow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: var(--sp-4);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-dot {
  color: var(--red-600);
  font-size: 1rem;
  line-height: 1;
  /* Pulsing "live" dot — matches the favicon SVG animation */
  animation: logo-pulse 2s ease-in-out infinite;
  display: inline-block;
  text-shadow: 0 0 8px rgba(192,57,43,.5);
}

@keyframes logo-pulse {
  0%, 100% { transform: scale(1);    opacity: 1;   text-shadow: 0 0 8px rgba(192,57,43,.5);  }
  50%       { transform: scale(1.35); opacity: .75; text-shadow: 0 0 16px rgba(192,57,43,.9); }
}

/* News-editorial wordmark — Hamra in heavy serif, SERVICES in tight caps */
.logo-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.01em;
  line-height: 1;
  transition: color var(--ease-slow);
}
/* "Services" smaller, uppercase tracking — like a newspaper section tag */
.logo-services {
  color: var(--red-600);
  font-size: .68em;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: var(--font-body);
  vertical-align: middle;
  margin-left: 2px;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  position: relative;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.site-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-600);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--red-600);
  border-bottom-color: var(--red-600);
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: transform .22s ease, opacity .22s ease;
}
[data-theme="dark"] .nav-toggle span { background: var(--gray-300); }

/* Hamburger → X when open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile: show hamburger, collapse links into a dropdown */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--white);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp-4) var(--sp-5);
    gap: var(--sp-3);
    min-width: 160px;
    z-index: 300;
  }
  .nav-links.open { display: flex; }

  [data-theme="dark"] .nav-links {
    background: #1E2537;
    border-color: #2D3748;
  }
  [data-theme="dark"] .nav-links a,
  [data-theme="dark"] .nav-links .dark-toggle {
    color: #CDD2DB;
  }

  .site-nav a {
    font-size: .9rem;
    padding-bottom: 0;
    border-bottom: none;
  }
  .site-nav a:hover,
  .site-nav a.active { color: var(--red-600); }
}

/* Dark Mode Toggle */
.dark-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-200);
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--ease), color var(--ease), background var(--ease), transform var(--ease);
}
.dark-toggle:hover {
  border-color: var(--red-600);
  color: var(--red-600);
  background: var(--red-50);
  transform: rotate(20deg);
}
.dark-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* ── AdSense Wrappers ─────────────────────────────────────── */
.ad-wrap { width: 100%; overflow: hidden; }

.ad-top {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--sp-3) 0;
  min-height: 50px;
}

.ad-in-article {
  margin: var(--sp-8) 0;
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.ad-sidebar-sticky {
  position: sticky;
  top: calc(60px + var(--sp-6));
}

.ad-label {
  font-size: .68rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--sp-2);
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero {
  background: var(--white);
  padding: var(--sp-8) 0;
  transition: background var(--ease-slow);
  overflow-x: hidden;
}

.hero-inner {
  display: grid;
  gap: var(--sp-6);
}
@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--sp-10);
  }
}

/* Hero text animation */
.hero-text {
  animation: fade-slide-up .6s ease both;
}
@keyframes fade-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-block;
  background: var(--red-50);
  color: var(--red-600);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px var(--sp-3);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-3);
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: var(--sp-4);
  line-height: 1.2;
  color: var(--gray-900);
}

.hero-excerpt {
  color: var(--gray-600);
  font-size: 1.02rem;
  margin-bottom: var(--sp-4);
  line-height: 1.65;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: .85rem;
  color: var(--gray-500);
  margin-bottom: var(--sp-5);
}
.hero-meta-sep { opacity: .4; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--red-600);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r);
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--red-700);
  color: #fff;
  box-shadow: var(--shadow-red);
  transform: translateY(-2px);
}

.hero-image {
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 16/10;
  box-shadow: var(--shadow-lg);
  animation: fade-slide-up .6s .15s ease both;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.hero-image:hover img { transform: scale(1.03); }

/* ── Page Section ─────────────────────────────────────────── */
.page-section { padding: var(--sp-10) 0; }

/* Content + Sidebar grid */
.content-grid {
  display: grid;
  gap: var(--sp-8);
  /* minmax(0,1fr) prevents auto-column from expanding to content min-width.
     Without this, sidebar widgets with white-space:nowrap inflate the implicit
     track to ~456px on mobile, overflowing the 398px container. */
  grid-template-columns: minmax(0, 1fr);
}
/* Allow grid items to shrink below their content min-width */
.content-grid > * {
  min-width: 0;
}
@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

/* ── Section Heading ──────────────────────────────────────── */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--red-600);
}
.section-heading h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

/* ── Post Grid ────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-5);
  min-width: 0; /* allow grid item to shrink below min-content */
}
@media (min-width: 540px) {
  .posts-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Post Card ────────────────────────────────────────────── */
.post-card {
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition:
    transform var(--ease-slow),
    box-shadow var(--ease-slow),
    border-color var(--ease),
    background var(--ease-slow);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gray-300);
}

/* Scroll-in animation */
.post-card {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity .5s ease,
    transform .5s ease,
    box-shadow var(--ease-slow),
    border-color var(--ease),
    background var(--ease-slow);
}
.post-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.post-card.visible:hover {
  transform: translateY(-4px);
}

/* Staggered delay */
.post-card:nth-child(1) { transition-delay: .0s; }
.post-card:nth-child(2) { transition-delay: .07s; }
.post-card:nth-child(3) { transition-delay: .14s; }
.post-card:nth-child(4) { transition-delay: .21s; }
.post-card:nth-child(5) { transition-delay: .28s; }
.post-card:nth-child(6) { transition-delay: .35s; }

.post-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray-100);
  flex-shrink: 0;
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-body {
  padding: var(--sp-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-category-badge {
  display: inline-block;
  background: var(--red-50);
  color: var(--red-600);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px var(--sp-2);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-3);
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
  align-self: flex-start;
}
.post-category-badge:hover {
  background: var(--red-100);
  color: var(--red-700);
}

.post-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--sp-2);
  line-height: 1.4;
  flex: 1;
}
.post-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease);
}
.post-card-title a:hover { color: var(--red-600); }

.post-card-excerpt {
  font-size: .855rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: var(--sp-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: .77rem;
  color: var(--gray-500); /* AA contrast: gray-400 (#9CA3AF) failed on white */
  margin-top: auto;
}
.post-card-meta-sep { opacity: .5; }

.read-more-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--red-600);
  text-decoration: none;
  margin-top: var(--sp-3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--ease), color var(--ease);
}
.read-more-link:hover { color: var(--red-700); gap: 8px; }

/* Ad card in grid — no min-height so it collapses if the ad doesn't fill */
.post-card.ad-card {
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  min-height: 0;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transform: none;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  /* Belt-and-suspenders: sidebar and all its widgets stay within column bounds */
  overflow-x: hidden;
  max-width: 100%;
  min-width: 0; /* allow sidebar to shrink below its content min-width */
}

.sidebar-widget {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: background var(--ease-slow), border-color var(--ease-slow);
  /* Prevent any child (e.g. AdSense iframe) from overflowing the widget */
  overflow: hidden;
  /* Ensure width never exceeds parent */
  max-width: 100%;
}

.widget-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--red-600);
}

.widget-link {
  display: inline-block;
  margin-top: var(--sp-3);
  font-size: .85rem;
  font-weight: 600;
  color: var(--red-600);
  text-decoration: none;
  transition: color var(--ease);
}
.widget-link:hover { color: var(--red-700); }

/* Category list (compact, below globe) */
.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.category-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .855rem;
  color: var(--gray-700);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  transition: color var(--ease), padding-left var(--ease);
}
.category-list li:last-child a { border-bottom: none; }
.category-list li a:hover {
  color: var(--red-600);
  padding-left: 4px;
}

.category-count {
  background: var(--red-50);
  color: var(--red-600);
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}

/* ── Tag Globe ────────────────────────────────────────────── */
.tag-globe-widget {
  padding-bottom: 0;
}

.tag-globe-container {
  position: relative;
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
  margin: var(--sp-2) 0 var(--sp-3);
}

/* Subtle sphere "glow" background */
.tag-globe-container::before {
  content: '';
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192,57,43,.07) 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.tag-cloud-item {
  position: absolute;
  white-space: nowrap;
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--red-50);
  color: var(--red-600);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-decoration: none;
  user-select: none;
  will-change: transform, opacity;
  border: 1px solid transparent;
  transition: background .18s, color .18s, border-color .18s;
  z-index: 1;
}
.tag-cloud-item:hover {
  background: var(--red-600);
  color: #fff;
  border-color: var(--red-600);
  opacity: 1 !important;
  transform: scale(1.1) !important;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-8);
}
.pagination button {
  padding: var(--sp-2) var(--sp-4);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  border-radius: var(--r);
  font-size: .855rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--ease);
}
.pagination button:hover:not(:disabled) {
  border-color: var(--red-600);
  color: var(--red-600);
  background: var(--red-50);
}
.pagination button.active {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
}
.pagination button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* ── Post Page ────────────────────────────────────────────── */
.post-page { padding: var(--sp-8) 0 var(--sp-16); }

.post-layout {
  display: grid;
  gap: var(--sp-8);
}
@media (min-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}

.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.post-article {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow-x: hidden;
  animation: fade-slide-up .5s ease both;
  transition: background var(--ease-slow), border-color var(--ease-slow);
}
@media (max-width: 600px) {
  .post-article { padding: var(--sp-5) var(--sp-4); border-radius: var(--r); }
}

.post-header { margin-bottom: var(--sp-6); }

.post-title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--sp-4);
  color: var(--gray-900);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: .855rem;
  color: var(--gray-500);
}
.post-meta-sep  { opacity: .4; }
.post-read-time { color: var(--gray-500); font-size: .85em; }

.post-featured-image {
  margin-bottom: var(--sp-8);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.post-featured-image img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

/* Post Content Typography */
.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-800);
  min-width: 0;
}
.post-content h2 {
  font-size: 1.45rem;
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-3);
  color: var(--gray-900);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--red-100);
}
.post-content h3 {
  font-size: 1.15rem;
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-2);
  color: var(--gray-900);
}
.post-content p     { margin-bottom: var(--sp-5); }
.post-content ul,
.post-content ol    { margin: var(--sp-3) 0 var(--sp-5) var(--sp-6); }
.post-content li    { margin-bottom: var(--sp-2); }
.post-content strong { color: var(--gray-900); font-weight: 600; }
.post-content em    { color: var(--gray-700); }
.post-content a     { color: var(--red-600); text-decoration: underline; text-underline-offset: 3px; }

.post-content blockquote {
  border-left: 4px solid var(--red-600);
  background: var(--red-50);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-6) 0;
  border-radius: 0 var(--r) var(--r) 0;
  font-style: italic;
  color: var(--gray-700);
}
.post-content code {
  background: var(--gray-100);
  color: var(--red-700);
  font-size: .87em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  font-family: 'Courier New', monospace;
}
.post-content pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: var(--sp-5);
  border-radius: var(--r);
  overflow-x: auto;
  margin: var(--sp-6) 0;
}
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-content img {
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin: var(--sp-6) auto;
  max-width: 100%;
}
.post-content hr {
  border: none;
  border-top: 2px solid var(--gray-200);
  margin: var(--sp-8) 0;
}

.post-footer {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--gray-200);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--gray-600);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  padding: var(--sp-2) var(--sp-4);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r);
  transition: all var(--ease);
}
.btn-back:hover {
  border-color: var(--red-600);
  color: var(--red-600);
  background: var(--red-50);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: var(--sp-8) 0;
  overflow-x: hidden;
  margin-top: var(--sp-16);
  transition: background var(--ease-slow);
}

/* Dark mode: footer stays dark regardless */
[data-theme="dark"] .site-footer {
  background: #080B12;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: #fff;
  font-size: .95rem;
}
.footer-brand .logo-dot { color: var(--red-500); animation: logo-pulse 3s ease-in-out infinite; }
.footer-copy { font-size: .8rem; }
.footer-nav  { display: flex; gap: var(--sp-5); }
.footer-nav a {
  font-size: .85rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: color var(--ease);
}
.footer-nav a:hover { color: var(--red-500); }

/* ── About Page ───────────────────────────────────────────── */
.about-page { padding: var(--sp-12) 0; }
.about-layout { max-width: 740px; margin: 0 auto; }

.about-header {
  text-align: center;
  margin-bottom: var(--sp-10);
  animation: fade-slide-up .5s ease both;
}
.about-header h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin-bottom: var(--sp-4); }
.about-header p  { font-size: 1.05rem; color: var(--gray-600); max-width: 520px; margin: 0 auto; }

.about-content {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  border: 1px solid var(--gray-200);
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--gray-700);
  animation: fade-slide-up .5s .1s ease both;
  transition: background var(--ease-slow), border-color var(--ease-slow);
}
.about-content h2 { font-size: 1.35rem; margin-top: var(--sp-8); margin-bottom: var(--sp-3); color: var(--gray-900); }
.about-content p  { margin-bottom: var(--sp-5); }
@media (max-width: 600px) {
  .about-content { padding: var(--sp-5) var(--sp-4); }
}

/* ── Loading / Empty States ───────────────────────────────── */
.loading-state {
  text-align: center;
  padding: var(--sp-12) var(--sp-4);
  color: var(--gray-500);
}
.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--red-100);
  border-top-color: var(--red-600);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 0 auto var(--sp-4);
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: var(--sp-12) var(--sp-4);
  color: var(--gray-500);
}

/* ── Admin ────────────────────────────────────────────────── */
.admin-body { background: #DFE3EA; min-height: 100vh; }
[data-theme="dark"] .admin-body { background: #161B28; }

/* Admin UI uses body font for headings — Playfair reserved for editorial content */
.admin-body h1,
.admin-body h2,
.admin-body h3,
.admin-body h4 { font-family: var(--font-body); }

.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  background: linear-gradient(135deg, #0A0C14 0%, #1E0A0A 100%);
}
[data-theme="dark"] .admin-login-page {
  background: linear-gradient(135deg, #050710 0%, #150606 100%);
}

.admin-login-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  animation: fade-slide-up .4s ease both;
}

.admin-login-logo { text-align: center; margin-bottom: var(--sp-5); }
.admin-login-logo .logo-dot  { font-size: 2.2rem; display: block; margin-bottom: var(--sp-2); }
.admin-login-logo .logo-text { font-size: 1.4rem; }

.admin-login-card h2 {
  text-align: center;
  font-size: 1rem;
  color: var(--gray-500);
  font-family: var(--font-body);
  font-weight: 400;
  margin-bottom: var(--sp-6);
}

.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block;
  font-size: .855rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--sp-2);
}
.form-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r);
  font-size: .95rem;
  font-family: var(--font-body);
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease-slow);
}
.form-input:focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
.form-input::placeholder { color: var(--gray-400); }
.form-textarea {
  resize: vertical;
  min-height: 320px;
  font-family: 'Courier New', monospace;
  font-size: .875rem;
  line-height: 1.6;
}

.btn-full {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--red-600);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--ease), box-shadow var(--ease);
}
.btn-full:hover { background: var(--red-700); box-shadow: var(--shadow-red); }

.form-error {
  color: var(--red-600);
  font-size: .855rem;
  margin-top: var(--sp-3);
  text-align: center;
  display: none;
}
.form-error.visible { display: block; }

/* Admin layout */
.admin-header {
  background: #0F1117;
  border-bottom: 3px solid var(--red-600);
}
.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--sp-6);
}
.admin-header .logo-text { color: #fff; }
.admin-topbar-right { display: flex; align-items: center; gap: var(--sp-4); }
.admin-user-badge { font-size: .78rem; color: var(--gray-400); }
.admin-version-badge {
  font-size: .72rem;
  font-family: var(--font-body);
  color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 2px 10px;
  cursor: default;
  white-space: nowrap;
  letter-spacing: .02em;
}

.btn-ghost {
  background: none;
  border: 1px solid #374151;
  color: #9CA3AF;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r);
  font-size: .78rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--ease);
}
.btn-ghost:hover { border-color: var(--red-500); color: var(--red-500); }

.admin-main {
  padding: var(--sp-8) var(--sp-6);
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 600px) { .admin-main { padding: var(--sp-4); } }

.admin-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.btn-create {
  background: var(--red-600);
  color: #fff;
  border: none;
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: background var(--ease), box-shadow var(--ease);
}
.btn-create:hover { background: var(--red-700); box-shadow: var(--shadow-red); }

.admin-posts-table {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 560px; }
.admin-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-5);
  background: var(--gray-50);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
}
.admin-table td {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--gray-50); }

.post-status-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-published { background: #D1FAE5; color: #065F46; }
.status-draft     { background: var(--gray-100); color: var(--gray-600); }

.admin-table-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.btn-sm {
  padding: 4px 12px;
  border-radius: var(--r-sm);
  font-size: .77rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid;
  font-family: var(--font-body);
  transition: all var(--ease);
  white-space: nowrap;
}
.btn-edit   { border-color: var(--gray-300); background: var(--white); color: var(--gray-700); }
.btn-edit:hover { border-color: var(--red-600); color: var(--red-600); background: var(--red-50); }
.btn-delete { border-color: var(--gray-200); background: var(--white); color: var(--gray-500); }
.btn-delete:hover { border-color: #DC2626; color: #DC2626; background: #FEF2F2; }
.btn-toggle { border-color: var(--gray-200); background: var(--white); color: var(--gray-500); }
.btn-toggle:hover { border-color: #059669; color: #059669; background: #D1FAE5; }

/* Editor */
.admin-editor-page {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: background var(--ease-slow);
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  gap: var(--sp-4);
}
.editor-toolbar h2 { font-size: 1rem; font-weight: 700; color: var(--gray-900); font-family: var(--font-body); }
.editor-toolbar-actions { display: flex; gap: var(--sp-2); flex-shrink: 0; }

.btn-save {
  background: var(--red-600);
  color: #fff;
  border: none;
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--ease);
}
.btn-save:hover { background: var(--red-700); }

.btn-cancel {
  background: none;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r);
  font-size: .875rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--ease);
}
.btn-cancel:hover { border-color: var(--gray-400); color: var(--gray-900); }

.editor-body { padding: var(--sp-6); display: grid; gap: var(--sp-4); }

.editor-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--sp-4); }
.editor-row > * { min-width: 0; }
@media (max-width: 640px) { .editor-row { grid-template-columns: 1fr; } }

.editor-preview-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--sp-4); }
.editor-preview-grid > * { min-width: 0; }
@media (max-width: 860px) { .editor-preview-grid { grid-template-columns: 1fr; } }

.preview-pane {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r);
  padding: var(--sp-4);
  background: var(--gray-50);
  min-height: 320px;
  max-height: 560px;
  overflow-y: auto;
  font-size: .9rem;
  line-height: 1.7;
}
.preview-pane h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: var(--sp-5) 0 var(--sp-2);
  color: var(--gray-900);
  border-bottom: 2px solid var(--red-100);
  padding-bottom: var(--sp-2);
}
.preview-pane p    { margin-bottom: var(--sp-3); }
.preview-pane ul, .preview-pane ol { margin: var(--sp-2) 0 var(--sp-3) var(--sp-5); }
.preview-pane li   { margin-bottom: var(--sp-1); }
.preview-pane strong { font-weight: 600; color: var(--gray-900); }
.preview-pane code {
  background: var(--gray-100); color: var(--red-700);
  padding: 1px 5px; border-radius: 3px; font-size: .85em;
}

.preview-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--gray-400); margin-bottom: var(--sp-2);
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  background: #111;
  color: #fff;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r);
  font-size: .875rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  border-left: 4px solid var(--red-600);
  max-width: 320px;
}
.admin-toast.show { transform: translateY(0); opacity: 1; }
.admin-toast.success { border-left-color: #10B981; }
.admin-toast.error   { border-left-color: #EF4444; }

/* ── Utility ──────────────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Mobile polish ────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero { padding: var(--sp-5) 0; }
  .page-section { padding: var(--sp-6) 0; }
  .posts-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  .hero-title { font-size: 1.55rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-nav { justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════
   CLS PREVENTION — reserve space for dynamic content so the
   page doesn't shift when JavaScript fills in posts, clocks,
   weather, and the tag globe. Biggest PageSpeed score impact.
══════════════════════════════════════════════════════════════ */

/* Hero: reserve min-height so post-load shift is minimised */
/* contain: content = layout + paint; paint containment also clips overflow */
.hero { min-height: 280px; contain: content; }
@media (max-width: 640px) { .hero { min-height: 200px; } }

/* Posts container: ghost space while JS fetches and renders cards */
#postsContainer { min-height: 420px; }

/* Post card image: enforce aspect ratio from CSS so no shift on img load */
.post-card-image {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--gray-100);
  overflow: hidden;
  flex-shrink: 0;
}
.post-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* Explicitly declare dimensions to help browser reserve space */
  aspect-ratio: 16 / 9;
}

/* Clocks container: reserve space so widget load doesn't push content */
#clocksContainer { min-height: 120px; }

/* Tag globe: already has fixed height, ensure it doesn't collapse before JS */
.tag-globe-container { min-height: 200px; }

/* Sidebar widget: stable height prevents ad injection from shifting layout */
#homeSidebarAd { min-height: 90px; contain: layout; }

/* Reserve space for YouTube player (prevents CLS on load) using aspect-ratio */
/* aspect-ratio is more reliable than contain:size + padding-top % on mobile */
.stream-player { aspect-ratio: 16 / 9; height: auto; }

/* font-display: swap fallback — ensure space is reserved for custom fonts */
@font-face {
  font-family: 'Playfair Display';
  font-display: swap;
  src: local('Playfair Display');
}
@font-face {
  font-family: 'Inter';
  font-display: swap;
  src: local('Inter');
}

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — new widgets (ticker, clocks, stream, etc.)
   Ensures everything works cleanly on phones ≤ 480px
══════════════════════════════════════════════════════════════ */

/* ── News ticker on small screens ── */
@media (max-width: 480px) {
  .news-ticker-bar    { height: 30px; font-size: .73rem; }
  .news-ticker-label  { padding: 0 8px; font-size: .62rem; letter-spacing: .07em; gap: 4px; }
  .news-ticker-label svg { display: none; } /* hide dot icon, save space */
  .news-ticker-inner a { padding: 0 24px 0 0; }
}

/* ── World clocks on small screens ── */
@media (max-width: 480px) {
  .clock-row   { font-size: .79rem; gap: 5px; padding: 6px 0; }
  /* Stack weather onto a second line on very small phones */
  .clock-weather { font-size: .7rem; }
}
/* Hide weather on tiny screens, show flag+city+time only */
@media (max-width: 360px) {
  .clock-weather { display: none; }
}

/* ── Live stream controls on small screens ── */
@media (max-width: 480px) {
  .stream-mute-btn   { font-size: .65rem; padding: 4px 8px; gap: 4px; }
  .stream-live-badge { font-size: .6rem;  padding: 2px 6px; }
  .stream-live-dot   { width: 5px; height: 5px; }
}

/* ── Search widget ── */
@media (max-width: 480px) {
  .search-input { font-size: .82rem; padding: 8px 10px; }
}

/* ── Post page sidebar: don't sticky-pin on mobile (too disruptive) ── */
@media (max-width: 1023px) {
  .post-sidebar > div[style*="sticky"] { position: static !important; }
}

/* ── Hero: stack image below text on mobile ── */
@media (max-width: 640px) {
  .hero-inner        { flex-direction: column; gap: var(--sp-5); }
  .hero-image        { width: 100%; max-height: 220px; overflow: hidden; border-radius: var(--r-lg); }
  .hero-image img    { width: 100%; height: 100%; object-fit: cover; }
}

/* ── Post content: tighten typography on mobile ── */
@media (max-width: 600px) {
  .post-content       { font-size: .96rem; line-height: 1.75; }
  .post-content h2    { font-size: 1.2rem; margin-top: var(--sp-8); }
  .post-content h3    { font-size: 1rem; }
  .post-content pre   { font-size: .78rem; overflow-x: auto; }
}

/* ── Admin table: horizontal scroll on mobile instead of broken layout ── */
@media (max-width: 640px) {
  .admin-posts-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table       { font-size: .78rem; }
  .admin-table th, .admin-table td { padding: var(--sp-2) var(--sp-3); }
  /* Hide date column on very small screens */
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) { display: none; }
}

/* ── Admin editor: single column on mobile ── */
@media (max-width: 480px) {
  .editor-toolbar        { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .editor-toolbar-actions{ flex-wrap: wrap; gap: var(--sp-2); }
  .btn-ai                { font-size: .75rem; padding: 5px 10px; }
  .admin-header-inner    { gap: var(--sp-2); }
  .admin-user-badge      { display: none; } /* hide "Signed in as..." on mobile */
  .admin-version-badge   { display: none; }
}

/* ── Help panel: full-width on mobile ── */
@media (max-width: 540px) {
  .help-panel        { right: 12px; left: 12px; width: auto; bottom: 80px; }
  .help-bubble-btn   { bottom: 16px; right: 16px; }
}

/* ── AI modal: full-width on mobile ── */
@media (max-width: 540px) {
  .ai-modal          { margin: 8px; }
  .ai-modal-body     { padding: 16px; }
}

/* ── Tags picker on mobile ── */
@media (max-width: 480px) {
  .tag-chip-selected,
  .tag-chip-available { font-size: .7rem; padding: 2px 8px; }
}

/* ── Sidebar order on mobile: search first, then content ── */
@media (max-width: 1023px) {
  .sidebar { display: flex; flex-direction: column; }
  /* Search stays at top, stream second, rest follow naturally */
}

/* ── Ad units: prevent overflow on mobile ── */
.ad-unit { overflow: hidden; max-width: 100%; }
@media (max-width: 480px) {
  .ad-unit { margin: 1rem 0; }
}

/* ── AdSense: prevent iframe overflow on all screen sizes ── */
ins.adsbygoogle {
  max-width: 100% !important;
  overflow: hidden !important;
}

/* ── Post content: prevent any element from breaking out on mobile ── */
@media (max-width: 640px) {
  .post-content img,
  .post-content iframe,
  .post-content video,
  .post-content table  { max-width: 100%; }
  .post-content table  { display: block; overflow-x: auto; }
}

/* ══════════════════════════════════════════════════════════════
   BREAKING NEWS TICKER
   Full-width red bar below header; headlines scroll left
══════════════════════════════════════════════════════════════ */
.news-ticker-bar {
  background: var(--red-600);
  color: #fff;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  height: 34px;
  width: 100%;
  max-width: 100%;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  position: relative;
  z-index: 190;
}
.news-ticker-label {
  background: #900e00;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  gap: 6px;
}
.news-ticker-scroll {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.news-ticker-inner {
  display: flex;
  gap: 0;
  will-change: transform;
  white-space: nowrap;
}
.news-ticker-inner a {
  color: #fff;
  text-decoration: none;
  padding: 0 36px 0 0;
  opacity: .92;
  transition: opacity .15s;
  flex-shrink: 0;
}
.news-ticker-inner a::after {
  content: '◆';
  margin-left: 18px;
  opacity: .4;
  font-size: .6rem;
}
.news-ticker-inner a:hover { opacity: 1; text-decoration: underline; }
.news-ticker-inner a:last-child::after { display: none; }

/* ══════════════════════════════════════════════════════════════
   SEARCH WIDGET
══════════════════════════════════════════════════════════════ */
.search-widget {
  padding: var(--sp-4) var(--sp-5);
}
.search-form {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.search-form:focus-within {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(192,57,43,.1);
}
.search-input {
  flex: 1;
  border: none;
  padding: 9px 12px;
  font-size: .875rem;
  font-family: var(--font-body);
  color: var(--gray-900);
  background: transparent;
  outline: none;
}
.search-input::placeholder { color: var(--gray-400); }
.search-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  transition: color .15s;
}
.search-btn:hover { color: var(--red-600); }
.search-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-no-results {
  text-align: center;
  padding: var(--sp-10) var(--sp-4);
  color: var(--gray-500);
  grid-column: 1/-1;
}

/* ══════════════════════════════════════════════════════════════
   WORLD CLOCKS + WEATHER WIDGET
══════════════════════════════════════════════════════════════ */
.clocks-widget {}
.clock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .82rem;
  gap: 8px;
}
.clock-row:last-child { border-bottom: none; }
.clock-city {
  color: var(--gray-600);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.clock-time {
  font-weight: 700;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.clock-weather {
  font-size: .75rem;
  color: var(--gray-500);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.clock-flag { font-size: 1rem; line-height: 1; }

/* ══════════════════════════════════════════════════════════════
   LIVE STREAM WIDGET — custom YouTube player (controls=0)
══════════════════════════════════════════════════════════════ */
.stream-widget { padding-bottom: 0; }

/* Player container — uses aspect-ratio (no padding-top hack needed) */
.stream-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
}
.stream-player > div,
.stream-player iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: none;
}

/* Thin top accent bar (brand red) */
.stream-player::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red-600);
  z-index: 5;
}

/* Custom controls overlay — fixed to bottom of player */
.stream-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.stream-live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #C0392B;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 3px 8px;
  border-radius: 3px;
}
.stream-live-dot {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: logo-pulse 1.5s ease-in-out infinite;
}
.stream-mute-btn {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}
.stream-mute-btn:hover { background: rgba(192,57,43,.8); border-color: transparent; }
.stream-mute-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ══════════════════════════════════════════════════════════════
   MULTI-TAG BADGES on post cards + post pages
══════════════════════════════════════════════════════════════ */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--sp-3);
}
.post-tags .post-category-badge { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════
   ADMIN — MULTI-TAG PICKER
══════════════════════════════════════════════════════════════ */
.tags-picker {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r);
  padding: 8px 10px;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  min-height: 46px;
}
.tags-picker:focus-within {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
/* Row of selected chips */
.tags-selected-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.tag-chip-selected {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red-600);
  color: #fff;
  padding: 2px 8px 2px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  cursor: default;
}
.tag-chip-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
  display: flex;
  align-items: center;
}
.tag-chip-remove:hover { color: #fff; }
/* Available chips to click */
.tags-available-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}
.tag-chip-available {
  display: inline-flex;
  align-items: center;
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, color .12s;
}
.tag-chip-available:hover { background: var(--red-50); color: var(--red-700); border-color: var(--red-100); }
/* Add-new input inside the picker */
.tags-add-row {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--gray-100);
  padding-top: 7px;
  margin-top: 3px;
}
.tags-add-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: .83rem;
  font-family: var(--font-body);
  color: var(--gray-900);
  background: transparent;
  padding: 2px 0;
}
.tags-add-input::placeholder { color: var(--gray-400); }
.tags-add-btn {
  background: var(--gray-100);
  border: none;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: background .12s;
}
.tags-add-btn:hover { background: var(--red-50); color: var(--red-700); }

/* ════════════════════════════════════════════════════════
   ACCESSIBILITY — visible keyboard focus + reduced motion
   ════════════════════════════════════════════════════════ */

/* Keyboard users get a clear focus ring; mouse clicks stay clean.
   Applies to links, buttons, inputs, the search field, pagination, etc. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--red-600);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Honour the OS "reduce motion" preference: drop transitions/animations
   and the continuously-scrolling/spinning widgets (also gated in JS). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
