/*
Theme Name: Butterfly
Description: Butterfly Theme
Version: 1.2.1
*/

:root {
    --custom-clr-text: #1a1a1a;
    --custom-clr-text-hover: #e5a819;
    --custom-clr-accent: #e5a819;
    --custom-current-opacity: 0.7;
}

@media (prefers-color-scheme: dark) {
    :root {
        --custom-clr-text: #ffffff;
    }
    .footer-section p, .footer-section li a {
        color: #bfbfbf;
    }
}

header {
    display: flex;
    align-items: flex-end;
    padding: 20px 0;
    width: 90%;
    max-width: 1400px;
    justify-content: space-between;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.custom-logo {
    font-weight: bold;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.custom-logo img {
    width: 200px;
    height: auto;
}

.custom-logo span {
    display: inline-block;
    position: absolute;
    background: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.mobile-menu-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

nav a {
    padding: 0 8px;
}

.multilevel-nav {
    position: absolute;
    left: calc((100% - 795px) / 2);
    bottom: 15px;
}

.multilevel-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    max-width: 100%;
}

.multilevel-menu > li {
    position: relative;
    padding: 0 10px;
    margin-bottom: 0;
}

.multilevel-menu > li > a {
    padding: 0 2px 2px;
    font-size: 18px;
}

.multilevel-menu > .current-menu-item > a, .multilevel-menu > .current-menu-ancestor > a {
    font-weight: bold;
    color:  var(--custom-clr-accent);
}

.current-menu-ancestor .current-menu-item > a {
    color:  var(--custom-clr-accent);
}

.multilevel-menu a {
    display: block;
    text-decoration: none;
    color: var(--custom-clr-text);
    transition: all 0.3s ease;
}

.multilevel-menu a:hover {
    opacity: var(--custom-current-opacity);
    color: var(--custom-clr-text-hover);
}

.multilevel-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    min-width: 220px;
    background: #000000; /* Automatic set with JS */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.submenu-level-2 {
    top: 100%;
    left: 0;
}

.submenu-level-3 {
    top: 0;
    left: 100%;
}

.multilevel-menu > li:hover > ul,
.multilevel-menu li.has-submenu:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.multilevel-menu ul li:last-child {
    border-bottom: none;
}

.multilevel-menu ul a {
    background: #000000; /* Automatic set with JS */
    padding: 10px 20px;
    line-height: 1.3;
}

.multilevel-menu ul a:hover {
    opacity: var(--custom-current-opacity);
}

.submenu-toggle {
    position: absolute;
    right: 8px;
    top: calc(50% - 12px);
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.menu-item-has-children{
    position: relative;
}

.toggle-icon {
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.submenu-toggle[aria-expanded="true"] .toggle-icon {
    display: none;
}

.submenu-toggle:focus {
    outline: none;
}

@media (max-width: 1240px) {
    .multilevel-menu {
        flex-direction: column;
        gap: 2px;
    }

    .multilevel-menu ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #000000; /* Automatic set with JS */
        /*margin-left: 20px;*/
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .multilevel-menu ul[data-level] {
        display: none;
    }

    .multilevel-menu ul.mobile-open {
        display: block;
        max-height: 1000px !important;
    }

    .submenu-toggle {
        display: flex;
    }

    .multilevel-menu ul a {
        background: none;
    }

    .multilevel-menu a:hover {
        background: #f8f9fa;
        color: #333;
    }

    .multilevel-menu ul a:hover {
        background: #f8f9fa;
        color: #333;
    }
}

@media (min-width: 769px) {
    .submenu-toggle {
        display: none;
    }

    .multilevel-menu ul {
        display: block !important;
    }
}

.burger-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 49px;
    height: 48px;
    padding: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 8px;
    z-index: 1002;
    margin-right: 0;
    border: 2px solid var(--custom-clr-accent);
}

.burger-line {
    display: block;
    height: 4px;
    width: 100%;
    background: var(--custom-clr-text);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger-menu-toggle[aria-expanded="true"] .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 6px);
}

.burger-menu-toggle[aria-expanded="true"] .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu-toggle[aria-expanded="true"] .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -5px);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1460px) {

    .breadcrumbs-container .breadcrumbs {
        border-top: 0;
    }

    
    main[data-content] {
        padding-top: 20px;
    }

    header {
        display: flex;
        align-items: flex-end;
        padding: 10px 5%;
        width: 100%;
        max-width: 100%;
        justify-content: space-between;
        margin-left: auto;
        margin-right: auto;
        align-items: center;
        border-bottom: 1px solid #ccc;
    }

    .custom-logo {
        font-size: 13px;
    }

    .custom-logo img {
        height: 48px;
        width: auto;
        max-width: none;
    }

    .custom-logo span {
        display: none;
    }

    .burger-menu-toggle {
        display: flex;
    }

    .mobile-menu-wrapper {
        position: relative;
        display: flex;
        align-items: flex-end;
        justify-content: end;
        margin-right: 0;
        margin-top: 0;
        min-height: 40px;
    }

    .multilevel-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: #000000; /* Automatic set with JS */
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
        padding: 100px 10px 20px;
    }

    .multilevel-nav.mobile-open {
        left: 0;
    }

    .multilevel-menu {
        flex-direction: column;
    }
    .multilevel-menu a {
        display: inline-block;
    }
}

@media (min-width: 1241px) {
    .mobile-menu-overlay {
        display: none !important;
    }
}

.container.breadcrumbs-container {
    padding: 0;
    margin-bottom: 2rem;
}

.breadcrumbs {
    font-size: 14px;
    padding: 10px 40px 10px 0;
    display: inline-flex !important;
    flex-wrap: wrap;
    max-width: 75rem;
    margin: 0 auto;
    border-top: 1px solid #ccc;
    margin-top: 2em;
}

.breadcrumbs ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs a {
    color: var(--custom-clr-text);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0;
}

.breadcrumbs a:hover {
    opacity: var(--custom-current-opacity);
    text-decoration: underline;
}

.breadcrumbs .current {
    opacity: var(--custom-current-opacity);
    font-weight: 500;
    padding: 0;
}

.breadcrumbs .breadcrumb-separator,
.breadcrumbs .separator {
    margin: 0 8px;
    color: var(--custom-clr-text);
    opacity: var(--custom-current-opacity);
}

.breadcrumbs .home {
    font-weight: 500;
}

@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 12px;
        margin: 15px 0;
    }

    .breadcrumbs .separator {
        margin: 0 5px;
    }
}

.footer-navigation {
    margin: 0;
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu li {
    margin: 0;
}
/*
.footer-menu a {
    color: var(--custom-clr-text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    opacity: var(--custom-current-opacity);
    text-decoration: underline;
}
*/
@media (max-width: 768px) {
    .footer-menu {
        flex-direction: column;
        gap: 15px;
    }

    .footer-menu a {
        font-size: 16px;
    }
}

.max-100 {
    max-width: 100%;
    height: auto;
    padding-bottom: 16px;
}

img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

/* TEST */
.site-footer {
    background: linear-gradient(135deg, #1a3a1a 0%, #0d1f0d 100%);
    color: #e0e0e0;
    padding: 40px 20px 20px;
    border-top: 5px solid #ffcc00;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3, .footer-section p.h3  {
    color: var(--custom-clr-accent);
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 8px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 5px;
}

.footer-section a {
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
}

.footer-section p {
    font-size: 14px;
}

.footer-section a:hover {
    color: var(--custom-clr-text-hover);
}

.footer-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-navigation a {
    text-decoration: none;
    transition: all 0.3s ease;
    align-items: center;
    color: #1A1A1A;
}

.footer-navigation a:hover {
   color: var(--custom-clr-accent);
}


.warning-section a {
    color: var(--custom-clr-accent);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
}

.footer-bottom p {
    line-height: 1.6;
    text-align: center;
}

.copyright {
    margin-top: 15px;
    font-size: 0.85rem;
}

.footer-container nav a {
        padding: 0;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .footer-container {
        grid-template-columns: 1fr;
    }

    .site-footer {
        padding: 30px 15px 15px;
    }
    .footer-section h3 {
        margin-bottom: 0;
    }
}

.table-of-contents {
    background-color: rgba(0, 0, 0, 0);
    padding: 20px;
    margin: 20px 0;
}

.table-of-contents h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.toc-list {
    margin: 0;
    padding-left: 20px;
}

.toc-list li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.toc-list a {
    text-decoration: none;
}

.toc-list a:hover {
    text-decoration: underline;
}

footer ul { padding-left: 0px; }
footer a { color: unset; }
@media (min-width: 1000px) and (max-width: 1200px) {
    .multilevel-menu a {
        font-size: 13px;
    }
}

.back-to-top {
    background: #fff;
    color: var(--custom-clr-accent);
    border-color: var(--custom-clr-accent);
    text-decoration: none;
    font-weight: bold;
    width: 40px;
    display: flex;
    height: 40px;
    align-items: center;
    justify-content: center;
    position: fixed;
    border-radius: 50%;
    border: 2px solid;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.wp-lightbox-overlay .close-button {
    right: 16px !important;
    top: 16px !important;
}
@supports (top: calc(env(safe-area-inset-top) + 16px)) {
    .wp-lightbox-overlay .close-button {
        right: calc(env(safe-area-inset-right) + 16px);
        top: calc(env(safe-area-inset-top) + 16px);
    }
}

@media (max-width: 760px) {
    header {
        padding: 10px 1.25rem;
    }
}

 .simple-sitemap {
            max-width: 800px;
            margin: 0 auto;
            padding: 40px 20px;
        }

        .sitemap-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .sitemap-header h1 {
            font-size: 2.2rem;
            color: #333;
            margin-bottom: 10px;
        }

        .sitemap-header p {
            color: #666;
            font-size: 1rem;
            margin: 0;
        }

        .simple-links-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 40px;
        }

        .simple-page-link {
            display: block;
            font-size: 1.1rem;
            color: #2c3e50;
            text-decoration: none;
            padding: 12px 20px;
            background: #f8f9fa;
            border-radius: 6px;
            border-left: 4px solid #3498db;
            transition: all 0.3s ease;
        }

        .simple-page-link:hover {
            background: #e3f2fd;
            color: #3498db;
            transform: translateX(5px);
        }

        .sitemap-stats {
            text-align: center;
            padding: 20px 0;
            color: #666;
            font-size: 0.95rem;
            border-top: 1px solid #e0e0e0;
            border-bottom: 1px solid #e0e0e0;
            margin-bottom: 30px;
        }

        .sitemap-footer {
            text-align: center;
            color: #888;
            font-size: 0.9rem;
        }

        .no-pages {
            text-align: center;
            padding: 40px;
            color: #666;
            font-size: 1.1rem;
            background: #f9f9f9;
            border-radius: 8px;
            margin: 40px 0;
        }

        @media (max-width: 768px) {
            .simple-sitemap {
                padding: 30px 15px;
            }

            .sitemap-header h1 {
                font-size: 1.8rem;
            }

            .simple-page-link {
                padding: 10px 15px;
                font-size: 1rem;
            }
        }

.page-template.page-template-articles main {
    max-width: 1200px;
}
.articles-sitemap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.sitemap-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sitemap-header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.sitemap-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    margin: 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.article-card {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    overflow: hidden;
    min-height: 300px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-left: unset !important;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.0) 100%);
    z-index: 1;
}

.article-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.article-card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
    color: #fff;
    padding: 1rem;
}

.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.article-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

.article-link:hover {
    opacity: 0.8;
}

.article-card-header {
    padding-bottom: 0;
}

.article-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    opacity: 0.9;
}

.article-children {
    margin-top: auto;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.children-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.child-item {
    margin: 0;
}

.child-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s;
}

.child-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(5px);
}

.child-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.child-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.grandchildren-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 52px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grandchild-item {
    margin: 0;
}

.grandchild-item a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s;
    display: block;
}

.grandchild-item a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.article-card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.article-date {
    font-style: italic;
}

.has-thumbnail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.has-thumbnail svg {
    opacity: 0.8;
    transition: opacity 0.3s;
}

.has-thumbnail:hover svg {
    opacity: 1;
}

.sitemap-footer {
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.articles-count,
.last-updated {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #64b5f6;
}

.no-articles {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    margin: 40px 0;
}

.no-articles p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .articles-sitemap {
        padding: 0px 15px 30px;
    }

    .sitemap-header {
        margin-bottom: 0px;
    }

    .sitemap-header h1 {
        font-size: 2.2rem;
    }

    .sitemap-header p {
        font-size: 1.1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .article-card {
        min-height: 350px;
    }

    .article-card-content {
        padding: 25px;
    }

    .article-title {
        font-size: 1.6rem;
    }

    .footer-stats {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .sitemap-header h1 {
        font-size: 1.8rem;
    }

    .article-card {
        min-height: 320px;
    }

    .article-card-content {
        padding: 20px;
    }

    .article-title {
        font-size: 1.4rem;
    }

    .child-link {
        padding: 6px 10px;
    }

    .child-thumbnail {
        width: 35px;
        height: 35px;
    }
}

.article-card:not([style*="background-image"]) {
    background: linear-gradient(135deg, #ffffff 0%, #000000 100%);
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(n+6) { animation-delay: 0.6s; }

.article-card {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .article-card {
        background-attachment: scroll;
    }
}

.breadcrumbs-container-articles {
    display: flex;
    justify-content: center;
}

.breadcrumbs-container-articles .breadcrumbs {
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

@media (prefers-color-scheme: dark) {
    header, .multilevel-nav.mobile-open {
        background: #1a1a18 !important;
    }
    .breadcrumbs a {
    color: #1a1a1a;
    }
}
