/* Тема «Надежда»: стили сайта и редактора. Цвета и шрифты — из theme.json (--wp--preset--*). */
:root {
  --nd-blue: var(--wp--preset--color--blue);
  --nd-ink: var(--wp--preset--color--ink);
  --nd-soft: var(--wp--preset--color--soft);
  --nd-line: color-mix(in srgb, var(--nd-ink) 12%, transparent);
  --nd-muted: color-mix(in srgb, var(--nd-ink) 70%, transparent);
  --nd-ease: cubic-bezier(.22, 1, .36, 1);
  --nd-radius: 16px;
}
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { height: auto; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--nd-blue); outline-offset: 3px; }

/* Кнопки и ссылки-действия */
.nd-btn, .wp-block-button__link { display: inline-flex; align-items: center; gap: 10px; transition: background-color .3s, color .3s, border-color .3s; }
.nd-btn { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--nd-blue); background: var(--nd-blue); color: #fff; font: 600 16px/1 var(--wp--preset--font-family--body); text-decoration: none; cursor: pointer; }
.nd-btn:hover { background: var(--nd-ink); border-color: var(--nd-ink); color: #fff; text-decoration: none; }
.nd-btn--light { background: #fff; border-color: #fff; color: var(--nd-ink); }
.nd-btn--light:hover { background: #dbe7f3; border-color: #dbe7f3; color: var(--nd-ink); }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--nd-blue); border: 1.5px solid var(--nd-blue); padding: 12px 22px; }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--nd-soft); color: var(--nd-blue); }
.nd-kicker { color: var(--nd-blue); font-weight: 600; font-size: 15px; margin-top: 0; margin-bottom: 12px; }
.nd-lead { font-size: var(--wp--preset--font-size--large); color: color-mix(in srgb, var(--nd-ink) 88%, transparent); max-width: 560px; }
.nd-muted { color: var(--nd-muted); }

/* Шапка */
.nd-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, #fff 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
.admin-bar .nd-header { top: 32px; }
.nd-header__row { min-height: 76px; gap: 24px; }
.nd-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--nd-ink); }
.nd-brand:hover { text-decoration: none; }
.nd-mark { width: 44px; height: 44px; color: var(--nd-blue); flex: none; }
.nd-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.nd-brand__text b { font: 600 20px/1.1 var(--wp--preset--font-family--display); }
.nd-brand__text small { font-size: 13px; color: var(--nd-muted); margin-top: 3px; }
.nd-nav .wp-block-navigation-item__content { padding: 10px 14px; border-radius: 999px; text-decoration: none; font-size: 16px; }
.nd-nav .wp-block-navigation-item__content:hover { background: var(--nd-soft); text-decoration: none; }
@media (max-width: 600px) { .nd-header .nd-btn-cta { display: none; } .nd-brand__text small { display: none; } }

/* Разделы */
.nd-section { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--50); }
.nd-section--soft { background: var(--nd-soft); }
.nd-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.nd-head h2 { margin: 0; }
.nd-head p { margin: 8px 0 0; color: var(--nd-muted); max-width: 540px; }

/* Первый экран */
.nd-hero { padding-top: clamp(24px, 4vw, 48px); padding-bottom: var(--wp--preset--spacing--50); }
.nd-hero .wp-block-columns { gap: clamp(32px, 4vw, 56px); align-items: stretch !important; }
.nd-hero h1 { margin: 0 0 24px; text-wrap: balance; }
/* Размер заголовка — от ширины его колонки, а не окна: «для молодёжи» (≈7,1 em в Литерате, неразрывно) помещается
   с запасом ~10%; слова внутри никогда не разрываются. */
.nd-hero__text { container-type: inline-size; }
.nd-hero h1 { font-size: min(var(--wp--preset--font-size--xx-large), 12.5cqi); overflow-wrap: normal; word-break: normal; hyphens: manual; }
/* На узком экране длинное слово заголовка («Технологические») шире колонки: переносим его по слогам, а не рвём
   посередине. Только слова от 10 букв и не короче 4 букв по краям переноса — «форум» не делится. */
@media (max-width: 600px) { h1 { hyphens: auto; hyphenate-limit-chars: 10 4 4; } }
.nd-hero .nd-lead { margin: 0 0 32px; }
.nd-hero__text { display: flex; flex-direction: column; justify-content: center; }
.nd-latest { position: relative; border-radius: 20px; overflow: hidden; min-height: 520px; height: 100%; background: var(--nd-soft); }
.nd-latest__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nd-latest__card { position: absolute; left: 20px; right: 20px; bottom: 20px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: #fff; color: var(--nd-ink); border-radius: 14px; padding: 18px 20px; text-decoration: none; box-shadow: 0 10px 30px rgba(20, 30, 45, .18); transition: transform .4s var(--nd-ease); }
.nd-latest__card:hover { transform: translateY(-3px); text-decoration: none; }
.nd-latest__date { font: 500 34px/1 var(--wp--preset--font-family--display); color: var(--nd-blue); text-align: center; }
.nd-latest__date small { display: block; font: 500 13px/1.3 var(--wp--preset--font-family--body); color: var(--nd-ink); }
.nd-latest__text small { display: block; font-size: 13px; color: var(--nd-muted); }
.nd-latest__text b { font: 500 19px/1.25 var(--wp--preset--font-family--display); }
.nd-latest__go { width: 44px; height: 44px; border-radius: 50%; background: var(--nd-soft); display: grid; place-items: center; color: var(--nd-blue); font-size: 20px; }

/* Хроника */
.nd-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.nd-filters button { appearance: none; border: 1.5px solid var(--nd-line); background: #fff; border-radius: 999px; padding: 9px 16px; font: 500 15px/1 var(--wp--preset--font-family--body); color: var(--nd-ink); cursor: pointer; transition: border-color .3s, color .3s; }
.nd-filters button:hover { border-color: var(--nd-blue); }
.nd-filters button[aria-pressed="true"] { border-color: var(--nd-blue); color: var(--nd-blue); }
.nd-timeline { position: relative; display: grid; gap: 28px; }
.nd-timeline::before { content: ""; position: absolute; left: 198px; top: 8px; bottom: 8px; width: 2px; background: color-mix(in srgb, var(--nd-blue) 30%, transparent); }
.nd-entry { display: grid; grid-template-columns: 200px 1fr; align-items: start; }
.nd-entry[hidden], .nd-filter-empty[hidden] { display: none; }
.nd-entry__when { position: relative; padding-right: 40px; text-align: right; }
.nd-entry__when::after { content: ""; position: absolute; right: -7px; top: 12px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--nd-blue); box-sizing: border-box; }
.nd-entry--soon .nd-entry__when::after { background: var(--nd-blue); }
.nd-entry__day { display: block; font: 500 44px/1 var(--wp--preset--font-family--display); }
.nd-entry__month { font-size: 16px; color: var(--nd-muted); }
.nd-entry__body { background: #fff; border-radius: var(--nd-radius); padding: 28px; margin-left: 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
.nd-entry--soon .nd-entry__body { border: 1.5px solid color-mix(in srgb, var(--nd-blue) 45%, transparent); }
.nd-entry__tag { display: inline-block; font-size: 14px; font-weight: 600; color: var(--nd-blue); margin-bottom: 8px; }
.nd-entry__tag a { color: inherit; }
.nd-entry h3 { margin: 0 0 10px; }
.nd-entry h3 a { color: var(--nd-ink); text-decoration: none; }
.nd-entry h3 a:hover { color: var(--nd-blue); }
.nd-entry p { margin: 0 0 12px; font-size: 17px; }
.nd-entry__text > p:not(.nd-entry__place) { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.nd-entry .nd-entry__place { font-size: 15px; color: var(--nd-muted); }
.nd-gal { display: grid; gap: 8px; aspect-ratio: 3 / 2; }
.nd-gal img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.nd-gal--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.nd-gal--3 img:first-child { grid-row: 1 / 3; }
.nd-gal--2 { grid-template-columns: 1fr 1fr; }
.nd-entry--next .nd-entry__when .nd-entry__month { font-weight: 600; color: var(--nd-blue); }
.nd-entry--next .nd-entry__when::after { background: var(--nd-soft); }
.nd-entry--next .nd-entry__body { display: block; background: transparent; border: 1.5px dashed color-mix(in srgb, var(--nd-blue) 45%, transparent); padding: 18px 24px; }
.nd-entry--next p { margin: 0; }
.nd-filter-empty { margin: 0 0 0 240px; color: var(--nd-muted); }
.nd-more { display: inline-flex; gap: 8px; margin-top: 28px; font-weight: 600; text-decoration: none; }
.nd-reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--nd-ease), transform .8s var(--nd-ease); }
.nd-reveal.is-in { opacity: 1; transform: none; }

/* Направления фонда с 3D */
.nd-dir > .wp-block-columns { gap: 48px; align-items: stretch !important; }
.nd-dir-stage { position: sticky; top: 14vh; height: 72vh; }
.nd-dir-stage canvas { width: 100%; height: 100%; display: block; }
.nd-dir.no-webgl .nd-dir-stage { display: none; }
.nd-dir h2 { margin: 0; }
.nd-dir-item { min-height: 54vh; display: flex; flex-direction: column; justify-content: center; gap: 10px; opacity: .35; transition: opacity .6s var(--nd-ease); }
.nd-dir-item.nd-dir-item--first { min-height: 44vh; justify-content: flex-start; padding-top: 40px; }
.nd-dir-item.is-on, .editor-styles-wrapper .nd-dir-item { opacity: 1; }
.nd-dir-item > * { margin: 0 !important; }
.nd-dir-item__label { font-size: 15px; font-weight: 600; color: var(--nd-blue); }
.nd-dir-item h3 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; }
.nd-dir-item p { max-width: 460px; }
.nd-dir-item a { font-weight: 600; text-decoration: none; }
.nd-dir.no-webgl .nd-dir-item { opacity: 1; min-height: 0; padding: 20px 0; }

/* Премия и номинации */
.nd-status { display: flex; gap: 14px; align-items: flex-start; background: #fff; border-radius: var(--nd-radius); padding: 20px 22px; margin: 0 0 24px; max-width: 520px; }
.nd-status__dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; flex: none; background: color-mix(in srgb, var(--nd-ink) 35%, transparent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--nd-ink) 8%, transparent); }
.nd-status.is-open .nd-status__dot { background: var(--nd-blue); box-shadow: 0 0 0 5px color-mix(in srgb, var(--nd-blue) 18%, transparent); }
.nd-status b { display: block; font-size: 18px; }
.nd-status span { font-size: 15px; color: var(--nd-muted); }
.nd-noms__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.nd-nom { display: flex; flex-direction: column; background: #fff; border-radius: var(--nd-radius); padding: 24px; color: var(--nd-ink); text-decoration: none; transition: transform .4s var(--nd-ease), box-shadow .4s; }
.nd-nom:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20, 30, 45, .08); text-decoration: none; }
.nd-nom__who { font-size: 13px; font-weight: 600; color: var(--nd-blue); }
.nd-nom h3 { font-size: 24px; margin: 8px 0; }
.nd-nom p { margin: 0; font-size: 16px; }
.nd-nom, .nd-status { border: 1.5px solid var(--nd-line); }
.nd-section--soft .nd-nom, .nd-section--soft .nd-status { border-color: transparent; }
.nd-nom--special { background: transparent; border: 1.5px solid color-mix(in srgb, var(--nd-blue) 35%, transparent); }
.nd-nom__open { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--nd-blue); }
.nd-doc { display: inline-flex; gap: 8px; margin-top: 24px; font-weight: 600; }

/* Цифры и партнёры */
.nd-facts > .wp-block-columns { border-top: 2px solid var(--nd-ink); gap: 0; }
.nd-fact { padding: 28px 24px 0 0; }
.nd-fact > * { margin: 0 !important; }
.nd-fact .nd-fact__num { font: 500 clamp(40px, 4.6vw, 64px)/1 var(--wp--preset--font-family--display); color: var(--nd-blue); margin-bottom: 12px !important; }
.nd-fact p:last-child { font-size: 16px; color: var(--nd-muted); }
.nd-partner { border: 1.5px solid var(--nd-line); border-radius: var(--nd-radius); padding: 22px 24px !important; height: 100%; }
.nd-partner > * { margin: 0 !important; }
.nd-partner p:first-child { font: 500 21px/1.25 var(--wp--preset--font-family--display); margin-bottom: 6px !important; }
.nd-partner p:last-child { font-size: 15px; color: var(--nd-muted); }

/* Заявка */
.nd-apply { background: var(--nd-ink); color: #fff; border-radius: 28px; margin: 0 clamp(0px, 2vw, 32px) 32px !important; }
.nd-apply h2 { color: #fff; margin: 0 0 16px; }
.nd-apply p { color: rgba(255, 255, 255, .82); }
.nd-apply a { color: #fff; font-weight: 600; }
.nd-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nd-form label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.nd-section-intro { margin-bottom: 32px; }
.nd-section-intro > * { margin-top: 0; }
.nd-section-intro h2 { margin-bottom: 20px; }
.nd-form input[type="text"], .nd-form input:not([type]), .nd-form input[type="tel"], .nd-form input[type="email"] { font: 400 18px/1.4 var(--wp--preset--font-family--body); padding: 13px 16px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); color: #fff; }
.nd-form input:focus-visible { outline: 2px solid #9cc3ea; outline-offset: 2px; }
.nd-form .nd-form__consent { grid-column: 1 / -1; flex-direction: row; align-items: flex-start; gap: 10px; color: rgba(255, 255, 255, .85); }
.nd-form__consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--nd-blue); }
.nd-form__foot { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.nd-apply .nd-form__msg { margin: 0; color: #cfe2f5; font-weight: 600; }
.nd-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.nd-req { color: #9cc3ea; margin-left: 2px; }
.nd-form button[disabled] { opacity: .6; cursor: progress; }

/* Подвал */
.nd-footer { display: flex; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 28px 0 48px; font-size: 16px; }
.nd-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nd-footer a { color: var(--nd-ink); }
.nd-footer .nd-footer__credit { width: 100%; display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--nd-muted); text-decoration: none; }
.nd-footer .nd-footer__credit span { text-decoration: underline; text-underline-offset: 3px; }
.nd-footer__zveno { flex: none; color: #e0574b; } /* цвет знака «Звено» с kredo.center */

/* Страницы мероприятия и номинации */
.nd-back { font-weight: 600; text-decoration: none; }
.nd-event-meta__line { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; color: var(--nd-muted); }
.nd-event-meta__line .nd-entry__tag { margin: 0; }
.nd-single .wp-block-gallery { margin-top: 32px; }
.nd-single .wp-block-gallery img { border-radius: 10px; }
.nd-nom-meta .nd-nom__who { margin: 0 0 16px; }
.nd-zoomable { cursor: zoom-in; transition: opacity .3s; }
.nd-zoomable:hover { opacity: .9; }
html.nd-lb-open { overflow: hidden; }
.nd-lb { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0f1218; color: #fff; overscroll-behavior: contain; touch-action: pan-y; }
.nd-lb::backdrop { background: #0f1218; }
.nd-lb[open] { display: grid; place-items: center; animation: nd-lb-in .3s var(--nd-ease); }
@keyframes nd-lb-in { from { opacity: 0; } to { opacity: 1; } }
.nd-lb__fig { margin: 0; width: 100%; height: 100%; display: grid; place-items: center; padding: 64px clamp(12px, 6vw, 96px); box-sizing: border-box; }
.nd-lb__img { max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 8px; user-select: none; -webkit-user-drag: none; }
.nd-lb__count { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font-size: 15px; color: rgba(255, 255, 255, .8); }
.nd-lb__btn { position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font: 400 32px/1 var(--wp--preset--font-family--body); cursor: pointer; display: grid; place-items: center; transition: background .3s; }
.nd-lb__btn:hover { background: rgba(255, 255, 255, .24); }
.nd-lb__btn:focus-visible { outline: 2px solid #9cc3ea; outline-offset: 3px; }
.nd-lb__btn[hidden] { display: none; }
.nd-lb__close { top: 16px; right: 16px; }
.nd-lb__prev { left: 16px; top: 50%; translate: 0 -50%; }
.nd-lb__next { right: 16px; top: 50%; translate: 0 -50%; }
@media (max-width: 600px) { .nd-lb__prev, .nd-lb__next { top: auto; bottom: 10px; translate: none; } .nd-lb__fig { padding: 56px 8px 72px; } }
.nd-videos { margin-top: 48px; }
.nd-videos .nd-videos__title { font-size: clamp(26px, 3vw, 36px); margin: 0 0 20px; }
.nd-videos__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.nd-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--nd-ink); }
.nd-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nd-videos .nd-videos__note { margin: 12px 0 0; font-size: 15px; color: var(--nd-muted); }

/* Узкие экраны */
@media (max-width: 980px) {
  .nd-latest { min-height: 420px; }
  .nd-timeline::before { left: 7px; }
  .nd-entry { grid-template-columns: 1fr; }
  .nd-entry__when { text-align: left; padding: 0 0 10px 32px; }
  .nd-entry__when::after { left: 0; right: auto; top: 10px; }
  .nd-entry__day { display: inline; font-size: 32px; margin-right: 8px; }
  .nd-entry__body { margin-left: 32px; grid-template-columns: 1fr; }
  .nd-filter-empty { margin-left: 32px; }
  .nd-dir-stage { position: relative; top: 0; height: 46vh; }
  .nd-dir-item, .nd-dir-item.nd-dir-item--first { min-height: 0; opacity: 1; padding: 18px 0; border-top: 1px solid var(--nd-line); justify-content: flex-start; }
  .nd-noms__grid { grid-template-columns: 1fr; }
  .nd-facts > .wp-block-columns { display: grid !important; grid-template-columns: 1fr 1fr; }
  .nd-form { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nd-latest { min-height: 360px; }
  .nd-latest__card { grid-template-columns: auto 1fr; left: 12px; right: 12px; bottom: 12px; }
  .nd-latest__go { display: none; }
  .nd-entry__body { padding: 20px; margin-left: 24px; }
  .nd-entry__when { padding-left: 24px; }
  .nd-apply { border-radius: 20px; margin: 0 0 16px !important; }
  .nd-hero .wp-block-buttons, .nd-hero .wp-block-button, .nd-hero .wp-block-button__link { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
