/* ===================================================================
   Кафедра неонатологии — стили
   Палитра: тёплый клинический teal + персиковый акцент
   =================================================================== */
:root{
  --bg:        #fbf8f4;   /* тёплый белый */
  --surface:   #ffffff;
  --ink:       #1f2a2e;   /* графит */
  --ink-soft:  #5a6a6e;
  --teal:      #15616d;   /* основной медицинский сине-зелёный */
  --teal-deep: #0d4751;
  --teal-tint: #e6f0f0;
  --coral:     #e8826b;   /* тёплый акцент */
  --coral-deep:#cf6450;
  --line:      #e7e0d6;
  --line-soft: #f0ebe3;
  --shadow:    0 1px 2px rgba(20,40,45,.04), 0 8px 24px rgba(20,40,45,.06);
  --radius:    14px;
  --wrap:      1080px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  font-size:17px; line-height:1.65; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{font-family:'Fraunces',Georgia,serif; line-height:1.15; font-weight:600; color:var(--ink); margin:0 0 .5em}
h1{font-size:clamp(2rem,4vw,3rem); letter-spacing:-.01em}
h2{font-size:clamp(1.5rem,2.6vw,2.1rem)}
h3{font-size:1.25rem}
a{color:var(--teal); text-decoration:none}
a:hover{color:var(--teal-deep)}
p{margin:0 0 1rem}
img{max-width:100%}
.wrap{max-width:var(--wrap); margin:0 auto; padding:0 24px}
.skip{position:absolute; left:-9999px; top:0; background:var(--teal); color:#fff; padding:10px 16px; z-index:100}
.skip:focus{left:8px; top:8px}

/* ---------- Шапка ---------- */
.site-head{position:sticky; top:0; z-index:50; background:rgba(251,248,244,.9); backdrop-filter:blur(10px); border-bottom:1px solid var(--line)}
.head-inner{display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:74px}
.brand{display:flex; align-items:center; gap:13px; color:var(--teal)}
.brand-mark{display:flex; color:var(--teal)}
.brand-txt{display:flex; flex-direction:column; line-height:1.15}
.brand-name{font-family:'Fraunces',serif; font-weight:600; font-size:1.18rem; color:var(--ink)}
.brand-sub{font-size:.72rem; color:var(--ink-soft); letter-spacing:.02em}
.site-nav{display:flex; align-items:center; gap:4px; flex-wrap:wrap}
.site-nav a{padding:8px 13px; border-radius:8px; font-size:.92rem; font-weight:500; color:var(--ink-soft)}
.site-nav a:hover{background:var(--teal-tint); color:var(--teal-deep)}
.site-nav a.active{color:var(--teal-deep); background:var(--teal-tint)}
.nav-admin{margin-left:6px; border:1px solid var(--line); color:var(--teal)!important}
.nav-toggle{display:none; flex-direction:column; gap:5px; background:none; border:0; cursor:pointer; padding:8px}
.nav-toggle span{width:24px; height:2px; background:var(--ink); border-radius:2px}

/* ---------- Главный экран ---------- */
.hero{position:relative; overflow:hidden; background:linear-gradient(160deg,#0d4751 0%,#15616d 55%,#1d7a82 100%); color:#fff}
.hero .wrap{position:relative; z-index:2; padding-top:84px; padding-bottom:84px}
.hero-blob{position:absolute; right:-120px; top:-80px; width:520px; height:520px; border-radius:50%; background:radial-gradient(circle at 30% 30%, rgba(232,130,107,.45), transparent 60%); z-index:1; pointer-events:none}
.hero-eyebrow{display:inline-block; font-size:.8rem; letter-spacing:.14em; text-transform:uppercase; color:#bfe3e3; margin-bottom:18px; font-weight:600}
.hero h1{color:#fff; max-width:16ch}
.hero-lead{font-size:1.2rem; color:#dcefef; max-width:54ch; margin-top:14px}
.hero-actions{display:flex; gap:14px; flex-wrap:wrap; margin-top:30px}

.btn{display:inline-flex; align-items:center; gap:9px; padding:13px 24px; border-radius:10px; font-weight:600; font-size:.96rem; border:1px solid transparent; cursor:pointer; transition:.16s; font-family:inherit}
.btn-primary{background:var(--coral); color:#fff}
.btn-primary:hover{background:var(--coral-deep); color:#fff}
.btn-ghost{background:rgba(255,255,255,.1); color:#fff; border-color:rgba(255,255,255,.35)}
.btn-ghost:hover{background:rgba(255,255,255,.2); color:#fff}
.btn-teal{background:var(--teal); color:#fff}
.btn-teal:hover{background:var(--teal-deep); color:#fff}
.btn-sm{padding:8px 15px; font-size:.85rem}
.btn-line{background:transparent; border-color:var(--line); color:var(--ink-soft)}
.btn-line:hover{border-color:var(--teal); color:var(--teal)}

/* ---------- Секции страниц ---------- */
.page-hero{background:linear-gradient(160deg,var(--teal-tint),var(--bg)); padding:54px 0 38px; border-bottom:1px solid var(--line)}
.eyebrow{display:inline-block; font-size:.78rem; letter-spacing:.13em; text-transform:uppercase; color:var(--teal); font-weight:600; margin-bottom:12px}
.lead{font-size:1.12rem; color:var(--ink-soft); max-width:60ch}
.section{padding:56px 0}
.section-tint{background:var(--surface); border-top:1px solid var(--line); border-bottom:1px solid var(--line)}
.section-head{display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:30px; flex-wrap:wrap}
.section-head p{color:var(--ink-soft); margin:6px 0 0}

/* ---------- Карточки/сетки ---------- */
.grid{display:grid; gap:20px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:24px; box-shadow:var(--shadow); transition:.18s}
.card:hover{transform:translateY(-2px); border-color:#d7cebf}
.card h3{margin-bottom:8px}
.card p{color:var(--ink-soft); font-size:.95rem; margin:0}

.feature{display:flex; flex-direction:column; gap:12px}
.feature .ic{width:46px; height:46px; border-radius:12px; background:var(--teal-tint); color:var(--teal); display:grid; place-items:center}
.feature .ic svg{width:24px; height:24px}

/* секции библиотеки */
.sec-card{display:flex; flex-direction:column; height:100%}
.sec-card .count{font-size:.82rem; color:var(--coral-deep); font-weight:600; margin-bottom:6px}
.sec-card .go{margin-top:auto; padding-top:14px; font-weight:600; color:var(--teal)}

/* список материалов */
.mat{display:flex; align-items:center; gap:16px; padding:16px 20px; background:var(--surface); border:1px solid var(--line); border-radius:12px; margin-bottom:12px; transition:.15s}
.mat:hover{border-color:#d7cebf}
.mat .badge{flex-shrink:0; width:52px; height:52px; border-radius:10px; background:var(--teal-tint); color:var(--teal-deep); display:grid; place-items:center; font-size:.7rem; font-weight:700; letter-spacing:.03em}
.mat .meta{flex:1; min-width:0}
.mat .meta b{display:block; font-weight:600; color:var(--ink)}
.mat .meta span{font-size:.85rem; color:var(--ink-soft)}
.mat .dl{flex-shrink:0}

/* ---------- Новости ---------- */
.news-item{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:24px; margin-bottom:18px; box-shadow:var(--shadow)}
.news-item.pinned{border-left:4px solid var(--coral)}
.news-top{display:flex; align-items:center; gap:12px; margin-bottom:10px; flex-wrap:wrap}
.tag{font-size:.72rem; font-weight:600; letter-spacing:.04em; text-transform:uppercase; padding:4px 11px; border-radius:30px}
.tag-Расписание{background:#e6f0f0; color:var(--teal-deep)}
.tag-Экзамены{background:#fdeae4; color:var(--coral-deep)}
.tag-Пересдача{background:#fbeee8; color:#b85539}
.tag-Объявление{background:#eef0e9; color:#5c6748}
.tag-default{background:var(--line-soft); color:var(--ink-soft)}
.news-date{font-size:.85rem; color:var(--ink-soft)}
.news-event{display:inline-flex; align-items:center; gap:6px; font-size:.88rem; font-weight:600; color:var(--coral-deep); margin-top:8px}
.news-body{color:var(--ink-soft); margin-top:6px; white-space:pre-line}
.news-file{display:inline-flex; align-items:center; gap:9px; margin-top:14px; padding:10px 15px; background:var(--teal-tint); border-radius:10px; font-size:.9rem; font-weight:600; color:var(--teal-deep)}
.news-file:hover{background:#d8e8e8}
.pin-flag{font-size:.72rem; font-weight:600; color:var(--coral-deep); display:inline-flex; align-items:center; gap:5px}

/* ---------- Сотрудники ---------- */
.staff-card{text-align:left}
.staff-photo{width:72px; height:72px; border-radius:50%; object-fit:cover; background:var(--teal-tint); margin-bottom:14px; display:grid; place-items:center; color:var(--teal); font-family:'Fraunces',serif; font-size:1.5rem; font-weight:600}
.staff-card .pos{color:var(--coral-deep); font-weight:600; font-size:.9rem; margin:4px 0}
.staff-card .deg{color:var(--ink-soft); font-size:.88rem}
.staff-card .ct{margin-top:10px; font-size:.88rem}
.staff-card .ct a{display:block}

/* ---------- FAQ ---------- */
.faq-item{background:var(--surface); border:1px solid var(--line); border-radius:12px; margin-bottom:12px; overflow:hidden}
.faq-item summary{padding:18px 22px; font-weight:600; cursor:pointer; list-style:none; display:flex; justify-content:space-between; gap:14px; align-items:center}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary::after{content:'+'; font-size:1.4rem; color:var(--teal); flex-shrink:0; transition:.2s}
.faq-item[open] summary::after{transform:rotate(45deg)}
.faq-item .ans{padding:0 22px 20px; color:var(--ink-soft); white-space:pre-line}

/* ---------- Контакты/проза ---------- */
.prose{max-width:70ch}
.prose p{color:var(--ink-soft)}
.contact-grid{display:grid; grid-template-columns:1fr 1fr; gap:24px}
.contact-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:26px}
.contact-card .lbl{font-size:.78rem; text-transform:uppercase; letter-spacing:.1em; color:var(--ink-soft); font-weight:600}
.contact-card .val{font-size:1.1rem; margin-top:6px}

/* ---------- Подвал ---------- */
.site-foot{background:var(--teal-deep); color:#cfe6e6; margin-top:60px}
.foot-inner{display:grid; grid-template-columns:2fr 1.4fr 1fr; gap:34px; padding-top:48px; padding-bottom:32px}
.foot-name{font-family:'Fraunces',serif; font-size:1.2rem; color:#fff; margin-bottom:10px}
.foot-addr{font-size:.9rem; color:#a9cfcf}
.foot-links{display:flex; flex-direction:column; gap:8px}
.foot-links a{color:#cfe6e6; font-size:.92rem}
.foot-links a:hover{color:#fff}
.foot-contact{display:flex; flex-direction:column; gap:8px}
.foot-contact a{color:#cfe6e6}
.foot-contact a:hover{color:#fff}
.foot-bottom{display:flex; align-items:center; justify-content:space-between; gap:20px; padding-top:22px; padding-bottom:26px; border-top:1px solid rgba(255,255,255,.12); flex-wrap:wrap}
.foot-uni{display:flex; align-items:center; gap:13px; color:#cfe6e6}
.foot-uni:hover{color:#fff}
.foot-uni .uni-mark{color:#7fb8b8; flex-shrink:0; display:flex}
.foot-uni .uni-logo{height:44px; width:auto; background:#fff; padding:5px; border-radius:8px}
.uni-txt{display:flex; flex-direction:column; line-height:1.2}
.uni-short{font-weight:700; color:#fff; font-size:.95rem; letter-spacing:.02em}
.uni-full{font-size:.78rem; color:#a9cfcf}
.foot-copy{font-size:.85rem; color:#8fbdbd}

/* ---------- Утилиты ---------- */
.empty{text-align:center; padding:50px 20px; color:var(--ink-soft)}
.empty svg{width:46px; height:46px; color:var(--line); margin-bottom:12px}
.flash{background:#e7f4ec; border:1px solid #b7dcc4; color:#1d6b3e; padding:13px 18px; border-radius:10px; margin-bottom:20px; font-size:.92rem}
.divider{height:1px; background:var(--line); margin:40px 0}

/* ---------- Адаптив ---------- */
@media (max-width:860px){
  .grid-3,.grid-4{grid-template-columns:repeat(2,1fr)}
  .foot-inner{grid-template-columns:1fr 1fr}
  .contact-grid{grid-template-columns:1fr}
}
@media (max-width:680px){
  .nav-toggle{display:flex}
  .site-nav{display:none; position:absolute; top:74px; left:0; right:0; background:var(--surface); flex-direction:column; align-items:stretch; padding:14px; border-bottom:1px solid var(--line); gap:2px}
  body.nav-open .site-nav{display:flex}
  .site-nav a{padding:12px 14px}
  .grid-2,.grid-3,.grid-4{grid-template-columns:1fr}
  .foot-inner{grid-template-columns:1fr}
  .foot-bottom{flex-direction:column; align-items:flex-start}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important; scroll-behavior:auto!important}}

/* ---------- Отработки ---------- */
.otr-card{display:flex; gap:18px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:20px 22px; margin-bottom:14px; box-shadow:var(--shadow)}
.otr-card.otr-past{opacity:.62}
.otr-date{flex-shrink:0; width:64px; text-align:center; background:var(--teal-tint); border-radius:12px; padding:10px 0; align-self:flex-start}
.otr-day{display:block; font-family:'Fraunces',serif; font-size:1.7rem; font-weight:600; color:var(--teal-deep); line-height:1}
.otr-mon{display:block; font-size:.74rem; text-transform:uppercase; letter-spacing:.05em; color:var(--teal); margin-top:3px}
.otr-body{flex:1; min-width:0}
.otr-line{display:flex; align-items:baseline; gap:14px; flex-wrap:wrap; margin-bottom:8px}
.otr-line b{font-size:1.08rem}
.otr-time{font-size:.9rem; color:var(--coral-deep); font-weight:600}
.otr-row{display:flex; gap:9px; align-items:flex-start; color:var(--ink-soft); font-size:.94rem; margin-top:5px}
.otr-row .otr-ic{flex-shrink:0}
.otr-note{margin-top:10px; padding:10px 14px; background:var(--line-soft); border-radius:9px; font-size:.9rem; color:var(--ink-soft)}

/* ---------- Календарь занятий ---------- */
.cal-head{display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px; flex-wrap:wrap}
.cal-legend{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px}
.cal-tag{font-size:.74rem; font-weight:600; padding:3px 10px; border-radius:20px}
.k-Лекция{background:#e6f0f0; color:var(--teal-deep)}
.k-Практика{background:#eef3e2; color:#4f6312}
.k-Зачёт{background:#fdeae4; color:var(--coral-deep)}
.k-Экзамен{background:#fbe3dc; color:#b23a1f}
.k-other{background:var(--line-soft); color:var(--ink-soft)}
.cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:6px}
.cal-weekdays{margin-bottom:6px}
.cal-wd{text-align:center; font-size:.78rem; font-weight:600; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.04em; padding:4px 0}
.cal-cell{min-height:96px; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:6px 7px; display:flex; flex-direction:column; gap:3px}
.cal-empty{background:transparent; border:0}
.cal-today{border-color:var(--coral); box-shadow:0 0 0 1px var(--coral)}
.cal-num{font-size:.82rem; font-weight:600; color:var(--ink-soft); margin-bottom:2px}
.cal-today .cal-num{color:var(--coral-deep)}
.cal-ev{display:flex; flex-direction:column; line-height:1.2; padding:3px 6px; border-radius:6px; font-size:.72rem; overflow:hidden}
.cal-ev-t{font-weight:600; font-size:.68rem; opacity:.85}
.cal-ev-x{white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

@media (max-width:680px){
  .cal-cell{min-height:auto; padding:5px}
  .cal-wd{font-size:.66rem}
  .cal-ev{font-size:.64rem; padding:2px 4px}
  .cal-ev-x{white-space:normal}
  .cal-num{font-size:.74rem}
  .otr-card{flex-direction:row}
}

/* ---------- Тёмная тема ---------- */
[data-theme="dark"]{
  --bg:        #121a1c;
  --surface:   #1a2426;
  --ink:       #e8eded;
  --ink-soft:  #9fb0b0;
  --teal:      #4db8a8;
  --teal-deep: #6fcabb;
  --teal-tint: #1e2e30;
  --coral:     #e8826b;
  --coral-deep:#f09980;
  --line:      #2a3739;
  --line-soft: #222e30;
  --shadow:    0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.25);
}
[data-theme="dark"] .hero{background:linear-gradient(160deg,#0a2a30 0%,#0f3b40 55%,#13474d 100%)}
[data-theme="dark"] .page-hero{background:linear-gradient(160deg,#1a2e30,var(--bg))}
[data-theme="dark"] .site-head{background:rgba(18,26,28,.9)}
[data-theme="dark"] .tag-Расписание,[data-theme="dark"] .k-Лекция{background:#143034;color:#7fcabb}
[data-theme="dark"] .tag-Экзамены,[data-theme="dark"] .k-Зачёт{background:#3a2018;color:#f0a890}
[data-theme="dark"] .tag-Пересдача{background:#3a1f15;color:#e8a085}
[data-theme="dark"] .k-Практика{background:#24300f;color:#a8c95f}
[data-theme="dark"] .k-Экзамен{background:#3a1a10;color:#e89070}
[data-theme="dark"] .site-foot{background:#0c1416}
[data-theme="dark"] img.uni-logo{background:#e8eded}

/* Переключатель темы */
.theme-toggle{background:none;border:1px solid var(--line);border-radius:8px;cursor:pointer;width:38px;height:38px;font-size:1rem;color:var(--ink-soft);margin-left:6px;display:inline-flex;align-items:center;justify-content:center;transition:.15s}
.theme-toggle:hover{background:var(--teal-tint);color:var(--teal)}
.theme-moon{display:none}
[data-theme="dark"] .theme-sun{display:none}
[data-theme="dark"] .theme-moon{display:inline}

/* ---------- Поиск ---------- */
.search-link{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border:1px solid var(--line);border-radius:8px;margin-left:6px;font-size:.95rem;text-decoration:none}
.search-link:hover{background:var(--teal-tint)}
.search-big{display:flex;gap:10px;max-width:620px}
.search-big input{flex:1;padding:15px 18px;border:1px solid var(--line);border-radius:11px;font-family:inherit;font-size:1.02rem;background:var(--surface);color:var(--ink)}
.search-big input:focus{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px var(--teal-tint)}
.search-res{display:flex;align-items:flex-start;gap:15px;padding:16px 18px;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:11px;transition:.15s;color:var(--ink)}
.search-res:hover{border-color:var(--teal);transform:translateX(2px)}
.search-ic{flex-shrink:0;width:42px;height:42px;border-radius:10px;background:var(--teal-tint);display:grid;place-items:center;font-size:1.2rem}
.search-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.search-top{display:flex;align-items:center;gap:9px}
.search-type{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--teal);background:var(--teal-tint);padding:2px 9px;border-radius:20px}
.search-sub{font-size:.82rem;color:var(--ink-soft)}
.search-meta b{font-size:1rem;color:var(--ink)}
.search-extra{font-size:.88rem;color:var(--ink-soft)}
.search-arrow{flex-shrink:0;color:var(--teal);font-size:1.2rem;align-self:center}

/* ---------- Виджет "Ближайшее" + обратный отсчёт ---------- */
.upnext{display:grid;grid-template-columns:1.7fr 1fr;gap:24px;align-items:start}
.upnext-main{}
.upnext-item{display:flex;gap:14px;align-items:center;padding:12px 14px;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:10px}
.upnext-date{flex-shrink:0;width:52px;height:52px;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--teal-tint)}
.upnext-date .d{font-family:'Fraunces',serif;font-size:1.35rem;font-weight:600;line-height:1;color:var(--teal-deep)}
.upnext-date .w{font-size:.66rem;text-transform:uppercase;color:var(--teal);margin-top:2px}
.upnext-info{min-width:0}
.upnext-info b{display:block;font-size:.98rem}
.upnext-info span{font-size:.85rem;color:var(--ink-soft)}
.countdown{background:linear-gradient(160deg,var(--teal-deep),var(--teal));color:#fff;border-radius:var(--radius);padding:26px 24px;display:flex;flex-direction:column;align-items:center;text-align:center;box-shadow:var(--shadow)}
.countdown.cd-exam{background:linear-gradient(160deg,#cf6450,#e8826b)}
.cd-label{font-size:.74rem;text-transform:uppercase;letter-spacing:.1em;opacity:.85}
.cd-num{font-family:'Fraunces',serif;font-size:4.5rem;font-weight:700;line-height:1;margin:6px 0}
.cd-days{font-size:.9rem;opacity:.9;margin-bottom:14px}
.cd-what{font-weight:600;font-size:1rem;line-height:1.3}
.cd-date{font-size:.85rem;opacity:.85;margin-top:4px}
@media (max-width:760px){.upnext{grid-template-columns:1fr}.countdown{order:-1}}
