/**
 * Main Theme Styles
 *
 * @package ToolHub
 * @since 1.0.0
 */

/* ==========================================================================
   COMPONENTS - BUTTONS
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    line-height: 1.5;
}

.btn-primary {
    background: #0066cc;
    color: #fff;
}

.btn-primary:hover {
    background: #0052a3;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    color: #fff;
    text-decoration: none;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ==========================================================================
   COMPONENTS - BADGES
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-type {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-category {
    background: #f3e5f5;
    color: #6a1b9a;
    text-decoration: none;
}

.badge-difficulty {
    color: #fff;
}

.badge-beginner {
    background: #28a745;
}

.badge-intermediate {
    background: #ffc107;
    color: #000;
}

.badge-advanced {
    background: #dc3545;
}

/* ==========================================================================
   COMPONENTS - CARDS
   ========================================================================== */

.tool-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tool-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
}

.tool-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tool-card__badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.tool-card__title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.tool-card__title a {
    color: #1a1a1a;
    text-decoration: none;
}

.tool-card__title a:hover {
    color: #fff;
    background: #0066cc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tool-card__excerpt {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.tool-card__categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tool-card__category {
    font-size: 0.75rem;
    color: #6b7280;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    background: #f3f4f6;
    border-radius: 4px;
}

.tool-card__category:hover {
    background: #e5e7eb;
    color: #374151;
}

.tool-card__link {
    color: #0066cc;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}

.tool-card__link:hover {
    color: #fff;
    background: #0066cc;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

/* Category Cards */
.category-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.category-card__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.category-card__title a {
    color: #1a1a1a;
    text-decoration: none;
}

.category-card__title a:hover {
    color: #0066cc;
}

.category-card__description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.category-card__count {
    color: #9ca3af;
    font-size: 0.875rem;
    margin: 0;
}

/* ==========================================================================
   LAYOUT - GRIDS
   ========================================================================== */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 0.5rem 0;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

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

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

.primary-navigation {
    flex: 1;
}

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

.primary-menu a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
}

.primary-menu a:hover {
    color: #0066cc;
}

.header-actions {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .primary-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ==========================================================================
   HOMEPAGE SECTIONS
   ========================================================================== */

.hero-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #fff;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    margin: 0;
    font-size: 2rem;
}

.section-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
}

.section-link:hover {
    text-decoration: underline;
}

.featured-tools-section,
.latest-tools-section,
.categories-section {
    margin: 3rem 0;
}

.cta-section {
    background: #f9fafb;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 12px;
    margin: 3rem 0;
}

.cta-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-text {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

/* ==========================================================================
   SINGLE TOOL PAGE
   ========================================================================== */

.breadcrumbs-wrapper {
    margin: 1rem 0;
}

.breadcrumbs {
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumbs a {
    color: #0066cc;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #fff;
    background: #0066cc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
}

.tool-page-header {
    margin-bottom: 2rem;
}

.tool-meta-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tool-summary {
    font-size: 1.125rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.tool-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
    margin: 2rem 0;
}

@media (max-width: 1024px) {
    .tool-content-wrapper {
        grid-template-columns: 1fr;
    }
}

.tool-info-column {
    min-width: 0;
}

.tool-section {
    margin-bottom: 2rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}


.tool-execution-column {
    /* Placeholder for any specific execution column styles */
}

/* Author Box - WordPress Blog Style */
.author-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #0066cc;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.author-box .author-name {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    color: #1a1a1a;
    font-weight: 600;
}

.author-box .author-name a {
    color: #1a1a1a;
    text-decoration: none;
}

.author-box .author-name a:hover {
    color: #0066cc;
}

.author-box .author-bio {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.author-box .author-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.author-box .author-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.author-box .author-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

.tool-runner-sticky {
    position: sticky;
    top: 100px;
}

.tool-runner-header {
    background: #f9fafb;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e5e7eb;
    border-bottom: none;
}

.tool-runner-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.tool-iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    display: block;
}

/* FAQ Section */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

.faq-question {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.faq-answer {
    color: #6b7280;
    margin: 0;
}

/* Ad Areas */
.ad-area {
    margin: 2rem 0;
    text-align: center;
}

/* Related Tools */
.related-tools-section {
    margin: 3rem 0;
    padding-top: 3rem;
    border-top: 2px solid #e5e7eb;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.submission-header {
    margin-bottom: 2rem;
}

.submission-intro {
    font-size: 1.125rem;
    color: #6b7280;
}

.submission-success {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.submission-error {
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.submission-form {
    max-width: 800px;
}

.form-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-section-description {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.required {
    color: #dc3545;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.code-input {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.checkbox-field label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

/* ==========================================================================
   FILTERS & ARCHIVE
   ========================================================================== */

.archive-header {
    margin-bottom: 2rem;
}

.tools-filters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

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

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination .current {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
}

.pagination a:hover {
    background: #f3f4f6;
}

.pagination .current {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.footer-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-menu a {
    color: #9ca3af;
    text-decoration: none;
}

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

.footer-info {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.no-results {
    text-align: center;
    padding: 3rem;
    background: #f9fafb;
    border-radius: 8px;
}

/* ==========================================================================
   ENHANCED FOOTER STYLES
   ========================================================================== */

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    padding: 3rem 0;
    border-bottom: 1px solid #374151;
}

@media (max-width: 1024px) {
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

.footer-widget-title {
    color: #fff;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-about-text {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-social-icons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    background: #374151;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    color: #fff;
    transition: background 0.3s;
}

.social-icon:hover {
    background: #0066cc;
}

.footer-category-list,
.footer-quick-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-category-list li,
.footer-quick-links li {
    margin-bottom: 0.5rem;
}

.footer-category-list a,
.footer-quick-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-category-list a:hover,
.footer-quick-links a:hover {
    color: #fff;
}

.footer-newsletter-form {
    display: flex;
    margin-top: 1rem;
}

.footer-newsletter-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #374151;
    border-radius: 4px 0 0 4px;
    background: #1a1a1a;
    color: #fff;
}

.footer-newsletter-button {
    padding: 0.5rem 1rem;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.footer-newsletter-button:hover {
    background: #0052a3;
}

.footer-newsletter-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

@media (max-width: 640px) {
    .footer-bottom-inner {
        flex-direction: column;
        gap: 1rem;
    }
}

.footer-copyright {
    color: #9ca3af;
    font-size: 0.875rem;
}

.footer-copyright a {
    color: #fff;
    text-decoration: none;
}

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

.footer-menu a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
}

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

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 58px;
    height: 58px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s;
}

.back-to-top:hover {
    background: #0052a3;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   RATING SYSTEM STYLES
   ========================================================================== */

.tool-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.stars {
    display: flex;
    gap: 0.25rem;
}

.star {
    font-size: 1.5rem;
    color: #d1d5db;
    transition: color 0.2s;
}

.star.filled,
.star.hover {
    color: #ffc107;
}

.star.interactive {
    cursor: pointer;
}

.star.interactive:hover {
    transform: scale(1.1);
}

.rating-average {
    font-weight: 600;
    color: #1a1a1a;
}

.rating-count {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ==========================================================================
   SINGLE TOOL PAGE LAYOUT (60/40 SPLIT)
   ========================================================================== */

.tool-content-wrapper {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 1024px) {
    .tool-content-wrapper {
        grid-template-columns: 1fr;
    }

    .tool-execution-column {
        order: -1;
        /* Tool appears first on mobile */
    }
}

.tool-runner-sticky {
    position: sticky;
    top: 2rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ========================================================================== */

/* Base mobile styles (already mobile-first) */

/* Tablet - 768px and up */
@media (min-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop - 1024px and up */
@media (min-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .site-header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* Large Desktop - 1280px and up */
@media (min-width: 1280px) {
    .site-container {
        max-width: 1200px;
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .tool-meta-badges {
        flex-wrap: wrap;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .tool-button {
        width: 100%;
        display: block;
    }

    .back-to-top {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        bottom: 1rem;
        right: 1rem;
    }
}

/* ==========================================================================
   PERFORMANCE - LAZY LOADING & OPTIMIZATION
   ========================================================================== */

/* Loading skeleton for lazy images */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {

    .back-to-top,
    .site-header,
    .site-footer,
    .ad-area,
    .related-tools-section {
        display: none !important;
    }

    .tool-content-wrapper {
        display: block;
    }
}

/* ==========================================================================
   MOBILE MENU - RESPONSIVE HAMBURGER
   ========================================================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
    margin-left: auto;
    /* Push to right side */
}

.hamburger-icon {
    display: block;
    width: 28px;
    height: 2px;
    background: #1a1a1a;
    position: relative;
    transition: background 0.3s;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 2px;
    background: #1a1a1a;
    transition: transform 0.3s;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    bottom: -8px;
}

.mobile-menu-toggle.is-active .hamburger-icon {
    background: transparent;
}

.mobile-menu-toggle.is-active .hamburger-icon::before {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.is-active .hamburger-icon::after {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile menu styles */
@media (max-width: 1023px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: #fff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 10000;
        /* Higher z-index to be above overlay */
        overflow-y: auto;
        padding: 4rem 0 2rem;
    }

    .main-navigation.is-open {
        right: 0;
    }

    .primary-menu {
        flex-direction: column;
        padding: 0;
        position: relative;
        z-index: 10001;
        /* Ensure menu items are clickable */
    }

    .primary-menu li {
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        z-index: 10001;
    }

    .primary-menu a {
        display: block;
        padding: 1rem 1.5rem;
        color: #1a1a1a;
        position: relative;
        z-index: 10001;
    }

    .primary-menu a:hover {
        background: #f0f0f0;
        color: #1a1a1a;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* Overlay */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        /* z-index removed - menu handles its own stacking */
    }
}

/* ==========================================================================
   MOBILE FOOTER OPTIMIZATION
   ========================================================================== */

@media (max-width: 767px) {
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 0;
    }

    .footer-widget-area {
        padding-bottom: 1.5rem;
        border-bottom: 1px solid #374151;
    }

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

    /* Collapsible footer sections on mobile */
    .footer-widget-title {
        position: relative;
        cursor: pointer;
        padding-right: 2rem;
        user-select: none;
    }

    .footer-widget-title::after {
        content: '+';
        position: absolute;
        right: 0;
        top: 0;
        font-size: 1.5rem;
        line-height: 1;
        transition: transform 0.3s;
    }

    .footer-widget-area.is-expanded .footer-widget-title::after {
        content: '−';
    }

    .footer-category-list,
    .footer-quick-links {
        display: none;
        margin-top: 1rem;
    }

    .footer-widget-area.is-expanded .footer-category-list,
    .footer-widget-area.is-expanded .footer-quick-links {
        display: block;
    }

    /* About section always visible */
    .footer-about .footer-about-text,
    .footer-about .footer-social-icons {
        display: block !important;
    }

    .footer-about .footer-widget-title::after {
        display: none;
    }

    /* Reduce category list on mobile */
    .footer-category-list li:nth-child(n+5) {
        display: none;
    }

    .footer-quick-links li:nth-child(n+5) {
        display: none;
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .footer-copyright p {
        font-size: 0.8125rem;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Desktop menu */
@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none;
    }

    .main-navigation {
        display: block;
    }

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

    .primary-menu a {
        color: #1a1a1a;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s;
    }

    .primary-menu a:hover {
        color: #fff !important;
        background: #0066cc;
        padding: 0.5rem 1rem;
        border-radius: 4px;
    }
}

/* ==========================================================================
   BLOG STYLES
   ========================================================================== */

/* Blog Archive Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Blog Card */
.blog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.blog-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
}

.blog-card__image img {
    width: 100%;    height: 100%;
    object-fit: cover;
}

.blog-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card__meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-card__categories {
    display: flex;
    gap: 0.5rem;
}

.blog-card__category {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.blog-card__category:hover {
    text-decoration: underline;
}

.blog-card__title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.blog-card__title a {
    color: #1a1a1a;
    text-decoration: none;
}

.blog-card__title a:hover {
    color: #0066cc;
}

.blog-card__excerpt {
    color: #6b7280;
    font-size: 0.938rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.blog-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.blog-card__author {
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-card__link {
    color: #0066cc;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.938rem;
}

.blog-card__link:hover {
    text-decoration: underline;
}

/* Single Post Styles */
.single-post {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 2rem;
}

.post-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.938rem;
    color: #6b7280;
}

.post-meta a {
    color: #0066cc;
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
}

.post-content {
    font-size: 1.063rem;
    line-height: 1.8;
    color: #374151;
}

.post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.post-tags {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.post-tags strong {
    margin-right: 0.5rem;
}

.tag-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag-link:hover {
    background: #e5e7eb;
    color: #374151;
}

.author-bio-box {
    margin-top: 3rem;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

.author-bio-box h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.author-bio-content {
    display: flex;
    gap: 1.5rem;
}

.author-bio-content img {
    border-radius: 50%;
    flex-shrink: 0;
}

.author-bio-text h4 {
    margin: 0 0 0.5rem 0;
}

.author-bio-text p {
    margin-bottom: 1rem;
    color: #6b7280;
}

.author-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.author-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .post-title {
        font-size: 1.875rem;
    }
    
    .author-bio-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
