/* ===== DESKTOP LAYOUT RESTORATION ===== */
/* Restores proper desktop container behavior and fixes layout regressions */
/* Only applies to desktop screens (min-width: 769px) */

@media (min-width: 769px) {
    /* ===== CONTAINER RESTORATION ===== */
    /* Restore proper container max-width and centering on desktop */
    .container {
        max-width: var(--container-max-width, 1200px);
        margin: 0 auto;
        padding: 0 var(--container-padding, 2rem);
    }
    
    .container--narrow {
        max-width: 800px;
    }
    
    .container--wide {
        max-width: 1400px;
    }
    
    /* ===== INDEX PAGE STATS CENTERING ===== */
    /* Fix index page stats section centering */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-xl, 2rem);
        text-align: center;
        justify-items: center;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .stat-item {
        text-align: center;
    }
    
    /* ===== GRID LAYOUTS RESTORATION ===== */
    /* Restore proper grid behavior on desktop */
    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .grid--auto {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .grid--features {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* ===== HEADER OVERLAP FIX ===== */
    /* Ensure content is not obscured by fixed header */
    .main {
        padding-top: 0;
        margin-top: 0;
    }
    
    /* Only add padding if header is actually fixed */
    .header:not(.header--relative) ~ .main,
    .header.header--fixed ~ .main {
        padding-top: 80px;
    }
    
    /* ===== BUTTON RESTORATION ===== */
    /* Restore proper button widths on desktop */
    .btn {
        width: auto;
        min-width: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1.5rem;
    }
    
    .btn:not(.btn--full-width) {
        width: auto;
        max-width: none;
    }
    
    /* ===== REQUEST ACCESS BOXES ===== */
    /* Fix Request Access boxes spanning full width */
    .hero-section__actions .btn,
    .cta-section__actions .btn {
        width: auto;
        min-width: 200px;
        max-width: 300px;
    }
    
    .hero-section__actions,
    .cta-section__actions {
        display: flex;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    /* ===== WARRANT CANARY FIXES ===== */
    /* Fix warrant canary layout issues */
    .canary-statement-box {
        max-width: 70ch;
        margin: 0 auto;
        padding: 1.5rem;
    }
    
    .canary-text {
        font-size: 0.875rem;
        line-height: 1.6;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    .canary-title-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        text-align: center;
    }
    
    .hash-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        gap: 1rem;
    }
    
    .button-container {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    /* ===== TYPOGRAPHY RESTORATION ===== */
    /* Restore proper typography sizes on desktop */
    h1 {
        font-size: var(--font-5xl, 3rem);
        text-align: inherit;
    }
    
    h2 {
        font-size: var(--font-3xl, 1.875rem);
        text-align: inherit;
    }
    
    h3 {
        font-size: var(--font-xl, 1.25rem);
        text-align: inherit;
    }
    
    /* ===== SECTION SPACING RESTORATION ===== */
    /* Restore proper section spacing on desktop */
    section {
        padding: var(--space-4xl, 4rem) 0;
    }
    
    .section--sm {
        padding: var(--space-2xl, 2rem) 0;
    }
    
    .section--lg {
        padding: var(--space-4xl, 4rem) 0 var(--space-4xl, 4rem);
    }
    
    /* ===== FEATURE CARDS RESTORATION ===== */
    /* Restore proper feature card layout on desktop */
    .feature-card,
    .feature-card--with-accent {
        padding: var(--space-2xl, 2rem);
        margin-bottom: 0;
    }
    
    /* ===== MOBILE MENU HIDE ON DESKTOP ===== */
    /* Ensure mobile menu elements are hidden on desktop */
    .nav__toggle,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .nav__menu {
        position: static;
        display: flex;
        width: auto;
        height: auto;
        background: transparent;
        padding: 0;
        box-shadow: none;
        border: none;
        overflow: visible;
    }
    
    .nav__list {
        display: flex;
        flex-direction: row;
        gap: var(--space-lg, 1.5rem);
    }
    
    /* ===== WARRANT CANARY SPECIFIC FIXES ===== */
@media (min-width: 769px) {
    /* Fix warrant canary title visibility on mobile - ensure it's visible */
    .canary-title {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Constrain copy statement width and center it */
    .canary-statement-container,
    .canary-statement-box {
        max-width: 70ch;
        margin: 0 auto;
        text-align: left;
    }
    
    .canary-text {
        max-width: 100%;
        font-size: 0.875rem;
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix beacon alignment - ensure proper flex layout */
    .canary-title-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        text-align: center;
        flex-wrap: wrap;
    }
    
    .canary-status-indicator {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
    }
    
    /* Ensure proper button layout */
    .button-container {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
        margin: 1.5rem 0;
    }
    
    .btn {
        flex: 0 1 auto;
        min-width: 150px;
        max-width: 300px;
    }
    
    /* Fix hash display layout */
    .hash-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .hash-display {
        font-family: monospace;
        font-size: 0.875rem;
        word-break: break-all;
        max-width: 100%;
    }
}

/* ===== MOBILE SPECIFIC CANARY FIXES ===== */
@media (max-width: 768px) {
    /* Ensure warrant canary title is visible on mobile */
    .canary-title {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: var(--mobile-font-h1, 1.75rem) !important;
        text-align: center !important;
    }
    
    /* Stack beacon and title properly on mobile */
    .canary-title-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        text-align: center;
    }
    
    .canary-status-indicator {
        width: 32px;
        height: 32px;
        margin-bottom: 0.5rem;
    }
}
}

/* ===== DEBUG INSTRUMENTATION ===== */
/* Debug logging for layout validation when ?debug=layout=1 */
.debug-layout-info {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    z-index: 9999;
    border-radius: 4px;
    display: none;
}

.debug-layout-info.show {
    display: block;
}

@media (max-width: 768px) {
    .debug-layout-info {
        display: none !important;
    }
}