/* ============================================================
   ПЕРЕМЕННЫЕ
   ============================================================ */
:root {
  --bg: #dceafa;
  --bg-gradient: linear-gradient(160deg, #dceafa 0%, #c5ddf5 100%);
  --card-bg: rgba(255, 255, 255, 0.55);
  --card-border: rgba(255, 255, 255, 0.7);
  --card-shadow: 0 4px 24px rgba(10, 27, 46, 0.08);
  --text: #0a1b2e;
  --text-muted: #4a637d;
  --accent: #247ad6;
  --accent-hover: #1e6ac0;
  --border: rgba(10, 27, 46, 0.1);
  --dropdown-bg: rgba(255, 255, 255, 0.96);
  --radius: 20px;
  --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] {
  --bg: #0a1424;
  --bg-gradient: linear-gradient(160deg, #0a1424 0%, #131e33 100%);
  --card-bg: rgba(30, 40, 60, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: #4a9eff;
  --accent-hover: #3a8eef;
  --border: rgba(255, 255, 255, 0.1);
  --dropdown-bg: rgba(30, 40, 60, 0.96);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100vh; }

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s, color 0.4s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

button { font-family: inherit; }

/* ============================================================
   ПРОГРЕСС-БАР
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.3s ease, opacity 0.3s;
  opacity: 0;
}
.progress-bar.active { opacity: 1; }

/* ============================================================
   ШАПКА
   ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px;
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--card-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  box-shadow: var(--card-shadow);
}

.logo {
  font-family: 'Unbounded', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.logo:hover { text-decoration: none; opacity: 0.8; }

.nav-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  min-width: 0;
}
.nav-scroll::-webkit-scrollbar { display: none; }

#nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  min-width: max-content;
}

#nav a,
.nav-btn {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 100px;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#nav a:hover,
.nav-btn:hover {
  color: var(--text);
  background: rgba(10, 27, 46, 0.05);
  text-decoration: none;
}

html[data-theme="dark"] #nav a:hover,
html[data-theme="dark"] .nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

#nav a.active,
.nav-btn.active {
  color: #fff;
  background: var(--accent);
}

.nav-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

.nav-add {
  padding: 8px 16px !important;
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-add:hover {
  filter: brightness(1.1);
  background: var(--accent-hover) !important;
  text-decoration: none;
}

.scroll-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.scroll-arrow:hover {
  background: rgba(10, 27, 46, 0.06);
  color: var(--text);
}

html[data-theme="dark"] .scroll-arrow:hover {
  background: rgba(255, 255, 255, 0.06);
}

.scroll-arrow svg { width: 16px; height: 16px; }

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(10, 27, 46, 0.05);
  transform: rotate(15deg);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ============================================================
   ДРОПДАУН
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  padding: 8px;
  background: var(--dropdown-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(10, 27, 46, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: var(--transition);
  z-index: 200;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.dropdown-menu button:hover {
  color: var(--text);
  background: rgba(10, 27, 46, 0.05);
}

html[data-theme="dark"] .dropdown-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dropdown-menu button.active {
  color: #fff;
  background: var(--accent);
}

/* Фиксированный дропдаун (для годов) */
.year-dropdown {
  position: fixed;
  z-index: 300;
}

.dropdown-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s;
}

/* ============================================================
   MAIN
   ============================================================ */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.glass {
  background: var(--card-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 56px 40px;
  margin-bottom: 24px;
  text-align: center;
}

.hero h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================================
   ФИЛЬТРЫ
   ============================================================ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  align-items: center;
}

.filter {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.filter:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   ЗАГОЛОВОК СЕКЦИИ
   ============================================================ */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
  gap: 16px;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-title .count {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 12px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  white-space: nowrap;
}

/* ============================================================
   СЕТКА АРХИВА
   ============================================================ */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.archive-item {
  position: relative;
  border: none;
  padding: 0;
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
  aspect-ratio: 4 / 3;
}

.archive-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(10, 27, 46, 0.15);
}

.archive-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.archive-item:hover img { transform: scale(1.04); }

.archive-item .tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(10, 27, 46, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 2;
}

.badge-new {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 2;
}

.archive-item .meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  z-index: 1;
}

.archive-item .meta .date {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 2px;
}

.archive-item .meta .title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   О САЙТЕ
   ============================================================ */
.about-content {
  padding: 40px;
  font-size: 16px;
  line-height: 1.8;
}

.about-content p { margin-bottom: 16px; }
.about-content p:last-child { margin-bottom: 0; }
.about-content strong { font-weight: 600; }
.about-content em { font-style: italic; color: var(--text-muted); }
.about-content .muted { color: var(--text-muted); font-size: 14px; margin-top: 32px; }

/* ============================================================
   ЛАЙТБОКС
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 20px;
}

.lightbox.open { opacity: 1; visibility: visible; }

.lightbox-inner {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 800px;
  color: #fff;
}

.lightbox-caption .info { text-align: left; }
.lightbox-caption .date { font-size: 13px; opacity: 0.7; }
.lightbox-caption .title { font-size: 18px; font-weight: 600; }

.lightbox-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  text-decoration: none;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.lightbox-download:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.lightbox-download svg { width: 16px; height: 16px; }

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-close svg { width: 20px; height: 20px; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-nav svg { width: 22px; height: 22px; }

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 40px 20px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 900px) {
  header { padding: 10px; }

  .header-inner {
    padding: 8px 10px;
    gap: 6px;
    border-radius: 100px;
  }

  .logo { font-size: 13px; }

  .scroll-arrow { display: flex; }

  #nav a,
  .nav-btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  .nav-add {
    padding: 7px 12px !important;
    font-size: 12px;
  }

  .theme-toggle { width: 36px; height: 36px; }

  .hero { padding: 40px 24px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 14px; }

  .archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .archive-item .meta { padding: 12px; }
  .archive-item .meta .title { font-size: 13px; }
  .archive-item .tag,
  .badge-new { font-size: 9px; padding: 4px 8px; }

  .lightbox-caption {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .lightbox-caption .info { text-align: center; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-nav svg { width: 18px; height: 18px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }

  .about-content { padding: 24px; font-size: 15px; }

  .filter { padding: 7px 14px; font-size: 13px; }

  .section-title { flex-wrap: wrap; }
  .section-title h2 { font-size: 18px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .archive-grid { grid-template-columns: 1fr 1fr; }
  .section-title .count { font-size: 12px; }
}
#catDropdown, .nav-separator { display: none !important; visibility: hidden !important; }
}
