/* Responsive overrides for mstimaj.com
   Mobile/tablet layout rules. No !important - relies on cascade order.
   Loaded after mystyles.css so these rules win naturally.
*/

/* ====================================
   CRITICAL SCROLL FIX - MINIMAL CHANGES
   ==================================== */

/* Fix body scrolling without breaking positioning */
body {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Prevent horizontal scroll only */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ====================================
   NAVBAR POSITION FIX
   ==================================== */

/* Ensure navbar stays at top - DO NOT override position fixed */
header,
.nav-wrapper,
.main-nav {
    /* Do not change position property */
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

/* Fix body - NO padding-top since header is sticky (not fixed) */
/* The black section was caused by body padding pushing content down */
@media (max-width: 768px) {
    body {
        padding-top: 0; /* Sticky header, no padding needed */
    }

    /* Main content flows naturally below sticky header */
    main {
        margin-top: 0;
        padding-top: 0;
    }
}

/* ====================================
   HAMBURGER MENU FIX
   ==================================== */

/* Ensure hamburger button is clickable */
.nav-toggle {
    pointer-events: auto;
    z-index: 1001;
    position: relative;
    cursor: pointer;
    touch-action: manipulation;
}

/* Fix nav links positioning on mobile */
@media (max-width: 768px) {
    .nav-links {
        pointer-events: auto;
        z-index: 999;
    }
    
    .nav-links.show {
        pointer-events: auto;
        opacity: 1;
        visibility: visible;
    }
}

/* ====================================
   MATRIX BACKGROUND FIX
   ==================================== */

/* Keep matrix behind navbar */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
}

/* ====================================
   CONNECT PAGE SPECIFIC FIXES
   ==================================== */

/* Fix input colors on Connect page */
.contact-form input,
.contact-form textarea,
.newsletter-form input,
.newsletter-form textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    background-color: var(--black, rgba(10, 10, 15, 0.8));
    color: var(--white-90, #e0e0e0);
    border: 1px solid rgba(0, 255, 157, 0.3);
}

/* Fix input focus states */
input:focus,
textarea:focus {
    background-color: var(--grey-dark, rgba(10, 10, 15, 0.9));
    border-color: var(--accent-green, #00ff9d);
    outline: none;
}

/* Fix placeholder colors */
input::placeholder,
textarea::placeholder {
    color: rgba(224, 224, 224, 0.5);
}

/* ====================================
   AI CHATBOX - COMPLETELY HANDS OFF
   ==================================== */

/* ENSURE AI CHATBOX GLOW WORKS ON MOBILE */
/* The original mstimaj-ai-chat.css handles:
   - Glow effect: box-shadow: 0 8px 25px rgba(0, 255, 157, 0.3);
   - Float animation: animation: ai-float 3s ease-in-out infinite;
   - Pulse rings: animation: ai-pulse 2s ease-out infinite;
*/

/* MOBILE AI GLOW FIX - Force the glow effect to work AND center it */
@media (max-width: 768px) {
    /* Ensure mobile AI chat has proper glow - force it if needed */
    .ai-avatar-button .ai-avatar-container {
        box-shadow: 0 8px 25px rgba(0, 255, 157, 0.3);
        animation: ai-float 3s ease-in-out infinite;
        
        /* Center the glow effect for mobile size (60px) */
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .ai-avatar-button,
    .ai-avatar-container {
        /* Ensure animations and effects work */
        will-change: transform, opacity, box-shadow;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        
        /* Ensure it's visible and clickable */
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        
        /* Ensure proper centering */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Fix pulse ring centering on mobile */
    .ai-pulse-ring {
        top: -10px;
        left: -10px;
        width: 80px; /* Adjusted for 60px mobile size */
        height: 80px; /* Adjusted for 60px mobile size */
    }
    
    /* Don't let any global animation overrides affect AI chat */
    .ai-avatar-button * {
        animation-duration: inherit;
        transition-duration: inherit;
    }
    
}

/* Fix copyright to be exactly 2 lines on mobile */
@media (max-width: 768px) {
    footer p:last-of-type,
    .site-info,
    .site-info p {
        font-size: 0.7rem;
        line-height: 1.4;
        text-align: center;
        max-width: 70%;
        margin: 0.5rem auto;
        display: block;
        word-break: break-word;
        white-space: normal;
    }
}

/* ====================================
   AI CHATBOX INPUT ALIGNMENT FIX
   ==================================== */

/* Fix AI chat input alignment within wrapper for desktop and mobile */
.ai-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Prevent input from overflowing */
}

.ai-chat-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    min-width: 0; /* Allows flex item to shrink below content size */
}

.ai-send-button {
    flex-shrink: 0; /* Prevent button from shrinking */
    margin-left: 8px; /* Space between input and button */
}

/* Mobile-specific AI chat input fixes */
@media (max-width: 768px) {
    .ai-input-wrapper {
        padding: 3px; /* Slightly less padding on mobile */
    }
    
    .ai-chat-input {
        padding: 10px 12px; /* Adjusted padding for mobile */
        font-size: 14px;
    }
    
    .ai-send-button {
        width: 36px;
        height: 36px;
        margin-left: 6px;
    }
}

/* ====================================
   HUMAN ALGORITHM ARCHIVE - MOBILE & TABLET FIXES
   ==================================== */

/* MOBILE ARCHIVE FIXES - SINGLE COLUMN LAYOUT */
@media (max-width: 768px) {
    /* Content containers */
    .content-container {
        padding: 0 0.5rem;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .articles-display {
        padding: 0;
        margin: 0;
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Featured and regular articles sections */
    .featured-articles-section,
    .regular-articles-section {
        margin: 1rem 0;
        padding: 0;
        overflow-x: hidden;
        width: 100%;
    }
    
    /* FORCE SINGLE COLUMN ON MOBILE - SPECIFIC TO ARTICLES ONLY */
    .voiceitonce-articles-grid,
    .articles-grid,
    .content-grid,
    .regular-articles-section .voiceitonce-articles-grid,
    .featured-articles-section .voiceitonce-articles-grid {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        gap: 1.5rem;
        margin: 1rem 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Override any inline grid styles on mobile - ONLY FOR ARTICLES */
    .voiceitonce-articles-grid[style*="grid-template-columns"],
    .articles-grid[style*="grid-template-columns"],
    .content-grid[style*="grid-template-columns"] {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
    }
    
    /* Article cards mobile fixes - CONTAINER-AWARE SIZING */
    .voiceitonce-article-card,
    .human-algorithm-item,
    article.voiceitonce-article-card,
    article.human-algorithm-item {
        margin: 0 0 1.5rem 0;
        padding: 1rem;
        aspect-ratio: auto; /* Remove fixed aspect ratio on mobile */
        min-height: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        height: auto;
        position: relative;
    }
    
    /* NUCLEAR OPTION - Override any inline aspect-ratio and sizing styles */
    .voiceitonce-article-card[style],
    .human-algorithm-item[style],
    article.voiceitonce-article-card[style],
    article.human-algorithm-item[style],
    article[style*="aspect-ratio"],
    article[class*="voiceitonce-article"][style] {
        aspect-ratio: auto;
        height: auto;
        min-height: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        margin-left: 0;
        margin-right: 0;
        left: auto;
        right: auto;
    }
    
    /* Ensure parent containers have proper mobile padding */
    .content-container,
    .articles-display,
    .featured-articles-section,
    .regular-articles-section {
        padding-left: 1rem;
        padding-right: 1rem;
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* TABLET ARCHIVE FIXES */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Fix tablet article cards - remove aspect ratio constraints */
    .voiceitonce-article-card,
    .human-algorithm-item,
    article.voiceitonce-article-card,
    article.human-algorithm-item {
        aspect-ratio: auto; /* Remove fixed aspect ratio on tablet */
        min-height: auto;
        height: auto;
        padding: 1.25rem;
    }
    
    /* Override inline aspect-ratio styles for tablet */
    article[style*="aspect-ratio: 1/1"],
    article[style*="aspect-ratio: 2/1"],
    article[style*="aspect-ratio"] {
        aspect-ratio: auto;
        height: auto;
        min-height: auto;
    }
    
    /* Fix read more button alignment on tablet */
    .voiceitonce-article-meta .meta-right {
        display: flex;
        justify-content: flex-end;
        margin-left: auto;
    }
}

/* MOBILE & TABLET HEADER FIXES - DO NOT TOUCH DESKTOP */
@media (max-width: 768px) {
    /* Remove gap between navbar and page header on mobile */
    main {
        margin-top: 0;
        padding-top: 0;
    }
    
    .page-header {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Mobile header fixes - reduce excessive padding */
    .page-header .header-content,
    .header-content[style*="padding: 4rem 0"] {
        padding: 1rem 0; /* Reduce from 4rem to 1rem on mobile */
    }
    
    /* Mobile title sizing */
    .page-header h1,
    #page-title {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .page-header .subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Remove gap between navbar and page header on tablet */
    main {
        margin-top: 0;
        padding-top: 0;
    }
    
    .page-header {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Tablet header fixes - reduce excessive padding */
    .page-header .header-content,
    .header-content[style*="padding: 4rem 0"] {
        padding: 1.5rem 0; /* Reduce from 4rem to 1.5rem on tablet */
    }
    
    /* Tablet title sizing */
    .page-header h1,
    #page-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .page-header .subtitle {
        font-size: 1rem;
        line-height: 1.4;
    }
}

/* ====================================
   SINGLE ARTICLE PAGE - MOBILE & TABLET FIXES
   ==================================== */

/* SINGLE ARTICLE MOBILE FIXES */
@media (max-width: 768px) {
    /* Fix horizontal scroll on single articles */
    .single-voice_article,
    .single-article {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .single-voice_article main,
    .single-article main {
        overflow-x: hidden;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Article page header fixes */
    .single-voice_article .page-header,
    .single-article .page-header {
        margin-top: 0;
        padding: 0 1rem;
    }
    
    .single-voice_article .header-content,
    .single-article .header-content {
        padding: 1rem 0;
    }
    
    /* Article title sizing */
    .single-voice_article h1,
    .single-article h1,
    .article-title {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    /* Article content container */
    .article-content,
    .single-article-content,
    .voice-article-content {
        padding: 0 1rem;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    /* Article meta information */
    .article-meta,
    .voice-article-meta {
        padding: 0 1rem;
        font-size: 0.9rem;
        margin: 1rem 0;
    }
    
    /* Article categories and tags */
    .article-categories,
    .article-tags,
    .voice-categories {
        margin: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .category-tag,
    .article-tag,
    .voice-category-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
        margin: 0.2rem;
    }
    
    /* Article paragraphs and content */
    .article-content p,
    .voice-article-content p,
    .single-article-content p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.2rem;
        text-align: left;
    }
    
    /* Article navigation (prev/next) */
    .article-navigation,
    .post-navigation {
        padding: 0 1rem;
        margin: 2rem 0;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-previous,
    .nav-next {
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    /* Comments section */
    .comments-section,
    .article-comments {
        padding: 0 1rem;
        margin: 2rem 0;
    }
    
    /* Comment form styling */
    .comment-form,
    .post-comment-form {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .comment-form h3,
    .comment-form h4 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .comment-form input,
    .comment-form textarea {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        margin-bottom: 1rem;
        border-radius: 4px;
        box-sizing: border-box;
    }
    
    .comment-form textarea {
        min-height: 120px;
        resize: vertical;
    }
    
    .comment-form button,
    .comment-form input[type="submit"] {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 4px;
        cursor: pointer;
    }
    
    /* Newsletter signup form */
    .newsletter-signup,
    .human-algorithm-signup {
        padding: 1rem;
        margin: 2rem 0;
        text-align: center;
    }
    
    .newsletter-signup h3,
    .newsletter-signup h4 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .newsletter-form,
    .signup-form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        max-width: 100%;
        margin: 1rem 0;
    }
    
    .newsletter-form input,
    .signup-form input {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: 4px;
        box-sizing: border-box;
    }
    
    /* FORCE newsletter form alignment on MOBILE ONLY - preserve tablet layout */
    .newsletter-form,
    .newsletter-form div,
    .newsletter-form .form-group {
        padding-left: 0;
        margin-left: 0;
    }
    
    /* Ensure the checkbox container has no extra padding on MOBILE ONLY */
    .newsletter-form div[style*="display: flex"] {
        padding-left: 0;
        margin-left: 0;
    }
    
    /* FORCE both checkboxes to be identical on MOBILE ONLY */
    .newsletter-form input[type="checkbox"]#newsletter_privacy_consent,
    .contact-form input[type="checkbox"]#privacy_consent {
        padding: 0;
        margin: 0;
        width: auto;
        height: auto;
        position: static;
    }
    
    .contact-form {
        padding-left: 0;
        margin-left: 0;
    }
    
    .newsletter-form button,
    .signup-form button {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 4px;
        cursor: pointer;
    }
    
    
    /* Privacy policy and consent text */
    .privacy-consent,
    .newsletter-consent {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        margin: 0.5rem 0;
        text-align: left;
    }

    .privacy-consent label,
    .newsletter-consent label {
        display: inline;
        font-size: 0.75rem;
        line-height: 1.4;
        text-align: left;
        flex: 1 1 auto;
        word-wrap: break-word;
    }
    
    /* More from Human Algorithm section */
    .more-articles,
    .back-to-human-algorithm {
        padding: 0 1rem;
        margin: 2rem 0;
        text-align: center;
    }
    
    .back-link,
    .more-articles a {
        display: inline-block;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        text-decoration: none;
        border-radius: 4px;
        margin: 0.5rem 0;
    }
    
    /* Related articles */
    .related-articles {
        padding: 0 1rem;
        margin: 2rem 0;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* SINGLE ARTICLE TABLET FIXES */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Fix horizontal scroll on single articles - tablet */
    .single-voice_article,
    .single-article {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .single-voice_article main,
    .single-article main {
        overflow-x: hidden;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Article title sizing for tablet */
    .single-voice_article h1,
    .single-article h1,
    .article-title {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 1.2rem;
    }
    
    /* Article content container for tablet */
    .article-content,
    .single-article-content,
    .voice-article-content {
        padding: 0 2rem;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    /* Article paragraphs for tablet */
    .article-content p,
    .voice-article-content p,
    .single-article-content p {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    /* Comment form for tablet */
    .comment-form,
    .post-comment-form {
        padding: 1.5rem;
        max-width: 600px;
        margin: 1.5rem auto;
    }
    
    /* Newsletter form for tablet - FIXED */
    .newsletter-form,
    .signup-form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        max-width: 500px;
        margin: 1rem auto;
        align-items: stretch;
    }
    
    /* Fix form-row on tablet to stack vertically */
    .newsletter-form .form-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .newsletter-form .form-row .form-group {
        width: 100%;
        margin: 0;
    }
    
    .newsletter-form input,
    .signup-form input {
        width: 100%;
        padding: 0.75rem;
        margin-bottom: 0;
        box-sizing: border-box;
    }
    
    .newsletter-form button,
    .signup-form button {
        width: 100%;
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    /* FORCE both checkboxes to be identical on TABLET too */
    .newsletter-form input[type="checkbox"]#newsletter_privacy_consent,
    .contact-form input[type="checkbox"]#privacy_consent {
        padding: 0;
        margin: 0;
        width: auto;
        height: auto;
        position: static;
    }
    
    
    /* Related articles grid for tablet */
    .related-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}
    
    /* Fix article titles on mobile */
    .voiceitonce-article-title {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    /* Fix article excerpts */
    .voiceitonce-article-excerpt {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    /* Fix article meta - make read more right-aligned */
    .voiceitonce-article-meta {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .voiceitonce-article-meta .meta-left {
        justify-content: center;
        font-size: 0.8rem;
    }
    
    .voiceitonce-article-meta .meta-right {
        display: flex;
        justify-content: flex-end; /* Right-align read more */
        align-self: flex-end;
    }
    
    .read-more-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    /* Fix pagination on mobile */
    .voiceitonce-pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
        margin: 2rem 0 1rem 0;
        padding: 0 1rem;
    }
    
    .voiceitonce-page-btn {
        padding: 0.3rem 0.7rem;
        font-size: 0.85rem;
        min-width: 35px;
    }
    
    /* Fix category tags */
    .voiceitonce-category-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    /* Fix badges */
    .voiceitonce-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
}

/* ====================================
   HUMAN ALGORITHM SIDEBAR MOBILE FIXES
   ==================================== */

@media (max-width: 768px) {
    /* Fix Browse Categories boxes */
    .browse-categories,
    .categories-section,
    .category-grid {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .category-item,
    .category-card {
        width: 100%;
        margin: 0.5rem 0;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Fix Support My Work boxes */
    .support-section,
    .support-work,
    .donation-section {
        padding: 1rem;
        margin: 1rem 0;
        text-align: center;
    }
    
    .support-button,
    .donate-button {
        display: block;
        width: 100%;
        max-width: 250px;
        margin: 0.5rem auto;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Fix Recent Articles links */
    .recent-articles,
    .sidebar-recent,
    .recent-posts {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .recent-article-item,
    .recent-post-item {
        margin: 0.75rem 0;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(0, 255, 157, 0.1);
    }
    
    .recent-article-title,
    .recent-post-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .recent-article-date,
    .recent-post-date {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
}

/* ====================================
   HOME PAGE BOX ALIGNMENT FIX
   ==================================== */

/* Fix hero CTA button alignment */
.hero-cta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Ensure both buttons have equal width and alignment */
.hero-cta .btn-primary,
.hero-cta .btn-secondary {
    flex: 1 1 auto;
    max-width: 300px;
    min-width: 250px;
    text-align: center;
    padding: 1rem 2rem;
    margin: 0;
    
    /* Ensure equal height */
    box-sizing: border-box;
    height: auto;
    line-height: 1.2;
}

/* Mobile stacking for hero buttons */
@media (max-width: 768px) {
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .hero-cta .btn-primary,
    .hero-cta .btn-secondary {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* ====================================
   FOOTER SPACING FIX - SOCIAL SECTION
   ==================================== */

/* Fix ONLY social links spacing - DO NOT TOUCH OTHER FOOTER ELEMENTS */
.social-links,
.social-links-container,
.social-link {
    line-height: 1.6;
    margin-bottom: 0;
    margin-top: 0; 
    padding: 0;
    margin: 0;
}

/* NUCLEAR OPTION - REMOVE ALL SPACING FROM SOCIAL LINKS */
a.social-link,
.social-links-container a.social-link,
.social-links a.social-link {
    padding: 0;
    margin: 0;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    gap: 0.1rem;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* NUCLEAR OPTION - REMOVE ALL SPACING FROM SVG ICONS */
a.social-link svg,
.social-links-container a.social-link svg,
.social-links a.social-link svg {
    margin: 0;
    padding: 0;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0.1rem;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Fix ONLY social links text elements - DO NOT TOUCH QUICK LINKS */
.social-links p,
.social-links a,
.social-links span {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Fix ONLY social links list spacing - DO NOT TOUCH MAIN FOOTER NAVIGATION */
.social-links ul {
    line-height: 1.6;
}

.social-links li {
    line-height: 1.6;
    margin-bottom: 0.25rem;
}

/* ====================================
   PAGE TITLE OVERLAP FIX
   ==================================== */

@media (max-width: 768px) {
    /* Fix page titles not overlapping with navbar */
    .page-header,
    .page-title,
    .hero,
    .hero-section,
    h1:first-child {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    /* Connect page specific title fix */
    .connect-page h1,
    .connect-header h1 {
        margin-top: 1rem;
    }
}

/* ====================================
   LAUNCH BANNER - HIDDEN ON MOBILE
   ==================================== */

/* Hide launch banner completely on mobile */
@media (max-width: 768px) {
    #launch-special-banner {
        display: none;
    }
}

/* ====================================
   PORTFOLIO PAGE MOBILE FIXES
   ==================================== */

@media (max-width: 768px) {
    /* Portfolio grid mobile improvements */
    .portfolio-grid {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    /* Project cards mobile spacing */
    .project-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Project content mobile adjustments */
    .project-content h2 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    /* Plugin grid mobile - force single column */
    .plugins-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    /* Plugin cards mobile padding */
    .plugin-card {
        padding: 1rem;
        text-align: center;
    }
    
    /* Beta form mobile improvements */
    .tester-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tester-form div {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tester-form input[type="text"],
    .tester-form input[type="email"] {
        width: 100%;
        box-sizing: border-box;
        margin: 0;
    }
    
    /* Form container mobile padding */
    .tester-form div[style*="background: linear-gradient"] {
        padding: 1.5rem 1rem;
        margin: 1.5rem 0;
    }
    
    /* Project meta mobile stacking */
    .project-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    /* Status and category mobile sizing */
    .status, .category {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Project actions mobile stacking */
    .project-actions {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    /* Project features mobile list */
    .project-features ul {
        padding-left: 0;
        margin: 1rem 0;
    }
    
    .project-features li {
        padding-left: 1rem;
        margin: 0.75rem 0;
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Checkbox labels mobile layout */
    .tester-form label[style*="display: flex"] {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    /* Privacy consent mobile layout */
    .tester-form div[style*="display: flex; align-items: center"] {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: left;
    }
    
    /* Mobile form button */
    .tester-form button {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1rem;
    }
    
    /* ARTICLE NEWSLETTER CONSENT FIX - Mobile-specific override */
    .single-voice_article .newsletter-section {
        text-align: center;
    }
    
    .single-voice_article .newsletter-section form > div:last-of-type {
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
        gap: 8px;
        margin: 0 auto 1rem auto;
        width: 100%;
        max-width: 90%;
        padding: 0;
        box-sizing: border-box;
    }
    
    .single-voice_article .newsletter-section input[type="checkbox"]#article_newsletter_privacy_consent {
        flex: 0 0 auto;
        margin: 2px 8px 0 0;
        padding: 0;
        width: auto;
        height: auto;
    }
    
    .single-voice_article .newsletter-section label[for="article_newsletter_privacy_consent"] {
        flex: 1;
        text-align: left;
        line-height: 1.4;
        margin: 0;
        padding: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        width: auto;
    }
}

/* ====================================
   FAQ PAGE MOBILE FIXES
   ==================================== */

@media (max-width: 768px) {
    /* FAQ page container mobile padding */
    .faq-page {
        padding: 1rem 0.5rem;
        max-width: 100%;
    }
    
    /* FAQ hero section mobile */
    .faq-hero {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
        border-radius: 8px;
    }
    
    .faq-hero h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .faq-hero .tagline {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }
    
    .faq-hero .mission {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    
    /* FAQ sections mobile spacing */
    .faq-section {
        margin-bottom: 2rem;
    }
    
    .faq-section h2 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1.5rem;
        padding-bottom: 0.5rem;
    }
    
    /* FAQ items mobile layout */
    .faq-item {
        margin-bottom: 1rem;
        border-radius: 6px;
    }
    
    /* FAQ questions mobile */
    .faq-question {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .faq-question h3 {
        font-size: 0.95rem;
        line-height: 1.4;
        margin: 0;
        flex: none;
        width: 100%;
    }
    
    .faq-toggle {
        align-self: flex-end;
        margin-left: 0;
        margin-top: -2rem;
        position: relative;
        z-index: 1;
    }
    
    /* FAQ answers mobile */
    .faq-answer {
        padding: 0 1rem;
    }
    
    .faq-answer.active {
        padding: 1rem;
        max-height: 2000px;
    }
    
    .faq-answer p {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .faq-answer ul {
        padding-left: 1.5rem;
        margin: 0.75rem 0;
    }
    
    .faq-answer li {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }
    
    /* FAQ highlight boxes mobile */
    .faq-answer .highlight {
        padding: 0.75rem;
        margin: 0.75rem 0;
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Contact CTA mobile */
    .contact-cta {
        padding: 2rem 1rem;
        margin-top: 2rem;
        border-radius: 8px;
        text-align: center;
    }
    
    .contact-cta h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .contact-cta p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    .contact-cta .btn-primary {
        width: 100%;
        max-width: 300px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        display: block;
        margin: 0 auto;
    }
}

/* FAQ page tablet fixes */
@media (min-width: 769px) and (max-width: 1024px) {
    .faq-page {
        padding: 1.5rem 1rem;
    }
    
    .faq-hero {
        padding: 2.5rem 1.5rem;
    }
    
    .faq-hero h1 {
        font-size: 2.5rem;
    }
    
    .faq-question {
        padding: 1.25rem;
    }
    
    .faq-answer.active {
        padding: 1.25rem;
    }
    
    .contact-cta {
        padding: 2.5rem 1.5rem;
    }
}

/* ====================================
   SUPPORT & LEGAL PAGES MOBILE FIXES
   ==================================== */

@media (max-width: 768px) {
    /* ACTUAL page class names used in the templates */
    .accessibility-page,
    .privacy-policy,
    .terms-of-service,
    .cookie-policy,
    .bug-report-page,
    .feedback-page,
    .sitemap-page,
    .testimonials-page,
    .gratitude-page {
        padding: 1rem 0.5rem;
        max-width: 100%;
        line-height: 1.6;
    }
    
    /* Hero sections - like FAQ page */
    .accessibility-hero,
    .testimonials-hero,
    .bug-report-hero,
    .privacy-hero,
    .terms-hero,
    .cookie-hero,
    .support-hero {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
        border-radius: 8px;
        text-align: center;
    }
    
    .accessibility-hero h1,
    .testimonials-hero h1,
    .bug-report-hero h1,
    .privacy-hero h1,
    .terms-hero h1,
    .cookie-hero h1,
    .support-hero h1,
    .gratitude-hero h1,
    .accessibility-page h1,
    .privacy-policy h1,
    .terms-of-service h1,
    .cookie-policy h1,
    .testimonials-page h1,
    .bug-report-page h1,
    .gratitude-page h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    /* Page content headings */
    .accessibility-page h2,
    .privacy-policy h2,
    .terms-of-service h2,
    .cookie-policy h2,
    .bug-report-page h2,
    .feedback-page h2,
    .sitemap-page h2,
    .testimonials-page h2,
    .gratitude-page h2 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin: 2rem 0 1rem 0;
    }
    
    .accessibility-page h3,
    .privacy-policy h3,
    .terms-of-service h3,
    .cookie-policy h3,
    .bug-report-page h3,
    .feedback-page h3,
    .sitemap-page h3,
    .testimonials-page h3,
    .gratitude-page h3 {
        font-size: 1.2rem;
        line-height: 1.3;
        margin: 1.5rem 0 0.75rem 0;
    }
    
    .accessibility-page p,
    .privacy-policy p,
    .terms-of-service p,
    .cookie-policy p,
    .bug-report-page p,
    .feedback-page p,
    .sitemap-page p,
    .testimonials-page p,
    .gratitude-page p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    /* Forms in support pages */
    .support-form,
    .feedback-form,
    .bug-report-form,
    .newsletter-form {
        padding: 1rem;
        margin: 1.5rem 0;
        border-radius: 6px;
    }
    
    .support-form input,
    .support-form textarea,
    .support-form select {
        width: 100%;
        padding: 0.75rem;
        margin-bottom: 1rem;
        font-size: 1rem;
        box-sizing: border-box;
    }
    
    .support-form textarea {
        min-height: 120px;
        resize: vertical;
    }
    
    .support-form button,
    .support-form input[type="submit"] {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1rem;
    }
    
    /* Lists in support/legal pages */
    .accessibility-page ul,
    .privacy-policy ul,
    .terms-of-service ul,
    .cookie-policy ul,
    .bug-report-page ul,
    .feedback-page ul,
    .sitemap-page ul,
    .testimonials-page ul,
    .gratitude-page ul {
        padding-left: 1.5rem;
        margin: 1rem 0;
    }
    
    .accessibility-page li,
    .privacy-policy li,
    .terms-of-service li,
    .cookie-policy li,
    .bug-report-page li,
    .feedback-page li,
    .sitemap-page li,
    .testimonials-page li,
    .gratitude-page li {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }
    
    /* Tables in support pages */
    .support-table-wrapper {
        overflow-x: auto;
        margin: 1rem 0;
        border-radius: 6px;
    }
    
    .support-table,
    .legal-table {
        min-width: 500px;
        font-size: 0.8rem;
    }
    
    .support-table th,
    .support-table td,
    .legal-table th,
    .legal-table td {
        padding: 0.5rem;
        text-align: left;
    }
    
    /* Contact cards */
    .contact-card,
    .support-card {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 6px;
        text-align: center;
    }
    
    .contact-card h3,
    .support-card h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    /* Testimonials specific */
    .testimonial-card {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 6px;
    }
    
    .testimonial-text {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .testimonial-author {
        font-size: 0.85rem;
        text-align: right;
    }
    
    /* Newsletter preferences */
    .preference-group {
        margin: 1.5rem 0;
        padding: 1rem;
        border-radius: 6px;
    }
    
    .preference-group h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .checkbox-group {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .checkbox-group label {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Success/Error messages */
    .success-message,
    .error-message,
    .info-message {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 6px;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Navigation breadcrumbs */
    .page-breadcrumbs {
        padding: 0.5rem 1rem;
        margin-bottom: 1rem;
        font-size: 0.8rem;
    }
    
    .page-breadcrumbs a {
        margin-right: 0.5rem;
    }
    
    /* Back to top buttons */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* Tablet fixes for support/legal pages */
@media (min-width: 769px) and (max-width: 1024px) {
    .accessibility-page,
    .privacy-page,
    .terms-page,
    .cookie-page,
    .bug-report-page,
    .feedback-page,
    .sitemap-page,
    .testimonials-page,
    .gratitude-page {
        padding: 1.5rem 1rem;
    }
    
    .support-page-header,
    .legal-page-header {
        padding: 2.5rem 1.5rem;
    }
    
    .support-page-header h1,
    .legal-page-header h1 {
        font-size: 2.2rem;
    }
    
    .support-content,
    .legal-content {
        padding: 0 1.5rem;
    }
    
    .support-form,
    .feedback-form {
        padding: 1.5rem;
        max-width: 600px;
        margin: 1.5rem auto;
    }
}

/* ====================================
   COURSES PAGE FIX (404 Error)
   ==================================== */

/* Ensure courses page content is properly styled */
.courses-page {
    padding-top: 2rem;
}

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

@media (max-width: 768px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ====================================
   SCROLL ENHANCEMENT WITHOUT BREAKING
   ==================================== */

/* Hardware acceleration for smooth scroll */
@media (max-width: 768px) {
    .container,
    .content-wrapper,
    main,
    section {
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* ====================================
   iOS SPECIFIC FIXES (SAFE)
   ==================================== */

@supports (-webkit-touch-callout: none) {
    /* iOS only - fix scroll without breaking layout */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent zoom on input focus */
    input,
    textarea,
    select {
        font-size: 16px;
    }
}

/* ====================================
   NEURAL CANVAS TABLET GRID FIX
   ==================================== */

/* Fix Neural Canvas content grid for tablet - 2 columns instead of 3 */
@media (min-width: 769px) and (max-width: 1199px) {
    /* Target the content grid sections on Neural Canvas page */
    .content-grid,
    .storyboard-grid,
    .templates-grid,
    .tutorials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* Ensure grid items have proper spacing */
    .content-grid .grid-item,
    .storyboard-grid .grid-item,
    .templates-grid .grid-item,
    .tutorials-grid .grid-item {
        margin-bottom: 1.5rem;
    }
    
    /* Fix any flex-based grids that might be used */
    .grid-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* ====================================
   MOBILE OPTIMIZATIONS
   ==================================== */
@media (max-width: 768px) {
    /* Optimize heavy matrix animations on mobile */
    .matrix-rain,
    .matrix-char {
        animation-duration: 0.5s;
    }

    /* ====================================
       CONSENT CHECKBOX / NEWSLETTER FIX
       Apr 7 2026 - Fix labels collapsing to width=0
       ==================================== */

    /* Fix all consent checkbox + label rows on mobile */
    .newsletter-consent,
    div[style*="display: flex"][style*="gap: 8px"] {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .newsletter-consent label,
    div[style*="display: flex"][style*="gap: 8px"] > label {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: calc(100% - 30px);
        font-size: 0.75rem;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        display: block;
    }

    .newsletter-consent input[type="checkbox"],
    div[style*="display: flex"][style*="gap: 8px"] > input[type="checkbox"] {
        flex-shrink: 0;
        width: 16px;
        height: 16px;
        margin-top: 2px;
    }

    /* Fix newsletter sidebar widget on mobile */
    .newsletter-sidebar-widget {
        max-width: 100%;
        box-sizing: border-box;
        padding: 16px;
    }

    .newsletter-sidebar-widget input,
    .newsletter-sidebar-widget button {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ====================================
       OVERFLOW CONTAINMENT
       Fix decorative orbs causing horizontal scroll
       ==================================== */
    section,
    .page-wrapper,
    .site-content {
        overflow-x: hidden;
    }

    .hero-orb,
    .cta-orb,
    .about-hero-orb,
    .about-cta-orb,
    .booking-hero-orb {
        display: none;
    }

    /* ====================================
       SERVICE PAGE BENEFIT ITEMS
       Fix overflow on mobile
       ==================================== */
    .benefit-item,
    .benefit-label {
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* ====================================
       TOUCH TARGET + TEXT SIZE
       ==================================== */

    /* Minimum touch target size */
    .share-btn,
    .social-link,
    footer a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Prevent text from being unreadably small */
    footer li,
    footer a,
    .marquee-item,
    .footer-section a {
        font-size: max(0.75rem, 12px);
    }
}