/* =============================================================
   Odzysk.org — Portal Recyklingu
   v1.0.0 | Clean, professional, image-forward design (teal palette)
   ============================================================= */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Color — neutrals */
  --er-white:      #ffffff;
  --er-bg:         #ffffff;
  --er-bg-alt:     #FAFBFA;
  --er-bg-sunken:  #F5F7F5;

  /* Text */
  --er-text:       #0A0F0D;
  --er-text-2:     #374151;
  --er-text-3:     #6B7280;
  --er-text-4:     #9CA3AF;

  /* Borders */
  --er-border:     #E5E7EB;
  --er-border-2:   #F0F2F0;

  /* Brand — teal (fresh, clean, water-like, professional) */
  --er-green-900:  #134E4A;   /* teal-900 */
  --er-green-800:  #115E59;   /* teal-800 */
  --er-green-700:  #0F766E;   /* teal-700 */
  --er-green-600:  #0D9488;   /* teal-600  ← primary */
  --er-green-500:  #14B8A6;   /* teal-500 */
  --er-green-100:  #CCFBF1;   /* teal-100 */
  --er-green-50:   #F0FDFA;   /* teal-50 */

  /* Accent — warm amber for highlights (contrast to teal) */
  --er-amber:      #D97706;
  --er-amber-light:#FEF3C7;

  /* Semantic */
  --er-primary:       var(--er-green-600);
  --er-primary-hover: var(--er-green-700);
  --er-primary-soft:  var(--er-green-50);
  --er-accent:        var(--er-amber);

  /* Category accents — mapped to PL categories */
  --er-cat-edu:      #0891B2;    /* sky-600 — wiedza/edukacja/segregacja B2C */
  --er-cat-tech:     #0D9488;    /* teal-600 — technologie */
  --er-cat-market:   #D97706;    /* amber-600 — rynek */
  --er-cat-law:      #7C3AED;    /* violet-600 — prawo */
  --er-cat-case:     #059669;    /* emerald-600 — case studies */
  --er-cat-news:     #DC2626;    /* red-600 — aktualnosci */
  --er-cat-default:  #4B5563;

  /* Typography */
  --er-font-display: 'Figtree', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --er-font-sans:    'Manrope', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --er-font-mono:    ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Layout */
  --er-container:   1280px;
  --er-content-w:   720px;
  --er-sidebar-w:   304px;
  --er-gap:         4rem;

  /* Radii */
  --er-radius:      10px;
  --er-radius-sm:   6px;
  --er-radius-lg:   16px;
  --er-radius-full: 9999px;

  /* Shadows — subtle, modern */
  --er-shadow-xs:  0 1px 2px rgba(10,15,13,.04);
  --er-shadow-sm:  0 1px 2px rgba(10,15,13,.04), 0 1px 3px rgba(10,15,13,.06);
  --er-shadow:     0 2px 4px rgba(10,15,13,.04), 0 4px 12px rgba(10,15,13,.06);
  --er-shadow-md:  0 4px 6px rgba(10,15,13,.05), 0 12px 24px rgba(10,15,13,.08);
  --er-shadow-lg:  0 10px 15px rgba(10,15,13,.05), 0 24px 48px rgba(10,15,13,.10);

  /* Motion */
  --er-transition: 180ms cubic-bezier(.4, 0, .2, 1);
  --er-transition-slow: 380ms cubic-bezier(.4, 0, .2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: var(--er-bg);
}

body {
  font-family: var(--er-font-sans);
  color: var(--er-text);
  background: var(--er-bg);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt", "ss01";
}

img, video, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--er-primary);
  text-decoration: none;
  transition: color var(--er-transition);
}
a:hover { color: var(--er-primary-hover); }

ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; }

::selection { background: var(--er-green-100); color: var(--er-green-900); }

:focus-visible {
  outline: 2px solid var(--er-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Typography scale ──────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--er-font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.022em;
  color: var(--er-text);
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.028em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.125rem, 1.8vw, 1.25rem); }

p { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }

/* ── Container ─────────────────────────────────────────────── */
.er-container {
  max-width: var(--er-container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 1.75rem);
}
.er-container--narrow { max-width: 860px; }

/* ── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--er-text);
  color: var(--er-white);
  padding: .75rem 1.25rem;
  font-size: .85rem;
  font-weight: 600;
  border-radius: var(--er-radius-sm);
  z-index: 9999;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; color: var(--er-white); }

/* =============================================================
   HEADER
   ============================================================= */
.er-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(1.8) blur(12px);
  -webkit-backdrop-filter: saturate(1.8) blur(12px);
  border-bottom: 1px solid var(--er-border);
  transition: box-shadow var(--er-transition);
}
.er-header--scrolled { box-shadow: var(--er-shadow-sm); }

.er-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2.5rem;
  min-height: 72px;
  padding-block: .5rem;
}

/* Logo / brand */
.er-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: var(--er-text);
  flex-shrink: 0;
}
.er-logo__img { height: 40px; width: auto; }

/* Custom logo (WP) — img-based lockup */
.er-logo--img { padding: 0; }
.er-logo--img .custom-logo-link {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.er-logo--img .custom-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: transform var(--er-transition);
}
.er-logo--img:hover .custom-logo { transform: scale(1.02); }

@media (max-width: 640px) {
  .er-logo--img .custom-logo { height: 38px; }
}

/* SVG mark — trifolium pinwheel */
.er-logo__mark {
  display: block;
  flex-shrink: 0;
}
.er-logo__trifolium {
  transform-origin: 24px 24px;
  transform-box: fill-box;
  transition: transform 900ms cubic-bezier(.22, 1, .36, 1);
}
.er-logo__petal {
  transform-origin: 24px 24px;
  transform-box: fill-box;
  transition: opacity var(--er-transition);
}
.er-logo__hub {
  transform-origin: 24px 24px;
  transform-box: fill-box;
  transition: r 260ms cubic-bezier(.22, 1, .36, 1);
}
.er-logo:hover .er-logo__trifolium {
  transform: rotate(120deg);
}
.er-logo:hover .er-logo__hub {
  r: 4.8;
}

/* Wordmark */
.er-logo__text {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  line-height: 1.1;
  color: var(--er-text);
}
.er-logo__name {
  display: block;
  font-family: var(--er-font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--er-text);
  white-space: nowrap;
}
.er-logo__tagline {
  display: block;
  font-family: var(--er-font-sans);
  font-size: .62rem;
  font-weight: 600;
  color: var(--er-text-3);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: .15rem;
  white-space: nowrap;
}

/* Primary navigation */
.er-nav { justify-self: center; }
.er-nav__list {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.er-nav__item { position: relative; }
.er-nav__link,
.er-nav__list > li > a {
  display: block;
  padding: .55rem .95rem;
  font-family: var(--er-font-sans);
  font-size: .9rem;
  font-weight: 500;
  color: var(--er-text-2);
  border-radius: var(--er-radius-sm);
  transition: all var(--er-transition);
  letter-spacing: -.005em;
}
.er-nav__link:hover,
.er-nav__list > li > a:hover {
  color: var(--er-primary);
  background: var(--er-primary-soft);
}
.er-nav__link[aria-current="page"],
.er-nav__list > li.current-menu-item > a {
  color: var(--er-primary);
  background: var(--er-primary-soft);
}

/* Header right */
.er-header__right {
  display: flex;
  align-items: center;
  gap: .875rem;
}
.er-header__search-btn {
  background: transparent;
  border: 1px solid var(--er-border);
  color: var(--er-text-2);
  width: 38px;
  height: 38px;
  border-radius: var(--er-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--er-transition);
}
.er-header__search-btn:hover {
  background: var(--er-primary-soft);
  color: var(--er-primary);
  border-color: var(--er-green-100);
}

/* Language switcher removed — Odzysk.org is a single-language (PL) portal.
   Logo dot-char separator styling kept below. */
.er-logo__dot-char {
  color: var(--er-primary);
  font-weight: 800;
}


/* Mobile toggle */
.er-nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--er-border);
  color: var(--er-text-2);
  width: 38px;
  height: 38px;
  border-radius: var(--er-radius-sm);
  align-items: center;
  justify-content: center;
}

/* =============================================================
   HERO SLIDER
   ============================================================= */
.er-slider {
  position: relative;
  overflow: hidden;
  background: var(--er-bg-sunken);
  border-bottom: 1px solid var(--er-border);
}
.er-slider__track {
  display: flex;
  width: 100% !important;
  transition: transform 650ms cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
.er-slider__slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 100%;
  height: clamp(440px, 60vh, 560px);
  display: block;
}

/* Background image */
.er-slider__bg {
  position: absolute;
  inset: 0;
  background-color: var(--er-green-900);
  background-size: cover;
  background-position: center;
}
.er-slider__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10,15,13,.88) 0%,
    rgba(10,15,13,.65) 32%,
    rgba(10,15,13,.25) 65%,
    transparent 100%
  );
}
.er-slider__bg:not([style*="background-image"]) {
  background: linear-gradient(135deg, var(--er-green-900) 0%, var(--er-green-700) 60%, var(--er-green-600) 100%);
}

/* Content */
.er-slider__content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: clamp(2rem, 5vw, 4rem);
  max-width: min(680px, 55%);
  color: var(--er-white);
}
.er-slider__cat {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
  padding: .35rem .75rem;
  font-family: var(--er-font-sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.12);
  color: var(--er-white);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--er-radius-full);
  backdrop-filter: blur(8px);
  text-decoration: none;
}
.er-slider__cat::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--er-green-500);
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
}

.er-slider__title {
  font-family: var(--er-font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.025em;
  margin-bottom: 1rem;
  color: var(--er-white);
  max-width: 18ch;
}
.er-slider__title a {
  color: var(--er-white);
  background: linear-gradient(var(--er-white), var(--er-white)) left 100% / 0 2px no-repeat;
  transition: background-size var(--er-transition-slow);
  padding-bottom: 3px;
}
.er-slider__title a:hover { background-size: 100% 2px; }

.er-slider__excerpt {
  font-family: var(--er-font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255,255,255,.85);
  margin-bottom: 1.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 52ch;
}

/* Slider controls */
.er-slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--er-white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all var(--er-transition);
}
.er-slider__btn:hover {
  background: var(--er-white);
  color: var(--er-text);
  border-color: var(--er-white);
  transform: translateY(-50%) scale(1.05);
}
.er-slider__btn--prev { left: clamp(1rem, 2.5vw, 1.75rem); }
.er-slider__btn--next { right: clamp(1rem, 2.5vw, 1.75rem); }

/* Dots */
.er-slider__dots {
  position: absolute;
  bottom: 1.5rem;
  right: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  gap: .5rem;
  z-index: 10;
}
.er-slider__dot {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.35);
  border: none;
  padding: 0;
  transition: all var(--er-transition);
}
.er-slider__dot:hover { background: rgba(255,255,255,.55); }
.er-slider__dot--active {
  background: var(--er-white);
  width: 48px;
}

/* Buttons */
.er-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  font-family: var(--er-font-sans);
  font-size: .875rem;
  font-weight: 600;
  border: 1px solid var(--er-primary);
  background: var(--er-primary);
  color: var(--er-white);
  border-radius: var(--er-radius-sm);
  transition: all var(--er-transition);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.er-btn:hover {
  background: var(--er-primary-hover);
  border-color: var(--er-primary-hover);
  color: var(--er-white);
  transform: translateY(-1px);
  box-shadow: var(--er-shadow-sm);
}
.er-btn:active { transform: translateY(0); }
.er-btn--white {
  background: var(--er-white);
  color: var(--er-text);
  border-color: var(--er-white);
}
.er-btn--white:hover {
  background: var(--er-green-50);
  color: var(--er-primary);
}
.er-btn--outline {
  background: transparent;
  color: var(--er-text);
  border-color: var(--er-border);
}
.er-btn--outline:hover {
  background: var(--er-bg-sunken);
  color: var(--er-text);
  border-color: var(--er-border);
}
.er-btn--sm { padding: .6rem 1rem; font-size: .8rem; }

/* =============================================================
   BREAKING / LATEST BAR — CSS marquee
   ============================================================= */
.er-breaking {
  background: var(--er-bg-alt);
  color: var(--er-text-2);
  font-family: var(--er-font-sans);
  font-size: .85rem;
  border-bottom: 1px solid var(--er-border);
  overflow: hidden;
}
.er-breaking__inner {
  display: flex;
  align-items: stretch;
  min-height: 46px;
}
.er-breaking__label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .7rem;
  color: var(--er-primary);
  padding: 0 1.25rem 0 0;
  position: relative;
}
.er-breaking__label::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--er-green-500);
  box-shadow: 0 0 0 3px var(--er-green-100);
  animation: er-pulse 2.4s ease-in-out infinite;
}
.er-breaking__label::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: var(--er-border);
}
@keyframes er-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--er-green-100); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,.12); }
}

/* Ticker viewport — clips overflowing track */
.er-breaking__ticker {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
  padding-left: 1.25rem;
  align-self: stretch;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0, black 2.5rem, black calc(100% - 2.5rem), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, black 2.5rem, black calc(100% - 2.5rem), transparent 100%);
}

/* Track — duplicated content, animated via CSS marquee.
   width: max-content ensures it expands to real content width (wider than viewport).
   flex-shrink: 0 prevents the parent flex from compressing it. */
.er-breaking__track {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  width: max-content;
  white-space: nowrap;
  animation: er-marquee 55s linear infinite;
  will-change: transform;
}
.er-breaking__ticker:hover .er-breaking__track,
.er-breaking__ticker:focus-within .er-breaking__track {
  animation-play-state: paused;
}
@keyframes er-marquee {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .er-breaking__track { animation: none; }
}

/* Individual item — uses margin-right instead of parent gap,
   so the trailing margin of item 5 equals the gap to item 6 (start of copy 2).
   This makes translate(-50%) land exactly on the copy boundary. */
.er-breaking__item {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  margin-right: 2.25rem;
  color: var(--er-text-2);
  text-decoration: none;
  transition: color var(--er-transition);
  padding: .25rem 0;
  flex-shrink: 0;
}
.er-breaking__item:hover { color: var(--er-primary); }
.er-breaking__item:hover .er-breaking__title { color: var(--er-primary); }

.er-breaking__tag {
  flex-shrink: 0;
  font-family: var(--er-font-sans);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--er-primary);
  background: var(--er-primary-soft);
  padding: .2rem .55rem;
  border-radius: var(--er-radius-full);
  border: 1px solid color-mix(in srgb, var(--er-primary) 15%, transparent);
  line-height: 1.35;
}
.er-breaking__title {
  font-family: var(--er-font-sans);
  font-size: .85rem;
  font-weight: 500;
  color: var(--er-text);
  transition: color var(--er-transition);
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================================================
   CATEGORY BADGE
   ============================================================= */
.er-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--er-font-sans);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .3rem .625rem;
  border-radius: var(--er-radius-full);
  color: var(--er-cat-default);
  background: color-mix(in srgb, currentColor 8%, transparent);
  text-decoration: none;
  transition: all var(--er-transition);
  border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
}
.er-cat-badge:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
  color: currentColor;
}
.er-cat--edu      { color: var(--er-cat-edu); }
.er-cat--tech     { color: var(--er-cat-tech); }
.er-cat--market   { color: var(--er-cat-market); }
.er-cat--law      { color: var(--er-cat-law); }
.er-cat--case     { color: var(--er-cat-case); }
.er-cat--news     { color: var(--er-cat-news); }
.er-cat--default  { color: var(--er-cat-default); }

/* =============================================================
   HOMEPAGE
   ============================================================= */
.er-home-main {
  padding: clamp(3rem, 6vw, 4.5rem) 0 clamp(3rem, 6vw, 4.5rem);
}

/* Section title */
.er-section-title {
  font-family: var(--er-font-display);
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--er-text);
  margin: 0 0 2rem 0;
  display: flex;
  align-items: center;
  gap: .875rem;
}
.er-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.75rem;
  background: var(--er-primary);
  border-radius: 2px;
}

/* Featured cluster */
.er-home-featured {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  margin-bottom: clamp(3rem, 5vw, 4rem);
  padding-bottom: clamp(3rem, 5vw, 4rem);
  border-bottom: 1px solid var(--er-border);
}
.er-home-featured__primary { position: relative; }
.er-home-featured__sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.er-home-featured__sidebar > article {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--er-border);
}
.er-home-featured__sidebar > article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.er-divider {
  border: none;
  border-top: 1px solid var(--er-border);
  margin: clamp(2.5rem, 5vw, 4rem) 0;
}

/* Posts grid */
.er-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.75rem, 3vw, 2.5rem);
}

/* Spotlight sections */
.er-spotlight {
  margin-top: clamp(3.5rem, 6vw, 5rem);
}
.er-spotlight__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--er-border);
}
.er-spotlight__title {
  font-family: var(--er-font-display);
  font-size: clamp(1.375rem, 2vw, 1.625rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--er-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.er-spotlight__title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.4rem;
  background: var(--er-primary);
  border-radius: 2px;
}
.er-spotlight__more {
  font-family: var(--er-font-sans);
  font-size: .85rem;
  font-weight: 600;
  color: var(--er-primary);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .75rem;
  border-radius: var(--er-radius-sm);
  transition: all var(--er-transition);
}
.er-spotlight__more:hover {
  background: var(--er-primary-soft);
  color: var(--er-primary-hover);
  gap: .5rem;
}

/* =============================================================
   ARTICLE CARD
   ============================================================= */
.er-card {
  position: relative;
  background: var(--er-white);
  display: flex;
  flex-direction: column;
  border-radius: var(--er-radius);
  overflow: hidden;
  transition: transform var(--er-transition), box-shadow var(--er-transition);
}
.er-card:hover {
  transform: translateY(-3px);
}
.er-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--er-bg-sunken);
  border-radius: var(--er-radius);
  margin-bottom: 1.1rem;
}
.er-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.22, 1, .36, 1);
}
.er-card:hover .er-card__thumb img { transform: scale(1.05); }

/* Placeholder thumb (fallback when no featured image) */
.er-card__thumb--placeholder {
  background: linear-gradient(135deg, var(--er-green-700) 0%, var(--er-green-600) 60%, var(--er-green-500) 100%);
  position: relative;
}
.er-card__thumb--placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.15), transparent 60%);
}
.er-card__thumb--placeholder a {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.er-card__placeholder-mark {
  font-family: var(--er-font-display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  color: var(--er-white);
  opacity: .85;
  line-height: 1;
}

.er-card__body {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}
.er-card__cat { margin: 0; }
.er-card__title {
  font-family: var(--er-font-display);
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.015em;
  color: var(--er-text);
  margin: 0;
}
.er-card__title a {
  color: inherit;
  transition: color var(--er-transition);
}
.er-card__title a:hover { color: var(--er-primary); }
.er-card__excerpt {
  font-family: var(--er-font-sans);
  font-size: .9rem;
  color: var(--er-text-3);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.er-card__meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--er-font-sans);
  font-size: .75rem;
  color: var(--er-text-4);
  margin-top: .25rem;
}
.er-card__meta-sep { opacity: .5; }
.er-card__meta-author a {
  color: var(--er-text-2);
  font-weight: 500;
}
.er-card__meta-author a:hover { color: var(--er-primary); }

/* Primary/hero card in featured cluster */
.er-home-featured__primary .er-card__thumb { aspect-ratio: 16 / 9; }
.er-home-featured__primary .er-card__title {
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  line-height: 1.15;
  margin-top: .25rem;
}
.er-home-featured__primary .er-card__excerpt {
  font-size: 1rem;
  -webkit-line-clamp: 3;
  max-width: 58ch;
}

/* Sidebar cards in featured cluster */
.er-home-featured__sidebar .er-card { flex-direction: row; gap: 1rem; }
.er-home-featured__sidebar .er-card__thumb {
  flex: 0 0 40%;
  aspect-ratio: 4 / 3;
  margin-bottom: 0;
}
.er-home-featured__sidebar .er-card__body { flex: 1; }
.er-home-featured__sidebar .er-card__title { font-size: 1rem; line-height: 1.25; }
.er-home-featured__sidebar .er-card__excerpt { display: none; }
.er-home-featured__sidebar .er-card__meta { font-size: .7rem; }

/* =============================================================
   SIDEBAR
   ============================================================= */
.er-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.er-widget {
  background: var(--er-bg-alt);
  border: 1px solid var(--er-border);
  border-radius: var(--er-radius);
  padding: 1.5rem;
}
.er-widget__title {
  font-family: var(--er-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--er-text);
  margin: 0 0 1.25rem 0;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: .625rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--er-border);
}
.er-widget__title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1.1rem;
  background: var(--er-primary);
  border-radius: 2px;
}

/* Popular articles mini list */
.er-mini-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.er-mini-post {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: .875rem;
  align-items: flex-start;
}
.er-mini-post__thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--er-radius-sm);
  overflow: hidden;
  background: var(--er-bg-sunken);
}
.er-mini-post__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.er-mini-post > div {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.er-mini-post__title {
  font-family: var(--er-font-display);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--er-text);
  margin: 0;
}
.er-mini-post__title a { color: inherit; }
.er-mini-post__title a:hover { color: var(--er-primary); }
.er-mini-post__meta {
  font-family: var(--er-font-sans);
  font-size: .7rem;
  color: var(--er-text-4);
  margin: 0;
}
.er-meta__date {
  font-family: var(--er-font-sans);
  font-size: .72rem;
  color: var(--er-text-4);
}

/* Widget links */
.er-widget .er-footer__links {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.er-widget .er-footer__link {
  font-family: var(--er-font-sans);
  font-size: .875rem;
  color: var(--er-text-2);
  padding: .5rem .625rem;
  border-radius: var(--er-radius-sm);
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  transition: all var(--er-transition);
}
.er-widget .er-footer__link:hover {
  background: var(--er-white);
  color: var(--er-primary);
}
.er-widget .er-footer__link span:last-child {
  font-size: .7rem;
  color: var(--er-text-4);
}

/* Tag cloud */
.er-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .25rem;
}
.er-tag {
  font-family: var(--er-font-sans);
  font-size: .75rem;
  font-weight: 500;
  color: var(--er-text-2);
  background: var(--er-white);
  border: 1px solid var(--er-border);
  padding: .3rem .625rem;
  border-radius: var(--er-radius-full);
  transition: all var(--er-transition);
}
.er-tag:hover {
  background: var(--er-primary);
  color: var(--er-white);
  border-color: var(--er-primary);
}

/* =============================================================
   BREADCRUMBS
   ============================================================= */
.er-breadcrumbs {
  font-family: var(--er-font-sans);
  font-size: .8rem;
  color: var(--er-text-4);
  padding: 1rem 0;
  border-bottom: 1px solid var(--er-border);
  background: var(--er-bg-alt);
}
.er-breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}
.er-breadcrumbs__item + .er-breadcrumbs__item::before {
  content: '›';
  margin-right: .35rem;
  color: var(--er-text-4);
  font-weight: 400;
}
.er-breadcrumbs__item a {
  color: var(--er-text-3);
  transition: color var(--er-transition);
}
.er-breadcrumbs__item a:hover { color: var(--er-primary); }
.er-breadcrumbs__item--current { color: var(--er-text); font-weight: 500; }

/* =============================================================
   SINGLE POST — Article layout
   ============================================================= */
.er-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--er-sidebar-w);
  gap: clamp(2rem, 4vw, 4rem);
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4rem);
}

.er-article {
  min-width: 0;
  max-width: calc(var(--er-content-w) + 120px);
  margin-inline: auto;
  width: 100%;
}

/* Article header */
.er-article-header {
  margin-bottom: 2rem;
}
.er-article-header__top {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.er-article-meta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--er-font-sans);
  font-size: .82rem;
  color: var(--er-text-3);
}
.er-article-meta__sep { color: var(--er-text-4); opacity: .6; }
.er-article-meta__author a {
  color: var(--er-text-2);
  font-weight: 600;
}
.er-article-meta__author a:hover { color: var(--er-primary); }
.er-article-meta__read { color: var(--er-text-3); }

.er-article-title {
  font-family: var(--er-font-display);
  font-size: clamp(1.875rem, 4.5vw, 2.875rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.028em;
  color: var(--er-text);
  margin: 0 0 1.25rem 0;
  max-width: 22ch;
}
.er-article-subtitle {
  font-family: var(--er-font-sans);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  color: var(--er-text-2);
  margin: 0;
  max-width: 58ch;
  font-weight: 400;
}

/* Featured image */
.er-article-featured {
  margin: 2rem 0;
  border-radius: var(--er-radius-lg);
  overflow: hidden;
}
.er-article-featured img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
}
.er-article-featured figcaption {
  font-family: var(--er-font-sans);
  font-size: .82rem;
  color: var(--er-text-3);
  text-align: center;
  margin-top: .75rem;
  padding: 0 1rem;
}

/* TOC inline */
.er-toc-inline {
  margin: 2rem 0;
}
.er-toc {
  background: var(--er-bg-alt);
  border: 1px solid var(--er-border);
  border-radius: var(--er-radius);
  padding: 1.5rem 1.75rem;
}
.er-toc__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--er-border);
}
.er-toc__title {
  font-family: var(--er-font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--er-text);
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.005em;
}
.er-toc__title::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background: var(--er-primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M4 6h16v2H4zM4 11h10v2H4zM4 16h16v2H4z'/%3E%3C/svg%3E") no-repeat center/contain;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M4 6h16v2H4zM4 11h10v2H4zM4 16h16v2H4z'/%3E%3C/svg%3E") no-repeat center/contain;
}
.er-toc__toggle {
  background: transparent;
  border: 1px solid var(--er-border);
  color: var(--er-text-3);
  width: 28px;
  height: 28px;
  border-radius: var(--er-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}
.er-toc__toggle:hover { color: var(--er-primary); background: var(--er-white); }
.er-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.er-toc__sub {
  list-style: none;
  padding-left: 1.25rem;
  margin-top: .3rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  border-left: 1px solid var(--er-border);
  margin-left: .5rem;
}
.er-toc__item { padding: 0; }
.er-toc__link {
  display: block;
  padding: .35rem .65rem;
  font-family: var(--er-font-sans);
  font-size: .88rem;
  color: var(--er-text-2);
  border-radius: var(--er-radius-sm);
  transition: all var(--er-transition);
  line-height: 1.4;
}
.er-toc__link:hover {
  background: var(--er-white);
  color: var(--er-primary);
}
.er-toc__item--h2 > .er-toc__link { font-weight: 600; }
.er-toc__item--h3 > .er-toc__link { font-size: .83rem; color: var(--er-text-3); }
.er-toc__num {
  font-family: var(--er-font-mono);
  font-size: .75rem;
  color: var(--er-primary);
  font-weight: 600;
  margin-right: .35rem;
}

/* Article content */
.er-article-content {
  font-family: var(--er-font-sans);
  font-size: 1.075rem;
  line-height: 1.75;
  color: var(--er-text);
}
.er-article-content p {
  margin-bottom: 1.3em;
  max-width: 64ch;
}
.er-article-content h2,
.er-article-content h3,
.er-article-content h4 {
  font-family: var(--er-font-display);
  color: var(--er-text);
  scroll-margin-top: 5rem;
}
.er-article-content h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  margin-top: 2.5em;
  margin-bottom: .7em;
  font-weight: 700;
  letter-spacing: -.02em;
}
.er-article-content h2::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--er-primary);
  border-radius: 2px;
  margin-bottom: .6rem;
}
.er-article-content h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.375rem);
  margin-top: 2em;
  margin-bottom: .55em;
  font-weight: 700;
  color: var(--er-text);
  letter-spacing: -.015em;
}
.er-article-content h4 {
  font-size: 1.1rem;
  margin-top: 1.8em;
  margin-bottom: .5em;
  font-weight: 600;
}
.er-article-content ul,
.er-article-content ol {
  margin: 0 0 1.4em 1.5em;
  max-width: 62ch;
}
.er-article-content ul { list-style: disc; }
.er-article-content ol { list-style: decimal; }
.er-article-content li {
  margin-bottom: .5em;
  padding-left: .3rem;
}
.er-article-content li::marker { color: var(--er-primary); }
.er-article-content a {
  color: var(--er-primary);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--er-primary) 30%, transparent);
  transition: text-decoration-color var(--er-transition);
}
.er-article-content a:hover {
  text-decoration-color: var(--er-primary);
}
.er-article-content blockquote {
  margin: 2em 0;
  padding: 1.25rem 1.75rem;
  background: var(--er-primary-soft);
  border-left: 4px solid var(--er-primary);
  border-radius: 0 var(--er-radius) var(--er-radius) 0;
  font-family: var(--er-font-display);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--er-text);
  font-style: normal;
  font-weight: 500;
}
.er-article-content blockquote p { margin-bottom: .5em; }
.er-article-content blockquote p:last-child { margin-bottom: 0; }
.er-article-content code {
  font-family: var(--er-font-mono);
  font-size: .88em;
  background: var(--er-bg-sunken);
  padding: .15em .4em;
  border-radius: 4px;
  color: var(--er-green-800);
}
.er-article-content pre {
  background: var(--er-text);
  color: var(--er-white);
  padding: 1.25rem 1.5rem;
  border-radius: var(--er-radius);
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: .88rem;
  line-height: 1.6;
}
.er-article-content pre code { background: none; padding: 0; color: inherit; }
.er-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75em 0;
  font-size: .95rem;
}
.er-article-content th,
.er-article-content td {
  padding: .75rem 1rem;
  border: 1px solid var(--er-border);
  text-align: left;
}
.er-article-content th {
  background: var(--er-primary-soft);
  font-weight: 700;
  color: var(--er-text);
}
.er-article-content tr:nth-child(even) td { background: var(--er-bg-alt); }

/* Inline figures (injected images) */
.er-article-content figure,
.er-article-content .er-article-img {
  margin: 2em 0;
  border-radius: var(--er-radius);
  overflow: hidden;
  max-width: 100%;
}
.er-article-content figure img,
.er-article-content .er-article-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--er-radius);
}
.er-article-content figcaption {
  font-family: var(--er-font-sans);
  font-size: .8rem;
  color: var(--er-text-3);
  text-align: center;
  margin-top: .75rem;
  padding: 0 1rem;
}

/* Post tags */
.er-article .er-tags {
  margin: 2.5rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--er-border);
  align-items: center;
}
.er-tags__label {
  font-family: var(--er-font-sans);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--er-text-3);
  margin-right: .5rem;
}

/* =============================================================
   AUTHOR BOX (E-E-A-T) — the one that was "rozjeżdża"
   ============================================================= */
.er-author-box {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.5rem;
  padding: 1.75rem;
  background: var(--er-bg-alt);
  border: 1px solid var(--er-border);
  border-radius: var(--er-radius-lg);
  margin: 3rem 0 2rem;
}
.er-author-box__avatar {
  width: 96px;
  height: 96px;
}
.er-author-box__avatar-img,
.er-author-box__avatar img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--er-white);
  box-shadow: var(--er-shadow-sm);
}
.er-author-box__body {
  min-width: 0;
}
.er-author-box__header {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin-bottom: .75rem;
}
.er-author-box__label {
  font-family: var(--er-font-sans);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--er-text-4);
}
.er-author-box__name {
  font-family: var(--er-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--er-text);
  margin: 0;
  letter-spacing: -.015em;
}
.er-author-box__name a {
  color: inherit;
  transition: color var(--er-transition);
}
.er-author-box__name a:hover { color: var(--er-primary); }
.er-author-box__credentials {
  display: inline-block;
  font-family: var(--er-font-sans);
  font-size: .78rem;
  font-weight: 500;
  color: var(--er-primary);
  background: var(--er-primary-soft);
  padding: .2rem .55rem;
  border-radius: var(--er-radius-full);
  margin-top: .3rem;
  width: fit-content;
}
.er-author-box__bio {
  font-family: var(--er-font-sans);
  font-size: .925rem;
  color: var(--er-text-2);
  line-height: 1.6;
  margin: 0 0 .875rem 0;
  max-width: 62ch;
}
.er-author-box__expertise {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.er-expertise-tag {
  font-family: var(--er-font-sans);
  font-size: .72rem;
  font-weight: 500;
  color: var(--er-text-2);
  background: var(--er-white);
  border: 1px solid var(--er-border);
  padding: .25rem .6rem;
  border-radius: var(--er-radius-full);
}
.er-author-box__footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.er-author-box__social {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .75rem;
  font-family: var(--er-font-sans);
  font-size: .8rem;
  font-weight: 600;
  color: var(--er-text-2);
  background: var(--er-white);
  border: 1px solid var(--er-border);
  border-radius: var(--er-radius-sm);
  transition: all var(--er-transition);
  text-decoration: none;
}
.er-author-box__social:hover {
  background: var(--er-primary);
  color: var(--er-white);
  border-color: var(--er-primary);
}
.er-author-box__social--linkedin:hover { background: #0A66C2; border-color: #0A66C2; }
.er-author-box__all-posts {
  font-family: var(--er-font-sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--er-primary);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: gap var(--er-transition);
}
.er-author-box__all-posts:hover { gap: .5rem; }

/* =============================================================
   RELATED ARTICLES — the one that "wygląda podle"
   ============================================================= */
.er-related {
  margin: 3rem 0 2rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--er-border);
}
.er-related__title {
  font-family: var(--er-font-display);
  font-size: clamp(1.375rem, 2.2vw, 1.625rem);
  font-weight: 700;
  color: var(--er-text);
  margin: 0 0 1.5rem 0;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .625rem;
}
.er-related__title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.4rem;
  background: var(--er-primary);
  border-radius: 2px;
}
.er-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.er-related__grid .er-card__thumb { aspect-ratio: 16 / 10; }
.er-related__grid .er-card__title { font-size: 1rem; line-height: 1.3; }
.er-related__grid .er-card__excerpt { display: none; }

/* =============================================================
   FOOTER
   ============================================================= */
.er-footer {
  background: #0A0F0D;
  color: #D1D5DB;
  padding: clamp(3.5rem, 6vw, 5rem) 0 2rem;
  margin-top: clamp(4rem, 8vw, 6rem);
  position: relative;
}
.er-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--er-green-500) 0%, var(--er-green-600) 40%, var(--er-green-700) 100%);
}
.er-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.er-footer__brand .er-logo {
  color: var(--er-white);
  margin-bottom: 1rem;
}
.er-footer__brand .er-logo__text {
  color: var(--er-white);
  font-size: 1.3rem;
}
.er-footer__brand .er-logo__text span {
  color: rgba(255,255,255,.5);
}
.er-footer__desc {
  font-family: var(--er-font-sans);
  font-size: .9rem;
  color: rgba(255,255,255,.6);
  max-width: 38ch;
  line-height: 1.65;
  margin-top: 1rem;
}
.er-footer__title {
  font-family: var(--er-font-display);
  font-size: .85rem;
  font-weight: 700;
  color: var(--er-white);
  margin-bottom: 1.25rem;
  letter-spacing: -.005em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.er-footer__title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: .9rem;
  background: var(--er-green-500);
  border-radius: 2px;
}
.er-footer__links {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.er-footer__link {
  font-family: var(--er-font-sans);
  font-size: .88rem;
  color: rgba(255,255,255,.65);
  transition: all var(--er-transition);
  text-decoration: none;
  display: inline-block;
  width: fit-content;
}
.er-footer__link:hover {
  color: var(--er-green-500);
  transform: translateX(2px);
}

.er-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--er-font-sans);
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}
.er-footer__legal {
  display: flex;
  gap: 1.5rem;
}
.er-footer__legal a {
  color: rgba(255,255,255,.5);
  transition: color var(--er-transition);
}
.er-footer__legal a:hover { color: var(--er-green-500); }

.er-footer .er-lang-switcher ul {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
.er-footer .er-lang-switcher a { color: rgba(255,255,255,.65); }
.er-footer .er-lang-switcher .current-lang a {
  background: rgba(255,255,255,.15);
  color: var(--er-white);
}

/* =============================================================
   404 PAGE
   ============================================================= */
.er-404 {
  padding: clamp(4rem, 10vw, 8rem) 0;
  text-align: center;
}
.er-404__title {
  font-family: var(--er-font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1rem;
  color: var(--er-primary);
  letter-spacing: -.04em;
}

/* Search form */
.er-search-form {
  display: flex;
  max-width: 480px;
  margin: 2rem auto;
  gap: .5rem;
}
.er-search-form__input {
  flex: 1;
  padding: .85rem 1.1rem;
  border: 1px solid var(--er-border);
  background: var(--er-white);
  font-family: var(--er-font-sans);
  font-size: .9rem;
  color: var(--er-text);
  border-radius: var(--er-radius-sm);
}
.er-search-form__input:focus {
  outline: 2px solid var(--er-primary);
  outline-offset: 0;
  border-color: var(--er-primary);
}
.er-search-form__btn {
  background: var(--er-primary);
  color: var(--er-white);
  border: 1px solid var(--er-primary);
  padding: 0 1.5rem;
  font-family: var(--er-font-sans);
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--er-radius-sm);
  transition: background var(--er-transition);
}
.er-search-form__btn:hover { background: var(--er-primary-hover); }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1100px) {
  .er-page-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .er-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .er-related__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .er-header__inner { grid-template-columns: auto auto; gap: 1rem; }
  .er-nav { display: none; grid-column: 1 / -1; }
  .er-nav--open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--er-white);
    border-top: 1px solid var(--er-border);
    border-bottom: 1px solid var(--er-border);
    padding: 1rem;
    box-shadow: var(--er-shadow);
  }
  .er-nav--open .er-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: .1rem;
  }
  .er-nav--open .er-nav__link,
  .er-nav--open .er-nav__list > li > a {
    padding: .8rem 1rem;
    border-radius: var(--er-radius-sm);
  }
  .er-nav__toggle { display: flex; }
  .er-logo__text span { display: none; }

  /* Home featured → stack */
  .er-home-featured {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .er-home-featured__sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .er-home-featured__sidebar .er-card { flex-direction: column; gap: .75rem; }
  .er-home-featured__sidebar .er-card__thumb { flex: none; aspect-ratio: 16 / 10; }

  /* Footer */
  .er-footer__grid { grid-template-columns: 1fr 1fr; }

  /* Author box stack */
  .er-author-box {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: left;
  }
  .er-author-box__avatar { margin: 0 auto; }
}

@media (max-width: 640px) {
  .er-slider__slide { height: clamp(400px, 56vh, 500px); }
  .er-slider__content { padding: 1.5rem; max-width: 92%; }
  .er-slider__title { font-size: 1.5rem; }
  .er-slider__btn { width: 40px; height: 40px; }
  .er-slider__btn--prev { left: .75rem; }
  .er-slider__btn--next { right: .75rem; }

  .er-home-featured__sidebar { grid-template-columns: 1fr; }
  .er-posts-grid { grid-template-columns: 1fr; }
  .er-related__grid { grid-template-columns: 1fr; }

  .er-footer__grid { grid-template-columns: 1fr; }
  .er-footer__bottom { flex-direction: column; align-items: flex-start; }

  .er-article-title { font-size: 1.75rem; }
  .er-breaking__label { font-size: .65rem; padding-right: .75rem; }
}

/* =============================================================
   MOTION — subtle, modern
   ============================================================= */
@media (prefers-reduced-motion: no-preference) {
  .er-slider__slide:first-child .er-slider__cat,
  .er-slider__slide:first-child .er-slider__title,
  .er-slider__slide:first-child .er-slider__excerpt,
  .er-slider__slide:first-child .er-btn {
    opacity: 0;
    transform: translateY(12px);
    animation: er-rise .7s cubic-bezier(.22, 1, .36, 1) forwards;
  }
  .er-slider__slide:first-child .er-slider__cat     { animation-delay: .1s;  }
  .er-slider__slide:first-child .er-slider__title   { animation-delay: .2s; }
  .er-slider__slide:first-child .er-slider__excerpt { animation-delay: .3s; }
  .er-slider__slide:first-child .er-btn             { animation-delay: .4s;  }

  @keyframes er-rise {
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================================
   UTILITIES
   ============================================================= */
.er-hidden { display: none !important; }
.screen-reader-text, .sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Fix for injected figure tags in articles */
.er-article-img {
  margin: 2em 0 !important;
  border-radius: var(--er-radius);
  overflow: hidden;
}
