/* ============================================
   GLOBAL PAGE RESPONSIVE STYLES
   Shared responsive patterns for all pages
   ============================================ */

/* ===== PROJECT/CARD GRIDS RESPONSIVE ===== */

.project-grid,
.ecosystem-grid,
.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

@media (max-width: 1280px) {

    .project-grid,
    .ecosystem-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .project-grid,
    .ecosystem-grid,
    .values-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

/* ===== GALLERY/PROOF GRID RESPONSIVE ===== */

.gallery-grid,
.proof-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 1024px) {

    .gallery-grid,
    .proof-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {

    .gallery-grid,
    .proof-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== TIMELINE RESPONSIVE ===== */

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-4xl);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-default);
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .timeline-item {
        grid-template-columns: auto 1fr;
        gap: var(--space-lg);
        text-align: left;
    }

    .timeline-line {
        left: 0;
        transform: none;
    }

    .timeline-content {
        grid-column: 2;
    }

    .timeline-date {
        grid-column: 2;
    }
}

/* ===== FILTER BUTTONS RESPONSIVE ===== */

.filter-buttons,
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
}

@media (max-width: 480px) {

    .filter-buttons,
    .tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }

    .filter-btn,
    .tab {
        width: 100%;
        text-align: center;
    }
}

/* ===== MODAL/LIGHTBOX RESPONSIVE ===== */

.modal,
.lightbox {
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 768px) {

    .modal,
    .lightbox {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: var(--radius-lg);
    }

    .modal-content {
        padding: var(--space-lg);
    }
}

/* ===== FOOTER RESPONSIVE ===== */

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }

    .footer-socials {
        order: -1;
    }
}

/* ===== SECTION HEADERS RESPONSIVE ===== */

.section-header {
    text-align: center;
    margin-bottom: var(--space-4xl);
}

.section-title {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-md);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .section-header {
        margin-bottom: var(--space-2xl);
    }

    .section-title {
        font-size: var(--text-3xl);
    }

    .section-subtitle {
        font-size: var(--text-base);
    }
}

/* ===== CARD COMPONENTS RESPONSIVE ===== */

.card,
.project-card,
.value-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-image,
.project-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

@media (max-width: 768px) {

    .card-image,
    .project-card-image {
        height: 180px;
    }
}

@media (max-width: 480px) {

    .card,
    .project-card,
    .value-card {
        padding: var(--space-lg);
    }

    .card-image,
    .project-card-image {
        height: 160px;
    }
}

/* ===== HERO SECTIONS RESPONSIVE ===== */

.page-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: var(--space-4xl) 0;
}

@media (max-width: 768px) {
    .page-hero {
        min-height: 50vh;
        padding: var(--space-3xl) 0;
    }
}

/* ===== CONTENT LAYOUT RESPONSIVE ===== */

.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: start;
}

@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }
}

.sidebar-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-3xl);
}

@media (max-width: 1024px) {
    .sidebar-layout {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .sidebar {
        order: -1;
    }
}

/* ===== BLOG/ARTICLE CARDS RESPONSIVE ===== */

.blog-grid,
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-xl);
}

@media (max-width: 768px) {

    .blog-grid,
    .article-grid {
        grid-template-columns: 1fr;
    }
}

.blog-card,
.article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===== LAB EXPERIMENTS RESPONSIVE ===== */

.experiments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

@media (max-width: 480px) {
    .experiments-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== CONNECT PAGE SOCIAL GRID ===== */

.connect-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .connect-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

/* ===== IMAGE OPTIMIZATION RESPONSIVE ===== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.responsive-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.hero-image,
.featured-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 0 auto;
}

@media (max-width: 768px) {

    .hero-image,
    .featured-image {
        max-width: 100%;
    }
}

/* ===== VIDEO/MEDIA RESPONSIVE ===== */

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===== FLAGSHIP/FEATURED ITEMS ===== */

.flagship-item,
.featured-item {
    grid-column: span 2;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

@media (max-width: 768px) {

    .flagship-item,
    .featured-item {
        grid-column: span 1;
    }
}

/* ===== TEXT CONTENT READABILITY ===== */

.content-wrapper,
.article-content {
    max-width: 65ch;
    margin: 0 auto;
}

.content-wrapper p,
.article-content p {
    margin-bottom: var(--space-lg);
    line-height: var(--leading-relaxed);
}

/* ===== UTILITY CLASSES ===== */

@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-full-width {
        width: 100% !important;
    }

    .mobile-text-center {
        text-align: center !important;
    }

    .mobile-stack {
        flex-direction: column !important;
    }
}

@media (min-width: 769px) {
    .desktop-hidden {
        display: none !important;
    }
}

/* ===== PREVENT LAYOUT SHIFT ===== */

.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
}

/* ===== SAFE AREA PADDING (for mobile notches) ===== */

@supports (padding: env(safe-area-inset-bottom)) {
    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .safe-area-top {
        padding-top: env(safe-area-inset-top);
    }
}