/**
 * elementicnaf Child Theme Custom Styles
 * 
 * @package elementicnaf
 * @since 1.1.0
 */

/* ============================================
   HEADER STYLES
   ============================================ */

.site-header {
    background: #ffffff;
    padding:0px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-branding .custom-logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
}

.site-branding .site-title {
    margin: 0;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.site-branding .site-title a {
    text-decoration: none;
    color: #0f172a;
}

.site-branding .site-title a:hover {
    color: var(--wp--preset--color--accent-1, #2563eb);
}

.site-branding img {
    height: 48px;
    width: auto;
    max-width: 100%;
    display: block;
}

/* Override parent Elementic header background */
.el-header-wrap {
    background: #ffffff !important;
}

.el-menu-box {
    background: #ffffff !important;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-wrap {

    /*background: var(--wp--preset--gradient--soft-hero);*/
    border-radius: 20px;
    padding: 1.5rem 1.25rem;
   /* box-shadow: 0 4px 16px rgba(2, 6, 23, 0.06);*/
    margin: 1.25rem 0 2rem;
}

/* Reduce site-content padding on mobile for better hero display */
@media (max-width: 768px) {
    .site-content {
        padding: 0 !important;
    }
}

.hero-wrap .category-pill {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 9999px;
    background: var(--wp--preset--color--accent-2);
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.65rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-wrap h1 {
    font-size: clamp(1.8rem, 3.8vw, 2.6rem);
    line-height: 1.2;
    margin: 0 0 0.5rem;
    color: var(--wp--preset--color--contrast);
}

.hero-wrap .meta {
    color: var(--wp--preset--color--muted);
    font-size: 0.95rem;
    margin-top: 0.75rem;
}

/* ============================================
   POST CARDS (BLOG HOME)
   ============================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.post-card {
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.06);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.12);
}

.post-card .thumb {
    display: block;
    overflow: hidden;
}

.post-card .thumb img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease;
}

.post-card:hover .thumb img {
    transform: scale(1.05);
}

.post-card .content {
    padding: 1rem 1.25rem 1.25rem;
}

.post-card .pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    background: var(--wp--preset--color--accent-1);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.post-card .content h2 {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    line-height: 1.3;
    margin: 0.25rem 0 0.5rem;
}

.post-card .content h2 a {
    color: var(--wp--preset--color--contrast);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-card .content h2 a:hover {
    color: var(--wp--preset--color--accent-1);
}

.post-card .content p {
    color: var(--wp--preset--color--muted);
    line-height: 1.6;
    margin: 0.5rem 0;
}

.meta {
    color: var(--wp--preset--color--muted);
    font-size: 0.95rem;
    margin-top: 0.75rem;
}

/* ============================================
   BLOCKQUOTE STYLES
   ============================================ */
blockquote,
.wp-block-quote {
    background: #f8fafc;
    border-left: 4px solid var(--wp--preset--color--accent-1);
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    font-style: italic;
    margin: 1.5rem 0;
}

blockquote p:last-child,
.wp-block-quote p:last-child {
    margin-bottom: 0;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.toc-wrap {
    margin: 1rem 0 2rem;
}

.toc-card {
    background: var(--wp--preset--background--color-contrast);
    border: 1px solid var(--wp--preset--background--color-contrast);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.05);
}

.toc-card h3 {
    margin: 0.25rem 0 0.5rem;
    font-size: 1.05rem;
    color: #ffffff;
}

.toc-card .toc-list {
    margin: 0.75rem 0 0;
    padding-left: 1.5rem;
    list-style: disc;
    color: #ffffff;
}

.toc-card .toc-list li {
    margin: 0.5rem 0;
    line-height: 1.5;
    color: #ffffff;
}

.toc-card a {
    text-decoration: none;
    color: #ffffff;
    transition: color 0.3s ease;
}

.toc-card a:hover {
    color: var(--wp--preset--color--accent-1);
}

/* ============================================
   SIDEBAR CATEGORIES
   ============================================ */
.widget_categories {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(2, 6, 23, 0.04);
}

.widget_categories .widget-title {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--wp--preset--color--contrast);
}

.widget_categories ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget_categories li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget_categories li:last-child {
    border-bottom: none;
}

.widget_categories a {
    color: var(--wp--preset--color--contrast);
    text-decoration: none;
    transition: color 0.3s ease;
    flex: 1;
}

.widget_categories a:hover {
    color: var(--wp--preset--color--accent-1);
}

.widget_categories .count {
    background: #f1f5f9;
    color: var(--wp--preset--color--muted);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: var(--wp--preset--color--contrast);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--wp--preset--color--accent-1);
    color: #fff;
    border-color: var(--wp--preset--color--accent-1);
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    /* Hide site title on mobile, keep logo if exists */
    .site-branding .site-title {
        display: none;
    }

    .hero-wrap {
        padding: 1.5rem 1.25rem;
        margin: 0;
        border-radius: 0;
    }

    .hero-wrap h1 {
        font-size: clamp(1.5rem, 5vw, 1.8rem);
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 0;
    }

    .post-card .content {
        padding: 0.9rem 1rem 1rem;
    }

    .toc-wrap {
        margin: 0.75rem 0.75rem 1.5rem;
    }

    .toc-card {
        padding: 0.875rem 1rem;
    }
    .post-card {
    border-radius: 0 0 20px 20px;
    }

    /* Add padding to content areas to prevent text from touching edges */
    .entry-content,
    .entry-header,
    .entry-footer,
    .post-navigation,
    .comments-area {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .site-main > article {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ============================================
   MOBILE HEADER - COMPACT HAMBURGER MENU
   ============================================ */
@media (max-width: 1220px) {
    /* Change grid to flexbox for horizontal layout */
    .el-menu-box {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 16px 20px !important;
        position: relative;
        gap: 16px;
        background: #ffffff !important;
    }

    /* Logo/brand on left - override parent center alignment */
    .el-menu-box__brand {
        flex: 0 1 auto !important;
        order: 1;
        z-index: 1001;
        text-align: left !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Hamburger button container on right */
    .el-menu-box__nav,
    .main-navigation {
        order: 2 !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        z-index: 1001;
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .site-branding {
        justify-content: flex-start !important;
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .site-branding img {
        height: 32px;
        width: auto;
        flex-shrink: 0;
    }

    .site-branding .site-title {
        font-size: 16px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
        min-width: 0;
    }

    /* Style hamburger button - minimal design matching mockup */
    .menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        margin: 0 !important;
        padding: 8px !important;
        width: auto !important;
        max-width: 40px !important;
        min-width: 40px !important;
        min-height: 32px !important;
        height: 32px !important;
        font-size: 0 !important;
        font-weight: normal !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        position: relative;
        z-index: 1001;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center !important;
    }

    /* Create hamburger icon with CSS */
    .menu-toggle::before,
    .menu-toggle::after,
    .main-navigation .menu-toggle::before,
    .main-navigation .menu-toggle::after {
        content: '';
        display: block;
        width: 24px;
        height: 2px;
        background: #64748b;
        transition: all 0.3s ease;
    }

    .menu-toggle .screen-reader-text::after,
    .main-navigation .menu-toggle .screen-reader-text::after {
        content: '';
        display: block;
        width: 24px;
        height: 2px;
        background: #64748b;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .menu-toggle:hover::before,
    .menu-toggle:hover::after,
    .menu-toggle:hover .screen-reader-text::after,
    .main-navigation .menu-toggle:hover::before,
    .main-navigation .menu-toggle:hover::after,
    .main-navigation .menu-toggle:hover .screen-reader-text::after {
        background: #fb923c;
    }

    .menu-toggle:focus,
    .main-navigation .menu-toggle:focus {
        outline: 2px solid #fb923c;
        outline-offset: 2px;
    }

    .menu-toggle:focus::before,
    .menu-toggle:focus::after,
    .menu-toggle:focus .screen-reader-text::after,
    .main-navigation .menu-toggle:focus::before,
    .main-navigation .menu-toggle:focus::after,
    .main-navigation .menu-toggle:focus .screen-reader-text::after {
        background: #fb923c;
    }

    .menu-toggle .screen-reader-text {
        position: relative !important;
        clip: auto !important;
        width: 24px !important;
        height: 2px !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: visible !important;
        color: transparent !important;
        background: #2c3e50;
    }

    .menu-toggle .menu-icon {
        display: none !important;
    }

    /* Full-screen overlay for menu */
    .el-menu-box__nav .menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: var(--wp--preset--color--header-bg, #1a1a1a);
        z-index: 1000;
        overflow-y: auto;
        padding: 80px 20px 40px;
        margin: 0;
    }

    /* Show menu when toggled */
    .el-menu-box__nav.toggled .menu {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* Hide search by default */
    .el-menu-box__search {
        display: none;
    }

    /* Show search in full-screen overlay */
    .el-menu-box__nav.toggled ~ .el-menu-box__search {
        display: block;
        position: fixed;
        top: auto;
        bottom: 80px;
        left: 20px;
        right: 20px;
        z-index: 1000;
        margin: 0;
        padding: 0;
    }

    /* Search form styling in overlay */
    .el-menu-box__nav.toggled ~ .el-menu-box__search .search-form {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 4px;
    }

    .el-menu-box__nav.toggled ~ .el-menu-box__search .search-form input[type="search"] {
        background: transparent;
        border: none;
        color: #fff;
        padding: 12px 16px;
        width: 100%;
    }

    .el-menu-box__nav.toggled ~ .el-menu-box__search .search-form input[type="search"]::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }

    /* Prevent body scroll when menu is open */
    body.mobile-menu-open {
        overflow: hidden;
    }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .site-header {
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        padding:0px;
    }
    #primary.site-main {
        padding: 0px auto;
    }   

}

/* ============================================
   SINGLE POST CONTENT
   ============================================ */
.single .site-main {
    max-width: 100%;
}

.single .entry-content {
    line-height: 1.75;
    font-size: 1.0625rem;
}

.single .entry-content h2,
.single .entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    scroll-margin-top: 2rem;
}

.single .entry-content h2 {
    font-size: 1.75rem;
    line-height: 1.3;
}

.single .entry-content h3 {
    font-size: 1.375rem;
    line-height: 1.4;
}

.single .entry-content p {
    margin-bottom: 1.25rem;
}

.single .entry-content img {
    border-radius: 12px;
    margin: 1.5rem 0;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}
/* ============================================
   PAGE BANNER - HERO STYLE
   ============================================ */
.page-banner-wrapper {
    margin: 1.25rem 0 2rem 0;
    padding: 0;
}

.page-banner-image {
    background: var(--wp--preset--gradient--soft-hero) !important;
    background-image: none !important;
    background-size: cover !important;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(2, 6, 23, 0.06);
    padding: 1.5rem 1.25rem;
    min-height: 120px;
}

.page-banner-overlay {
    display: none !important;
}

.page-banner-content {
    padding: 0 1.25rem;
}

.page-banner-title {
    color: var(--wp--preset--color--contrast, #0f172a) !important;
    font-size: 2em;
    font-weight: 700;
    text-shadow: none;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Page Banner - Mobile */
@media screen and (max-width: 768px) {
    .page-banner-wrapper {
        margin: 0 0.75rem 1.5rem 0.75rem;
    }
    
    .page-banner-image {
        padding: 1.25rem 1rem;
        min-height: 100px;
    }
    
    .page-banner-content {
        padding: 0 0.5rem;
    }
    
    .page-banner-title {
        font-size: 1.75em;
        letter-spacing: 0.3px;
    }
}

@media screen and (max-width: 480px) {
    .page-banner-title {
        font-size: 1.5em;
        letter-spacing: 0.25px;
    }
    
    .page-banner-image {
        padding: 1rem 0.75rem;
        min-height: 80px;
    }
}