/*
 * Nexus Theme Styles
 * Custom CSS for the Nexus WordPress theme
 */

/*======================================================================
   Layout & Grid
======================================================================*/

.container {
    max-width: var(--nexus-container-width, 1200px);
    margin: 0 auto;
    padding: 0 1rem;
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.site-content {
    flex: 1;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

/* Content Area Grid */
.content-area {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    min-width: 0;
}

.sidebar-left .content-area {
    grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar-right .content-area {
    grid-template-columns: minmax(0, 1fr) 300px;
}

.sidebar-left .site-main {
    order: 2;
    min-width: 0;
    overflow-wrap: break-word;
}

.sidebar-left .widget-area {
    order: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    background-color: #fff;
    border-bottom: 1px solid #e1e1e1;
    position: relative;
    z-index: 998;
}

.sticky-header .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sticky-header .site-content {
    margin-top: 80px; /* Adjust based on header height */
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

/* Header Layouts */
.header-centered .site-header .container {
    flex-direction: column;
    text-align: center;
}

.header-minimal .site-branding {
    display: none;
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: #333;
    text-decoration: none;
}

.site-title a:hover {
    color: var(--nexus-primary-color, #0073aa);
}

.site-title a:focus {
    color: var(--nexus-primary-color, #0073aa);
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

.site-description {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
}


/* ==========================================================================
   Navigation
   ========================================================================== */

.main-navigation {
    position: relative;
    z-index: 9998;
}

/* Mobile Navigation - Hidden on Desktop */
.mobile-navigation {
    display: none;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border-radius: 3px;
}

.menu-toggle:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
    height: 18px;
    justify-content: center;
}

.menu-toggle-icon span {
    width: 100%;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
    border-radius: 2px;
    transform-origin: center;
}

.menu-toggle.active .menu-toggle-icon span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .menu-toggle-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active .menu-toggle-icon span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    flex-wrap: wrap;
}

.primary-menu li {
    position: relative;
    list-style: none;
}

.primary-menu a {
    display: block;
    padding: 0.5rem 0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.primary-menu a:hover {
    color: var(--nexus-primary-color, #0073aa);
}

.primary-menu a:focus {
    color: var(--nexus-primary-color, #0073aa);
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Dropdown Menus */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
    list-style: none;
    padding: 0;
    margin: 0;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu,
.primary-menu .sub-menu.focus,
.primary-menu .sub-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu li {
    width: 100%;
    position: relative;
}

.primary-menu .sub-menu a {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    display: block;
    width: 100%;
}

.primary-menu .sub-menu a:hover {
    background-color: #f8f9fa;
}

.primary-menu .sub-menu li:last-child a {
    border-bottom: none;
}

/* Third level menus */
.primary-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    z-index: 10000;
    margin-top: -1px;
}

.primary-menu .sub-menu li:hover > .sub-menu,
.primary-menu .sub-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Menu item indicators for submenus */
.primary-menu .menu-item-has-children > a::after {
    content: "▼";
    font-size: 0.7em;
    margin-left: 0.5rem;
    opacity: 0.7;
}

.primary-menu .sub-menu .menu-item-has-children > a::after {
    content: "▶";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
}

/* ==========================================================================
   Content
   ========================================================================== */

.site-main {
    margin-bottom: 2rem;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.posts-container {
    margin-bottom: 2rem;
    min-width: 0;
}

/* Blog Layouts */
.blog-layout-grid .posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-layout-masonry .posts-container {
    columns: 3;
    column-gap: 2rem;
}

.blog-layout-masonry .post {
    break-inside: avoid;
    margin-bottom: 2rem;
}

/* Post Styles */
.post {
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
    margin-bottom: 1rem;
}

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

.entry-header {
    padding: 1.5rem;
    padding-bottom: 1rem;
}

.entry-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-width: 0;
}

.entry-title a {
    color: #333;
    text-decoration: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.entry-title a:hover {
    color: var(--nexus-primary-color, #0073aa);
}

.entry-title a:focus {
    color: var(--nexus-primary-color, #0073aa);
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

.entry-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.entry-meta a {
    color: #666;
    text-decoration: none;
}

.entry-meta a:hover {
    color: var(--nexus-primary-color, #0073aa);
}

.entry-content {
    padding: 0 1.5rem 1.5rem;
}

.entry-summary {
    padding: 0 1.5rem 1rem;
    color: #666;
    line-height: 1.6;
}

/* Ensure links in content areas are underlined for accessibility */
.entry-content a,
.comment-content a,
.textwidget a,
.widget_text a {
    text-decoration: underline;
}

.entry-content a:hover,
.comment-content a:hover,
.textwidget a:hover,
.widget_text a:hover {
    text-decoration: underline;
}

.entry-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f0f0f0;
    background-color: #f8f9fa;
    font-size: 0.875rem;
}

.entry-footer .cat-links,
.entry-footer .tags-links {
    display: inline-block;
    margin-right: 1rem;
}
.gallery-caption {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

.bypostauthor {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.widget-area {
    padding: 0;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.widget {
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
}

.widget-title {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid var(--nexus-primary-color, #0073aa);
    padding-bottom: 0.5rem;
}

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

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: #333;
    text-decoration: none;
}

.widget a:hover {
    color: var(--nexus-primary-color, #0073aa);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background-color: #333;
    color: #fff;
    margin-top: auto;
}

.footer-widgets {
    padding: 3rem 0;
}

.footer-widgets-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.footer-widget-area .widget {
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 2rem;
}

.footer-widget-area .widget-title {
    color: #fff;
    border-bottom-color: var(--nexus-primary-color, #0073aa);
}

.footer-widget-area .widget a {
    color: #ccc;
}

.footer-widget-area .widget a:hover {
    color: #fff;
}

.site-info {
    background-color: #222;
    padding: 1.5rem 0;
    border-top: 1px solid #444;
}

.site-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright {
    margin: 0;
    font-size: 0.875rem;
    color: #ccc;
}

.footer-navigation .footer-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.footer-navigation a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-navigation a:hover {
    color: #fff;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.navigation.post-navigation {
    margin: 3rem 0;
    text-align: center;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-previous a,
.nav-next a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--nexus-primary-color, #0073aa);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-previous a:hover,
.nav-next a:hover {
    background-color: var(--nexus-secondary-color, #005177);
    color: #fff;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e1e1;
}

.comments-title {
    margin-bottom: 2rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.comment-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.comment-content {
    margin-bottom: 1rem;
}

.reply {
    text-align: right;
}

.reply a {
    font-size: 0.875rem;
    color: var(--nexus-primary-color, #0073aa);
    text-decoration: none;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.comment-form {
    margin-top: 2rem;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.comment-form-comment,
.comment-form-author,
.comment-form-email,
.comment-form-url {
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
    border-color: var(--nexus-primary-color, #0073aa);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* ==========================================================================
   Accessibility Focus Styles
   ========================================================================== */

/* General focus styles for accessibility */
button:focus,
input[type="button"]:focus,
input[type="reset"]:focus,
input[type="submit"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="range"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="time"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="color"]:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Focus styles for links */
a:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Navigation focus styles */
.primary-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Post title focus - additional styling */
.entry-title a:focus {
    text-decoration: underline;
}

/* Meta links focus */
.entry-meta a:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Widget links focus */
.widget a:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Footer links focus */
.footer-widget-area .widget a:focus,
.footer-navigation a:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Comment reply link focus */
.reply a:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Breadcrumb links focus */
.breadcrumb-item a:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Navigation pagination focus */
.nav-previous a:focus,
.nav-next a:focus,
.page-numbers:focus {
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

/* Skip link focus */
.skip-link:focus {
    background: var(--nexus-primary-color, #0073aa);
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 3px;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Back to top button focus */
.back-to-top:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: #666;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    min-width: 0;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0; 
    min-width: 0;
}

.breadcrumb-item {
    color: #666;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: #666;
}

.breadcrumb-item a {
    color: var(--nexus-primary-color, #0073aa);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .has-sidebar .content-area {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar-left .content-area {
        grid-template-columns: 1fr;
    }

    .sidebar-left .site-main {
        order: 1;
    }

    .sidebar-left .widget-area {
        order: 2;
    }

    .blog-layout-masonry .posts-container {
        columns: 2;
    }

    .footer-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .site-main,
    .widget-area,
    .post,
    .widget {
        min-width: 0;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
}

/* Desktop Navigation - show on desktop, hide on mobile */
@media (min-width: 768px) {
    .main-navigation .primary-menu {
        display: flex !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .mobile-navigation {
        display: none !important;
    }
}

@media (max-width: 767px) {
    /* Header Styles */
    .site-header {
        position: relative;
        z-index: 1000;
    }
    
    .site-header .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background-color: #fff;
        border-bottom: 1px solid #e1e1e1;
    }
    
    .site-branding {
        flex: 1;
        min-width: 0;
    }
    
    .main-navigation {
        flex-shrink: 0;
    }
    
    /* Hide desktop menu on mobile */
    .main-navigation .primary-menu {
        display: none !important;
    }
    
    .site-title {
        font-size: 1.25rem;
        margin: 0;
    }
    
    .site-description {
        font-size: 0.75rem;
        margin: 0;
    }
    
    .menu-toggle {
        display: flex;
        flex-shrink: 0;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        align-items: center;
        background-color: transparent;
        border: 2px solid #e1e1e1;
        border-radius: 6px;
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .menu-toggle:hover {
        background-color: #f8f9fa;
        border-color: var(--nexus-primary-color, #0073aa);
    }
    
    .menu-toggle:focus {
        outline: 2px solid var(--nexus-primary-color, #0073aa);
        outline-offset: 2px;
        background-color: #f8f9fa;
        border-color: var(--nexus-primary-color, #0073aa);
    }
    
    .menu-toggle.active {
        background-color: var(--nexus-primary-color, #0073aa);
        border-color: var(--nexus-primary-color, #0073aa);
    }
    
    .menu-toggle.active .menu-toggle-icon span {
        background-color: #fff;
    }
    
    .menu-toggle-text {
        display: none;
    }
    
    /* Mobile Navigation Overlay */
    .mobile-navigation {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }
    
    .mobile-navigation.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Mobile Menu Panel */
    .mobile-menu-panel {
        position: absolute;
        top: 0;
        right: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background-color: #fff;
        box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .mobile-navigation.active .mobile-menu-panel {
        transform: translateX(0);
    }
    
    /* Mobile Menu Header */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid #e1e1e1;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .mobile-menu-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #333;
        margin: 0;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 1.8rem;
        color: #666;
        cursor: pointer;
        padding: 0.25rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-close:hover {
        background-color: rgba(0, 0, 0, 0.1);
        color: #333;
        transform: rotate(90deg);
    }
    
    /* Mobile Menu Items */
    .mobile-menu-items {
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .mobile-menu-items li {
        border-bottom: 1px solid #f0f0f0;
        position: relative;
    }
    
    .mobile-menu-items li:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-items a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem 1.5rem;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    
    .mobile-menu-items a::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.1), transparent);
        transition: left 0.5s ease;
    }
    
    .mobile-menu-items a:hover::before {
        left: 100%;
    }
    
    .mobile-menu-items a:hover {
        background-color: #f8f9fa;
        color: var(--nexus-primary-color, #0073aa);
        padding-left: 2rem;
        transform: translateX(5px);
    }
    
    /* Submenu Styles */
    .mobile-menu-items .has-submenu > a::after {
        content: "+";
        font-size: 1.3em;
        font-weight: bold;
        color: var(--nexus-primary-color, #0073aa);
        transition: all 0.3s ease;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: rgba(0, 123, 255, 0.1);
    }
    
    .mobile-menu-items .has-submenu.open > a::after {
        content: "−";
        transform: rotate(180deg);
        background-color: var(--nexus-primary-color, #0073aa);
        color: #fff;
    }
    
    .mobile-submenu {
        max-height: 0;
        overflow: hidden;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateY(-10px);
        opacity: 0;
        list-style: none;
    }
    
    .mobile-submenu.open {
        max-height: 500px;
        transform: translateY(0);
        opacity: 1;
    }
    
    .mobile-submenu a {
        padding: 1rem 1.5rem 1rem 2.5rem;
        font-size: 0.9rem;
        font-weight: 400;
        border-bottom: 1px solid rgba(255, 255, 255, 0.5);
        background-color: transparent;
    }
    
    .mobile-submenu a:hover {
        padding-left: 3rem;
        background-color: rgba(255, 255, 255, 0.8);
        border-left: 3px solid var(--nexus-primary-color, #0073aa);
    }
    
    /* Animation for menu items */
    .mobile-menu-items li {
        opacity: 0;
        transform: translateX(30px);
        animation: slideInFromRight 0.3s ease forwards;
    }
    
    .mobile-menu-items li:nth-child(1) { animation-delay: 0.1s; }
    .mobile-menu-items li:nth-child(2) { animation-delay: 0.2s; }
    .mobile-menu-items li:nth-child(3) { animation-delay: 0.3s; }
    .mobile-menu-items li:nth-child(4) { animation-delay: 0.4s; }
    .mobile-menu-items li:nth-child(5) { animation-delay: 0.5s; }
    .mobile-menu-items li:nth-child(6) { animation-delay: 0.6s; }
    
    @keyframes slideInFromRight {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    /* Blog layouts on mobile */
    .blog-layout-grid .posts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-layout-masonry .posts-container {
        columns: 1;
        gap: 1.5rem;
    }
    
    /* Post cards on mobile */
    .post {
        margin-bottom: 1.5rem;
    }
    
    .entry-header {
        padding: 1rem;
    }
    
    .entry-title {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    .entry-content,
    .entry-summary {
        padding: 0 1rem 1rem;
    }
    
    .entry-footer {
        padding: 1rem;
    }
    
    .footer-widgets-grid {
        grid-template-columns: 1fr;
    }
    
    .site-info-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-navigation .footer-menu {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-previous,
    .nav-next {
        width: 100%;
        text-align: center;
    }
    
    /* Page header on mobile */
    .page-header {
        text-align: center;
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .search-results-count {
        font-size: 0.875rem;
        color: #666;
        margin-bottom: 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .site-content {
        padding: 1rem 0;
    }
    
    .site-header .container {
        padding: 0.5rem 1rem;
    }
    
    .site-title {
        font-size: 1.125rem;
    }
    
    .site-description {
        font-size: 0.75rem;
    }
    
    .entry-header {
        padding: 1rem;
    }
    
    .entry-title {
        font-size: 1.125rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    .entry-content,
    .entry-summary {
        padding: 0 1rem 1rem;
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .entry-footer {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .widget {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .widget-title {
        font-size: 1rem;
    }
    
    .comment-form {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
        line-height: 1.3;
    }
    
    .search-results-count {
        font-size: 0.8rem;
    }
    
    /* Blog layouts on small mobile */
    .blog-layout-grid .posts-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .post {
        margin-bottom: 1rem;
    }
    
    /* Footer improvements */
    .footer-widgets {
        padding: 2rem 0;
    }
    
    .site-info {
        padding: 1rem 0;
    }
    
    .copyright {
        font-size: 0.8rem;
        text-align: center;
    }
    
    /* Navigation improvements */
    .posts-navigation {
        margin: 2rem 0;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .nav-previous a,
    .nav-next a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--nexus-primary-color, #0073aa);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9997;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--nexus-secondary-color, #005177);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* .back-to-top svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
} */

.back-to-top .screen-reader-text {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Clearfix and Float Handling
   ========================================================================== */

/* Clearfix utility */
.clearfix::before,
.clearfix::after {
    content: "";
    display: table;
}

.clearfix::after {
    clear: both;
}

/* Clear floats in content areas */
.entry-content::after,
.comment-content::after,
.site-content::after,
.widget-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Float utilities */
.alignleft {
    float: left;
    margin: 0.5rem 1rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0.5rem 0 1rem 1rem;
}

.aligncenter {
    display: block;
    margin: 0.5rem auto;
    text-align: center;
}



/* Clear floats after posts container */
.posts-container::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   Page Links (Content Pagination)
   ========================================================================== */

/* Page links (pagination within content) should clear floats */
.page-links {
    clear: both;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e1e1;
    font-weight: 600;
}

.page-links a,
.page-links > span {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem 0.5rem 0;
    background-color: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
}

.page-links a:hover {
    background-color: var(--nexus-primary-color, #0073aa);
    color: #fff;
    border-color: var(--nexus-primary-color, #0073aa);
}

.page-links a:focus {
    background-color: var(--nexus-primary-color, #0073aa);
    color: #fff;
    border-color: var(--nexus-primary-color, #0073aa);
    outline: 2px solid var(--nexus-primary-color, #0073aa);
    outline-offset: 2px;
}

.page-links > span {
    background-color: var(--nexus-primary-color, #0073aa);
    color: #fff;
    border-color: var(--nexus-primary-color, #0073aa);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .widget-area,
    .comments-area,
    .posts-navigation {
        display: none;
    }
    
    .site-content {
        padding: 0;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    a {
        text-decoration: underline;
    }
    
    .entry-title {
        color: #000;
    }
}

/* ==========================================================================
   Custom Block Styles
   ========================================================================== */

/* Button Block Styles */
.wp-block-button.is-style-nexus-outline .wp-block-button__link {
    background-color: transparent !important;
    border: 2px solid currentColor;
    color: var(--nexus-primary-color, #0073aa);
}

.wp-block-button.is-style-nexus-outline .wp-block-button__link:hover {
    background-color: var(--nexus-primary-color, #0073aa) !important;
    color: white;
}

.wp-block-button.is-style-nexus-rounded .wp-block-button__link {
    border-radius: 50px;
}

/* Quote Block Styles */
.wp-block-quote.is-style-nexus-bordered {
    border: 2px solid var(--nexus-primary-color, #0073aa);
    border-left: 6px solid var(--nexus-primary-color, #0073aa);
    padding: 2rem;
    background-color: rgba(0, 115, 170, 0.05);
}

.wp-block-quote.is-style-nexus-bordered p {
    margin-bottom: 1rem;
}

.wp-block-quote.is-style-nexus-bordered cite {
    font-style: normal;
    font-weight: 600;
    color: var(--nexus-primary-color, #0073aa);
}

/* Group Block Styles */
.wp-block-group.is-style-nexus-shadow {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.wp-block-group.is-style-nexus-border-radius {
    border-radius: 12px;
    overflow: hidden;
}

/* Image Block Styles */
.wp-block-image.is-style-nexus-rounded-image img {
    border-radius: 12px;
}

.wp-block-image.is-style-nexus-shadow-image img {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Columns Block Styles */
.wp-block-columns.is-style-nexus-equal-height {
    align-items: stretch;
}

.wp-block-columns.is-style-nexus-equal-height .wp-block-column {
    display: flex;
    flex-direction: column;
}

/* Custom Block Pattern Styles */
.nexus-cta {
    text-align: center;
}

.nexus-cta .wp-block-heading {
    color: var(--nexus-primary-color, #0073aa);
}

.nexus-cta .wp-block-button__link {
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
    transition: all 0.3s ease;
}

.nexus-cta .wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

/* Search results specific styles */
.search .posts-container {
    margin-top: 2rem;
}

.search .blog-layout-grid .posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.search .blog-layout-list .posts-container {
    display: block;
}

.search .blog-layout-list .post {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 2rem;
}

.search .blog-layout-list .post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ==========================================================================
   Typography and Text Handling
   ========================================================================== */

/* Ensure all text elements handle long content properly */
h1, h2, h3, h4, h5, h6,
.entry-title,
.page-title,
.widget-title,
.comment-author,
.site-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    /* Only prevent expanding beyond container when necessary */
    min-width: 0;
}

/* Content areas */
.entry-content,
.entry-summary,
.comment-content,
.widget-content,
.textwidget {
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Only prevent overflow issues */
    min-width: 0;
}

/* Navigation items */
.primary-menu a,
.footer-navigation a {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Prevent horizontal overflow */
.site,
.container,
.content-area,
.site-main,
.widget-area {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* Images and media */
img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* Tables */
table {
    width: 100%;
    table-layout: fixed;
    word-wrap: break-word;
}

/* Code blocks */
pre,
code {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Page header and title fixes */
.page-header {
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    /* Only prevent overflow issues */
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    /* Smart word wrapping for page titles */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-width: 0;
    line-height: 1.2;
}

/* Archive and search result titles */
.archive-title,
.search-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-width: 0;
} 