/* =========================
   style.css — Полный файл
   ========================= */

/* === ROOT VARIABLES === */
:root{
  --bg: #0b1120;
  --card: #1b2437;
  --text: #e4eaf4;
  --accent: #ffd500;
  --link: #4da3ff;
  --primary: #2a6df4;
  --muted: #94a3b8;
  --border: #2c3b52;

  /* кнопки меню */
  --button-default: #2c3b52;
  --button-hover: #3c4f6b;

  /* высота шапки */
  --header-height-desktop: 72px;
  --header-height-mobile: 112px;

  /* общие размеры */
  --max-width: 1200px;
  --gap: 1rem;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --transition-fast: 0.18s;
}

/* === RESET / BASE === */
* { box-sizing: border-box; margin:0; padding:0; min-width:0; }
html,body{ height:100%; }
body{
  font-family: "Inter","Segoe UI",Roboto,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* utility to lock scroll */
body.no-scroll { overflow: hidden; }

/* links */
a { color: var(--link); text-decoration: none; transition: color .25s; }
a:hover { color: var(--accent); }

/* containers */
.nav-container {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 1.5rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* === HEADER (fixed) === */
header:not(.metadata-section) {
  background: rgba(11,17,32,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  border-bottom: 1px solid var(--border);
  padding: 0;
  display: flex;
  justify-content: center;
  will-change: transform;
}

/* header internal layout */
.header-top-row {
  width: 100%;
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 0.8rem 0;
}
.header-bottom-row {
  width: 100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 0.8rem 0;
  border-top: 1px solid transparent;
}

/* logo */
.logo{
  font-size: 1.4rem;
  font-weight:700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  flex-shrink:0;
}

/* language switcher */
.language-switcher {
  display:flex;
  gap:.6rem;
  align-items:center;
}
.flag-icon{
  width:32px;
  height:22px;
  border-radius:3px;
  border:1px solid rgba(255,255,255,.12);
  object-fit:cover;
  display:block;
  transition: transform .15s, border-color .15s;
}
.language-switcher a:hover .flag-icon{
  transform: scale(1.08);
  border-color: var(--accent);
}

/* hamburger */
.menu-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  padding:6px;
  border-radius:6px;
  background:transparent;
  cursor:pointer;
  border:0;
  z-index:1300;
  flex-direction:column;
  flex-shrink:0;
}
.menu-toggle span{
  display:block;
  width:24px;
  height:3px;
  background:var(--text);
  border-radius:3px;
  margin:3px 0;
  transition: transform .28s, opacity .2s;
}

/* NAV — базовые стили (скрыто по умолчанию) */
#nav-menu{
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--header-height-mobile));
  background: transparent;
  border-top: 1px solid var(--border);
  z-index: 1199;
  padding: 0;
  opacity: 0;
  transform-origin: top center;
  transform: translateY(-6px) scaleY(.98);
  transition: opacity .22s ease, transform .22s ease, max-height .28s ease;
  max-height: 0;
  overflow: hidden;
  box-shadow: none;
}

/* active state */
#nav-menu.active{
  opacity: 1;
  transform: none;
  max-height: 1200px;
}

/* list */
#nav-menu ul{
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:.6rem;
  align-items:center;
  padding: .8rem 0;
  margin:0;
}
#nav-menu li{
  width:100%;
  display:flex;
  justify-content:center;
}
#nav-menu a{
  display:inline-block;
  padding:.5rem 1.2rem;
  width:100%;
  max-width:450px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--text);
  text-align:center;
  font-weight:600;
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast), color var(--transition-fast), transform .12s, box-shadow .18s, border-color .18s;
  border: 1px solid var(--border);
  background: var(--button-default);
}
#nav-menu a:hover{
  background: var(--button-hover);
  color: var(--accent);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 4px 8px rgba(0,0,0,0.18);
  border-color: var(--accent);
}

/* === CONTENT SECTIONS (default) === */
.top-offset {
  padding-top: calc(var(--header-height-mobile) + 16px) !important;
}

.hero {
  text-align: center;
  padding: calc(var(--header-height-mobile) + 2rem) 1.5rem 3rem;
  background: linear-gradient(160deg,#1b2437 0%,#0b1120 100%);
}
.metadata-section {
  padding: calc(var(--header-height-mobile) + 3rem) 1.5rem 3rem;
  text-align: center;
  background: linear-gradient(160deg,#1b2437 0%,#0b1120 100%);
  border-radius: 12px;
  max-width: var(--max-width);
  margin: 2rem auto;
}

/* finer typography inside hero / metadata */
.metadata-section .logo { font-size: 1.1rem; color: var(--accent); margin-bottom:.5rem; }
.metadata-section h1 { font-size: 2rem; margin-bottom:.5rem; }
.metadata-section p { font-size: 1.1rem; color: var(--muted); }

.hero h1 { font-size: 2.8rem; font-weight:800; color:var(--accent); margin-bottom:1rem; }
.hero p { max-width:750px; margin:0 auto; color:var(--muted); font-size:1.15rem; }

/* containers, main and cards */
.container{ padding-top:0; max-width:var(--max-width); margin:0 auto; padding-left:1.5rem; padding-right:1.5rem; }
main{ max-width:var(--max-width); margin: 3rem auto; padding: 0 1.5rem; display:grid; gap:2rem; }
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover{ transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0,0,0,0.35); }
.card h2{ color: var(--primary); margin-bottom:1rem; font-size:1.3rem; border-left:4px solid var(--accent); padding-left:.6rem; }
.card p{ margin: .4rem 0 .6rem 0; color:var(--text); font-size:1rem; }

.teasers{ display:flex; flex-direction:column; gap:.5rem; margin-top:1rem; }
.teasers a{ display:inline; color:var(--link); font-size:.9rem; text-decoration:none; border-left:3px solid var(--border); padding-left:.5rem; transition: all .25s; }
.teasers a:hover{ color:var(--accent); border-color:var(--accent); }

/* footer */
footer{
  background:#111827;
  color: var(--muted);
  text-align:center;
  padding:1.5rem;
  border-top:1px solid var(--border);
  font-size:.9rem;
}

/* lists */
ol, ul{ padding-left:1.8rem; margin-bottom:1em; }
ol li, ul li{ line-height:1.6; margin-bottom:.8em; }
ol li::marker, ul li::marker{ color:var(--accent); font-weight:700; }

/* === РЕКЛАМНЫЕ БЛОКИ === */
.ad-desktop {
    display: none;
}

.ad-mobile {
    display: block;
}

.ad-mobile > div {
    display: flex;
    justify-content: center;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

/* --- Desktop >=769px --- */
@media(min-width:769px){

  :root {
    --header-height: var(--header-height-desktop);
  }

  .nav-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
  }

  .header-top-row { display:flex; width:auto; padding:0; justify-content:flex-start; margin-right:auto; }
  .header-bottom-row { display:flex; width:auto; padding:0; border-top:none; justify-content:flex-end; gap:1.5rem; }

  /* NAV на десктопе */
  #nav-menu{
    position: absolute;
    top: auto;
    right: 1.5rem;
    left: auto;
    width: auto;
    opacity: 0;
    max-height: 0;
    transform: translateY(0);
    border-top: none;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  #nav-menu.active{ opacity:1; max-height:1000px; }

  #nav-menu ul {
    flex-direction: column;
    align-items: flex-end;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    list-style:none;
    gap:0.5rem;
  }
  #nav-menu li { width:auto; justify-content:flex-end; }
  #nav-menu a {
    text-align:center;
    padding: .5rem 1.2rem;
    width:auto;
    max-width:none;
    white-space:nowrap;
    font-weight:600;
    border:1px solid var(--border);
    background: var(--button-default);
    color: var(--text);
    border-radius: var(--radius-pill);
  }
  #nav-menu a:hover{
    background: var(--button-hover);
    color: var(--accent);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-color: var(--accent);
  }

  .top-offset { padding-top: calc(var(--header-height-desktop) + 8px) !important; }
  .hero { padding: calc(var(--header-height-desktop) + 2rem) 1.5rem 3rem; }
  .metadata-section { padding: calc(var(--header-height-desktop) + 2.5rem) 1.5rem 3rem; }

  /* РЕКЛАМНЫЕ БЛОКИ (Десктоп) */
  .ad-desktop {
    display: block;
  }

  .ad-mobile {
    display: none;
  }
}

/* --- Mobile <=768px --- */
@media(max-width:768px){

  :root {
    --header-height: var(--header-height-mobile);
  }

  .nav-container { flex-direction: column; padding: 0 1rem; }
  .header-top-row { justify-content:center; }
  .header-bottom-row { justify-content:space-between; width:100%; }

  /* NAV на мобильном */
  #nav-menu{
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--header-height-mobile));
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    background: linear-gradient(180deg, rgba(27,36,55,0.98), rgba(11,17,32,0.98));
    border-top: 1px solid var(--border);
    padding: .6rem 0;
  }
  #nav-menu ul { padding: .8rem 0; }
  #nav-menu li { justify-content:center; }
  #nav-menu a { max-width: 95%; }

  .top-offset { padding-top: calc(var(--header-height-mobile) + 16px) !important; }
  .metadata-section { padding: calc(var(--header-height-mobile) + 2.5rem) 1rem 2rem; }
  .hero { padding: calc(var(--header-height-mobile) + 1.5rem) 1rem 2rem; }
  .hero h1 { font-size:2.1rem; }
  .metadata-section h1{ font-size:1.6rem; }
  .metadata-section p{ font-size:1rem; }
  main { margin-bottom:2rem; padding: 0 1rem; }
  .container { padding-left:1rem; padding-right:1rem; }
  .card { padding:1.5rem; }
}

/* small helpers */
.hide-on-desktop { display:none; }
.show-on-desktop { display:inline-block; }

/* print-friendly */
@media print {
  header, #nav-menu, .menu-toggle, .language-switcher { display:none !important; }
  body { background: #fff; color: #000; }
  a:after { content: " (" attr(href) ")"; font-size: 0.9em; }
}