/* ==========================================================================
   Leenardo Homepage Redesign Trial (design/home-playful)
   Derived strictly from scratch/design/mockup-gunduz.html and mockup-gece.html
   ========================================================================== */

:root {
  /* tune these three numbers for header spacing */
  --header-pad-y: 16px;
  --header-top-space: 20px;
  --header-hero-gap: 24px;
  /* if the logo size changes, update this number */
  --logo-box-w: 200px;
  --logo-l-shift: 3px;
  --content-max: 1240px;

  --bg-page: #FAF5EC;
  --ink-primary: #3A3152;
  --ink-secondary: #6B6485;
  --card-bg: #FFFFFF;
  --border-card: 2px solid #CFC4D8;
  --border-color: #CFC4D8;
  --shadow-card: 5px 5px 0 #DDD2BF;
  --shadow-hero: 7px 7px 0 #DDD2BF;
  --shadow-popover: 4px 4px 0 #DDD2BF;
  --shadow-color: #DDD2BF;
  --hero-bg: #F7D35C;
  --hero-ink: #3A3152;
  --hero-image-bg: #E7DABD;
  --coral-accent: #F5806C;
  --inverted-ink: #3A3152;
  --mint-accent: #B7DDCB;
  --lavender-accent: #CDC5EE;
  --yellow-accent: #F3E3B0;
  --hero-cta-bg: #3A3152;
  --hero-cta-color: #F7D35C;

  /* Category colors (Day) */
  --cat-hero-science: #8FD3B6;
  --cat-hero-history: #F7D35C;
  --cat-hero-culture: #BFB3F2;
  --cat-hero-arts: #F5A08F;
  --cat-hero-other: #E7DABD;

  --cat-dot-science: #3F7F69;
  --cat-dot-history: #B58A1E;
  --cat-dot-culture: #6F63B0;
  --cat-dot-arts: #D9604E;
  --cat-dot-other: #8E8373;
}

[data-theme="dark"] {
  --bg-page: #15102B;
  --ink-primary: #F4F0FF;
  --ink-secondary: #B2A9D4;
  --card-bg: #221A46;
  --border-card: 2.5px solid #4B3F8C;
  --border-color: #4B3F8C;
  --shadow-card: 5px 5px 0 #0A0716;
  --shadow-hero: 7px 7px 0 #0A0716;
  --shadow-popover: 4px 4px 0 #0A0716;
  --shadow-color: #0A0716;
  --hero-bg: #3B2C8F;
  --hero-ink: #F4F0FF;
  --hero-image-bg: #5A4E82;
  --coral-accent: #FF6252;
  --inverted-ink: #1D1630;
  --mint-accent: #5ED6A8;
  --lavender-accent: #A594FA;
  --yellow-accent: #FFD04A;
  --hero-cta-bg: #F4F0FF;
  --hero-cta-color: #3B2C8F;

  /* Category colors (Night) */
  --cat-hero-science: #1F6B5A;
  --cat-hero-history: #8A6A12;
  --cat-hero-culture: #4B3F9C;
  --cat-hero-arts: #8F3B33;
  --cat-hero-other: #3B2C8F;

  --cat-dot-science: #5ED6A8;
  --cat-dot-history: #FFD04A;
  --cat-dot-culture: #A594FA;
  --cat-dot-arts: #FF8A78;
  --cat-dot-other: #B2A9D4;
}

/* Base resets & typography */
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink-primary);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: var(--ink-primary);
  font-family: inherit;
}

/* Interactive elements: Touch targets >= 44px and visible focus outlines */
button,
a,
select,
input {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2.5px solid var(--ink-primary);
  outline-offset: 2px;
}

/* 1. Preserved Utility Bar (Hidden) */
body .top-utility-bar {
  display: none !important;
}

/* 2. Sticky Masthead (Desktop One Row Bar, position: sticky; top: 0; z-index: 500) */
body .main-masthead {
  position: sticky;
  top: 0;
  z-index: 500;
  background: transparent;
  border-bottom: 2px solid transparent;
  box-shadow: none;
  padding: var(--header-pad-y) 32px;
  max-width: 100%;
  width: 100%;
  margin-top: var(--header-top-space);
  margin-bottom: 0;
  box-sizing: border-box;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

[data-theme="dark"] body .main-masthead {
  border-bottom: 2.5px solid transparent;
}

body .main-masthead.is-stuck {
  background: var(--bg-page);
  border-bottom-color: var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] body .main-masthead.is-stuck {
  background: var(--bg-page);
  border-bottom-color: var(--border-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  body .main-masthead {
    transition: none !important;
  }
}

body .main-masthead-inner {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

body .masthead-brand-wrap {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  min-width: max-content;
}

body .masthead-logo-row {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

body .masthead-logo {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink-primary);
  text-decoration: none;
  margin: 0;
  padding: 0;
}

body .brand-glyph-l {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px 0 0;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  position: relative;
  top: 0;
  transform: translateY(var(--logo-l-shift, 3px));
}

body .brand-glyph-l svg {
  width: 38px;
  height: 46px;
  display: block;
  margin: 0;
  padding: 0;
}

body .brand-text-rest {
  display: inline-block;
  line-height: 1;
  color: var(--ink-primary);
  margin: 0;
  padding: 0;
}

body #brand-subtitle {
  display: none !important;
}

/* Category Navigation Pills inside sticky header */
body #nav-categories-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 0 clamp(16px, 2.5vw, 40px);
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
  flex-wrap: nowrap;
}

body #nav-categories-container::-webkit-scrollbar {
  display: none;
}

body .nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  background: var(--card-bg);
  color: var(--ink-primary);
  border: var(--border-card);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none !important;
  outline: none;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

body .nav-tab-btn:hover {
  background: var(--card-bg);
  color: var(--ink-primary);
  opacity: 0.88;
  box-shadow: none !important;
}

body .nav-tab-btn.active {
  background: var(--ink-primary);
  color: var(--bg-page);
  border: var(--border-card);
  box-shadow: none !important;
  outline: none;
}

/* Actions Group (Search, Random Story, Compact Language Pill, Profile Slot) */
body .masthead-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

/* Expandable Search Pill */
body .header-search-wrap {
  display: inline-flex;
  align-items: center;
  height: 40px;
  min-height: 40px;
  border: var(--border-card);
  border-radius: 999px;
  background: var(--card-bg);
  box-sizing: border-box;
  transition: width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
  flex-shrink: 0;
}

body .header-search-wrap:not(.expanded) {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

body .header-search-wrap.expanded {
  width: 220px;
  padding: 0 14px 0 4px;
}

body .header-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  color: var(--ink-primary);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  padding: 0;
  outline: none;
}

body .header-search-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-primary);
  box-sizing: border-box;
  transition: opacity 0.2s ease;
}

body .header-search-wrap:not(.expanded) .header-search-input {
  width: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
}

body .header-search-wrap.expanded .header-search-input {
  width: 100%;
  opacity: 1;
  padding: 0 4px;
  pointer-events: auto;
}

/* Random Story Button */
body .btn-random-story {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  border: var(--border-card);
  border-radius: 999px;
  background: var(--card-bg);
  font: inherit;
  font-weight: 800;
  color: var(--ink-primary);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  gap: 8px;
  flex-shrink: 0;
  transition: all 0.15s ease;
  width: 40px;
  min-width: 40px;
  padding: 0;
}

body .btn-random-story:hover {
  background: var(--card-bg);
  color: var(--ink-primary);
  opacity: 0.9;
}

body .btn-random-story .btn-box-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

body .btn-random-story .btn-box-text {
  display: none !important;
}

/* Compact Language Selectors Pill [ Target → Support ] */
body .header-lang-pill {
  display: inline-flex;
  align-items: center;
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  background: var(--card-bg);
  border: var(--border-card);
  border-radius: 999px;
  box-sizing: border-box;
  gap: 4px;
  flex-shrink: 0;
}

body .header-lang-label {
  display: none;
}

body .header-lang-select {
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-primary);
  cursor: pointer;
  padding: 0 2px;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}

body .header-lang-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-secondary);
  user-select: none;
  padding: 0 2px;
}

/* Profile Slot */
body .masthead-profile-slot {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

body .btn-profile-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  background: var(--card-bg);
  border: var(--border-card);
  border-radius: 50%;
  color: var(--ink-primary);
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity 0.12s ease;
}

body .btn-profile-menu:hover {
  opacity: 0.9;
}

body .btn-profile-menu .profile-btn-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

body .btn-profile-menu .auth-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--coral-accent);
  border: 1.5px solid var(--ink-primary);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

body .profile-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 600;
  width: 260px;
  background: var(--card-bg);
  border: var(--border-card);
  border-radius: 18px;
  box-shadow: var(--shadow-popover);
  padding: 12px;
  box-sizing: border-box;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 420px) {
  body .profile-menu-dropdown {
    width: calc(100vw - 32px);
    right: 0;
  }
}

body .profile-menu-user-header {
  padding: 6px 8px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body .profile-menu-user-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-primary);
  line-height: 1.25;
  word-break: break-word;
}

body .profile-menu-user-email {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  line-height: 1.25;
  word-break: break-all;
}

body .profile-menu-divider {
  border: 0;
  border-top: 1.5px solid var(--border-color);
  margin: 6px 0;
  width: 100%;
  box-sizing: border-box;
}

body .profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-primary);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: background-color 0.12s ease;
}

body .profile-menu-item:hover {
  background: rgba(58, 49, 82, 0.08);
}

[data-theme="dark"] body .profile-menu-item:hover {
  background: rgba(244, 240, 255, 0.1);
}

body .profile-menu-item.danger {
  color: #D93829;
}

[data-theme="dark"] body .profile-menu-item.danger {
  color: #FF7B6B;
}

body .profile-menu-theme-wrap {
  padding: 6px 6px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body .profile-menu-theme-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-secondary);
}

body .profile-theme-segmented {
  display: flex;
  align-items: center;
  background: var(--bg-page);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  box-sizing: border-box;
}

body .profile-theme-option {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 2px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.12s ease;
}

body .profile-theme-option:hover {
  color: var(--ink-primary);
}

body .profile-theme-option.active {
  background: var(--card-bg);
  color: var(--ink-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 800;
}

body .header-lang-field {
  display: inline-flex;
  align-items: center;
}

body .masthead-lang-slot {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

body .btn-lang-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  background: var(--card-bg);
  border: var(--border-card);
  color: var(--ink-primary);
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

body .btn-lang-mobile:hover {
  background: var(--card-bg);
  color: var(--ink-primary);
  opacity: 0.9;
}

body .btn-lang-mobile:active {
  transform: scale(0.94);
}

body .btn-lang-mobile svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

body .lang-badge-mobile {
  position: absolute;
  top: -2px;
  right: -3px;
  min-width: 16px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--coral-accent);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

body .lang-panel-mobile {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 610;
  width: 260px;
  max-width: calc(100vw - 32px);
  background: var(--card-bg);
  border: var(--border-card);
  border-radius: 18px;
  box-shadow: var(--shadow-popover);
  padding: 14px;
  box-sizing: border-box;
  flex-direction: column;
  gap: 12px;
}

body .lang-panel-mobile.show {
  display: flex !important;
}

body .lang-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

body .lang-panel-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

body .btn-close-lang-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

body .btn-close-lang-panel:hover {
  background: var(--bg-page);
  color: var(--ink-primary);
}

body .lang-panel-content {
  width: 100%;
}

body #lang-panel-mobile .header-lang-pill {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  gap: 10px;
}

body #lang-panel-mobile .header-lang-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

body #lang-panel-mobile .header-lang-arrow {
  display: none !important;
}

body #lang-panel-mobile .header-lang-label {
  display: block !important;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink-secondary);
  letter-spacing: 0.04em;
}

body #lang-panel-mobile .header-lang-select {
  display: block !important;
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: var(--border-card);
  border-radius: 12px;
  background: var(--bg-page);
  color: var(--ink-primary);
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  box-sizing: border-box;
  -webkit-appearance: menulist;
  appearance: menulist;
  cursor: pointer;
}

/* Accessible CSS Tooltips for Icon-Only Actions */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-primary);
  color: var(--bg-page);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

@media (hover: hover) {
  [data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
  }
}

[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* Hide search tooltip when search input is expanded */
body .header-search-wrap.expanded .header-search-icon::after {
  display: none !important;
}

body .profile-menu-lang-slot {
  display: none !important;
}

body .btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  background: var(--card-bg);
  border: var(--border-card);
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-primary);
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

body .btn-theme-toggle:hover {
  opacity: 0.9;
}

body .btn-header-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  padding: 0 14px 0 8px;
  background: var(--card-bg);
  border: var(--border-card);
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-primary);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  gap: 8px;
  transition: all 0.15s ease;
}

body .btn-header-auth:hover {
  opacity: 0.9;
}

body .auth-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--coral-accent);
  color: var(--inverted-ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: 12px;
}

/* 3. Hero Section (Task 2 Proportions: text ~45%, image ~55%) */
body .magazine-hero-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--header-hero-gap) 32px 0;
  box-sizing: border-box;
}

body .magazine-hero-inner {
  display: block;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body #hero-lead-box {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--hero-bg);
  color: var(--hero-ink);
  border: var(--border-card);
  border-radius: 28px;
  box-shadow: var(--shadow-hero);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 420px;
  box-sizing: border-box;
}

body .hero-slider-track {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 420px;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-sizing: border-box;
}

body .hero-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 420px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  box-sizing: border-box;
  overflow: hidden;
}

/* Category backgrounds for hero slides */
body .hero-slide[data-cat="science"] .hero-lead-content {
  background: var(--cat-hero-science);
}
body .hero-slide[data-cat="history"] .hero-lead-content {
  background: var(--cat-hero-history);
}
body .hero-slide[data-cat="culture"] .hero-lead-content {
  background: var(--cat-hero-culture);
}
body .hero-slide[data-cat="arts"] .hero-lead-content {
  background: var(--cat-hero-arts);
}
body .hero-slide[data-cat="other"] .hero-lead-content {
  background: var(--cat-hero-other);
}

/* Text shadow, filter, backdrop-filter override */
body .hero-lead-content,
body .hero-lead-top,
body .hero-cat-tag,
body .hero-lead-title,
body .hero-lead-content .feed-title-support,
body .hero-lead-excerpt,
body .hero-lead-link,
body .hero-levels-group {
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Task 2: .hero-lead-content flex 5 1 400px (45%), padding-left 80px */
body .hero-lead-content {
  position: relative;
  inset: auto;
  flex: 5 1 400px;
  min-width: 0;
  box-sizing: border-box;
  padding: 40px 44px 40px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  order: 1;
  background: var(--hero-bg);
  color: var(--hero-ink);
  z-index: 2;
}

body .hero-lead-content::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(58, 49, 82, 0.14) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to top right, #000, transparent 55%);
  mask-image: linear-gradient(to top right, #000, transparent 55%);
  z-index: 0;
}

[data-theme="dark"] body .hero-lead-content::before {
  background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1.5px, transparent 1.5px);
}

body .hero-lead-content > * {
  position: relative;
  z-index: 1;
}

/* Task 2: .hero-lead-bg flex 6 1 440px (55%) */
body .hero-lead-media {
  position: relative;
  inset: auto;
  flex: 6 1 440px;
  min-width: 0;
  max-width: 100%;
  min-height: 420px;
  height: 100%;
  box-sizing: border-box;
  order: 2;
  display: block;
  overflow: hidden;
  background: var(--hero-image-bg);
  border-left: var(--border-card);
  text-decoration: none;
}

body .hero-lead-bg {
  position: relative;
  inset: auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: block;
  object-fit: cover;
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body .hero-slide:hover .hero-lead-bg {
  transform: none !important;
}

body .hero-lead-overlay,
body .mosaic-card-overlay,
body #hero-mosaic-sub {
  display: none !important;
}

body .hero-badges-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

body .hero-cat-tag {
  align-self: flex-start;
  padding: 4px 14px;
  background: var(--hero-cta-bg);
  color: var(--hero-cta-color);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}

body .hero-read-tag {
  font-size: 13px;
  font-weight: 800;
  color: var(--hero-ink);
  opacity: 0.85;
}

/* Task 2: Title clamp max 46px, max 3 lines */
body .hero-lead-title {
  margin: 0;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--hero-ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body .hero-lead-content a {
  text-decoration: none;
  color: inherit;
}

body .hero-lead-content a:hover .hero-lead-title {
  text-decoration: underline;
}

body .hero-lead-content .feed-title-support {
  margin: 10px 0 0 0;
  font-size: 18px;
  font-weight: 700;
  opacity: 0.85;
  color: var(--hero-ink);
  display: block;
}

body .hero-lead-excerpt {
  margin: 16px 0 0 0;
  padding: 18px 20px;
  background: var(--card-bg);
  color: var(--ink-primary);
  border: var(--border-card);
  border-radius: 18px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: none;
}

body .hero-lead-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 10px;
}

body .hero-levels-group {
  display: flex;
  align-items: center;
  border: var(--border-card);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card-bg);
}

body .hero-lvl-pill {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0 10px;
}

body .hero-lvl-pill.active {
  background: var(--coral-accent);
  color: var(--inverted-ink);
}

/* Read story link always visible */
body .hero-lead-link,
body .hero-lead-content a.hero-lead-link {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  padding: 0 28px;
  background: var(--hero-cta-bg);
  color: var(--hero-cta-color) !important;
  -webkit-text-fill-color: var(--hero-cta-color) !important;
  opacity: 1 !important;
  border: var(--border-card);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--shadow-color);
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
}

/* Arrows & Slider dots positioned centered over image panel */
body .hero-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: var(--border-card);
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow-color);
  transition: transform 0.15s ease;
  opacity: 0.95;
}

body .hero-slider-arrow:focus-visible {
  outline: 2.5px solid var(--ink-primary);
  outline-offset: 2px;
}

body .hero-slider-arrow:hover {
  transform: translateY(-50%) scale(1.06);
  opacity: 1;
}

body .hero-slider-prev {
  left: 16px;
}

body .hero-slider-next {
  right: 16px;
}

/* Task 2: Slider dots recomputed for 5:6 ratio (image center at 3/11 from right) */
body .hero-slider-dots {
  position: absolute;
  bottom: 20px;
  left: auto;
  right: calc(100% * 3 / 11);
  transform: translateX(50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

body .hero-slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: var(--border-card);
  background: var(--card-bg);
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transition: all 0.2s ease;
}

body .hero-slider-dot.active {
  width: 24px;
  border-radius: 999px;
  background: var(--coral-accent);
  box-shadow: none;
}

/* 4. Level Selector Bar (Below Hero in Normal Flow) */
body .main-navbar {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  position: static !important;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 32px 14px;
  box-sizing: border-box;
}

body .main-navbar-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
  max-width: 100% !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Category dot badge (8-10px circle with ink border) */
.cat-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  margin-right: 4px;
  vertical-align: middle;
  box-sizing: border-box;
  flex-shrink: 0;
}

[data-cat="science"] .cat-dot { background: var(--cat-dot-science); }
[data-cat="history"] .cat-dot { background: var(--cat-dot-history); }
[data-cat="culture"] .cat-dot { background: var(--cat-dot-culture); }
[data-cat="arts"] .cat-dot    { background: var(--cat-dot-arts); }
[data-cat="other"] .cat-dot   { background: var(--cat-dot-other); }

.hero-slide[data-cat="science"] .hero-cat-tag .cat-dot { background: var(--cat-dot-science); }
.hero-slide[data-cat="history"] .hero-cat-tag .cat-dot { background: var(--cat-dot-history); }
.hero-slide[data-cat="culture"] .hero-cat-tag .cat-dot { background: var(--cat-dot-culture); }
.hero-slide[data-cat="arts"] .hero-cat-tag .cat-dot    { background: var(--cat-dot-arts); }
.hero-slide[data-cat="other"] .hero-cat-tag .cat-dot   { background: var(--cat-dot-other); }

body .navbar-level-widget {
  display: flex;
  align-items: center;
}

body #sidebar-level-pills {
  display: flex;
  align-items: center;
  gap: 0;
  border: var(--border-card);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: none;
}

body #sidebar-level-pills .level-chip {
  min-width: 48px;
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0 12px;
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease;
}

body #sidebar-level-pills .level-chip.active {
  background: var(--coral-accent);
  color: var(--inverted-ink);
}

body #widget-levels-title,
body #widget-active-level-label {
  display: none !important;
}

/* 5. Feature 3-Card Strip */
.feature-strip-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding-bottom: 34px;
  width: 100%;
  box-sizing: border-box;
}

.feature-strip-card {
  padding: 22px 24px;
  border: var(--border-card);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-word-of-day {
  container-type: inline-size;
  background: var(--mint-accent);
  color: var(--inverted-ink);
}

.card-mini-quiz {
  background: var(--lavender-accent);
  color: var(--inverted-ink);
}

.card-vocab-notebook {
  background: var(--card-bg);
  color: var(--ink-primary);
}

.strip-card-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strip-word-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: clamp(20px, 2.5vw, 36px);
  font-size: clamp(20px, 7.5cqw, 36px);
  font-weight: 800;
  line-height: 1.1;
  min-width: 0;
}

.strip-word-title {
  font-size: inherit;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  min-width: 0;
}

.strip-word-form {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.8;
  margin-top: 2px;
  margin-bottom: 2px;
  word-break: break-word;
}

.strip-word-translation {
  font-size: 17px;
  font-weight: 800;
  word-break: break-word;
}

.strip-audio-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.strip-audio-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

.strip-audio-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.strip-audio-icon {
  display: block;
}

.strip-skeleton-bar {
  background: currentColor;
  opacity: 0.12;
  border-radius: 8px;
  animation: strip-skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes strip-skeleton-pulse {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.22; }
}

@media (prefers-reduced-motion: reduce) {
  .strip-skeleton-bar {
    animation: none;
  }
}

.strip-skeleton-bar-title {
  width: 65%;
  height: 34px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.strip-skeleton-bar-sub {
  width: 45%;
  height: 18px;
  margin-bottom: 12px;
}

.strip-skeleton-bar-link {
  width: 40%;
  height: 16px;
  margin-top: 14px;
}

/* Mini Quiz Card Components */
.strip-quiz-card-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  width: 100%;
}

.strip-quiz-card-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 8px;
}

.strip-quiz-card-question {
  margin-top: 8px;
  margin-bottom: 12px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.strip-quiz-card-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  font-weight: 800;
  text-decoration: underline;
  color: inherit;
}

/* Native Quiz Dialog Modal */
.quiz-dialog {
  padding: 0;
  border: var(--border-card);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  background: var(--lavender-accent);
  color: var(--inverted-ink);
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: 90vh;
  box-sizing: border-box;
  margin: auto;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 9999;
}

.quiz-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.quiz-dialog-content {
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
}

.quiz-dialog-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  font-size: 28px;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease;
  z-index: 2;
}

.quiz-dialog-close-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

.quiz-dialog-close-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .quiz-dialog {
    width: calc(100% - 32px);
    max-height: 90vh;
    margin: auto 16px;
  }
  .quiz-dialog-content {
    padding: 20px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-dialog,
  .quiz-dialog::backdrop,
  .quiz-dialog-close-btn {
    animation: none !important;
    transition: none !important;
  }
}

.strip-quiz-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 40px;
}

.strip-quiz-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.strip-quiz-hint {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  margin-top: 2px;
  line-height: 1.3;
}

.strip-quiz-streak {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--coral-accent);
  color: var(--inverted-ink);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.strip-quiz-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.strip-quiz-question {
  margin-top: 4px;
  margin-bottom: 12px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: break-word;
}

.strip-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.strip-quiz-option {
  min-height: 44px;
  padding: 10px 14px;
  border: var(--border-card);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.strip-quiz-option-text {
  word-break: break-word;
  overflow-wrap: break-word;
}

.strip-quiz-option-marker {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.strip-quiz-option:hover:not(:disabled) {
  transform: translateY(-1px);
}

.strip-quiz-option:focus-visible {
  outline: 2px solid var(--inverted-ink);
  outline-offset: 2px;
}

.strip-quiz-option:disabled {
  cursor: default;
}

.strip-quiz-option.is-correct {
  background: var(--mint-accent);
  color: var(--inverted-ink);
  border-color: var(--inverted-ink);
}

.strip-quiz-option.is-wrong {
  background: var(--coral-accent);
  color: var(--inverted-ink);
  border-color: var(--inverted-ink);
}

.strip-quiz-feedback {
  min-height: 24px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.strip-quiz-feedback.is-correct {
  font-weight: 800;
  color: var(--inverted-ink);
}

.strip-quiz-wrong-lead {
  font-weight: 800;
}

.strip-quiz-wrong-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
}

.strip-quiz-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.strip-quiz-skip-btn {
  background: transparent;
  border: none;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  color: inherit;
  cursor: pointer;
  opacity: 0.85;
}

.strip-quiz-skip-btn:hover {
  opacity: 1;
}

.strip-quiz-done {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 16px;
}

.strip-quiz-done-text {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.strip-quiz-restart-btn {
  min-height: 44px;
  padding: 10px 18px;
  border: var(--border-card);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.strip-quiz-restart-btn:hover {
  transform: translateY(-1px);
}

.strip-quiz-skeleton {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  margin-top: 12px;
}

.strip-skeleton-bar-q {
  width: 85%;
  height: 52px;
  margin-bottom: 12px;
}

.strip-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.strip-badge-count {
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--coral-accent);
  color: var(--inverted-ink);
  border-radius: 14px;
  font-weight: 800;
  font-size: 14px;
  padding: 0 6px;
  box-sizing: border-box;
}

.strip-vocab-body {
  margin-top: 4px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.strip-card-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  font-weight: 800;
  text-decoration: underline;
  color: inherit;
}

/* 6. Main Feed & Masonry Cards */
body .magazine-body-wrap {
  display: block;
  grid-template-columns: 1fr;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
}

body #col-trending,
body #col-sidebar,
body .promo-section,
body #heading-archive,
body .full-feed-section {
  display: none !important;
}

body .col-main-feed > .section-block-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body .col-main-feed {
  width: 100%;
}

.feed-heading-wrap {
  margin-bottom: 20px;
}

.feed-section-heading {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  margin: 0;
}

@media (max-width: 600px) {
  .feed-section-heading {
    font-size: 24px;
  }
}

body #search-result-info {
  margin-bottom: 20px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-secondary);
}

body .empty-state {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-secondary);
  padding: 48px 24px;
  text-align: center;
}

/* Feed container */
body #feed-articles-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  padding-top: 10px;
}

body .feed-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Task 3: Load More Button */
body .feed-load-more-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 32px 0 48px;
  width: 100%;
}

body .btn-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 36px;
  background: var(--card-bg);
  border: var(--border-card);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  font: inherit;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-primary);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body .btn-load-more:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 var(--shadow-color);
}

body .btn-load-more:focus-visible {
  outline: 2.5px solid var(--ink-primary);
  outline-offset: 2px;
}

body .feed-card {
  display: block;
  width: 100%;
  background: var(--card-bg);
  border: var(--border-card);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  box-sizing: border-box;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

@media (hover: hover) {
  body .feed-card:hover {
    transform: translateY(-3px);
    box-shadow: 2px 2px 0 var(--shadow-color);
  }
}

@media (prefers-reduced-motion: reduce) {
  body .feed-card,
  body .feed-card:hover {
    transform: none !important;
    transition: none !important;
  }
}

/* Card image aspect ratios */
body .feed-card[data-ratio="wide"] .feed-img-link,
body .feed-img-link[data-ratio="wide"] {
  aspect-ratio: 4 / 3;
}

body .feed-card[data-ratio="square"] .feed-img-link,
body .feed-img-link[data-ratio="square"] {
  aspect-ratio: 1 / 1;
}

@media (max-width: 640px) {
  body .feed-card .feed-img-link,
  body .feed-img-link {
    aspect-ratio: 4 / 3;
  }
}

body .feed-img-link {
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--hero-image-bg);
  border-bottom: var(--border-card);
}

body .feed-img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center !important;
  filter: none !important;
  opacity: 1 !important;
}

body .feed-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 18px;
}

body .feed-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body .feed-cat {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
}

body .card-read-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-secondary);
}

body .feed-title {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body .feed-body a {
  text-decoration: none;
  color: inherit;
}

body .feed-body a:hover .feed-title {
  text-decoration: underline;
}

body .feed-title-support {
  white-space: normal;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
}

body .feed-desc {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
  line-height: 1.45;
  margin: 6px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body .feed-levels-row {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

body .level-tabs {
  display: flex;
  border: var(--border-card);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card-bg);
}

body .level-tab {
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-primary);
  text-decoration: none;
  border-right: var(--border-card);
  padding: 0 6px;
  box-sizing: border-box;
}

body .level-tab:last-child {
  border-right: none;
}

body .level-tab.active {
  background: var(--coral-accent);
  color: var(--inverted-ink);
}

body .card-read-link {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-primary);
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* 7. Slim Footer Strip */
body .site-footer {
  width: 100%;
  margin: 56px auto 0;
  padding: 10px 32px 12px;
  max-width: 1240px;
  background: transparent !important;
  border: 0 !important;
  border-top: var(--border-card) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

body .site-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 100%;
  padding: 0;
}

body .footer-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 0;
  border-bottom: 0 !important;
}

body .footer-brand-copy {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  line-height: 1.35;
  white-space: nowrap;
}

body .footer-links-nav {
  display: contents;
}

body .footer-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
  line-height: 1.35;
  white-space: nowrap;
}

body .footer-link:hover {
  color: var(--ink-primary);
  text-decoration: underline;
}

body .footer-disclaimers {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink-secondary);
  text-align: center;
  max-width: none !important;
  width: 100%;
  margin: 0;
  padding: 0;
  opacity: 0.85;
}

body #notice-banner-text,
body #notice-contact-text {
  display: inline;
}

body .footer-disclaimers a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* 8. Responsive Design (Breakpoints: >= 1100px, 900-1099px, < 900px down to 390px) */
@media (min-width: 1100px) {
  body .main-masthead {
    padding-left: 0;
    padding-right: 0;
  }

  body .masthead-brand-wrap {
    width: max(var(--logo-box-w), calc((100% - var(--content-max)) / 2));
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    min-width: max-content;
    box-sizing: border-box;
  }

  body .masthead-logo {
    font-size: 41.5px;
  }

  body .brand-glyph-l svg {
    width: 41.5px;
    height: 50.2px;
  }

  body #nav-categories-container {
    margin-left: 32px;
    margin-right: 16px;
    flex: 1 1 auto;
    min-width: 0;
  }

  body .masthead-actions-group {
    padding-right: 32px;
  }
}

@media (min-width: 900px) and (max-width: 1099px) {
  body #nav-categories-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
  }

  body #nav-categories-container::-webkit-scrollbar {
    display: none;
  }

  body .nav-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 14px;
    min-height: 42px;
    font-size: 13.5px;
  }
}

@media (max-width: 899px) {
  :root {
    --header-pad-y: 8px;
    --header-top-space: 8px;
    --header-hero-gap: 14px;
  }

  body .main-masthead {
    padding: var(--header-pad-y) 16px;
    margin-top: var(--header-top-space);
    margin-bottom: 0;
  }

  body .magazine-hero-wrap {
    --hero-img-h: clamp(200px, 56vw, 340px);
    padding-top: var(--header-hero-gap);
    padding-left: 16px;
    padding-right: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body .magazine-hero-inner,
  body #hero-lead-box,
  body .hero-slider-track,
  body .hero-slide,
  body .hero-lead-content {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body .magazine-hero-inner {
    display: block;
    width: 100%;
  }

  body #hero-lead-box {
    width: 100%;
    min-height: 0;
    border-radius: 24px;
    overflow: hidden;
  }

  body .hero-slider-track {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  body .hero-slide {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
    overflow: hidden;
  }

  body .hero-lead-media {
    order: 1;
    flex: none;
    width: 100%;
    height: var(--hero-img-h);
    min-height: 0;
    border-left: 0;
    border-top: 0;
    border-bottom: var(--border-card);
    display: block;
    overflow: hidden;
  }

  body .hero-lead-bg {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    border: 0;
  }

  body .hero-lead-content {
    order: 2;
    flex: 0 0 auto;
    min-width: 0;
    padding: 18px 20px 22px;
    gap: 12px;
    justify-content: flex-start;
  }

  body .hero-lead-title {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    font-size: clamp(22px, 6.2vw, 30px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    text-wrap: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body .hero-lead-content .feed-title-support {
    font-size: 14px;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body .hero-lead-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
  }

  body .hero-levels-group {
    display: flex;
    align-items: center;
  }

  body .hero-lvl-pill {
    min-width: 38px;
    min-height: 38px;
    padding: 0 8px;
    font-size: 13px;
  }

  body .hero-lead-link,
  body .hero-lead-content a.hero-lead-link {
    min-height: 42px;
    padding: 0 20px;
    font-size: 14.5px;
    font-weight: 800;
  }

  body .hero-slider-arrow {
    width: 36px;
    height: 36px;
    top: calc(var(--hero-img-h) / 2 - 18px);
    transform: none;
  }

  body .hero-slider-arrow:hover {
    transform: scale(1.05);
  }

  body .hero-slider-prev {
    left: 10px;
  }

  body .hero-slider-next {
    right: 10px;
  }

  body .hero-slider-dots {
    position: absolute;
    top: calc(var(--hero-img-h) - 30px);
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
  }

  body .main-masthead-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 6px 8px;
  }

  body .masthead-brand-wrap {
    grid-column: 1;
    grid-row: 1;
  }

  body .masthead-logo {
    font-size: 26px;
  }

  body .brand-glyph-l svg {
    width: 26px;
    height: 32px;
  }

  body .masthead-actions-group {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    gap: 6px;
    margin-left: 0;
  }

  body .masthead-profile-slot {
    margin: 0;
    padding: 0;
    gap: 0;
  }

  body .header-search-wrap:not(.expanded) {
    width: 40px;
    height: 40px;
  }

  body .header-search-wrap.expanded {
    width: 170px;
    height: 40px;
  }

  body .header-search-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  body .btn-random-story {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  body .header-lang-pill {
    display: none;
  }

  body .masthead-lang-slot {
    display: inline-flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
  }

  body .btn-lang-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
    background: var(--card-bg);
    border: var(--border-card);
    color: var(--ink-primary);
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.15s ease, background-color 0.15s ease;
  }

  body .btn-lang-mobile:active {
    transform: scale(0.94);
  }

  body .btn-lang-mobile svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
  }

  body .lang-badge-mobile {
    position: absolute;
    top: -2px;
    right: -3px;
    min-width: 16px;
    height: 15px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--coral-accent);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 15px;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    pointer-events: none;
  }

  body .lang-panel-mobile {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 610;
    width: 260px;
    max-width: calc(100vw - 32px);
    background: var(--card-bg);
    border: var(--border-card);
    border-radius: 18px;
    box-shadow: var(--shadow-popover);
    padding: 14px;
    box-sizing: border-box;
    flex-direction: column;
    gap: 12px;
  }

  body .lang-panel-mobile.show {
    display: flex !important;
  }

  body .lang-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  body .lang-panel-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
  }

  body .btn-close-lang-panel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 999px;
    border: none;
    background: var(--hover-chip, rgba(0, 0, 0, 0.05));
    color: var(--ink-secondary);
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
  }

  body .lang-panel-content {
    width: 100%;
  }

  body #lang-panel-mobile .header-lang-pill {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    gap: 10px;
  }

  body #lang-panel-mobile .header-lang-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }

  body #lang-panel-mobile .header-lang-arrow {
    display: none !important;
  }

  body #lang-panel-mobile .header-lang-label {
    display: block !important;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ink-secondary);
    letter-spacing: 0.04em;
  }

  body #lang-panel-mobile .header-lang-select {
    display: block !important;
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    border: var(--border-card);
    border-radius: 12px;
    background: var(--bg-page);
    color: var(--ink-primary);
    font-size: 13.5px;
    font-weight: 700;
    text-align: left;
    box-sizing: border-box;
    -webkit-appearance: menulist;
    appearance: menulist;
    cursor: pointer;
  }

  body .btn-theme-toggle {
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  body .btn-header-auth {
    height: 40px;
    min-height: 40px;
    padding: 0 10px 0 6px;
    gap: 6px;
    font-size: 12.5px;
  }

  body .btn-profile-menu {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  body .btn-profile-menu .auth-user-avatar {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  body .auth-user-avatar {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  body #nav-categories-container {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-left: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 6px;
    padding: 2px 0;
    width: 100%;
  }

  body #nav-categories-container::-webkit-scrollbar {
    display: none;
  }

  body .nav-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 12px;
    min-height: 34px;
    font-size: 12.5px;
  }

  body .main-navbar {
    padding: 16px 16px 8px;
  }

  body .main-navbar-inner {
    justify-content: center !important;
  }
}

@media (max-width: 820px) {
  body .top-utility-bar,
  body .magazine-hero-wrap,
  body .main-navbar,
  body .magazine-body-wrap,
  body .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  body #sidebar-level-pills {
    justify-content: center;
  }

  body .site-footer {
    padding: 10px 16px 12px;
    margin-top: 36px;
  }

  body .footer-disclaimers {
    font-size: 11px;
    text-align: center;
  }
}

@media (max-width: 699px) {
  body .footer-primary-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    text-align: center;
  }

  body .footer-brand-copy {
    width: 100%;
    text-align: center;
  }
}
