/* ============================================================
   Новое меню сайта (вынесено из courses/new-menu-preview.php)
   Переиспользуемая шапка для лендингов v2.
   Подключать вместе с nmp-header.php + nmp-header.js
   ============================================================ */

/* CSS-переменные шапки. Только переменные — фон/шрифт body не трогаем,
   чтобы не конфликтовать со стилем лендинга (.clp2). */
body.nmp{
  --ink:#24182b; --muted:#6d6071; --line:#d8c7aa;
  --v:#8f1a82; --vd:#76006a; --gold:#b58a32;
  --bg:#f4efe5; --hbg:rgba(242,240,236,.97); --drop:#ececec;
}

/* ── хедер ── */
body.nmp .hdr{ position:sticky; top:0; z-index:50; background:var(--hbg); border-bottom:1px solid rgba(36,24,43,.11); box-shadow:0 8px 28px rgba(48,31,54,.12); -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); transition:box-shadow .3s; }
body.nmp .hdr.is-compact{ box-shadow:0 3px 14px rgba(36,24,43,.16); }
body.nmp .hdr-inner{ position:relative; z-index:1; width:94%; max-width:1200px; height:80px; margin:0 auto; display:flex; align-items:center; gap:0; transition:height .32s cubic-bezier(.4,0,.2,1); }
body.nmp .hdr.is-compact .hdr-inner{ height:56px; }

/* ── логотип ── */
body.nmp .brand{ display:flex; align-items:center; gap:9px; text-decoration:none; flex:0 0 auto; margin-right:auto; }
body.nmp .brand img{ width:46px; height:auto; display:block; }
body.nmp .brand-text{ display:flex; flex-direction:column; gap:0; }
@keyframes nmp-shimmer{ 0%{ background-position:150% center; } 100%{ background-position:-50% center; } }
body.nmp .brand-name{
  font-family:"Palatino Linotype",serif; font-size:1.65rem; line-height:.92; text-transform:uppercase; font-weight:400; letter-spacing:.01em;
  background:linear-gradient(100deg,#24182b 20%,#24182b 36%,#c9a050 50%,#9801fe 58%,#24182b 70%,#24182b 100%);
  background-size:250% auto;
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
  animation:nmp-shimmer 7s linear infinite;
  transition:font-size .32s cubic-bezier(.4,0,.2,1);
}
body.nmp .hdr.is-compact .brand-name{ font-size:1.28rem; }
body.nmp .brand-sub{ font-size:.56rem; letter-spacing:.04em; text-transform:uppercase; color:#666; margin-top:3px; transition:opacity .32s ease,max-height .32s ease; max-height:20px; overflow:hidden; }
body.nmp .hdr.is-compact .brand-sub{ opacity:0; max-height:0; }

/* ── nav ── */
body.nmp .nav{ display:flex; align-items:stretch; height:100%; }
body.nmp .nav-home{ display:flex; align-items:center; padding:0 10px; color:#24182b; text-decoration:none; transition:background .15s; }
body.nmp .nav-home svg{ width:22px; height:22px; fill:#24182b; transition:transform .2s cubic-bezier(.34,1.56,.64,1); }
body.nmp .nav-home:hover{ background:rgba(0,0,0,.06); }
body.nmp .nav-home:hover svg{ transform:scale(1.15); }
body.nmp .nav-item{ position:relative; display:flex; align-items:stretch; }
body.nmp .nav-link,
body.nmp .nav-btn{ display:flex; align-items:center; padding:0 13px; border:0; background:transparent; color:#24182b; cursor:pointer; font-family:"Palatino Linotype",serif; font-size:.82rem; text-transform:uppercase; text-decoration:none; letter-spacing:.02em; white-space:nowrap; transition:background .15s,color .15s; position:relative; }
body.nmp .nav-link:hover,
body.nmp .nav-item:hover>.nav-link,
body.nmp .nav-item:focus-within>.nav-link{ background:rgba(0,0,0,.06); color:var(--vd); }
body.nmp .nav-btn:hover,
body.nmp .nav-item:hover>.nav-btn,
body.nmp .nav-item:focus-within>.nav-btn{ background:rgba(0,0,0,.06); color:var(--vd); }
body.nmp .nav-btn::after{ content:""; display:inline-block; width:5px; height:5px; margin-left:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) translateY(-2px); flex-shrink:0; transition:transform .2s; }
body.nmp .nav-item:hover>.nav-btn::after{ transform:rotate(225deg) translateY(2px); }
body.nmp .nav-link::before,
body.nmp .nav-btn::before{ content:""; position:absolute; bottom:0; left:0; right:0; height:2px; background:linear-gradient(90deg,var(--gold),var(--v)); transform:scaleX(0); transform-origin:left; transition:transform .28s cubic-bezier(.22,.68,0,1.2); border-radius:2px 2px 0 0; }
body.nmp .nav-link:hover::before,
body.nmp .nav-item:hover>.nav-link::before,
body.nmp .nav-btn:hover::before,
body.nmp .nav-item:hover>.nav-btn::before{ transform:scaleX(1); }

/* ── поиск в шапке ── */
body.nmp .hdr-search-btn{ display:flex; align-items:center; justify-content:center; width:38px; height:38px; border:1px solid rgba(36,24,43,.18); border-radius:10px; background:transparent; cursor:pointer; color:#24182b; flex:0 0 auto; margin-left:8px; transition:background .15s,border-color .15s,color .15s; }
body.nmp .hdr-search-btn svg{ width:18px; height:18px; }
body.nmp .hdr-search-btn:hover, body.nmp .hdr-search-btn.is-active{ background:rgba(181,138,50,.10); border-color:rgba(181,138,50,.42); color:var(--vd); }
body.nmp .hdr-search-drop{ position:absolute; top:calc(100% + 10px); right:3%; z-index:65; width:min(620px,calc(100vw - 24px)); visibility:hidden; opacity:0; pointer-events:none; transform:translateY(-8px) scale(.985); transform-origin:top right; transition:opacity .16s,transform .16s,visibility .16s; }
body.nmp .hdr.is-search-open .hdr-search-drop{ visibility:visible; opacity:1; pointer-events:auto; transform:translateY(0) scale(1); }
body.nmp .site-search-panel{ width:100%; max-height:calc(100vh - 112px); display:flex; flex-direction:column; border:1px solid rgba(181,138,50,.34); border-radius:24px; background:radial-gradient(circle at 92% 0%,rgba(181,138,50,.16),transparent 34%),linear-gradient(145deg,#fffaf2 0%,#f1e6d5 100%); color:var(--ink); box-shadow:0 18px 54px rgba(47,32,54,.18),0 2px 0 rgba(255,250,242,.8) inset; overflow:hidden; }
body.nmp .site-search-head{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 18px 8px; }
body.nmp .site-search-kicker{ display:block; color:var(--gold); font-size:.62rem; font-weight:700; letter-spacing:.16em; text-transform:uppercase; }
body.nmp .site-search-close{ flex:0 0 auto; border:1px solid rgba(118,0,106,.16); border-radius:999px; background:rgba(118,0,106,.045); color:var(--ink); cursor:pointer; font:700 .6rem/1 "MSReferenceSansSerif",sans-serif; letter-spacing:.08em; text-transform:uppercase; padding:8px 11px; transition:background .14s,color .14s,border-color .14s; }
body.nmp .site-search-close:hover{ background:rgba(181,138,50,.12); border-color:rgba(181,138,50,.36); color:var(--vd); }
body.nmp .site-search-form{ display:grid; grid-template-columns:1fr auto; gap:8px; padding:0 18px 8px; }
body.nmp .site-search-input-wrap{ position:relative; }
body.nmp .site-search-input-wrap svg{ position:absolute; left:15px; top:50%; width:18px; height:18px; color:rgba(181,138,50,.78); transform:translateY(-50%); pointer-events:none; }
body.nmp .site-search-form input{ width:100%; box-sizing:border-box; border:1px solid rgba(118,0,106,.14); border-radius:17px; background:#fffdf8; color:var(--ink); font:400 .9rem/1.3 "MSReferenceSansSerif",sans-serif; padding:11px 15px 11px 42px; outline:0; box-shadow:inset 0 1px 0 rgba(255,255,255,.95); transition:border-color .15s,box-shadow .15s,transform .15s; }
body.nmp .site-search-form input:focus{ border-color:rgba(181,138,50,.72); box-shadow:0 0 0 4px rgba(181,138,50,.16),inset 0 1px 0 rgba(255,255,255,.95); transform:translateY(-1px); }
body.nmp .site-search-form button[type=submit]{ border:0; border-radius:17px; background:linear-gradient(135deg,var(--vd),#5b2455); color:#fffaf2; cursor:pointer; font:800 .68rem/1 "MSReferenceSansSerif",sans-serif; letter-spacing:.09em; text-transform:uppercase; padding:0 16px; min-width:96px; box-shadow:0 12px 30px rgba(118,0,106,.22); }
body.nmp .site-search-form button[type=submit]:hover{ filter:brightness(1.06); }
body.nmp .site-search-presets{ display:flex; flex-wrap:wrap; gap:5px; padding:0 18px 10px; }
body.nmp .site-search-presets button{ border:1px solid rgba(181,138,50,.30); border-radius:999px; background:rgba(181,138,50,.10); color:var(--vd); cursor:pointer; font:700 .62rem/1 "MSReferenceSansSerif",sans-serif; padding:6px 10px; transition:background .14s,color .14s,transform .14s; }
body.nmp .site-search-presets button:hover{ background:rgba(181,138,50,.18); color:#5b2455; transform:translateY(-1px); }
body.nmp .site-search-main{ min-width:0; min-height:0; padding:11px 16px 16px; overflow:auto; border-top:1px solid rgba(118,0,106,.10); }
body.nmp .site-search-status{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 12px; color:rgba(36,24,43,.56); font-size:.72rem; }
body.nmp .site-search-status strong{ color:var(--vd); font-weight:700; }
body.nmp .site-search-results{ display:grid; gap:9px; }
body.nmp .site-search-result{ display:grid; grid-template-columns:auto minmax(0,1fr); gap:10px; align-items:start; padding:11px; border:1px solid rgba(216,199,170,.76); border-radius:15px; background:rgba(255,253,248,.86); color:var(--ink); text-decoration:none; transition:background .14s,border-color .14s,transform .14s; }
body.nmp .site-search-result:hover,
body.nmp .site-search-result.is-focused{ background:#fffdf8; border-color:rgba(181,138,50,.46); transform:translateY(-1px); }
body.nmp .site-search-kind{ align-self:start; min-width:64px; border:1px solid rgba(181,138,50,.42); border-radius:999px; color:var(--vd); background:rgba(181,138,50,.08); font-size:.58rem; font-weight:800; letter-spacing:.09em; text-align:center; text-transform:uppercase; padding:6px 8px; }
body.nmp .site-search-result b{ display:block; color:var(--ink); font-size:.88rem; line-height:1.25; }
body.nmp .site-search-result p{ margin:5px 0 0; color:rgba(36,24,43,.58); font-size:.72rem; line-height:1.45; }
body.nmp .site-search-url{ display:none; }
body.nmp .site-search-empty{ margin:24px auto; max-width:390px; color:rgba(36,24,43,.54); text-align:center; line-height:1.55; }
body.nmp .site-search-empty b{ display:block; margin-bottom:7px; color:var(--ink); font-family:"Palatino Linotype",serif; font-size:1.25rem; font-weight:400; }
body.nmp .site-search-mark{ color:#24182b; background:#e0bd65; border-radius:4px; padding:0 2px; }

/* ── мобильная кнопка ── */
body.nmp .burger{ display:none; flex-direction:column; justify-content:center; gap:5px; width:40px; height:40px; padding:8px; border:1px solid rgba(36,24,43,.22); border-radius:10px; background:#fffaf2; cursor:pointer; margin-left:12px; }
body.nmp .burger span{ display:block; height:2px; background:#24182b; border-radius:2px; transition:transform .22s,opacity .22s; }
body.nmp .burger.is-open span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
body.nmp .burger.is-open span:nth-child(2){ opacity:0; transform:scaleX(0); }
body.nmp .burger.is-open span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }

/* ── мини-дропдаун (Библиотека, О нас) ── */
body.nmp .mini-drop{ position:absolute; top:100%; left:50%; transform:translateX(-50%) translateY(-6px); min-width:210px; z-index:60; background:linear-gradient(rgba(255,250,242,.76),rgba(255,250,242,.76)),url("/img/common/menu-big-constellation.png") no-repeat right bottom,url("/img/common/menu-small-constellation.png") no-repeat left top #f3eadc; border:1px solid rgba(181,138,50,.30); border-radius:14px; box-shadow:0 14px 40px rgba(47,32,54,.14),0 2px 8px rgba(47,32,54,.06); padding:8px 0; overflow:hidden; visibility:hidden; opacity:0; pointer-events:none; transition:opacity .16s ease,transform .16s ease,visibility 0s .16s; }
body.nmp .nav-item:hover .mini-drop,
body.nmp .nav-item.is-drop-open .mini-drop{ visibility:visible; opacity:1; pointer-events:auto; transform:translateX(-50%) translateY(0); transition:opacity .16s ease,transform .16s ease,visibility 0s 0s; }
body.nmp .mini-drop a{ display:block; padding:8px 20px; color:var(--ink); font-size:.76rem; text-decoration:none; white-space:nowrap; transition:background .13s,color .13s; }
body.nmp .mini-drop a:hover{ background:rgba(181,138,50,.12); color:var(--vd); }

/* ── мобильное меню ── */
body.nmp .mob-panel{ display:none; border-top:1px solid rgba(36,24,43,.10); background:url("/img/common/menu-big-constellation.png") no-repeat right bottom,url("/img/common/menu-small-constellation.png") no-repeat left top #e9e5de; padding:16px 4% 24px; max-height:calc(100vh - 100px); overflow-y:auto; }
body.nmp .mob-panel.is-open{ display:block; }
body.nmp .mob-section{ margin-bottom:20px; }
body.nmp .mob-section>h3{ margin:0 0 6px; color:var(--v); font-family:"Palatino Linotype",serif; font-size:1rem; font-weight:400; }
body.nmp .mob-section a{ display:block; padding:7px 0; border-top:1px solid rgba(36,24,43,.10); color:var(--ink); font-size:.88rem; text-decoration:none; transition:color .13s,padding-left .16s; }
body.nmp .mob-section a:hover{ color:var(--vd); padding-left:6px; }

/* ── адаптив ── */
@media (max-width:900px){
  body.nmp .nav{ display:none; }
  body.nmp .burger{ display:flex; }
  body.nmp .brand-name{ font-size:1.35rem; }
  body.nmp .hdr-search-drop{ top:calc(100% + 8px); left:12px; right:12px; width:auto; }
}
@media (max-width:640px){
  body.nmp .site-search-panel{ max-height:calc(100vh - 96px); border-radius:20px; }
  body.nmp .site-search-head{ padding:15px 15px 9px; }
  body.nmp .site-search-form{ grid-template-columns:1fr; padding:0 15px 12px; }
  body.nmp .site-search-form button[type=submit]{ min-height:44px; }
  body.nmp .site-search-presets{ padding:0 15px 12px; }
  body.nmp .site-search-main{ padding:13px 12px 16px; }
  body.nmp .site-search-result{ grid-template-columns:1fr; }
}
