/*
Theme Name: HTML Landing Importer
Theme URI: http://indieman.com.ua
Description: A WordPress theme for importing static HTML pages into editable Gutenberg pages.
Version: 1.0.0
Author: IndieMan
Author URI: http://indieman.com.ua
Text Domain: landing-importer
*/

/* Базовые стили для сброса и стандартной разметки */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    background-color: #fff;
    line-height: 1.5;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* Скрытые элементы */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link:focus {
    background-color: #f1f1f1;
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    left: 5px;
    padding: 15px 23px;
    position: absolute;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Шапка сайта */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 9999;
    padding: 15px 0;
    transition: all 0.3s ease;
}

.site-branding-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo-wrap a {
    text-decoration: none;
    color: #1a1a1a;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Навигация (Десктоп) */
.main-navigation {
    display: flex;
    align-items: center;
}

/* Бургер-кнопка */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10000;
}

.burger-icon-line {
    width: 100%;
    height: 2px;
    background-color: #1f2937;
    transition: all 0.3s ease;
    transform-origin: left center;
}

.menu-toggle.active .burger-icon-line:nth-child(1) {
    transform: rotate(45deg) translateY(-2px);
}
.menu-toggle.active .burger-icon-line:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .burger-icon-line:nth-child(3) {
    transform: rotate(-45deg) translateY(2px);
}

/* Адаптивность мобильного меню (независимая от донора) */
@media (max-width: 991px) {
    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background-color: #fff !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1) !important;
        padding: 80px 30px 40px !important;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        overflow-y: auto !important;
        display: block !important;
        z-index: 9999 !important;
    }

    .main-navigation.active {
        right: 0 !important;
    }
    
    .main-navigation ul {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .main-navigation li {
        width: 100% !important;
        display: block !important;
        margin: 0 !important;
    }

    .main-navigation a {
        display: block !important;
        font-size: 1.1rem !important;
        border-bottom: 1px solid #f3f4f6 !important;
        padding-bottom: 10px !important;
        color: #1f2937 !important;
        text-align: left !important;
    }
}

/* Подвал сайта */
.site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 60px 0;
    border-top: 1px solid #1e293b;
    font-size: 0.9rem;
}

.site-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.footer-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav-menu a {
    text-decoration: none;
    color: #94a3b8;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-nav-menu a:hover {
    color: #38bdf8;
}

.site-info p {
    margin: 0;
    text-align: center;
}

/* Стили для полноценной темы (блог, архивы, записи и 404) */
.theme-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 60px 20px;
}

.theme-blog-layout {
    background-color: #f8fafc;
    min-height: 70vh;
}

.blog-post-article {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    padding: 50px;
    margin-bottom: 40px;
}

.entry-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.2;
}

.entry-meta {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
}

.post-thumbnail {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #334155;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

/* Сетка постов (архив) */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.blog-post-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.post-card-thumbnail img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.post-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-date {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

.post-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 15px 0;
    line-height: 1.3;
    transition: color 0.2s;
}

.post-card-title:hover {
    color: #6366f1;
}

.post-card-title-link {
    text-decoration: none;
}

.post-card-excerpt {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more-btn {
    text-decoration: none;
    color: #6366f1;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.read-more-btn:hover {
    color: #4f46e5;
}

.page-header {
    margin-bottom: 40px;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
}

/* Стили для страницы 404 */
.error-404-container {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 60vh;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    margin: 0;
    line-height: 1;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 10px;
    margin-bottom: 15px;
}

.error-message {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.back-home-btn {
    display: inline-block;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
    margin-top: 20px;
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.5);
    color: #fff;
}

.search-form-wrap {
    margin-bottom: 30px;
}

/* Сброс маркеров для динамических списков меню */
.site-header ul, 
.site-header li, 
#primary-menu, 
#primary-menu li,
.nav-menu, 
.nav-menu li,
.navbar-nav, 
.navbar-nav li,
.sub-menu, 
.sub-menu li {
    list-style: none !important;
    list-style-type: none !important;
    margin-image: none !important;
}

/* Сброс дефолтных отступов блоков Gutenberg на главной для сохранения верстки оригинального лендинга */
.home .entry-content > *,
.home .wp-block-group,
.home .wp-block-heading,
.home .wp-block-paragraph,
.home .wp-block-image,
.home .wp-block-group__inner-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    gap: 0 !important;
}

.home .wp-block-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Стили нативного мобильного хедера темы */
.native-mobile-header {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 99999;
    padding: 0 20px;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
}

.mobile-header-branding {
    display: flex;
    align-items: center;
}

.mobile-header-branding img {
    max-height: 36px !important;
    width: auto !important;
    object-fit: contain;
    display: block;
}

.mobile-header-branding svg {
    max-height: 36px !important;
    width: auto !important;
    display: block;
}

.mobile-header-branding a {
    display: flex;
    align-items: center;
    text-decoration: none;
    max-height: 36px;
}

.mobile-site-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-decoration: none;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#theme-mobile-menu-trigger {
    display: none;
    background: transparent;
    border: none;
    width: 24px;
    height: 18px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    padding: 0;
    z-index: 100000;
}

#theme-mobile-menu-trigger .mobile-burger-bar {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

#theme-mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#theme-mobile-menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
}

#theme-mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 999999 !important;
    pointer-events: auto !important;
}

#theme-mobile-menu-close:hover {
    color: #fff;
}

.mobile-logo-area {
    margin-bottom: 40px;
}

.mobile-site-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.mobile-navigation-wrap {
    width: 100% !important;
    text-align: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.mobile-menu-list-items {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.mobile-menu-list-items li {
    list-style: none !important;
    margin-bottom: 25px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
}

.mobile-menu-list-items li a {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #e2e8f0 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
    background: transparent !important;
    border: none !important;
    padding: 5px 15px !important;
    display: inline-block !important;
    border-radius: 8px !important;
}

.mobile-menu-list-items li a:hover {
    color: #f43f5e;
}

/* Нативный десктоп-хедер темы: скрыт по умолчанию */
.native-desktop-header-wrap {
    display: none;
}

/* Случай 1: нет импортированного хедера вообще */
body.no-imported-header .native-desktop-header-wrap {
    display: block;
}

/* Случай 2: импортированный хедер есть, но без навбара (Hero-блок) —
   показываем нативный навбар выше него */
body.imported-header-no-nav .native-desktop-header-wrap {
    display: block;
}

/* На мобайле нативный десктоп-хедер всегда скрыт (его заменяет native-mobile-header) */
@media (max-width: 991px) {
    body.no-imported-header .native-desktop-header-wrap,
    body.imported-header-no-nav .native-desktop-header-wrap {
        display: none !important;
    }
}

/* Отображение нативного мобильного хедера и скрытие импортированного */
@media (max-width: 991px) {
    .native-mobile-header {
        display: flex !important;
    }
    
    #theme-mobile-menu-trigger {
        display: flex !important;
    }
    
    #imported-header-container {
        display: none !important;
    }
}

/* Убираем наш контейнер из дерева отрисовки CSS, чтобы шапка наследовала оригинальное поведение (sticky, fixed или static) от сайта-донора */
@media (min-width: 992px) {
    #imported-header-container {
        display: contents;
    }
}

/* Горизонтальное меню в импортированном хедере (десктоп).
   WP генерирует <nav class="main-nav"><ul class="menu">...</ul></nav>.
   Оригинальный CSS мог быть инлайновым и не попасть в импорт.
   Этот блок гарантирует горизонтальный layout в любом случае. */
@media (min-width: 992px) {
    #imported-header-container nav > ul,
    #imported-header-container nav ul:first-child {
        display: flex !important;
        flex-direction: row !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: inherit;
    }

    #imported-header-container nav > ul > li,
    #imported-header-container nav ul:first-child > li {
        display: inline-flex !important;
        align-items: center !important;
        list-style: none !important;
    }
}

/* Стилизация выпадающих субменю для ПК (Desktop) */
@media (min-width: 992px) {
    .menu-item-has-children {
        position: relative;
    }

    /* Добавляем указатель (стрелочку) для родительских пунктов на ПК */
    .menu-item-has-children > a::after {
        content: ' \25BE'; /* Маленький треугольник вниз ▾ */
        font-size: 10px;
        margin-left: 5px;
        display: inline-block;
        vertical-align: middle;
        opacity: 0.7;
        transition: transform 0.2s ease;
    }

    .menu-item-has-children:hover > a::after {
        transform: rotate(180deg);
        opacity: 1;
    }
    
    /* Скрываем субменю по умолчанию на ПК */
    .menu-item-has-children .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 99999;
        display: none;
        min-width: 220px;
        background-color: #0f172a; /* Элегантный темный фон */
        padding: 10px 0;
        margin: 0;
        border-radius: 8px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.08);
        text-align: left;
    }
    
    /* Показываем при наведении */
    .menu-item-has-children:hover > .sub-menu,
    .menu-item-has-children:focus-within > .sub-menu {
        display: block;
    }
    
    /* Стили элементов выпадающего списка */
    .menu-item-has-children .sub-menu li {
        width: 100%;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }
    
    .menu-item-has-children .sub-menu li a {
        display: block;
        padding: 10px 20px;
        color: #94a3b8 !important;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        transition: background-color 0.2s, color 0.2s;
    }
    
    .menu-item-has-children .sub-menu li a:hover {
        background-color: #1e293b;
        color: #fff !important;
    }
    
    /* Скрываем мобильную кнопку раскрытия на ПК */
    .menu-item-has-children .dropdown-toggle {
        display: none !important;
    }
}

/* Стилизация выпадающих субменю для Мобильных устройств */
@media (max-width: 991px) {
    .menu-item-has-children {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }
    
    .menu-item-has-children > a {
        flex: 0 1 auto;
    }

    /* Мобильное субменю свернуто по умолчанию */
    .menu-item-has-children .sub-menu {
        display: none;
        width: 100%;
        padding-left: 20px !important;
        margin-top: 10px !important;
        list-style: none !important;
        text-align: center;
    }
    
    /* Разворачиваем субменю при добавлении класса активности */
    .menu-item-has-children.sub-menu-open > .sub-menu {
        display: block !important;
    }

    .menu-item-has-children .sub-menu li {
        margin-bottom: 12px !important;
        list-style: none !important;
    }

    .menu-item-has-children .sub-menu li a {
        font-size: 18px !important;
        font-weight: 600 !important;
        color: #64748b !important;
    }

    /* Кнопка переключения мобильного субменю */
    .menu-item-has-children .dropdown-toggle {
        display: inline-flex !important;
        background: rgba(255, 255, 255, 0.08);
        border: none;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #94a3b8;
        padding: 0;
        transition: transform 0.25s ease, background-color 0.2s;
    }

    .menu-item-has-children .dropdown-toggle::after {
        content: '\25BC'; /* Символ стрелочки вниз */
        font-size: 9px;
    }

    .menu-item-has-children.sub-menu-open .dropdown-toggle {
        transform: rotate(180deg);
        background-color: rgba(244, 63, 94, 0.2);
        color: #f43f5e;
    }

    /* Стили SVG логотипа на мобильных */
    .mobile-logo-link.svg-logo svg {
        max-height: 36px;
        width: auto;
        display: block;
    }
}

/* Десктопное меню по умолчанию (если на импортированном сайте не было меню) */
.native-desktop-nav {
    display: block;
    margin: 0 auto;
    padding: 0 15px;
    z-index: 10;
}

.native-desktop-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.native-desktop-menu li {
    position: relative;
}

.native-desktop-menu li a {
    font-size: 0.95rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s ease, color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.native-desktop-menu li a:hover {
    opacity: 1;
    color: #6366f1; /* Премиальный индиго-акцент */
}

/* ==========================================================================
   Internal Pages Framework (Blog, Page, Single, Archive)
   ========================================================================== */

/* Layout base for inner pages */
.internal-page-body {
    /* Background and color inherit from imported CSS */
}

/* Mini Hero Header (using IDs to override any imported CSS specificity) */
#li-internal-hero {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 120px 20px 60px 20px; /* Увеличен верхний паддинг, чтобы фиксированная шапка не перекрывала */
    text-align: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#li-internal-hero #li-hero-title {
    margin: 0 auto !important;
    font-size: 2.2rem !important;
    line-height: 1.3 !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    letter-spacing: -0.5px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    max-width: 900px !important;
    text-align: center !important;
    display: block !important;
}

/* Responsive Container */
.theme-container {
    max-width: 1280px; /* Увеличено для совпадения с шириной донора */
    margin: 0 auto;
    padding: 0 20px;
}

/* Content Area Styling */
.page-content, .entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.page-content p, .entry-content p {
    margin-bottom: 1.5em;
}

.page-content h2, .entry-content h2 {
    font-size: 2rem;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.page-content h3, .entry-content h3 {
    font-size: 1.5rem;
    margin-top: 1.25em;
    margin-bottom: 0.75em;
}

.page-content a, .entry-content a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
}

.page-content a:hover, .entry-content a:hover {
    opacity: 0.8;
}

/* Blog Post Specifics */
.theme-blog-layout .blog-post-article {
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 40px;
}

.theme-blog-layout .entry-meta {
    margin-bottom: 30px;
    font-size: 0.95rem;
    color: #94a3b8;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.theme-blog-layout .post-thumbnail {
    margin: -40px -40px 30px -40px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.theme-blog-layout .post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .internal-hero { padding: 40px 20px; }
    .internal-hero h1 { font-size: 2rem; }
    .theme-blog-layout .blog-post-article { padding: 25px; }
    .theme-blog-layout .post-thumbnail { margin: -25px -25px 20px -25px; }
}
