/* Port fixes: D7 system CSS classes the design relies on. */
.element-invisible,
.element-focusable {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  height: 1px;
  width: 1px;
}
.element-invisible.element-focusable:active,
.element-invisible.element-focusable:focus {
  position: static !important;
  clip: auto;
  overflow: visible;
  height: auto;
  width: auto;
}
/* D10 injects these wrappers; keep them out of the layout like D7. */
.js-form-item .form-required {
  color: inherit;
}
/* The measures search view must always span its container: after an AJAX
   refresh with an empty result the flex parent shrinks it, which breaks the
   full-bleed calc() margins of .measures-filters-bar. */
.view-measures-search {
  width: 100%;
}

/* ===== Горизонтальное меню внутренних страниц (белый фон, sticky) ===== */
.header-section {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
}
.header-section .navbar-custom {
  position: static;
  background: #fff;
}
.header-section .header-anchor-nav {
  display: flex;
  gap: .25rem;
  background: none;
  padding: 0;
  margin-top: 0;
  align-items: center;
}
.header-section .header-anchor-nav a {
  color: #10265c;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  border-bottom: none;
  transition: background .2s, color .2s;
}
.header-section .header-anchor-nav a:hover {
  background: #eef5ff;
  color: #0342a0;
}
.header-section .header-anchor-nav a.active {
  background: #0342a0;
  color: #fff;
}

/* ===== Страница авторизации ===== */
.page-user-login .login-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 9vh;
  background:
    radial-gradient(1200px 500px at 85% -10%, #dbe8ff 0%, rgba(219,232,255,0) 60%),
    #f5f8fd;
}
.page-user-login .login-card {
  width: min(440px, 92vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(16, 38, 92, 0.12);
  padding: 36px 38px 28px;
}
.page-user-login .login-logo img { height: 44px; }
.page-user-login .login-title {
  font-size: 26px; font-weight: 700; color: #10265c; margin: 18px 0 18px;
}
.page-user-login .form-item { margin-bottom: 14px; }
.page-user-login .form-item label { display: none; }
.page-user-login input.form-text, .page-user-login input.form-password {
  width: 100%; padding: 12px 14px; font-size: 15px; border: 1px solid #c9d8ef;
  border-radius: 10px; background: #fff; font-family: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.page-user-login input.form-text:focus, .page-user-login input.form-password:focus {
  border-color: #0342a0; box-shadow: 0 0 0 3px rgba(3, 66, 160, .12);
}
.page-user-login .description { font-size: .8rem; color: #6b7a90; margin-top: 6px; }
.page-user-login form button, .page-user-login form input[type=submit] {
  width: 100%; margin-top: 18px; padding: 12px 0; border: none; border-radius: 10px;
  background: #0342a0; color: #fff; font-size: 15px; font-weight: 600;
  letter-spacing: .3px; cursor: pointer; transition: background .2s;
}
.page-user-login form button:hover, .page-user-login form input[type=submit]:hover { background: #036; }
.page-user-login ul { list-style: none; padding: 0; margin: 14px 0 0; }
.page-user-login ul a { color: #2f7bff; text-decoration: none; font-size: .85rem; }
.login-back { display: block; margin-top: 16px; color: #6b7a90; text-decoration: none; font-size: .85rem; }
.login-back:hover { color: #2f7bff; }

/* ===== Заголовок страницы мер — как section-title на /projects ===== */
.view-measures-search .section-title { margin-bottom: 24px; }

/* ===== Страница меры поддержки (node--measures) — общий стиль сайта ===== */
.measure-top-banner-section { padding: 10px 0 20px; }
/* Категория мер (/measures/{machine_name}) — та же сетка карточек, что на /measures/all */
.taxonomy-measures-section { padding: 10px 0 60px; }
.taxonomy-measures-section .measure-back-links { margin-bottom: 16px; }
.taxonomy-measures-section .section-title { margin-bottom: 24px; }
.measure-back-links { display: flex; gap: 12px; flex-wrap: wrap; }
.measure-top-banner-section .measure-back-links { margin-bottom: 16px; }
.measure-back-link {
  display: inline-flex; align-items: center;
  padding: 8px 24px; border-radius: 20px; border: 1px solid #E5E7EB; background: #fff;
  color: #333; font-size: 14px; font-weight: 500; text-decoration: none;
  transition: border-color .2s, color .2s;
}
.measure-back-link:hover { border-color: var(--btn-blue, #0169E2); color: var(--btn-blue, #0169E2); }

.project-banner.measure-banner {
  min-height: 0; display: block; padding: 40px;
  background: linear-gradient(374deg, #0342a0 0%, #0f49b0 100%);
}
.project-banner.measure-banner .project-banner-title {
  font-size: 40px; margin: 16px 0 24px; max-width: 1100px;
}
.project-banner.measure-banner .card-badge { border-radius: 999px; }

.measure-content-section { padding: 10px 0 60px; }
.measure-section-block { margin-bottom: 32px; }
.measure-section-title {
  font-family: 'Onest', sans-serif; font-size: 28px; font-weight: 700;
  margin: 0 0 16px; color: #333;
}
.measure-text { font-size: 16px; line-height: 1.65; max-width: 960px; }
.measure-text p { margin: 0 0 12px; }
.measure-text p:last-child { margin-bottom: 0; }
.measure-text ul, .measure-text ol { margin: 0 0 12px; padding-left: 22px; }
.measure-text a { color: var(--btn-blue, #0169E2); }

.measure-accordion {
  border: 1px solid #E5E7EB; border-radius: 12px; background: #fff;
  margin-bottom: 12px; overflow: hidden;
}
.measure-accordion summary {
  list-style: none; cursor: pointer; padding: 18px 24px;
  font-family: 'Onest', sans-serif; font-size: 18px; font-weight: 600; color: #333;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  transition: background .2s;
}
.measure-accordion summary::-webkit-details-marker { display: none; }
.measure-accordion summary::after {
  content: '+'; flex: none; font-size: 26px; font-weight: 400; line-height: 1;
  color: var(--btn-blue, #0169E2); transition: transform .2s ease;
}
.measure-accordion[open] summary::after { transform: rotate(45deg); }
.measure-accordion summary:hover { background: #f7faff; }
.measure-accordion .measure-accordion-body { padding: 0 24px 20px; }

.measure-bottom-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-top: 36px;
}
.measure-print-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 24px; border-radius: 20px; border: 1px solid #E5E7EB; background: #fff;
  color: #333; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.measure-print-btn:hover { border-color: var(--btn-blue, #0169E2); color: var(--btn-blue, #0169E2); }

@media (max-width: 767px) {
  .project-banner.measure-banner { padding: 24px; }
  .project-banner.measure-banner .project-banner-title { font-size: 26px; margin: 12px 0 16px; }
  .measure-section-title { font-size: 22px; }
  .measure-bottom-bar { flex-direction: column; align-items: flex-start; }
}

/* ===== Плавающая кнопка «Панель управления» (модераторы) ===== */
.moderator-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; background: #0342a0; color: #fff;
  font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none;
  box-shadow: 0 6px 18px rgba(3, 66, 160, .35);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.moderator-fab:hover { background: #003366; color: #fff; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(3, 66, 160, .45); }
.moderator-fab::before {
  content: ''; width: 16px; height: 16px; flex: none;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z'/%3E%3C/svg%3E") no-repeat center / contain;
}
@media (max-width: 767px) {
  .moderator-fab { right: 16px; bottom: 16px; padding: 12px 16px; }
}

/* ===== Иконка авторизации в меню ===== */
.header-anchor-nav a.header-auth {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%; padding: 0; flex: none;
  border: 1px solid rgba(16, 38, 92, .25); color: #10265c;
  transition: border-color .2s, color .2s, background .2s;
}
.header-anchor-nav a.header-auth svg {
  width: 15px; height: 15px; display: block;
}
/* color on both levels: base theme sets * { color: #333 } — a direct rule beats inheritance */
.header-anchor-nav a.header-auth svg,
.header-anchor-nav a.header-auth svg path {
  color: inherit;
}
.header-anchor-nav a.header-auth:hover {
  border-color: #2f7bff; color: #2f7bff; background: #eef5ff;
}
.hero-section .header-anchor-nav a.header-auth {
  border-color: rgba(255,255,255,.55); color: #fff;
}
.hero-section .header-anchor-nav a.header-auth:hover {
  background: rgba(255,255,255,.15); color: #fff;
}
.navbar-custom.sticky-fixed .header-anchor-nav a.header-auth {
  border-color: rgba(255,255,255,.6); color: #fff;
}

/* ===== Внутренние страницы: мобильное меню за бургером ===== */
@media (max-width: 991.98px) {
  .header-section .burger-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    transform: none;
    padding: 8px;
  }
  .header-section .burger-toggle span {
    display: block; width: 22px; height: 2px;
    background: #10265c; border-radius: 2px;
  }
  .header-section .burger-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .header-section .burger-toggle.active span:nth-child(2) { opacity: 0; }
  .header-section .burger-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .header-section .header-anchor-nav {
    display: none;
    position: absolute;
    top: 100%; left: 12px; right: 12px;
    z-index: 1040;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 14px 30px rgba(16, 38, 92, 0.18);
  }
  .header-section .header-anchor-nav.open { display: flex; }
  .header-section .header-anchor-nav a { padding: 9px 4px; border-radius: 0; border-bottom: 1px solid #eef2f8; }
  .header-section .header-anchor-nav a:hover { background: none; color: #0342a0; }
  .header-section .header-anchor-nav a.active { background: none; color: #0342a0; }
  .header-section .header-anchor-nav a:last-of-type { border-bottom: none; }
}
