/* Shared foundation — system fonts, stable layout, mobile-first */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text, #1e293b);
  background: var(--bg, #fff);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link, #b91c1c); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover, #7f1d1d); }

.container { width: min(1140px, 100% - 2rem); margin-inline: auto; }

/* Skip link — a11y + SEO */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: .75rem 1rem;
  background: var(--accent, #b91c1c);
  color: #fff;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Pre-header (news / DE themes) */
.pre-header {
  display: none;
  font-size: .8125rem;
  background: var(--pre-header-bg, #0f172a);
  color: var(--pre-header-text, #e2e8f0);
}
.pre-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: .5rem;
}
.pre-header .badge {
  background: var(--accent, #ea580c);
  color: #fff;
  padding: .15rem .55rem;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pre-header .pre-phone { margin-left: auto; font-weight: 600; color: var(--accent-light, #fbbf24); }

/* Header */
.site-header {
  background: var(--header-bg, #fff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: .875rem;
  flex-wrap: wrap;
  position: relative;
}
.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand, #0f172a);
  text-decoration: none;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.brand-wrap { line-height: 1.2; }
.brand-tag {
  display: none;
  margin: .25rem 0 0;
  font-size: .8rem;
  color: var(--muted, #64748b);
  font-style: italic;
  max-width: 14rem;
}
.pre-header-visible { display: block; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.nav-toggle-label {
  display: none;
  margin-left: auto;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  background: var(--surface, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle-label span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--text, #1e293b);
  border-radius: 1px;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  flex: 1;
  justify-content: center;
}
.primary-nav a {
  text-decoration: none;
  color: var(--nav-text, #475569);
  padding: .5rem .85rem;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.primary-nav a:hover,
.primary-nav a.is-active {
  background: var(--nav-active-bg, #fef2f2);
  color: var(--accent, #b91c1c);
}
.header-cta {
  text-decoration: none;
  font-size: .875rem;
  font-weight: 700;
  padding: .55rem 1.1rem;
  border-radius: 6px;
  background: var(--accent, #b91c1c);
  color: #fff !important;
  white-space: nowrap;
}
.header-cta:hover { filter: brightness(1.08); color: #fff !important; }

/* Page layout — sidebar always on the right */
.page-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width, 300px);
  gap: var(--layout-gap, 2.5rem);
  padding-block: 2rem 3rem;
  align-items: start;
}
.main-content { min-width: 0; }

/* Sidebar — persistent */
.site-sidebar {
  position: sticky;
  top: calc(var(--header-offset, 4rem));
  font-size: .9375rem;
}
.sidebar-widget {
  background: var(--sidebar-bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 8px);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.sidebar-widget h2,
.sidebar-widget h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  margin: 0 0 .875rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--accent, #b91c1c);
  color: var(--heading, #0f172a);
}
.sidebar-author {
  display: flex;
  gap: .875rem;
  align-items: center;
}
.sidebar-author img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-author-role { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #64748b); }
.sidebar-author-name { font-weight: 700; margin: .15rem 0; font-size: .95rem; }
.sidebar-author a { font-size: .8rem; font-weight: 600; text-decoration: none; }

.side-card {
  display: flex;
  gap: .75rem;
  padding-bottom: .875rem;
  margin-bottom: .875rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.side-card:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.side-card-thumb {
  flex: 0 0 72px;
  height: 54px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border, #e2e8f0);
}
.side-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-card-meta { font-size: .68rem; color: var(--muted, #64748b); text-transform: uppercase; }
.side-card-title {
  margin: .2rem 0 0;
  font-size: .875rem;
  line-height: 1.35;
  font-weight: 600;
}
.side-card-title a { color: var(--text, #1e293b); text-decoration: none; }
.side-card-title a:hover { color: var(--accent, #b91c1c); }

.sidebar-cats { list-style: none; margin: 0; padding: 0; }
.sidebar-cats li { margin-bottom: .4rem; }
.sidebar-cats a {
  text-decoration: none;
  color: var(--text, #1e293b);
  font-size: .875rem;
}
.sidebar-cats a:hover { color: var(--accent, #b91c1c); }
.sidebar-slot { min-height: 1rem; margin-top: .5rem; }
.sidebar-partners .partners-links {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-height: 1.5rem;
  font-size: .875rem;
}
.sidebar-partners .partners-links a {
  text-decoration: none;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.page-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border, #e2e8f0); }
.page-body > p:first-child { font-size: 1.05rem; color: var(--muted, #475569); }

/* Content blocks */
.hero {
  margin-bottom: 1.5rem;
  border-radius: var(--radius, 8px);
  overflow: hidden;
  background: var(--border, #e2e8f0);
}
.hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.author-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 8px);
  margin-bottom: 1.25rem;
}
.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-role { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted, #64748b); }
.author-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  margin: .2rem 0 .35rem;
  font-weight: 700;
}
.author-link { font-size: .85rem; font-weight: 600; text-decoration: none; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  font-size: .8125rem;
  color: var(--muted, #64748b);
  margin-bottom: 1.25rem;
}
.article-meta time { font-weight: 600; color: var(--text, #1e293b); }

.prose h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  color: var(--heading, #0f172a);
}
.prose .lead {
  font-size: 1.125rem;
  color: var(--muted, #475569);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.prose p { margin: 0 0 1.2em; }
.prose h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  margin: 2rem 0 .65rem;
  color: var(--heading, #0f172a);
  line-height: 1.3;
}
.prose h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; color: var(--heading, #0f172a); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin-bottom: .35em; }
.prose figure { margin: 0 0 1.5rem; }
.prose .article-hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius, 8px); }

.partners-block {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface, #f8fafc);
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: var(--radius, 8px);
}
.partners-block h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  margin: 0 0 1rem;
}
.partners-inner { min-height: 1.5rem; }

.contact-block p { margin-bottom: 1rem; }
.author-page-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
}

/* Footer — compact unified layout */
.site-footer {
  background: var(--footer-bg, #0f172a);
  color: var(--footer-text, #94a3b8);
  margin-top: 2.5rem;
}
.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.25rem 0 1.25rem;
  flex-wrap: wrap;
}
.footer-brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--footer-heading, #f8fafc);
  margin: 0 0 .35rem;
}
.footer-tagline {
  font-style: italic;
  color: var(--accent-light, #cbd5e1);
  margin: 0 0 .5rem;
  font-size: .9rem;
}
.footer-about {
  margin: 0;
  font-size: .85rem;
  line-height: 1.5;
  max-width: 36rem;
}
.footer-nav-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: center;
}
.footer-nav-inline a {
  color: var(--footer-text, #94a3b8);
  text-decoration: none;
  font-size: .875rem;
  padding: .35rem .5rem;
  border-radius: 4px;
}
.footer-nav-inline a:hover { color: #fff; background: rgba(255,255,255,.06); }
.footer-contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .65rem;
  padding-bottom: 1.25rem;
  font-size: .85rem;
  border-bottom: 1px solid var(--footer-border, #1e293b);
}
.footer-contact-row a { color: var(--footer-text, #94a3b8); }
.footer-sep { opacity: .5; }
.footer-bottom {
  padding-block: .85rem;
  font-size: .8rem;
  color: #64748b;
}
.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
}
.footer-bottom a { color: #94a3b8; text-decoration: none; }
.footer-18 { font-size: .78rem; opacity: .9; }

/* Blog listing */
.blog-page-header { margin-bottom: 1.5rem; }
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.blog-card {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.blog-card:last-child { border-bottom: none; padding-bottom: 0; }
.blog-card-thumb {
  display: block;
  border-radius: var(--radius, 8px);
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
  aspect-ratio: 16 / 9;
}
.blog-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  font-size: .78rem;
  color: var(--muted, #64748b);
  margin-bottom: .35rem;
}
.blog-card-title {
  font-size: 1.2rem;
  line-height: 1.35;
  margin: 0 0 .5rem;
}
.blog-card-title a { color: var(--heading, #0f172a); text-decoration: none; }
.blog-card-title a:hover { color: var(--accent, #b91c1c); }
.blog-card-excerpt {
  margin: 0 0 .75rem;
  color: var(--text, #334155);
  line-height: 1.55;
}
.blog-card-more {
  font-weight: 600;
  color: var(--link, #1d4ed8);
  text-decoration: none;
  font-size: .9rem;
}
.blog-card-more:hover { color: var(--link-hover, #1e40af); text-decoration: underline; }

/* Mobile */
@media (max-width: 900px) {
  .page-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .site-sidebar { position: static; order: 2; }
  .main-content { order: 1; }
  .footer-top { flex-direction: column; gap: 1rem; }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
  .nav-toggle-label {
    display: flex;
    order: 2;
    margin-left: auto;
    z-index: 210;
  }
  .primary-nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex: none;
    width: 100%;
    flex-direction: column;
    gap: .15rem;
    padding: .75rem;
    background: var(--header-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .12);
    z-index: 205;
  }
  .primary-nav a {
    width: 100%;
    padding: .75rem 1rem;
    border-radius: 8px;
  }
  .nav-toggle:checked ~ .primary-nav { display: flex; }
  .nav-toggle:checked + .nav-toggle-label {
    background: var(--nav-active-bg, #fef2f2);
    border-color: var(--accent, #b91c1c);
  }
  .header-cta { order: 3; display: none; }
  .brand-wrap { order: 1; flex: 1; min-width: 0; }
}

@media (max-width: 540px) {
  .author-box { flex-direction: column; text-align: center; }
  .blog-card { grid-template-columns: 1fr; }
}

/* theme-cosmopolitan — international magazine, indigo accent, multilingual-friendly */
.theme-cosmopolitan {
  --accent: #4f46e5;
  --accent-light: #a5b4fc;
  --link: #4338ca;
  --link-hover: #3730a3;
  --brand: #1e1b4b;
  --heading: #1e1b4b;
  --text: #334155;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --muted: #64748b;
  --nav-text: #475569;
  --nav-active-bg: #eef2ff;
  --header-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --footer-bg: #1e1b4b;
  --footer-text: #c7d2fe;
  --footer-heading: #f8fafc;
  --footer-border: #312e81;
  --pre-header-bg: linear-gradient(90deg, #312e81 0%, #4f46e5 100%);
  --pre-header-text: #e0e7ff;
  --radius: 10px;
  --layout-gap: 2.25rem;
}

.theme-cosmopolitan body,
.theme-cosmopolitan {
  background: var(--bg);
}

.theme-cosmopolitan .pre-header {
  display: block;
  background: var(--pre-header-bg);
  color: var(--pre-header-text);
}

.theme-cosmopolitan .pre-header .badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.theme-cosmopolitan .pre-header .lang-chip {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.theme-cosmopolitan .site-header {
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(30, 27, 75, 0.04);
}

.theme-cosmopolitan .brand {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.01em;
}

.theme-cosmopolitan .brand-tag {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.15rem 0 0;
  max-width: 28ch;
}

.theme-cosmopolitan .header-cta {
  background: var(--accent);
  color: #fff !important;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-weight: 600;
  text-decoration: none;
}

.theme-cosmopolitan .header-cta:hover {
  background: var(--link-hover);
  color: #fff !important;
}

.theme-cosmopolitan .primary-nav a.is-active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  background: transparent;
}

.theme-cosmopolitan .main-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: 0 1px 2px rgba(30, 27, 75, 0.04);
}

.theme-cosmopolitan .sidebar-widget {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.theme-cosmopolitan .hero-cosmopolitan {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
}

.theme-cosmopolitan .hero-cosmopolitan img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.theme-cosmopolitan .hero-cosmopolitan .hero-caption {
  padding: 1rem 1.25rem 1.25rem;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-top: 3px solid var(--accent);
}

.theme-cosmopolitan .hero-cosmopolitan .hero-kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.theme-cosmopolitan .hero-cosmopolitan .hero-caption p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.35;
}

.theme-cosmopolitan .author-box {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
}

.theme-cosmopolitan .breadcrumb {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.theme-cosmopolitan .breadcrumb a {
  color: var(--link);
  text-decoration: none;
}

.theme-cosmopolitan .breadcrumb a:hover {
  text-decoration: underline;
}

.theme-cosmopolitan .prose h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}

.theme-cosmopolitan .prose h2 {
  border-left: 4px solid var(--accent);
  padding-left: 0.75rem;
}

.theme-cosmopolitan .lead {
  font-size: 1.1rem;
  color: var(--muted);
}

.theme-cosmopolitan .article-hero {
  border-radius: var(--radius);
}

.theme-cosmopolitan .site-footer {
  border-top: 4px solid var(--accent);
}

@media (max-width: 768px) {
  .theme-cosmopolitan .main-content {
    padding: 1.25rem 1rem;
  }
}
