/* СБРОС И БАЗА */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #111827;
    background: #0b1624;
}

/* Ссылки */

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Контейнер */

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ШАПКА САЙТА */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #020617;
    border-bottom: 1px solid #111827;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 0;
}

/* Логотип */

.logo img {
    display: block;
    height: 40px;
    width: auto;
}

@media (min-width: 992px) {
    .logo img {
        height: 44px;
    }
}

/* Навигация */

.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.nav a {
    color: #e5e7eb;
    white-space: nowrap;
}

.nav a:hover {
    color: #60a5fa;
    text-decoration: none;
}

.nav-phone {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    font-weight: 600;
}

/* Бургер */

.nav-toggle {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: transparent;
    padding: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #e5e7eb;
    position: relative;
    transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-toggle span::before {
    top: -5px;
}

.nav-toggle span::after {
    top: 5px;
}

/* состояние "открыто" для бургера – скрипт вешает nav-open */

.nav-toggle.nav-open span {
    transform: rotate(45deg);
}

.nav-toggle.nav-open span::before {
    transform: rotate(-90deg);
    top: 0;
}

.nav-toggle.nav-open span::after {
    opacity: 0;
}

/* Адаптив меню */

@media (max-width: 900px) {
    .nav {
        position: absolute;
        inset: 56px 0 auto 0;
        background: #020617;
        padding: 12px 16px 16px;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px 16px;
        display: none;
        border-bottom: 1px solid #111827;
    }

    /* Ваш script.js вешает nav-open на #mainNav */
    .nav.nav-open {
        display: flex;
    }

    .nav-toggle {
        display: inline-flex;
    }
}

/* ОБЩИЕ СЕКЦИИ */

section {
    padding: 50px 0;
    background: #f9fafb;
}

section:nth-of-type(odd):not(.hero) {
    background: #f3f4f6;
}

.section-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #0f172a;
}

.section-sub {
    margin: 0 0 24px;
    font-size: 17px;
    color: #4b5563;
}

/* КАРТОЧКИ, СЕТКИ, ТЭГИ */

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 20px 18px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    border: 1px solid #e5e7eb;
}

.card-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

/* Блок для фото в карточках */

.card-media {
    margin-bottom: 12px;
}

.card-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

/* Баннер секции "Кому подходит" */

.who-banner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    background: #020617;
}

.who-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* Светлый градиент по низу фото */

.who-banner::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    background: linear-gradient(
        to top,
        rgba(243, 244, 246, 1),
        rgba(243, 244, 246, 0.20),
        rgba(243, 244, 246, 0.0)
    );
    z-index: 0;
}

.who-banner-overlay {
    position: absolute;
    z-index: 1;
    left: 24px;
    right: 24px;
    bottom: 32px;
    max-width: 720px;
    padding: 10px 16px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
}

.who-banner-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}

.who-banner-subtitle {
    font-size: 15px;
    margin: 0;
}

/* СЕТКИ */

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.money-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 960px) {
    .grid-3,
    .grid-2,
    .money-layout {
        grid-template-columns: 1fr;
    }
}

.tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: #e0f2fe;
    color: #0369a1;
}

/* КНОПКИ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: #2563eb;
    color: #f9fafb;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: transparent;
    border: 1px solid #9ca3af;
    color: #e5e7eb;
}

.btn-outline:hover {
    background: rgba(148, 163, 184, 0.12);
    text-decoration: none;
}

.btn-light {
    background: #f9fafb;
    color: #111827;
    border: none;
}

.btn-light:hover {
    background: #e5e7eb;
}

/* ГЛАВНЫЙ БЛОК HERO */

.hero {
    background: #0b1624;
    color: #f9fafb;
    padding: 48px 0 40px;
}

/* Фото баннер */

.hero-banner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
    background: #020617;
}

.hero-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* затемнение по низу фото */

.hero-banner::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50%;
    background: linear-gradient(
        to top,
        rgba(5, 11, 20, 0.85),
        rgba(5, 11, 20, 0.35),
        rgba(5, 11, 20, 0)
    );
    z-index: 0;
}

/* плашка с текстом поверх градиента */

.hero-banner-overlay {
    position: absolute;
    z-index: 1;
    left: 24px;
    right: 24px;
    bottom: 32px;
    color: #ffffff;
    max-width: 720px;
    padding: 10px 16px 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
}

.hero-banner-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.hero-banner-subtitle {
    font-size: 15px;
    line-height: 1.4;
}

.hero-banner-title,
.hero-banner-subtitle {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

@media (min-width: 768px) {
    .hero-banner-title {
        font-size: 26px;
    }

    .hero-banner-subtitle {
        font-size: 16px;
    }
}

/* Контент под баннером */

.hero-inner {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

@media (max-width: 960px) {
    .hero-inner {
        flex-direction: column;
    }
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.hero-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #1e293b;
}

/* инфо баннер */

.info-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    background: #0f172a;
    border: 1px solid #1f2937;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
}

.info-banner-main {
    flex: 1 1 220px;
}

.info-banner-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.info-banner-text {
    font-size: 14px;
    color: #e5e7eb;
}

.info-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-title {
    font-size: 26px;
    font-weight: 800;
    margin: 8px 0 8px;
}

.hero-subtitle {
    margin: 0 0 16px;
    font-size: 17px;
    color: #e5e7eb;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 16px 0 12px;
}

.hero-note {
    font-size: 14px;
    color: #cbd5f5;
    margin-bottom: 16px;
}

/* три блока с выплатами */

.hero-numbers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.hero-number-card {
    background: #f9fafb;
    color: #111827;
    padding: 14px 14px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.hero-number-main {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.hero-number-label {
    font-size: 17px;
    color: #4b5563;
}

@media (max-width: 900px) {
    .hero-numbers {
        grid-template-columns: 1fr;
    }
}

/* правый столбец */

.hero-right {
    max-width: 360px;
    flex: 0 0 360px;
}

@media (max-width: 960px) {
    .hero-right {
        max-width: 100%;
        flex: 1 1 auto;
    }
}

.hero-right-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-list {
    margin: 0 0 12px;
    padding-left: 18px;
    font-size: 16px;
}

.hero-list li {
    margin-bottom: 4px;
}

.hero-small {
    font-size: 16px;
    color: #cbd5e1;
}

/* СПИСКИ, ВЫПЛАТЫ */

.list {
    margin: 0;
    padding-left: 18px;
    font-size: 16px;
    color: #111827;
}

.list li {
    margin-bottom: 6px;
}

.payout-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.payout-name {
    font-size: 15px;
    color: #374151;
}

.payout-value {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.payout-note {
    margin-top: 10px;
    font-size: 14px;
    color: #6b7280;
}

/* ФОРМЫ */

.form-row {
    margin-bottom: 10px;
}

.form-row label {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 15px;
    font-family: inherit;
}

.form-row textarea {
    min-height: 80px;
    resize: vertical;
}

.form-note {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 10px;
}

/* FAQ */

#faq {
    background: #f9fafb;
}

.faq-item {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
    background: #ffffff;
    overflow: hidden;
}

.faq-q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

.faq-q span:last-child {
    font-size: 18px;
    line-height: 1;
    margin-left: 8px;
}

.faq-a {
    padding: 0 14px 12px;
    font-size: 15px;
    color: #4b5563;
    display: none;
}

.faq-item.open .faq-a {
    display: block;
}

.faq-item.open .faq-q span:last-child {
    transform: rotate(45deg);
}

/* НИЖНЯЯ ПЛАНКА С КНОПКАМИ */

.bottom-bar {
    position: sticky;
    bottom: 0;
    z-index: 900;
    background: rgba(15, 23, 42, 0.96);
    border-top: 1px solid #1f2937;
    backdrop-filter: blur(10px);
}

.bottom-bar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #e5e7eb;
    font-size: 14px;
}

.bottom-bar-text {
    flex: 1 1 auto;
}

.bottom-bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 768px) {
    .bottom-bar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .bottom-bar-actions {
        justify-content: stretch;
    }

    .bottom-bar-actions .btn {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* ПОДВАЛ */

.site-footer {
    background: #020617;
    color: #9ca3af;
    padding: 32px 0 40px;
    border-top: 1px solid #111827;
    margin-top: 40px;
}

.footer-grid {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.footer-links a {
    color: #e5e7eb;
}

.footer-links a:hover {
    color: #60a5fa;
    text-decoration: none;
}

.logo-footer img {
    height: 32px;
    width: auto;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .footer-grid {
        flex-direction: column;
    }
}

/* МОДАЛЬНОЕ ОКНО */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 16px;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    max-width: 420px;
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.45);
    padding: 18px 18px 16px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modal-body {
    font-size: 14px;
}

/* АДАПТИВНЫЙ ТЕКСТ И ОТСТУПЫ НА МОБИЛЬНЫХ */

@media (max-width: 768px) {
    section {
        padding: 40px 0;
    }

    .hero {
        padding-top: 80px;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-subtitle,
    .section-sub,
    .card p,
    .list,
    .hero-list,
    .hero-small,
    .faq-a,
    .payout-name,
    .payout-value,
    .bottom-bar-text {
        font-size: 18px;
    }

    .hero-note,
    .form-note,
    .payout-note {
        font-size: 17px;
    }
}

/* МОБИЛЬНОЕ ПОВЕДЕНИЕ ПЛАШКИ HERO */

@media (max-width: 768px) {

    .hero-banner {
        overflow: visible;        /* плашка выходит за границы фото */
        margin-bottom: 130px;     /* место под плашку */
    }

    .hero-banner-overlay {
        left: 16px;
        right: 16px;
        bottom: -130px;           /* плашка опускается ниже фото */
        max-width: none;
        padding: 10px 14px 12px;
        border-radius: 16px;
    }
}

/* МОБИЛЬНОЕ ПОВЕДЕНИЕ ПЛАШКИ "КОМУ ПОДХОДИТ" */

@media (max-width: 768px) {

    .who-banner {
        overflow: visible;
        margin-bottom: 90px;
    }

    .who-banner-overlay {
        left: 16px;
        right: 16px;
        bottom: -60px;
        max-width: none;
        padding: 10px 14px 12px;
        border-radius: 16px;
    }

    .who-banner-title {
        font-size: 19px;
    }

    .who-banner-subtitle {
        font-size: 15px;
    }
}

/* БЛОК МАТЕРИАЛОВ О СЛУЖБЕ ПО КОНТРАКТУ */

#materials {
    /* фон в общем стиле секций, отдельный не задаем */
}

.materials-list {
    margin-top: 16px;
}

.materials-list ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.materials-list li {
    margin-bottom: 8px;
    font-size: 16px;
}

.materials-list a {
    color: #2563eb;
}

.materials-list a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.materials-more {
    margin-top: 16px;
}

/* Карточки материалов на лендинге */

.materials-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 1023px) {
    .materials-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .materials-cards {
        grid-template-columns: 1fr;
    }
}

.materials-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.materials-card-image img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
}

@media (max-width: 767px) {
    .materials-card-image img {
        height: 180px;
    }
}

.materials-card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.materials-card-tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    margin-bottom: 8px;
}

.materials-card-title {
    font-size: 18px;
    line-height: 1.35;
    margin: 0 0 8px;
    color: #0f172a;
}

.materials-card-title a {
    color: inherit;
    text-decoration: none;
}

.materials-card-title a:hover {
    text-decoration: underline;
}

.materials-card-date {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
}

.materials-card-intro {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

/* Контент внутренних страниц (материалы, категории и т.п.) */

.page-main {
    background: #f9fafb;
    color: #111827;
    padding: 64px 0 96px;
}

/* Контейнер с компонентом Joomla на внутренних страницах */

.page-main .page-component {
    max-width: 960px;
    margin: 0 auto;
}

/* На всякий случай принудительно задаем цвет тексту внутри компонента */

.page-main h1,
.page-main h2,
.page-main h3,
.page-main h4,
.page-main h5,
.page-main h6,
.page-main p,
.page-main li,
.page-main dl,
.page-main dt,
.page-main dd,
.page-main time {
    color: #111827;
}

/* Убираем возможные серые подложки у блоков информации о материале */

.page-main .com-content-article__body,
.page-main .page-header,
.page-main .article-info {
    background: transparent;
}

/* Архив материалов "Публикации в СМИ" */

.materials-archive {
    padding: 40px 0 60px;
}

.page-component .materials-archive {
    max-width: 1200px;
    margin: 0 auto;
}

.materials-archive-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
}

/* 2 колонки на планшетах */

@media (min-width: 768px) {
    .materials-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 3 колонки на десктопе */

@media (min-width: 1024px) {
    .materials-archive-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.materials-archive-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Картинка карточки */

.materials-archive-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 18px;
}

/* Дата под изображением */

.materials-archive-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.materials-archive-date {
    white-space: nowrap;
}

/* Заголовок и анонс */

.materials-archive-title {
    margin-top: 8px;
    font-size: 18px;
}

.materials-archive-title a {
    color: inherit;
    text-decoration: none;
}

.materials-archive-title a:hover {
    text-decoration: underline;
}

.materials-archive-intro {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Пагинация (на будущее) */

.materials-archive-pagination {
    margin-top: 32px;
    text-align: center;
}

/* Блок документов: фото слева, текст справа, без размытия в стилях */

.card-docs .docs-layout {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.card-docs .docs-media {
    position: relative;
    flex: 0 0 52%;
    max-width: 52%;
    margin-bottom: 0;
    border-radius: 18px;
    overflow: hidden;
}

.card-docs .docs-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-docs .docs-content {
    flex: 1 1 auto;
    position: relative;
    margin-left: -72px;
    padding-left: 24px;
    z-index: 1;
}

/* Адаптив для блока документов */

@media (max-width: 768px) {
    .card-docs .docs-layout {
        flex-direction: column;
    }

    .card-docs .docs-media {
        max-width: 100%;
        margin-bottom: 0;
    }

    .card-docs .docs-content {
        margin-left: 0;
        padding-left: 0;
        margin-top: -32px;  /* текст немного заходит на фото снизу */
        padding-top: 8px;
        position: relative;
        z-index: 1;
}

/* Большое модальное окно для изображений */

.modal-large {
    max-width: 800px;
}

.modal-large .modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

.image-preview {
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}