/* ============================================================
   ROOT — цветовая схема и переменные
   ============================================================ */
:root {
  /* стандартные, но характерные читаемые шрифты */
  --font-heading: Georgia, 'Palatino Linotype', 'Times New Roman', serif;
  --font-body: Verdana, 'Segoe UI', Tahoma, Geneva, sans-serif;

  --bg-main: #F9F5EC;
  --bg-sidebar: #2E353D;
  --bg-card: #FEFCF8;
  --bg-card-hover: #F7F2E9;

  --brown-dark: #2C2B2E;
  --brown-mid: #5D5550;
  --brown-light: #978B82;
  --brown-pale: #DCCFC7;

  --gold: #BFA77A;
  --gold-light: #DAC9A2;
  --gold-pale: #F1E9D5;

  --teal: #7A9A8C;
  --teal-light: #A5C2B6;
  --burgundy: #B07D82;

  --white: #FEFCF8;

  --text-dark: #2A292B;
  --text-mid: #5D5752;
  --text-muted: #958D85;

  --border: #E0D7CC;
  --border-light: #F0EAE0;

  --sidebar-w: 280px;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(46,53,61,0.10);
  --shadow-card: 0 2px 12px rgba(46,53,61,0.07);
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--brown-dark);
}

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

button {
  cursor: pointer;
  font-family: inherit;
}

img {
  max-width: 100%;
}

/* ============================================================
   SIDEBAR — боковая навигация во всю высоту, прижата влево
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 20px 22px;
}

.logo-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(200,150,62,.3));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: bold;
  color: var(--gold-light);
  letter-spacing: .5px;
  line-height: 1.25;
}

.logo-sub {
  font-size: 11.5px;
  color: var(--brown-pale);
  letter-spacing: .3px;
  margin-top: 3px;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--brown-mid), transparent);
  margin: 0 16px 12px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--brown-light);
  padding: 2px 26px 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--brown-pale);
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  position: relative;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(200,150,62,.12);
  color: var(--gold-light);
  transform: translateX(3px);
  border-color: rgba(200,150,62,.15);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(200,150,62,.22), rgba(200,150,62,.08));
  color: var(--gold-light);
  border-color: rgba(200,150,62,.3);
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
  font-size: 17px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.nav-text {
  flex: 1;
  line-height: 1.3;
}

.sidebar-footer {
  padding: 16px 20px;
  font-size: 11px;
  color: var(--brown-light);
  border-top: 1px solid var(--brown-mid);
  text-align: center;
}

.sidebar-footer p {
  margin-top: 10px;
}

.sidebar-footer .lang-switch {
  display: inline-block;
  padding: 6px 22px;
  border: 1px solid var(--gold);
  border-radius: 20px;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  transition: background var(--transition), color var(--transition);
}

.sidebar-footer .lang-switch:hover {
  background: var(--gold);
  color: var(--bg-sidebar);
}

/* ============================================================
   КНОПКА-ГАМБУРГЕР (для мобильных)
   ============================================================ */
.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--bg-sidebar);
  color: var(--gold-light);
  border: 1px solid var(--brown-mid);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 32px 36px 0;
  max-width: calc(100vw - var(--sidebar-w));
  display: flex;
  flex-direction: column;
}

.breadcrumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  letter-spacing: .3px;
}

.breadcrumbs a {
  color: var(--gold);
  text-decoration: underline;
}

.main-content h1 {
  font-size: 38px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.lead {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.7;
  max-width: 760px;
  margin-bottom: 8px;
}

.section-title {
  font-size: 24px;
  margin: 30px 0 6px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-pale);
}

/* ============================================================
   HERO (главная)
   ============================================================ */
.hero {
  background: var(--bg-card);
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}

.hero h1 {
  font-size: 40px;
  margin-bottom: 12px;
}

.hero p {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.7;
  max-width: 720px;
}

/* ============================================================
   СЕТКА ПЕРИОДОВ (главная)
   ============================================================ */
.period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.period-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.25s ease;
  display: flex;
  flex-direction: column;
}

.period-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(46, 53, 61, 0.15);
  background: var(--bg-card-hover);
}

.period-icon {
  font-size: 38px;
  margin-bottom: 12px;
}

.period-card h3 {
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.period-card p {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 14px;
}

.badge {
  align-self: flex-start;
  background: var(--gold-pale);
  color: var(--brown-mid);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11.5px;
}

/* ============================================================
   КАРТОЧКИ ПРОИЗВЕДЕНИЙ (страницы периодов)
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(46, 53, 61, 0.08);
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(46, 53, 61, 0.15);
}

.card-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--gold-pale);
}

.card-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  font-size: 19px;
  line-height: 1.3;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 13px;
  color: var(--teal);
  font-style: italic;
  margin-bottom: 10px;
  flex: 1;
}

.card-link {
  color: var(--teal);
  font-size: 14px;
  font-weight: 500;
}

.card:hover .card-link {
  color: var(--gold);
}

/* ============================================================
   СТРАНИЦА ПРОИЗВЕДЕНИЯ
   ============================================================ */
.work {
  max-width: 800px;
}

.work-head {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 26px;
}

.work-cover {
  width: 180px;
  border-radius: var(--radius);
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.work-meta h1 {
  font-size: 32px;
  margin-bottom: 14px;
}

.work-meta dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 14px;
}

.work-meta dt {
  color: var(--text-muted);
}

.work-meta dd {
  color: var(--text-dark);
}

.work-meta dd a {
  color: var(--teal);
  text-decoration: underline;
}

.work p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dark);
  margin-bottom: 14px;
}

.img-right {
  float: right;
  width: min(320px, 45%);
  margin: 4px 0 14px 22px;
}

.img-right img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.img-right figcaption {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 6px;
  line-height: 1.5;
}

.back-link {
  clear: both;
  margin-top: 24px;
}

.back-link a {
  color: var(--text-muted);
  font-size: 14px;
}

.back-link a:hover {
  color: var(--gold);
}

/* ============================================================
   ФУТЕР
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 2px solid var(--border-light);
  margin-top: auto;
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer { margin-top: 40px; }

.footer-lang {
  margin-top: 10px;
}

.lang-link {
  display: inline-block;
  padding: 6px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-mid);
  font-weight: 500;
  transition: all 0.2s;
  margin: 0 6px;
}

.lang-link:hover {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--brown-dark);
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .main-content { padding: 24px 20px 0; }
  .work-head { flex-direction: column; }
  .work-cover { width: 160px; }
}

@media (max-width: 700px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,.3);
  }

  .menu-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 70px 16px 0;
  }

  .main-content h1,
  .hero h1 {
    font-size: 28px;
  }

  .period-grid,
  .cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-cover {
    height: 150px;
  }

  .img-right {
    float: none;
    width: 100%;
    margin: 12px 0;
  }
}

/* ============================================================
   СКРОЛЛБАРЫ
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brown-pale);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--brown-mid);
}
