/* ==========================================================================
   NadorCity.info — app.css
   Design system (dark default, light via [data-theme]).
   Wire-path stylesheet matching the classes used across all routes.
   ========================================================================== */

/* ============ Self-hosted Inter (variable, latin) ============ */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============ Design tokens ============ */
:root {
  /* Native controls (inputs/selects/scrollbars) follow the site theme,
     not the OS preference — prevents black inputs in light mode. */
  color-scheme: dark;

  /* Fonts */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Surfaces (dark default) */
  --background: #0b0d14;
  --foreground: #f5f5f5;
  --card: #161821;
  --card-rgba: rgba(22, 24, 33, 0.4);
  --popover: #131722;
  --popover-rgba: rgba(19, 23, 34, 0.92);
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.1);
  --ring: #ec305a;

  /* Brand */
  --primary: #ec305a;
  --primary-foreground: #ffffff;
  --secondary: #8d54ff;
  --secondary-foreground: #ffffff;
  --destructive: #f43f5e;
  --accent: #ec305a;
  --accent-2: #e12afb;
  --gradient-brand: linear-gradient(135deg, #ff2357, #c600db);
  --gradient-hero: linear-gradient(90deg, #ff2357, #e12afb, #00d2ef);

  /* Text */
  --muted: rgba(245, 245, 245, 0.6);
  --muted-foreground: rgba(245, 245, 245, 0.6);

  /* Layout */
  --radius: 0.625rem;              /* 10px */
  --radius-lg: calc(var(--radius) * 1.4);
  --container: 1280px;
  --max-width: 1280px;

  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Motion */
  --duration: 0.3s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Image filter */
  --image-filter: contrast(1.12) saturate(1.22) brightness(1.04);
}

html[data-theme="light"] {
  color-scheme: light;
  --background: #f7f7f9;
  --foreground: #17181f;
  --card: #ffffff;
  --card-rgba: rgba(255, 255, 255, 0.6);
  --popover: #ffffff;
  --popover-rgba: rgba(255, 255, 255, 0.96);
  --border: rgba(0, 0, 0, 0.08);
  --input: rgba(0, 0, 0, 0.08);
  --muted: rgba(23, 24, 31, 0.6);
  --muted-foreground: rgba(23, 24, 31, 0.6);
  --ring: #ec305a;
}

/* Back-compat aliases (routes may reference old tokens) */
html:not([data-theme]), html[data-theme="dark"] {
  --bg: #0b0d14;
  --bg-elev: #131722;
  --bg-elev-2: #1a1f2e;
  --text: #f5f5f7;
  --muted-foreground: rgba(245, 245, 245, 0.6);
  --popover: #131722;
}
html[data-theme="light"] {
  --bg: #f7f7f9;
  --bg-elev: #ffffff;
  --bg-elev-2: #f1f1f4;
  --text: #17181f;
}

/* ============ Reset & base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
html, body { max-width: 100%; overflow-wrap: break-word; }
html { overflow-x: hidden; }
body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
/* Global media guard — prevents any embed/iframe/svg/canvas from exceeding
   the viewport and causing horizontal overflow on small screens. */
video, iframe, canvas, svg, embed, object { max-width: 100%; }
.leaflet-container { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ============ Layout containers ============ */
.container, .section-wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; min-width: 0; }
.section-top { padding-top: 24px; } /* mobile base; desktop restores at 561px */
@media (min-width: 561px) { .section-top { padding-top: 40px; } }
.section-bottom { padding-bottom: 64px; }
.mt-section { margin-top: 10px; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.section-header h1, .section-header h2 { margin: 0; font-size: var(--text-2xl); }
.section-header .sub { color: var(--muted-foreground); font-size: var(--text-sm); }
.section-more { margin-left: auto; font-size: var(--text-sm); font-weight: 600; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--popover-rgba);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}
.header-nav-wrap { display: none; } /* mobile base; desktop at 901px */
@media (min-width: 561px) {
  .header-inner { gap: 16px; padding: 10px 16px; }
}
@media (min-width: 901px) {
  .header-nav-wrap { display: flex; justify-content: center; flex: 1; min-width: 0; }
}

.site-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.site-logo:hover { text-decoration: none; }
.site-logo-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--gradient-brand);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, #ff2357 60%, transparent);
  flex: none;
}
.site-logo-icon svg { width: 20px; height: 20px; stroke: #fff; }
.site-logo-text { font-size: 1.1rem; font-weight: 800; letter-spacing: .02em; color: var(--foreground); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-logo-text .accent { color: var(--accent); }
@media (min-width: 561px) { .site-logo-text { font-size: 1.25rem; } }

.main-nav {
  display: none; /* mobile base */
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  background: var(--card-rgba);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (min-width: 901px) { .main-nav { display: inline-flex; } }
.main-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted-foreground);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
  white-space: nowrap;
}
.main-nav a:hover { color: var(--foreground); background: color-mix(in srgb, var(--foreground) 8%, transparent); text-decoration: none; }
.main-nav a.active { background: var(--primary); color: var(--primary-foreground); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
[dir="rtl"] .header-actions { margin-left: 0; margin-right: auto; }
.icon-flip { transition: transform var(--duration) var(--ease); }
[dir="rtl"] .icon-flip { transform: scaleX(-1); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--card-rgba);
  color: var(--foreground);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), background var(--duration) var(--ease);
}
.icon-btn:hover { transform: translateY(-1px); border-color: var(--ring); background: color-mix(in srgb, var(--foreground) 8%, transparent); }
.icon-btn svg { width: 18px; height: 18px; }
/* The `hidden` attribute is overridden by .icon-btn's display rule above, so
   keep the install button hidden until the beforeinstallprompt event fires. */
#installBtn[hidden] { display: none !important; }
.lang-pill { display: none; width: auto; padding: 0 12px; font-weight: 800; font-size: var(--text-xs); border-radius: 999px; } /* mobile base hidden */
@media (min-width: 561px) { .lang-pill { display: inline-flex; align-items: center; justify-content: center; } }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  min-width: 60px;
  z-index: 60;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
.lang-dropdown-item {
  display: block;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--muted-foreground);
  transition: background 0.2s, color 0.2s;
}
.lang-dropdown-item:hover { background: var(--accent); color: var(--primary-foreground); text-decoration: none; }
.lang-dropdown-item.active { color: var(--primary); }

/* ============ Top-nav "More" dropdown ============ */
.nav-more-wrap { position: relative; display: inline-flex; }
.nav-more-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 500;
  color: var(--muted-foreground);
  background: transparent; border: 0; cursor: pointer;
  transition: color .15s, background .15s;
}
.nav-more-trigger:hover { color: var(--foreground); background: color-mix(in srgb, var(--foreground) 8%, transparent); }
.nav-more-trigger.active { background: var(--primary); color: var(--primary-foreground); }
.nav-more-caret { transition: transform .15s; }
.nav-more-trigger[aria-expanded="true"] .nav-more-caret { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; padding: 6px;
  background: var(--bg-elev-1, var(--card));
  border: 1px solid var(--border, color-mix(in srgb, var(--foreground) 10%, transparent));
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display: flex; flex-direction: column; gap: 2px;
  z-index: 100;
}
.nav-dropdown[hidden] { display: none; }
[dir="rtl"] .nav-dropdown { right: auto; left: 0; }
.nav-dropdown-item {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--muted-foreground); text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-dropdown-item:hover { background: var(--accent); color: var(--primary-foreground); text-decoration: none; }
.nav-dropdown-item.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }

.mobile-menu { display: none; padding: 8px 16px 16px; border-bottom: 1px solid var(--border); background: var(--popover); }
.mobile-menu.open { display: block; }
.mobile-menu-btn { display: inline-flex; } /* mobile base */
@media (min-width: 901px) { .mobile-menu-btn { display: none; } }

/* ============ Hero ============ */
.hero { text-align: center; padding: 40px 0 2px; max-width: var(--max-width); margin: 0 auto; } /* mobile base 40px top */
@media (min-width: 561px) { .hero { padding: 12px 0 2px; } }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.hero .grad {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { max-width: 42rem; margin: 8px auto 0; color: var(--muted-foreground); font-size: var(--text-lg); }

/* ============ Article cards ============ */
.article-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile base single column */
  gap: 16px;
  min-width: 0;
}
.acard, .hcard, .band, .feature-tile, .contact-card { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 561px) {
  .article-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
}
.acard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-rgba);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.acard:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 28px -16px rgba(0,0,0,.4);
  border-color: var(--ring);
  background: var(--card);
  text-decoration: none;
}
.acard:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }
.acard-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-elev-2); }
.acard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration) var(--ease), filter var(--duration) var(--ease); }
.acard:hover .acard-img img { transform: scale(1.07); filter: var(--image-filter); }
.acard-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; }
.acard-badge { padding: 3px 9px; border-radius: 999px; font-size: var(--text-xs); font-weight: 700; color: #fff; line-height: 1.4; box-shadow: 0 2px 8px -2px rgba(0,0,0,.4); }
.acard-badge--feat { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.acard-badge--want { background: #10b981; }
.acard-badge--dias { background: #6366f1; }
.acard-price { position: absolute; bottom: 10px; left: 10px; z-index: 2; padding: 6px 13px; border-radius: 999px; font-size: var(--text-sm); font-weight: 800; color: #fff; background: rgba(15, 23, 42, .82); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); box-shadow: 0 4px 14px -4px rgba(0,0,0,.5); }
.acard-price small { font-weight: 600; opacity: .8; font-size: var(--text-xs); }
.acard-info { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; }
.acard-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-xs); }
.acard-cat { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.acard-city { color: var(--muted-foreground); }
.acard-title { font-size: var(--text-base); font-weight: 700; color: var(--foreground); line-height: 1.38; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard-summary { color: var(--muted-foreground); font-size: var(--text-sm); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 3px; color: var(--muted-foreground); font-size: var(--text-xs); }
.acard-foot time { display: inline-flex; align-items: center; gap: 4px; }

.article-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #fff;
  z-index: 2;
}
.article-badge.factcheck { background: #10b981; }
.article-badge.citizen { background: #f59e0b; }

/* ============ Featured card ============ */
.featured-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr; /* mobile base single column */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-rgba);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
@media (min-width: 901px) { .featured-card { grid-template-columns: 1.4fr 1fr; } }
.featured-card:hover { box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .6); border-color: var(--ring); background: var(--card); text-decoration: none; }
.featured-card-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.featured-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration) var(--ease), filter var(--duration) var(--ease); }
.featured-card:hover .featured-card-img img { transform: scale(1.05); filter: var(--image-filter); }
.featured-card-info { padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.featured-card-cat { color: var(--accent); font-weight: 700; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; }
.featured-card-title { font-size: clamp(1.3rem, 2.4vw, var(--text-3xl)); font-weight: 800; line-height: 1.25; }
.featured-card-meta { color: var(--muted-foreground); font-size: var(--text-sm); }

/* ============ Category bands ============ */
.bands-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px)  { .bands-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bands-grid { grid-template-columns: repeat(3, 1fr); } }

/* Band wrapper (rounded card with gradient header) */
.band {
  overflow: hidden;
  border-radius: calc(var(--radius) * 1.4);
  border: 1px solid var(--border);
  background: rgba(22, 24, 33, 0.2);
}
.band-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #fff;
  text-decoration: none;
  transition: filter var(--duration) var(--ease);
}
.band-banner:hover { filter: brightness(1.1); }
.band-banner h2 {
  font-size: var(--text-base);
  font-weight: 700;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.band-banner h2 .desc {
  font-size: var(--text-sm);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}
.band-banner .all {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: rgba(255, 255, 255, 0.9);
  transition: color var(--duration) var(--ease);
}
.band-banner:hover .all { color: #fff; }
.band-banner .all svg { width: 14px; height: 14px; }
.band-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

/* ============ Horizontal card (.hcard) ============ */
.hcard {
  display: flex;
  gap: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(22, 24, 33, 0.4);
  padding: 8px;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.hcard:hover { background: var(--card); }
.hcard-img {
  position: relative;
  flex: 0 1 150px;
  min-width: 0;
  width: min(150px, 42vw);
  max-width: 150px;
  aspect-ratio: 16/9;
  border-radius: calc(var(--radius) * 0.8);
  overflow: hidden;
  background: var(--card);
}
.hcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
  filter: contrast(1.12) saturate(1.22) brightness(1.04);
}
.hcard:hover .hcard-img img { transform: scale(1.05); filter: contrast(1.15) saturate(1.28) brightness(1.05); }
.hcard-img-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 13, 20, 0.4);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.hcard:hover .hcard-img-overlay { opacity: 1; }
.hcard-play {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
.hcard-play svg { width: 16px; height: 16px; fill: currentColor; }
.hcard-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  border-radius: 4px;
  background: rgba(11, 13, 20, 0.8);
  padding: 0 4px;
  font-size: 10px;
  font-weight: 400;
  color: var(--foreground);
}
.hcard-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 100%;
  overflow: hidden;
}
.hcard-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hcard-meta {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hcard-meta svg { width: 12px; height: 12px; }
.hcard-meta .dot { color: rgba(161, 161, 161, 0.5); }
.hcard-meta .hcard-cat { color: var(--muted-foreground); }

/* 3 small thumbs at bottom of card */
.hcard-thumbs {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.hcard-thumb {
  position: relative;
  min-width: 0;
  flex: 1 1 0;
  aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--card);
}
.hcard-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transform: scale(1.34);
  transform-origin: center center;
  filter: contrast(1.12) saturate(1.22) brightness(1.04);
}
/* Duplicate-thumb illusion crops: when an article has fewer than 3 distinct
   images, repeated slots reuse the same file with a tighter zoom on opposite
   corners (+ horizontal mirror on var-a) so the 3 thumbs read as different. */
.hcard-thumb--var-a img {
  transform: scale(1.7) scaleX(-1);
  /* NOTE: X origin must stay 50% — mirroring about any other X point shifts
     the flipped image sideways and leaves part of the thumb box blank. */
  transform-origin: 50% 30%;
}
.hcard-thumb--var-b img {
  transform: scale(1.9);
  transform-origin: 80% 75%;
}

/* Lazy shimmer + fade-in for .lazy images */
@keyframes hcard-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.hcard-img:has(img.lazy:not(.loaded)),
.hcard-thumb:has(img.lazy:not(.loaded)) {
  background-image: linear-gradient(90deg,
    var(--card) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    var(--card) 100%
  );
  background-size: 200% 100%;
  animation: hcard-shimmer 1.5s ease-in-out infinite;
}
html[data-theme="light"] .hcard-img:has(img.lazy:not(.loaded)),
html[data-theme="light"] .hcard-thumb:has(img.lazy:not(.loaded)) {
  background-image: linear-gradient(90deg,
    var(--card) 0%,
    rgba(0, 0, 0, 0.06) 50%,
    var(--card) 100%
  );
}

/* Category color schemes (banner + play btn gradients) */
.band.violet  .band-banner { background: linear-gradient(90deg, #8d54ff, #e12afb); }
.band.violet  .hcard-play  { background: linear-gradient(135deg, #8d54ff, #e12afb); }
.band.cyan    .band-banner { background: linear-gradient(90deg, #00b7d7, #155dfc); }
.band.cyan    .hcard-play  { background: linear-gradient(135deg, #00b7d7, #155dfc); }
.band.emerald .band-banner { background: linear-gradient(90deg, #00bb7f, #009588); }
.band.emerald .hcard-play  { background: linear-gradient(135deg, #00bb7f, #009588); }
.band.orange  .band-banner { background: linear-gradient(90deg, #fe6e00, #fb2c36); }
.band.orange  .hcard-play  { background: linear-gradient(135deg, #fe6e00, #fb2c36); }
.band.rose    .band-banner { background: linear-gradient(90deg, #e70044, #8200da); }
.band.rose    .hcard-play  { background: linear-gradient(135deg, #e70044, #8200da); }
.band.amber   .band-banner { background: linear-gradient(90deg, #f99c00, #f6339a); }
.band.amber   .hcard-play  { background: linear-gradient(135deg, #f99c00, #f6339a); }

/* Light theme band/hcard overrides */
html[data-theme="light"] .band { background: rgba(255, 255, 255, 0.5); border-color: rgba(0, 0, 0, 0.1); }
html[data-theme="light"] .hcard { background: rgba(255, 255, 255, 0.6); border-color: rgba(0, 0, 0, 0.1); }
html[data-theme="light"] .hcard:hover { background: #ffffff; }
html[data-theme="light"] .hcard-img-overlay { background: rgba(250, 250, 250, 0.5); }
html[data-theme="light"] .hcard-badge { background: rgba(250, 250, 250, 0.9); color: #0a0a0a; }

/* ============ Category chips ============ */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.chip {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-rgba);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.chip:hover { border-color: var(--ring); color: var(--foreground); text-decoration: none; }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }

/* ============ Article detail ============ */
.article-detail { max-width: 760px; margin: 0 auto; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: var(--text-sm); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted-foreground); }
.breadcrumb a:hover { color: var(--accent); }
.article-title { font-size: clamp(1.6rem, 3.6vw, var(--text-4xl)); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.article-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted-foreground); font-size: var(--text-sm); margin: 12px 0 20px; }
.article-cat { color: var(--accent); font-weight: 700; }
.article-meta .dot { color: var(--accent); }
.article-hero { margin: 0 auto; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-elev-2); text-align: center; }
.article-hero img,
.article-media-img img { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 auto; }
.article-media { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 24px 0; }
.article-media-img { margin: 0; text-align: center; }
.article-media-img img { width: auto; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev-2); }
.article-body { font-size: 1.08rem; line-height: 1.8; color: var(--foreground); white-space: pre-line; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.article-body a, .article-body p, .article-body li { overflow-wrap: anywhere; word-break: break-word; }
.article-body p { margin-bottom: 1.3em; }
.article-body img { display: block; margin: 1.4em auto; max-width: 100%; height: auto; border-radius: var(--radius); }
/* Future-proofing: crawled/imported content may carry wide tables, <pre>
   blocks or inline media — keep them inside the column on small screens. */
.article-body table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; }
.article-body pre { max-width: 100%; overflow-x: auto; }
.article-body iframe, .article-body video { max-width: 100%; }
.article-body blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--bg-elev-2); border-radius: var(--radius); color: var(--muted-foreground); }
.article-source { font-size: var(--text-xs); color: var(--muted-foreground); opacity: .65; margin: 28px 0 12px; text-transform: none; text-align: end; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.article-source a { color: var(--muted-foreground); text-decoration: none; overflow-wrap: anywhere; word-break: break-all; }
.contact-card-desc, .contact-card-desc a { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.article-source a:hover { color: var(--accent); opacity: 1; text-decoration: none; }
.article-reactions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.reactions-caption { width: 100%; color: var(--muted-foreground); font-size: var(--text-sm); margin-bottom: 4px; }
.reaction-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card-rgba); color: var(--foreground); cursor: pointer; font-size: var(--text-sm); line-height: 1; transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease), transform var(--duration) var(--ease); }
.reaction-btn:hover { border-color: var(--ring); transform: translateY(-1px); }
.reaction-btn:active { transform: scale(.96); }
.reaction-btn:disabled { opacity: .6; cursor: default; transform: none; }
.reaction-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.reaction-emoji { font-size: 1.1rem; line-height: 1; }
.reaction-count { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 1ch; }
.reaction-btn.active { background: color-mix(in srgb, var(--primary) 16%, transparent); border-color: var(--primary); color: var(--primary); }
.reaction-btn.active .reaction-count { color: var(--primary); }
.article-comments { margin-top: 24px; }
.article-comments h2 { font-size: 1.1rem; margin: 0; }
.comment-list { list-style: none; padding: 0; margin: 12px 0; }
.comment-list li { padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0; overflow-wrap: anywhere; }
.comment-list li p, .article-detail .liveblog-entry p { overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; }
.comment-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comment-head time { opacity: .7; font-size: .8rem; }
.comment-delete { border: 1px solid var(--border); background: var(--card-rgba); cursor: pointer; font-size: 1rem; line-height: 1; padding: 4px 8px; border-radius: var(--radius); color: #ef4444; opacity: .8; transition: color var(--duration) var(--ease), background var(--duration) var(--ease), opacity var(--duration) var(--ease), border-color var(--duration) var(--ease); }
.comment-delete svg { width: 16px; height: 16px; display: block; }
.comment-delete:hover { color: #fff; background: #ef4444; border-color: #ef4444; opacity: 1; }
.comment-delete:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.comment-delete:disabled { opacity: .5; cursor: default; }
.comment-list time { opacity: .7; font-size: .8rem; }
.comment-form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-rgba);
  color: var(--foreground);
  font: inherit;
  font-size: var(--text-sm);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
}
.comment-form textarea { resize: vertical; }
.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--muted-foreground); }
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
  background: color-mix(in srgb, var(--foreground) 4%, transparent);
}
.comment-form .comment-submit { align-self: flex-start; margin-top: 2px; }
.comment-form .comment-submit:disabled { opacity: .6; cursor: default; transform: none; }
.comment-status { display: none; margin: 10px 0 0; font-size: var(--text-sm); }
.comment-status.show { display: block; }
.comment-status.is-success { color: var(--primary); }
.comment-status.is-error { color: #ef4444; }
.article-share { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: var(--text-sm); }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-rgba); color: var(--foreground); cursor: pointer; transition: border-color var(--duration) var(--ease); }
.share-btn:hover { border-color: var(--ring); }
.share-btn svg { width: 17px; height: 17px; }

/* ============ Search ============ */
.search-form { display: flex; gap: 10px; max-width: 640px; margin: 0 0 24px; }
.search-form input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-rgba);
  color: var(--foreground);
  font-size: var(--text-base);
  transition: border-color var(--duration) var(--ease);
}
.search-form input:focus { border-color: var(--ring); outline: none; }
.search-form button {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.search-form button:hover { transform: translateY(-1px); box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--primary) 60%, transparent); }
.search-summary { color: var(--muted-foreground); margin-bottom: 20px; }
.search-summary strong { color: var(--foreground); }

/* ============ Search modal (Fuse.js typeahead) ============ */
.search-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  animation: search-modal-in var(--duration) var(--ease);
}
.search-modal[hidden] { display: none; }
body.search-modal-open { overflow: hidden; }
@keyframes search-modal-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.search-modal-panel {
  position: relative; width: 100%; max-width: 640px;
  background: var(--popover-rgba);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.search-modal-input-wrap { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search-modal-icon { width: 20px; height: 20px; color: var(--muted-foreground); margin-inline-end: 10px; flex: none; }
.search-modal-input-wrap input { flex: 1; border: none; background: none; color: var(--foreground); font-size: 1.05rem; outline: none; }
.search-modal-close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: none; background: color-mix(in srgb, var(--foreground) 10%, transparent); color: var(--foreground); border-radius: var(--radius); cursor: pointer; }
.search-modal-close svg { width: 16px; height: 16px; }
.search-modal-hint { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: var(--text-xs); }
.search-modal-hint kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-rgba);
}
.search-dropdown { max-height: 50vh; overflow-y: auto; padding: 6px; }
.search-dropdown-item {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 8px;
  color: var(--foreground); font-size: var(--text-sm);
  transition: background var(--duration) var(--ease);
}
.search-dropdown-item:hover, .search-dropdown-item.active { background: color-mix(in srgb, var(--foreground) 10%, transparent); text-decoration: none; }
.search-dropdown-item img { width: 56px; height: 32px; object-fit: cover; border-radius: 4px; flex: none; background: var(--bg-elev-2); }
.search-dropdown-item .sdi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-dropdown-item .sdi-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-dropdown-item .sdi-meta { color: var(--muted-foreground); font-size: var(--text-xs); }
.search-dropdown-item mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--foreground); padding: 0 2px; border-radius: 2px; }

/* ============ Pagination ============ */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.page-link { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-rgba); color: var(--foreground); font-size: var(--text-sm); font-weight: 600; transition: border-color var(--duration) var(--ease); }
.page-link:hover { border-color: var(--ring); text-decoration: none; }
.page-link.current { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.page-link.disabled { opacity: .45; pointer-events: none; }

/* ============ Static pages ============ */
.static-page { max-width: 780px; margin: 0 auto; }
.section-head { margin-bottom: 24px; }
.section-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--card-rgba); color: var(--accent); font-weight: 700; font-size: var(--text-xs); margin-bottom: 12px; border: 1px solid var(--border); }
.section-title { font-size: clamp(1.6rem, 3.4vw, var(--text-4xl)); font-weight: 800; margin: 0; }
.section-desc { color: var(--muted-foreground); margin-top: 8px; }
.static-page h2 { font-size: var(--text-xl); margin-top: 1.6em; }
.static-page .lead { font-size: var(--text-lg); color: var(--foreground); }
.static-page ul, .static-page ol { padding-inline-start: 1.4em; }
.check-list li, .cross-list li { margin-bottom: .5em; }
.cross-list { list-style: none; padding-inline-start: 0; }
.cross-list li::before { content: "✕"; color: var(--accent); margin-inline-end: 8px; font-weight: 700; }
.check-list li::marker { color: var(--accent); }
.kbd-code { font-family: var(--font-mono); background: var(--card-rgba); padding: 2px 6px; border-radius: 4px; font-size: .85em; border: 1px solid var(--border); }
.callout { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius); margin: 20px 0; border: 1px solid var(--border); background: var(--card-rgba); }
.callout-info { border-left: 4px solid var(--secondary); }
.callout-warning { border-left: 4px solid #f59e0b; }
.callout-icon { font-size: 1.3rem; line-height: 1.3; }
.callout-body p { margin: 0; }
.last-updated { color: var(--muted-foreground); font-size: var(--text-xs); margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 18px; margin: 20px 0; min-width: 0; }
.feature-tile { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-rgba); transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease); }
.feature-tile:hover { border-color: var(--ring); transform: translateY(-2px); }
.feature-tile-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-tile h3 { font-size: var(--text-lg); }
.feature-tile p { color: var(--muted-foreground); font-size: var(--text-sm); margin: 0; }

/* ============ Contact ============ */
.contact-card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-rgba); margin: 20px 0; }
.contact-card-title { font-weight: 800; font-size: var(--text-lg); color: var(--accent); }
.contact-card-desc { color: var(--muted-foreground); font-size: var(--text-sm); margin: 6px 0 0; }

/* ============ Buttons / empty states ============ */
.btn-glow, .btn-ghost { display: inline-block; padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: var(--text-sm); transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease), border-color var(--duration) var(--ease); }
.btn-glow { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 4px 18px -4px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-glow:hover { transform: translateY(-1px); text-decoration: none; color: var(--primary-foreground); box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-ghost { border: 1px solid var(--border); color: var(--foreground); background: var(--card-rgba); }
.btn-ghost:hover { border-color: var(--ring); text-decoration: none; }
.empty-state { color: var(--muted-foreground); padding: 32px 0; text-align: center; }
.empty-state-hint { color: var(--muted-foreground); text-align: center; margin-top: -12px; }

/* ============ 404 / offline ============ */
.not-found, .offline-page { text-align: center; padding: 40px 0; max-width: 560px; margin: 0 auto; }
.not-found-illustration, .offline-illustration { font-size: 3.5rem; }
.not-found-h1 { font-size: 4rem; font-weight: 800; color: var(--accent); margin: 8px 0; }
.not-found-h2 { font-size: var(--text-3xl); margin: 0 0 8px; }
.not-found-p { color: var(--muted-foreground); margin-bottom: 24px; }
.not-found-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============ Admin ============ */
.admin-login, .admin-form-wrap, .admin-list { max-width: 640px; margin: 0 auto; }
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); font-weight: 600; }
.admin-form input, .admin-form select, .admin-form textarea {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-rgba);
  color: var(--foreground);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  width: 100%;
  transition: border-color var(--duration) var(--ease);
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--ring); outline: none; }
.admin-form textarea { font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.5; resize: vertical; }
.admin-checks { display: flex; gap: 20px; flex-wrap: wrap; }
.admin-checks label { flex-direction: row; align-items: center; font-weight: 400; }
.admin-checks input { width: auto; }
.form-error { color: #f43f5e; font-weight: 600; }
.form-success { color: #10b981; font-weight: 600; }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.admin-table th, .admin-table td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--muted-foreground); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; }
.admin-table td { color: var(--foreground); }
.admin-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; white-space: normal; overflow-wrap: anywhere; }
.admin-actions form { display: inline; margin: 0; }
.link-danger { background: none; border: none; padding: 0; color: #f43f5e; cursor: pointer; font-size: var(--text-sm); font-weight: 600; }
.link-danger:hover { text-decoration: underline; }
.admin-logout { margin-top: 28px; }
.admin-logout a { color: var(--muted-foreground); font-size: var(--text-sm); }

/* ============ Footer ============ */
.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--card);
  margin-top: 48px;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0.5;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px 24px;
}
@media (min-width: 561px) { .footer-inner { padding: 48px 16px 24px; } }

/* Grid — brand full-width on top below 901px, all inline on desktop */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px 24px;
}
.footer-brand {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
@media (min-width: 901px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}
@media (max-width: 560px) {
  .footer-grid { gap: 24px 16px; }
}

/* Brand */
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 8px;
}
.footer-logo .site-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gradient-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, #ff2357 60%, transparent);
  flex: none;
}
.footer-logo .site-logo-icon svg { width: 20px; height: 20px; stroke: #fff; }
.footer-logo .site-logo-text { font-size: 1.25rem; font-weight: 800; letter-spacing: .02em; color: var(--foreground); }
.footer-logo .site-logo-text .accent { color: var(--accent); }
.footer-logo:hover { text-decoration: none; }
.footer-logo:hover .site-logo-text { color: var(--foreground); }
.footer-desc {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 0 0 16px;
  max-width: 280px;
  text-align: start;
}

/* Contact card */
.footer-contact {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
}
.footer-contact-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  line-height: 1.4;
  min-width: 0;
}
.footer-contact-row svg { color: var(--accent); flex: none; }
.footer-contact-row a { color: inherit; text-decoration: none; transition: color var(--duration) var(--ease); min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.footer-contact-row > span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.footer-contact-row a:hover { color: var(--accent); }

/* Columns — simplified mobile, static columns on desktop */
.footer-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.footer-col nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col a {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--duration) var(--ease), transform var(--duration) var(--ease);
  display: inline-block;
}
.footer-col a:hover {
  color: var(--accent);
  transform: translateX(4px);
}

/* Newsletter */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.newsletter-input-wrap {
  display: flex;
  gap: 8px;
}
.newsletter-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input);
  color: var(--foreground);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  min-width: 0;
}
.newsletter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.newsletter-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}
.newsletter-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  flex: none;
}
.newsletter-msg {
  font-size: var(--text-xs);
  min-height: 18px;
}
.newsletter-msg:empty::before {
  content: '\00a0';
}

/* Social row */
.footer-social {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
@media (max-width: 420px) {
  .footer-social { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-social-list { flex-wrap: wrap; }
}
.footer-social-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted-foreground);
}
.footer-social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
}
.footer-social-list li a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-rgba);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
}
.footer-social-list li a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-2px);
}

/* Bottom bar */
.footer-bottom {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-bottom-links { gap: 14px; flex-wrap: wrap; }
}
.footer-copy {
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  margin: 0;
}
.footer-bottom-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom-links a {
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
.footer-bottom-links a:hover {
  color: var(--accent);
}
.footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.back-to-top {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-rgba);
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
  flex: none;
}
.back-to-top:hover {
  color: var(--foreground);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-2px);
}
.back-to-top svg { width: 18px; height: 18px; }

/* RTL tweaks */
[dir="rtl"] .footer-col a:hover { transform: translateX(-4px); }
[dir="rtl"] .footer-contact-row { flex-direction: row; }

/* Print */
@media print {
  .site-footer { display: none !important; }
}

/* ============ Update toast ============ */
.update-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  max-width: calc(100vw - 32px);
  min-width: 0;
  overflow-wrap: anywhere;
  background: var(--popover-rgba);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  z-index: 200;
  font-size: var(--text-sm);
  animation: toast-in var(--duration) var(--ease);
}
.update-toast[hidden] { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.update-toast-btn { background: var(--primary); color: var(--primary-foreground); border: none; border-radius: 999px; padding: 6px 16px; font-weight: 700; cursor: pointer; }

/* ============ Shimmer skeleton ============ */
@keyframes shimmer {
  0%   { background-position: -800px 0; }
  100% { background-position: 800px 0; }
}
.acard-img, .featured-card-img, .article-hero {
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.05) 50%,
    rgba(255,255,255,0) 100%);
  background-size: 1600px 100%;
  animation: shimmer 2s linear infinite;
}
img.lazy { opacity: 0; transition: opacity 0.35s var(--ease); }
img.lazy.loaded { opacity: 1; }

/* ============ Responsive — mobile-first restores (legacy max-width blocks removed) ============
   All mobile bases now defined above; min-width restores at 561px and 901px handle
   previous max-width:900/560 overrides. bands-grid stays 1fr base with 768/1024 upgrades. */

/* ============ Small-screen tuning (<=400px) ============
   Tighten horizontal padding and inner card spacing so content never feels
   cramped or pushes past the viewport on the smallest phones. */
@media (max-width: 400px) {
  .container, .section-wrap { padding-left: 14px; padding-right: 14px; }
  .header-inner { gap: 8px; padding: 10px; }
  .acard-info { padding: 10px 12px 12px; }
  .featured-card-info { padding: 20px; }
  .side-card { padding: 16px; }
  .sub-card, .acct-card { padding: 18px; }
  .sub-hero-inner { padding: 22px 18px; }
  .contact-card { padding: 18px; }
  .article-detail { padding: 0 2px; }
  .article-reactions { gap: 6px; }
  .reaction-btn { padding: 6px 10px; }
  .pagination { gap: 4px; }
  .page-link { padding: 8px 11px; }
}

/* ============ RTL tweaks ============ */
[dir="rtl"] .section-more { margin-left: 0; margin-right: auto; }
[dir="rtl"] .article-badge { left: auto; right: 10px; }
[dir="rtl"] .mobile-menu nav { direction: rtl; }
[dir="rtl"] .callout-info { border-left: none; border-right: 4px solid var(--secondary); }
[dir="rtl"] .callout-warning { border-left: none; border-right: 4px solid #f59e0b; }
[dir="rtl"] .update-toast { left: auto; right: 20px; transform: none; }
[dir="rtl"] .search-modal-hint kbd:first-child { margin-inline-start: 4px; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Light theme component overrides ============ */
html[data-theme="light"] .site-header { background: var(--popover-rgba); }
html[data-theme="light"] .acard,
html[data-theme="light"] .featured-card,
html[data-theme="light"] .chip:not(.active),
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .feature-tile,
html[data-theme="light"] .callout { background: var(--card-rgba); }
html[data-theme="light"] .acard:hover,
html[data-theme="light"] .featured-card:hover { background: var(--card); }
html[data-theme="light"] .admin-form input,
html[data-theme="light"] .admin-form select,
html[data-theme="light"] .admin-form textarea,
html[data-theme="light"] .search-form input { background: var(--card-rgba); }
html[data-theme="light"] .acard-img,
html[data-theme="light"] .featured-card-img,
html[data-theme="light"] .article-hero {
  background: linear-gradient(90deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.04) 50%,
    rgba(0,0,0,0) 100%);
  background-size: 1600px 100%;
}
html[data-theme="light"] .search-dropdown-item mark { background: color-mix(in srgb, var(--accent) 20%, transparent); }

/* Form Kit (.sub-* / .acct-btn) moved to public/css/forms.css */
