/* ============================================
   CSS CUSTOM PROPERTIES (Design System)
   ============================================ */
:root {
  /* Colors - Bold Magazine Palette */
  --color-primary: #E63946;
  --color-primary-dark: #C52A36;
  --color-secondary: #1D3557;
  --color-accent: #F4A261;
  --color-accent-light: #FFB976;
  
  --color-text: #1A1A1A;
  --color-text-light: #4A4A4A;
  --color-text-muted: #757575;
  
  --color-bg: #FAFAFA;
  --color-bg-alt: #FFFFFF;
  --color-bg-dark: #F0F0F0;
  
  --color-border: #E0E0E0;
  --color-border-light: #F0F0F0;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  
  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Helvetica Neue', Arial, sans-serif;
  
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3rem;
  
  --line-height-tight: 1.2;
  --line-height-base: 1.5;
  --line-height-relaxed: 1.75;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.35s ease;
  --transition-cubic: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --container-max: 1200px;
  --sidebar-width: 320px;
  --header-height: 80px;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  --gradient-accent: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  --gradient-overlay: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   WRAPPER & LAYOUT
   ============================================ */
.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background: var(--color-bg-alt);
  border-bottom: 3px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.header__logo {
  margin: 0;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-black);
  color: var(--color-secondary);
  letter-spacing: -0.02em;
}

.header__logo a {
  display: block;
  transition: transform var(--transition-base);
}

.header__logo a:hover {
  transform: scale(1.02);
  color: var(--color-primary);
}

.header__logo img {
  max-height: 50px;
  width: auto;
}

.header__toggle {
  display: none;
  padding: var(--space-xs);
  color: var(--color-secondary);
  transition: color var(--transition-fast);
}

.header__toggle:hover {
  color: var(--color-primary);
}

.header__toggle svg {
  stroke: currentColor;
}

/* Header Navigation (desktop) */
.header .nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
}

.header .nav a {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  position: relative;
}

.header .nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 3px;
  background: var(--gradient-primary);
  transition: transform var(--transition-base);
}

.header .nav a:hover {
  color: var(--color-primary);
}

.header .nav a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ============================================
   CATEGORY TRAY (top menu)
   ============================================ */
.tray {
  background: var(--color-secondary);
  border-bottom: 2px solid var(--color-primary);
}

.tray__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.tray ul {
  display: flex;
  list-style: none;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tray ul::-webkit-scrollbar {
  display: none;
}

.tray a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  transition: all var(--transition-base);
  border-bottom: 3px solid transparent;
}

.tray a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */
.smallnav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--color-bg-alt);
  z-index: 200;
  padding: var(--space-2xl) var(--space-lg);
  overflow-y: auto;
}

.smallnav__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  padding: var(--space-xs);
  color: var(--color-secondary);
  transition: color var(--transition-fast);
}

.smallnav__close:hover {
  color: var(--color-primary);
}

.smallnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.smallnav li {
  border-bottom: 1px solid var(--color-border-light);
}

.smallnav a {
  display: block;
  padding: var(--space-md) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-secondary);
  transition: all var(--transition-base);
}

.smallnav a:hover {
  color: var(--color-primary);
  padding-left: var(--space-sm);
}

@media (max-width: 767px) {
  .header__toggle {
    display: flex;
  }
  
  .header .nav {
    display: none;
  }
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main {
  flex: 1;
  max-width: var(--container-max);
  width: 100%;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-lg);
}

.main__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 1024px) {
  .main__inner {
    grid-template-columns: 1fr var(--sidebar-width);
  }
}

.content {
  min-width: 0;
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-form {
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.search-form form {
  display: flex;
  gap: var(--space-sm);
  max-width: 600px;
  margin: 0 auto;
}

.search-form__input {
  flex: 1;
  padding: var(--space-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  box-shadow: var(--shadow-sm);
}

.search-form__input:focus {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.search-form__button {
  padding: var(--space-md) var(--space-xl);
  background: var(--color-secondary);
  color: white;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.search-form__button:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
  .search-form form {
    flex-direction: column;
  }
}

/* ============================================
   PAGE TITLE & SECTION TITLES
   ============================================ */
.page-title,
.section-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-black);
  color: var(--color-secondary);
  margin-bottom: var(--space-xl);
  position: relative;
  padding-bottom: var(--space-md);
}

.page-title::after,
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

@media (max-width: 768px) {
  .page-title,
  .section-title {
    font-size: var(--font-size-2xl);
  }
}

/* ============================================
   ARTICLE CARDS (Grid Layout)
   ============================================ */
.articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.article {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(30px);
}

.article.animate-in {
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.article__image-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--color-bg-dark);
}

.article__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.article__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article:hover .article__image {
  transform: scale(1.08);
}

.article__category-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 2;
}

.article__category-badge a {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--gradient-primary);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base);
}

.article__category-badge a:hover {
  transform: scale(1.05);
}

.article__content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.article__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-secondary);
  margin: 0;
}

.article__title a {
  transition: color var(--transition-base);
}

.article__title a:hover {
  color: var(--color-primary);
}

.article__perex {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
  margin: 0;
  flex: 1;
}

.article__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

.article__date {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  margin: 0;
}

.article__category {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin: 0;
}

.article__category a {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  transition: color var(--transition-fast);
}

.article__category a:hover {
  color: var(--color-primary-dark);
}

.separator {
  color: var(--color-border);
  margin: 0 var(--space-xs);
}

/* ============================================
   TOP ARTICLES (Hero Section)
   ============================================ */
.top {
  margin-bottom: var(--space-3xl);
  background: var(--color-bg-alt);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.top__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .top__inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .top__inner {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article--top {
  position: relative;
}

.article--top .article__image-wrapper {
  aspect-ratio: 4 / 3;
}

.article--top .article__title {
  font-size: var(--font-size-2xl);
}

/* ============================================
   BOTTOM SECTION (Similar/Category Articles)
   ============================================ */
.bottom {
  margin-bottom: var(--space-3xl);
}

.bottom__inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.bottom .article {
  box-shadow: var(--shadow-sm);
}

.bottom .article__image-wrapper {
  aspect-ratio: 16 / 9;
}

.bottom .article__content {
  padding: var(--space-md);
}

.bottom .article__title {
  font-size: var(--font-size-lg);
}

/* ============================================
   FULL ARTICLE (Post Page)
   ============================================ */
.text {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-2xl);
}

.text__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-black);
  line-height: var(--line-height-tight);
  color: var(--color-secondary);
  margin-bottom: var(--space-xl);
}

.text__cover-wrapper {
  margin: 0 calc(-1 * var(--space-2xl)) var(--space-2xl);
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.text__cover {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.text__body {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
}

.text__body h2 {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.text__body h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.text__body p {
  margin-bottom: var(--space-md);
}

.text__body ul,
.text__body ol {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.text__body li {
  margin-bottom: var(--space-xs);
}

.text__body a {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: all var(--transition-fast);
}

.text__body a:hover {
  color: var(--color-primary-dark);
  text-decoration-thickness: 3px;
}

.text__body img {
  margin: var(--space-xl) 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.text__body img.author {
  max-width: 300px;
  float: left;
  margin: 0 var(--space-lg) var(--space-lg) 0;
  border-radius: var(--radius-lg);
}

.table-of-content {
  background: var(--color-bg-dark);
  border-left: 4px solid var(--color-primary);
  padding: var(--space-lg);
  margin-bottom: var(--space-2xl);
  border-radius: var(--radius-md);
}

.table-of-content__title {
  display: block;
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-lg);
}

.table-of-content ul {
  margin-left: var(--space-md);
}

.table-of-content a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.table-of-content a:hover {
  color: var(--color-primary);
}

.video-wrapper {
  margin: var(--space-2xl) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.text__info {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 2px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.text__date,
.text__category,
.text__author {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin: 0;
}

.text__info .label {
  font-weight: var(--font-weight-semibold);
  color: var(--color-secondary);
}

.text__info a {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.text__tags {
  margin-top: var(--space-md);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg-dark);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.tag:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .text {
    padding: var(--space-lg);
  }
  
  .text__title {
    font-size: var(--font-size-3xl);
  }
  
  .text__cover-wrapper {
    margin: 0 calc(-1 * var(--space-lg)) var(--space-lg);
  }
  
  .text__body {
    font-size: var(--font-size-base);
  }
  
  .text__body img.author {
    float: none;
    margin: var(--space-lg) 0;
  }
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.sidebar__widget {
  background: var(--color-bg-alt);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-primary);
}

.sidebar__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-border-light);
}

/* Sidebar Navigation */
.sidebar .nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar .nav__item {
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar .nav__item:last-child {
  border-bottom: none;
}

.sidebar .nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  transition: all var(--transition-base);
}

.sidebar .nav__link:hover {
  color: var(--color-primary);
  padding-left: var(--space-xs);
}

.sidebar .nav__link svg {
  flex-shrink: 0;
  stroke: currentColor;
}

/* Sidebar Articles */
.sidebar__articles {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.article--sidebar {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-sm);
  padding: 0;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  opacity: 1;
  transform: none;
}

.article--sidebar:hover {
  transform: none;
  box-shadow: none;
}

.article--sidebar .article__image-link {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article--sidebar .article__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article--sidebar .article__title {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
  margin: 0;
}

/* Sidebar Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tags__item {
  margin: 0;
}

.tags__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg-dark);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.tags__link:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-2px);
}

.tags__link svg {
  flex-shrink: 0;
  stroke: currentColor;
}

/* Sidebar Promo Links */
.promo {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.promo__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-bg-dark);
  border-radius: var(--radius-md);
  transition: background var(--transition-base);
}

.promo__item:hover {
  background: var(--color-border);
}

.promo__item svg {
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--color-primary);
}

.promo__item a {
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

/* Sidebar Authors */
.authors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.authors__item {
  border-bottom: 1px solid var(--color-border-light);
}

.authors__item:last-child {
  border-bottom: none;
}

.authors__link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  transition: all var(--transition-base);
}

.authors__link:hover {
  color: var(--color-primary);
  padding-left: var(--space-xs);
}

.authors__link svg {
  flex-shrink: 0;
  stroke: currentColor;
}

/* Sidebar HTML Widget */
.sidebar__html {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

@media (max-width: 1023px) {
  .sidebar {
    margin-top: var(--space-2xl);
  }
}

/* ============================================
   PREFOOTER (Sidebar Bottom)
   ============================================ */
.prefooter {
  background: var(--color-bg-dark);
  padding: var(--space-3xl) 0;
  margin-top: var(--space-3xl);
}

.prefooter__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.prefooter .sidebar__widget {
  background: var(--color-bg-alt);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-2xl);
}

.pagination ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.pagination li {
  margin: 0;
}

.pagination__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-sm);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.pagination__link:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pagination__active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-sm);
  background: var(--gradient-primary);
  color: white;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.pagination__ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-bold);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--color-secondary);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-2xl) 0;
  margin-top: auto;
}

.footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  text-align: center;
}

.footer p {
  margin: var(--space-xs) 0;
  font-size: var(--font-size-sm);
}

.footer a {
  color: var(--color-accent);
  text-decoration: underline;
}

.footer a:hover {
  color: var(--color-accent-light);
}

/* ============================================
   POPUP
   ============================================ */
.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 300;
  background: var(--color-bg-alt);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.popup::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: -1;
}

.popup #close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  font-size: var(--font-size-2xl);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  line-height: 1;
}

.popup #close:hover {
  background: var(--color-primary-dark);
  transform: rotate(90deg);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  :root {
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
  }
  
  .articles {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .top__inner {
    grid-template-columns: 1fr;
  }
  
  .bottom__inner {
    grid-template-columns: 1fr;
  }
  
  .main {
    margin: var(--space-xl) auto;
    padding: 0 var(--space-md);
  }
  
  .header__inner {
    padding: var(--space-md);
  }
  
  .search-form {
    padding: var(--space-lg);
  }
}

@media (max-width: 480px) {
  .article__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
}