/* ========================================
   ENTREPALMAS - CUSTOM WORDPRESS STYLES
   ======================================== */

/* Disable transitions during initial paint to avoid "brinco" on internal pages */
.site-header.header-no-transition,
.site-header.header-no-transition *,
.site-header.header-no-transition *::before,
.site-header.header-no-transition *::after {
    transition: none !important;
}

/* Header states */
.site-header.header-transparent {
    background-color: transparent;
}

.site-header.header-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.site-header.header-scrolled .header-top-bar {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.site-header.header-scrolled .header-logo-scroll {
    display: flex !important;
}

.site-header.header-scrolled .header-logo-main {
    display: none;
}

.site-header.header-scrolled nav {
    background-color: #fff !important;
    border-bottom: 1px solid #f3f4f6;
}

.site-header.header-scrolled .nav-menu > li > a {
    color: #4b5563 !important;
    padding-left: 1rem;
    padding-right: 1rem;
}

.site-header.header-scrolled .nav-menu > li > a:hover {
    color: #8FA826 !important;
    background-color: rgba(143, 168, 38, 0.05);
}

.site-header.header-scrolled .mobile-menu-toggle {
    color: #374151 !important;
}

.site-header.header-scrolled .mobile-menu-toggle:hover {
    background-color: #f3f4f6 !important;
}

/* Desktop navigation menu */
.nav-menu,
.nav-menu > li,
.nav-menu > li > a {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.25rem;
}

.nav-menu > li {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-menu > li > a {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.25;
}

.nav-menu > li > a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Underline hover effect */
.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
    border-radius: 9999px;
}

.nav-menu > li > a:hover::after {
    width: 50%;
}

/* Current menu item */
.nav-menu > .current-menu-item > a,
.nav-menu > .current_page_item > a,
.nav-menu > .current-menu-ancestor > a {
    color: #8FA826;
    background-color: rgba(143, 168, 38, 0.05);
}

/* Ensure header doesn't overlap content on internal pages */
body:not(.home) .site-main {
    padding-top: 0;
}

/* Blog card hover effects */
.blog-card:hover .blog-card-image img {
    transform: scale(1.1);
}

.blog-card-image {
    width: 100%;
    height: 100%;
}

.blog-card-image img {
    transition: transform 0.7s ease;
}

/* Single post header */
.single-hero {
    background: linear-gradient(135deg, #8FA826 0%, #7A8F20 100%);
}

/* Featured image */
.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure iframe responsiveness */
.embed-responsive iframe,
.entry-content iframe {
    max-width: 100%;
}

/* Category badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background-color: #8FA826;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
}

/* Line clamp utilities for cross-browser support */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile header layout improvements */
@media screen and (max-width: 1023px) {
    .site-header .header-logo-main img {
        height: 3rem;
    }

    .site-header .header-logo-scroll img {
        height: 2.25rem;
    }

    .site-header .header-nav > div {
        position: relative;
    }

    .site-header .mobile-menu-toggle {
        margin-left: auto;
    }

    /* Mobile menu drawer */
    .mobile-menu {
        max-height: 0;
        opacity: 0;
        transition: max-height 0.35s ease, opacity 0.25s ease;
    }

    .mobile-menu.opacity-100 {
        opacity: 1;
    }

    .mobile-menu.max-h-0 {
        max-height: 0 !important;
        opacity: 0;
    }

    .mobile-menu ul {
        list-style: none;
        margin: 0;
        padding: 0.75rem 1.5rem;
    }

    .mobile-menu li {
        margin: 0;
        padding: 0;
    }

    .mobile-menu li a {
        display: block;
        padding: 0.75rem 1rem;
        color: #374151;
        font-weight: 500;
        border-radius: 0.5rem;
        transition: background-color 0.2s ease, color 0.2s ease;
        text-decoration: none;
    }

    .mobile-menu li a:hover,
    .mobile-menu li.current-menu-item > a,
    .mobile-menu li.current_page_item > a {
        background-color: rgba(143, 168, 38, 0.08);
        color: #8FA826;
    }
}

/* Fix for admin bar on fixed header */
@media screen and (max-width: 600px) {
    #wpadminbar {
        position: fixed;
    }
}

/* Search page styles */
.search-result {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.search-result:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Video container */
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* WordPress alignments */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile menu */
.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-menu li a:hover,
.mobile-menu .current-menu-item a {
    background-color: rgba(143, 168, 38, 0.05);
    color: #8FA826;
}
