/* ═══════════════════════════════════════════
   STRUCTURALIST DESIGN SYSTEM — FRIȘPA/USM
   ═══════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────── */
:root {
  /* Brand */
  --brand:          #0E5A4A;
  --brand-hover:    #0B473C;
  --brand-light:    #1E8E79;
  --accent:         #D6C19A;
  --accent-dark:    #BFA675;

  /* Text */
  --text-main:      #222222;
  --text-secondary: #555555;
  --text-tertiary:  #999999;
  --text-inverse:   #FFFFFF;

  /* Surfaces */
  --bg-page:        #F5F5F7;
  --bg-card:        #FFFFFF;
  --bg-muted:       #F0F0F2;
  --border-light:   #E5E7EB;
  --border-medium:  #D1D5DB;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Type scale */
  --font-sans:  'Onest', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, monospace;
  --font-serif: 'Merriweather', Georgia, serif;

  --text-xs:   0.625rem;   /* 10px */
  --text-sm:   0.75rem;    /* 12px */
  --text-base: 0.9375rem;  /* 15px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  2rem;       /* 32px */
  --text-3xl:  2.5rem;     /* 40px */
  --text-hero: clamp(3rem, 8vw, 5.5rem);

  /* Radii */
  --radius-sm: 2px;
  --radius-md: 4px;

  /* Shadows */
  --shadow-card:  0 1px 3px rgba(0,0,0,.04), 0 0 0 1px var(--border-light);
  --shadow-brand: 6px 6px 0px var(--accent);
  --shadow-brand-hover: 2px 2px 0px var(--accent);

  /* Max width */
  --container: 1600px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-page);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--brand);
  color: var(--text-inverse);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ── NOISE TEXTURE ──────────────────────── */
.noise-bg {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

/* Штриховка для пустых ячеек */
.striped-bg {
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 10px,
    var(--bg-page) 10px, var(--bg-page) 20px
  );
}

/* ── LAYOUT ─────────────────────────────── */
.site-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  background: var(--bg-card);
  min-height: 100vh;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  box-shadow: 0 0 40px rgba(0,0,0,.03);
  display: flex;
  flex-direction: column;
}

/* ── HEADER ─────────────────────────────── */
.site-header {
  height: 6rem;
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Обертка для двух логотипов */
.site-logos {
  display: flex;
  height: 100%;
  border-right: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* Общие стили для обоих квадратов-логотипов */
.site-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  aspect-ratio: 1 / 1; /* Делает их строгими квадратами */
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  color: var(--text-main);
  transition: background .2s;
  text-decoration: none;
}
.site-brand:hover { background: var(--bg-muted); }
.site-brand .slash { color: var(--brand); }

/* Разделительная линия между первым и вторым логотипом */
.site-brand-university {
  border-right: 1px solid var(--border-light);
}

/* 1. Стили для обычных загруженных картинок (PNG/JPG) */
.site-brand .brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-2);
}

/* 2. НОВЫЕ СТИЛИ ДЛЯ SVG-ЛОГОТИПОВ */

/* Обертка для SVG */
.site-brand .brand-svg {
  width: 100%;
  height: 100%;
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Сам векторный файл и ВСЕ его внутренние элементы */
.site-brand .brand-svg svg,
.site-brand .brand-svg svg * {
  fill: var(--text-main) !important; /* Принудительно задаем базовый цвет */
  transition: fill 0.2s ease; 
}

/* При наведении принудительно перекрашиваем в корпоративный цвет */
.site-brand:hover .brand-svg svg,
.site-brand:hover .brand-svg svg * {
  fill: var(--brand) !important; 
}
/* Контейнер для текста (теперь элементы выстраиваются в колонку) */
.site-subtitle {
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--space-6);
  height: 100%; /* Обязательно для эффекта наведения */
  border-right: 1px solid var(--border-light); 
  transition: background .2s; 
  text-decoration: none; 
}
@media (min-width: 1024px) { .site-subtitle { display: flex; } }

/* Эффект наведения */
.site-subtitle:hover {
  background: var(--bg-muted);
}

/* Название Университета (Верхняя строка) */
.subtitle-uni {
  font-family: var(--font-sans);
  font-size: 14px; 
  font-weight: 400; /* Исправлено с 100 на 400 (Regular) */
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 2px;
}

/* Название Факультета (Две нижние строки) */
.subtitle-fac {
  font-family: var(--font-sans); 
  font-size: 16px; 
  font-weight: 900; /* Исправлено с 1000 на 900 (Black) */
  text-transform: uppercase;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Nav */
.site-nav {
  margin-left: auto;
  display: flex;
  height: 100%;
}
.site-nav a {
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  border-left: 1px solid var(--border-light);
  transition: background .2s, color .2s;
}
.site-nav a:hover {
  background: var(--brand);
  color: var(--text-inverse);
}
.site-nav .nav-primary {
  background: var(--text-main);
  color: var(--text-inverse);
}
.site-nav .nav-primary:hover {
  background: var(--brand);
}

/* ── HERO ───────────────────────────────── */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 1280px) {
  .hero-grid { grid-template-columns: 4fr 6fr; }
}

.hero-left {
  border-right: 1px solid var(--border-light);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  position: relative;
}
.hero-left .noise-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .4;
}

.hero-content {
  padding: var(--space-8);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(8px);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 768px) { .hero-content { padding: var(--space-12); } }
@media (min-width: 1024px) { .hero-content { padding: var(--space-16); } }

.hero-tags {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.hero-tag {
  padding: var(--space-1) var(--space-2);
  background: var(--brand);
  color: var(--text-inverse);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  line-height: 1;
}
.hero-year {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
}

.hero-title {
  font-size: var(--text-hero);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: .9;
  text-transform: uppercase;
  margin-bottom: var(--space-8);
  color: var(--text-main);
}
.hero-title .gradient {
  background: linear-gradient(to right, var(--brand), var(--brand-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 24rem;
}
@media (min-width: 768px) { .hero-lead { font-size: var(--text-lg); } }

/* ── BUTTONS ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-8);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: .12em;
  transition: all .2s;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}
.btn-brand {
  background: var(--brand);
  color: var(--text-inverse);
  box-shadow: var(--shadow-brand);
}
.btn-brand:hover {
  background: var(--brand-hover);
  box-shadow: var(--shadow-brand-hover);
  transform: translate(4px, 4px);
}
.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-medium);
}
.btn-outline:hover {
  background: var(--bg-muted);
  border-color: var(--text-main);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
}
.btn-ghost:hover { color: var(--brand); }

/* ── STATS ──────────────────────────────── */
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  z-index: 1;
  background: var(--bg-card);
}
.hero-stat {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: background .2s;
}
.hero-stat:first-child { border-right: 1px solid var(--border-light); }
.hero-stat:hover { background: var(--bg-muted); }
.hero-stat__icon {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}
.hero-stat__icon--accent { color: var(--accent); }
.hero-stat__icon--brand  { color: var(--brand); }
.hero-stat__num {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: var(--space-1);
}
.hero-stat__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-tertiary);
}

/* ── MONO LABEL (utility) ───────────────── */
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* ── TOOLBAR ────────────────────────────── */
.section-toolbar {
  height: 3.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-6);
  background: var(--bg-card);
  position: sticky;
  top: 4rem;
  z-index: 40;
}
@media (min-width: 768px) { .section-toolbar { padding: 0 var(--space-8); } }

.toolbar-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.toolbar-title .icon { color: var(--brand); font-size: var(--text-lg); }

.legend {
  display: none;
  align-items: center;
  gap: var(--space-6);
}
@media (min-width: 640px) { .legend { display: flex; } }

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-secondary);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot--brand  { background: var(--brand); }
.legend-dot--accent { background: var(--accent); }
.legend-dot--dark   { background: var(--text-main); }

/* ── CARD GRID ──────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-light);
  flex: 1;
}
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Штрихованная заглушка — заполняет ряд */
.program-card-filler {
  background: var(--bg-card);
  min-height: 160px;
  display: none;
}
@media (min-width: 768px) {
  .program-card-filler {
    display: block;
    background:
      repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        var(--bg-page) 10px,
        var(--bg-page) 20px
      );
    opacity: 0.5;
  }
}

.card-grid__section-header {
  grid-column: 1 / -1;
  background: var(--bg-page);
  height: 3.5rem;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 768px) {
  .card-grid__section-header { padding: 0 var(--space-8); }
}

.section-num { color: var(--brand); }

/* ── PROGRAM CARD ───────────────────────── */
.program-card {
  background: var(--bg-card);
  padding: var(--space-6);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  cursor: pointer;
  transition: background .2s;
}
.program-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}
.program-card:hover::before { transform: scaleX(1); }

.program-card--licenta:hover         { background: rgba(14,90,74,.03); }
.program-card--licenta::before       { background: var(--brand); }
.program-card--master:hover          { background: rgba(214,193,154,.08); }
.program-card--master::before        { background: var(--accent); }
.program-card--doctorat:hover        { background: var(--bg-muted); }
.program-card--doctorat::before      { background: var(--text-main); }

.program-card__top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}
.program-card__top .num { color: var(--text-main); }

.program-card__body {
  text-align: center;
  margin: auto 0;
  padding: var(--space-2) 0;
}
.program-card__symbol {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: var(--space-1);
  transition: color .2s;
}
.program-card--licenta:hover  .program-card__symbol { color: var(--brand); }
.program-card--master:hover   .program-card__symbol { color: var(--accent-dark); }
.program-card--doctorat:hover .program-card__symbol { color: var(--text-main); }

.program-card__name {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.3;
}

.program-card__footer {
  text-align: center;
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border-light);
}
.program-card__level {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}
.program-card__level--licenta  { color: var(--brand); }
.program-card__level--master   { color: var(--accent-dark); }
.program-card__level--doctorat { color: var(--text-main); }

/* Make card a link without underlines */
a.program-card { text-decoration: none; color: inherit; }

/* ── PROGRAM HERO (single page) ─────────── */
.program-hero {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-light);
}
@media (min-width: 768px) {
  .program-hero {
    flex-direction: row;
    align-items: stretch;
  }
}

.program-hero__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-12) var(--space-8);
  min-width: 200px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  position: relative;
}
.program-hero__card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.program-card--licenta .program-hero__card::before,
.program-hero__card.program-card--licenta::before  { background: var(--brand); }
.program-card--master .program-hero__card::before,
.program-hero__card.program-card--master::before   { background: var(--accent); }
.program-card--doctorat .program-hero__card::before,
.program-hero__card.program-card--doctorat::before { background: var(--text-main); }

@media (min-width: 768px) {
  .program-hero__card {
    border-bottom: none;
    border-right: 1px solid var(--border-light);
    min-width: 240px;
    padding: var(--space-16) var(--space-12);
  }
  .program-hero__card::before {
    top: 0; left: 0; bottom: 0;
    right: auto;
    width: 4px;
    height: auto;
  }
}

.program-hero__symbol {
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
}
.program-hero__level {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.program-hero__credits {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* --- ПРАВАЯ ЧАСТЬ (С ВИДЕОФОНОМ) --- */
.program-hero__info {
  flex: 1;
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  
  /* Добавлено для работы видеофона */
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .program-hero__info { padding: var(--space-12) var(--space-16); }
}

/* Делаем так, чтобы весь текст (h1, кнопки, лейблы) был ПОВЕРХ видео и оверлея */
.program-hero__info > *:not(.program-hero__video-container) {
  position: relative;
  z-index: 3;
}

.program-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  /* Если видео темное, убедись, что переменная дает контрастный (светлый) цвет */
  color: var(--text-main); 
}

/* --- СТИЛИ САМОГО ВИДЕО И ЗАТЕМНЕНИЯ --- */
.program-hero__video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.program-hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.program-hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Темный фильтр, меняй 0.6 для настройки прозрачности */
  z-index: 2;
}

/* ── PROGRAM LAYOUT (sidebar + content) ── */
.program-layout {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-light);
}
@media (min-width: 1024px) {
  .program-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.program-layout__content {
  flex: 1;
  min-width: 0;
  order: 1;
}

.program-layout__sidebar {
  width: 100%;
  border-top: 1px solid var(--border-light);
  background: var(--bg-page);
  order: 2;
}
@media (min-width: 1024px) {
  .program-layout__sidebar {
    width: 380px;
    flex-shrink: 0;
    border-top: none;
    border-right: 1px solid var(--border-light);
    order: 0;  /* sidebar first = left */
    position: sticky;
    top: 4rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
  .program-layout__content {
    order: 1;
  }
}

/* Sidebar blocks — visual separation */
.sidebar-block {
  background: var(--bg-card);
  margin-bottom: 8px;  /* visible gap between blocks — bg-page shows through */
}
.sidebar-block:last-child { margin-bottom: 0; }
.sidebar-block__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 3rem;
  padding: 0 var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-main);
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-light);
}
.sidebar-block__title i { color: var(--brand); font-size: var(--text-lg); }

/* Sidebar specs */
.sidebar-specs__item {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-light);
}
.sidebar-specs__item:last-child { border-bottom: none; }

.sidebar-specs__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--brand);
  margin-bottom: 3px;
  line-height: 1.4;
}
.sidebar-specs__label-en {
  display: block;
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: 8px;
  letter-spacing: .06em;
  margin-top: 1px;
}
.sidebar-specs__value {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-main);
  line-height: 1.4;
}
.sidebar-specs__value-en {
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: 1px;
  line-height: 1.3;
}

/* Sidebar documents */
.sidebar-doc {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-doc:last-child { border-bottom: none; }
.sidebar-doc:hover { background: var(--bg-muted); }

.sidebar-doc__icon {
  width: 40px;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--brand);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.sidebar-doc__icon i { font-size: 1rem; }
.sidebar-doc__ext {
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1;
}
.sidebar-doc__icon--muted {
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.sidebar-doc__info { flex: 1; min-width: 0; }
.sidebar-doc__title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 2px;
}
.sidebar-doc--archive .sidebar-doc__title {
  font-size: 11px;
  color: var(--text-secondary);
}
.sidebar-doc__meta {
  display: flex;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sidebar-doc__dl {
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: 1rem;
  transition: color .15s;
}
.sidebar-doc:hover .sidebar-doc__dl { color: var(--brand); }

/* Archive toggle */
.sidebar-archive {
  background: var(--bg-muted);
}
.sidebar-archive__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  list-style: none;
}
.sidebar-archive__toggle::-webkit-details-marker { display: none; }
.sidebar-archive__toggle::before {
  content: '▸';
  font-size: 10px;
  transition: transform .2s;
}
.sidebar-archive[open] .sidebar-archive__toggle::before {
  transform: rotate(90deg);
}
.sidebar-archive__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 8px;
  margin-left: auto;
}
.sidebar-archive .sidebar-doc { background: transparent; }
.sidebar-archive .sidebar-doc:hover { background: rgba(255,255,255,.5); }

/* Sidebar related programs */

/* ── PROGRAM ACCORDION ──────────────────── */
.program-accordion {
  border-bottom: 1px solid var(--border-light);
}

.program-accordion__item {
  border-bottom: 1px solid var(--border-light);
}
.program-accordion__item:last-child { border-bottom: none; }

.program-accordion__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-8);
  cursor: pointer;
  transition: background .15s;
  list-style: none;
}
.program-accordion__header::-webkit-details-marker { display: none; }
.program-accordion__header:hover { background: var(--bg-muted); }

.program-accordion__icon {
  font-size: var(--text-xl);
  color: var(--brand);
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.program-accordion__title {
  flex: 1;
  font-weight: 800;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}
.program-accordion__title-en {
  display: block;
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: 1px;
}

.program-accordion__chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: var(--text-base);
  transition: transform .25s;
}
.program-accordion__item[open] .program-accordion__chevron {
  transform: rotate(180deg);
}

.program-accordion__body {
  padding: 0 var(--space-8) var(--space-8);
  padding-left: calc(var(--space-8) + 1.5rem + var(--space-4)); /* align with title text */
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}
.program-accordion__body p { margin-bottom: 1em; }
.program-accordion__body p:last-child { margin-bottom: 0; }
.program-accordion__body ul,
.program-accordion__body ol { padding-left: 1.25em; margin-bottom: 1em; }
.program-accordion__body li { margin-bottom: .35em; }

/* ── PROGRAM FAQ ────────────────────────── */
.program-faq {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-muted);
}

.program-faq__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 3rem;
  padding: 0 var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
}
.program-faq__header-icon { color: var(--brand); font-size: var(--text-lg); }
.program-faq__header-en {
  margin-left: auto;
  color: var(--text-tertiary);
  font-weight: 500;
}

.program-faq__item {
  border-bottom: 1px solid var(--border-light);
}
.program-faq__item:last-child { border-bottom: none; }

.program-faq__question {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-8);
  cursor: pointer;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-main);
  list-style: none;
  transition: background .15s;
}
.program-faq__question::-webkit-details-marker { display: none; }
.program-faq__question:hover { background: rgba(255,255,255,.5); }
.program-faq__question::before {
  content: '▸';
  font-size: 10px;
  color: var(--brand);
  margin-right: var(--space-2);
  display: inline;
  transition: transform .2s;
}
.program-faq__item[open] .program-faq__question::before {
  content: '▾';
}

.program-faq__question-en {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: 1px;
  margin-left: calc(10px + var(--space-2)); /* align with text after arrow */
}

.program-faq__answer {
  padding: 0 var(--space-8) var(--space-6);
  padding-left: calc(var(--space-8) + 10px + var(--space-2));
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}
.program-faq__answer p { margin-bottom: .75em; }
.program-faq__answer p:last-child { margin-bottom: 0; }
.sidebar-related__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
.sidebar-related__item:last-child { border-bottom: none; }
.sidebar-related__item:hover { background: var(--bg-muted); }

.sidebar-related__symbol {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: var(--text-sm);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: border-color .15s, color .15s;
}
.sidebar-related__item:hover .sidebar-related__symbol { border-color: var(--brand); }
.sidebar-related__symbol--licenta  { color: var(--brand); }
.sidebar-related__symbol--master   { color: var(--accent-dark); }
.sidebar-related__symbol--doctorat { color: var(--text-main); }

.sidebar-related__name {
  flex: 1;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-main);
  line-height: 1.3;
}
.sidebar-related__item:hover .sidebar-related__name { color: var(--brand); }

.sidebar-related__credits {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ── CONTENT SECTIONS ───────────────────── */
.section {
  padding: var(--space-12) var(--space-8);
  border-top: 1px solid var(--border-light);
}
@media (min-width: 768px) {
  .section { padding: var(--space-16) var(--space-12); }
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.section-number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--brand);
}
.section-title {
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* ── POST CARDS (Archive) ───────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
}
@media (min-width: 768px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card {
  background: var(--bg-card);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: background .2s;
}
.post-card:hover { background: var(--bg-muted); }

.post-card__image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-light);
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.post-card__type {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--brand);
}
.post-card__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
}

.post-card__title {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
  line-height: 1.3;
}
.post-card__title a:hover { color: var(--brand); }

.post-card__excerpt {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

/* ── SINGLE POST ────────────────────────── */
.single-content {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}
@media (min-width: 768px) {
  .single-content { padding: var(--space-16) var(--space-8); }
}

.single-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-6);
}

.single-content .entry-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-light);
}

.single-content .entry-body {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--text-secondary);
}
.single-content .entry-body p { margin-bottom: 1.5em; }
.single-content .entry-body h2 {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-main);
  margin: 2em 0 0.75em;
  letter-spacing: -0.02em;
}
.single-content .entry-body h3 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-main);
  margin: 1.5em 0 0.5em;
}
.single-content .entry-body a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.single-content .entry-body a:hover { color: var(--brand-hover); }
.single-content .entry-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-6);
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text-secondary);
}
.single-content .entry-body ul,
.single-content .entry-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}
.single-content .entry-body li { margin-bottom: 0.5em; }
.single-content .entry-body img {
  border: 1px solid var(--border-light);
  margin: 2em 0;
}

/* ── FOOTER ─────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}
.footer-brand {
  font-weight: 900;
  font-size: var(--text-lg);
  text-transform: uppercase;
  letter-spacing: -0.04em;
}
.footer-brand .slash { color: var(--brand); }
.footer-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* ── PAGINATION ─────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) 0;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  border: 1px solid var(--border-light);
  transition: all .2s;
}
.pagination a:hover {
  background: var(--brand);
  color: var(--text-inverse);
  border-color: var(--brand);
}
.pagination .current {
  background: var(--text-main);
  color: var(--text-inverse);
  border-color: var(--text-main);
}

/* ── 404 ────────────────────────────────── */
.page-404 {
  padding: var(--space-16) var(--space-8);
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.page-404__code {
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--border-light);
  margin-bottom: var(--space-4);
}
.page-404__text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-tertiary);
}

/* ── WIDGET / SIDEBAR ───────────────────── */
.widget {
  margin-bottom: var(--space-8);
}
.widget-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-main);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-4);
}

/* ── ADMIN BAR FIX ──────────────────────── */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
