/* ========================================
   RESPONSIVE DESIGN - Filipa Matias Portfolio
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero-title {
        font-size: 42px;
    }
    
    .section-title-large {
        font-size: 32px;
    }
}

/* Mobile - Landscape & Portrait */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        background-color: rgba(250, 250, 250, 0.97);
        flex-direction: column;
        padding: var(--spacing-xl) var(--spacing-md);
        transform: translateX(-100%);
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        gap: 0;
        z-index: 9999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        justify-content: center;
        visibility: hidden;
        opacity: 0;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
    }
    
    .nav-menu li {
        width: 100%;
        max-width: 600px;
        display: block;
    }
    
    .nav-menu li:first-child {
        background-color: var(--primary-color);
        border-radius: 32px;
        padding: var(--spacing-xl) var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        width: 100%;
        max-width: 600px;
    }
    
    .nav-menu li:last-child {
        width: 100%;
        max-width: 600px;
        text-align: center;
    }
    
    .nav-menu .btn-pill {
        width: auto;
        text-align: center;
    }
    
    .nav-pill-group {
        width: 100%;
        flex-direction: column;
        background-color: transparent;
        border-radius: 0 !important;
        gap: var(--spacing-xs);
        padding: 0;
        margin: 0;
        overflow: visible;
        display: flex;
    }
    
    .nav-pill-group a {
        width: 100%;
        text-align: left;
        border-radius: 0 !important;
        padding: 14px 0;
        background-color: transparent;
        color: #FAFAFA !important;
        font-size: 22px;
        font-weight: 400;
        display: block;
        border-bottom: none;
        transition: padding-left 0.2s ease;
    }
    
    .nav-pill-group a:first-child {
        border-radius: 0 !important;
    }
    
    .nav-pill-group a:last-child {
        border-radius: 0 !important;
        padding-bottom: 0;
    }
    
    .nav-pill-group a:hover {
        background-color: rgba(255, 255, 255, 0.05);
        padding-left: 10px;
    }
    
    .nav-menu .btn-pill.btn-secondary {
        background-color: var(--secondary-color) !important;
        color: var(--text-primary) !important;
        border-color: var(--secondary-color) !important;
        margin-top: var(--spacing-md);
        padding: 16px 32px;
        border-radius: 50px;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 10000;
        position: relative;
    }
    
    .header {
        overflow: visible;
    }
    
    .header.menu-open {
        background-color: transparent;
        overflow: visible;
    }
    
    /* Hero */
    .hero {
        padding: var(--spacing-lg) 0;
        padding-top: 120px;
    }
    
    .hero-title {
        font-size: 60px;
        line-height: 70px;
        min-width: 180px;
        height: 70px;
    }
    
    .hero-subtitle {
        font-size: 30px;
        line-height: 38px;
        min-height: 80px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .hero-text {
        align-items: center;
        text-align: center;
        width: 100%;
        min-height: 150px;
    }
    
    .hero-title {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-subtitle {
        text-align: center;
    }
    
    .hero-image-container {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    /* Design Philosophy */
    .philosophy-card {
        padding: var(--spacing-lg);
        border-radius: var(--radius-card);
    }
    
    .philosophy-items-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .philosophy-title {
        font-size: 28px;
    }
    
    /* Case Studies */
    .case-studies-wrapper {
        padding: 48px 32px;
        border-radius: 32px;
    }
    
    .section-title-large {
        font-size: 28px;
    }
    
    .case-studies-grid {
        grid-template-columns: 1fr;
    }
    
    /* About Page */
    .about-hero-section,
    .about-details-section {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .about-details-section {
        padding: 40px 0;
    }
    
    .about-heading {
        font-size: 36px;
    }
    
    .about-bio-title {
        font-size: 28px;
        line-height: 36px;
    }
    
    /* Work Page */
    .work-grid {
        grid-template-columns: 1fr;
    }
    
    .work-title {
        font-size: 28px;
    }
    
    .case-title {
        font-size: 20px;
        line-height: 28px;
    }
    
    /* Case Study Page */
    .case-study-header {
        grid-template-columns: 1fr;
    }
    
    .case-study-intro {
        align-items: flex-start;
        text-align: left;
        position: static !important;
    }
    
    .case-tags-list {
        justify-content: flex-start;
    }
    
    .case-study-title {
        font-size: 36px;
    }
    
    .section-images-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-image {
        height: 400px;
    }
    
    .section-heading {
        font-size: 24px;
    }
    
    .outcomes-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --spacing-md: 16px;
        --spacing-lg: 24px;
        --spacing-xl: 32px;
        --spacing-xxl: 48px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    /* Navigation - ensure proper sizing on small screens */
    .nav-menu {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .nav-menu li {
        max-width: 90%;
    }
    
    .nav-menu li:first-child {
        max-width: 90%;
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .nav-menu li:last-child {
        max-width: 90%;
    }
    
    /* Hero */
    .hero {
        padding-top: 100px;
    }
    
    .hero-title {
        font-size: 40px;
        line-height: 50px;
        min-width: 150px;
        height: 50px;
    }
    
    .hero-subtitle {
        font-size: 20px;
        line-height: 28px;
        min-height: 60px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .hero-text {
        align-items: center;
        text-align: center;
        width: 100%;
        min-height: 120px;
    }
    
    .hero-title {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-subtitle {
        text-align: center;
    }
    
    .hero-image-container {
        width: 100%;
        max-width: 240px;
        margin: 0 auto;
    }
    
    /* Philosophy */
    .philosophy-card {
        padding: var(--spacing-md);
    }
    
    .philosophy-items-wrapper {
        gap: var(--spacing-md);
    }
    
    .philosophy-title {
        font-size: 24px;
    }
    
    .philosophy-heading {
        font-size: 18px;
    }
    
    .philosophy-text {
        font-size: 14px;
    }
    
    /* Section Headers */
    .case-studies-wrapper {
        padding: 32px 16px;
        border-radius: 24px;
    }
    
    .section-title-large {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
    
    /* Case Study Cards */
    .case-study-card {
        padding: var(--spacing-sm);
    }
    
    .case-thumbnail {
        height: 160px;
    }
    
    .case-thumbnail-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .case-title {
        font-size: 18px;
    }
    
    /* About Page */
    .about-heading {
        font-size: 32px;
    }
    
    .about-greeting {
        font-size: 18px;
    }
    
    .about-bio-title {
        font-size: 24px;
        line-height: 32px;
    }
    
    .about-paragraph {
        font-size: 16px;
        line-height: 24px;
        max-width: 100%;
    }
    
    /* Work Page */
    .work-title {
        font-size: 24px;
    }
    
    .case-title {
        font-size: 18px;
        line-height: 24px;
    }
    
    .case-description {
        font-size: 14px;
        line-height: 18px;
    }
    
    /* Case Study Page */
    .case-study-title {
        font-size: 28px;
    }
    
    .section-heading {
        font-size: 22px;
    }
    
    .section-text {
        font-size: 14px;
    }
    
    .section-images-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    /* Adjust MOIA image max-height for mobile */
    .section-images-grid.moia-images .image-item img {
        max-height: 900px;
    }
    
    /* Data Canvas images - collapse two-column rows on mobile */
    .section-images-grid.data-canvas-images .image-row-double {
        grid-template-columns: 1fr;
    }
    
    .section-images-grid.data-canvas-images .image-row-double .image-item img {
        max-height: 600px;
    }
    
    .outcome-card {
        padding: var(--spacing-md);
        min-height: 280px;
    }
    
    .outcome-stat {
        font-size: 24px;
    }
    
    /* Buttons */
    .btn-pill {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .btn-pill.btn-small {
        padding: 6px 16px;
        font-size: 12px;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .hero-title {
        font-size: 24px;
    }
    
    .section-title-large {
        font-size: 20px;
    }
    
    .about-heading {
        font-size: 28px;
    }
    
    .case-study-title {
        font-size: 24px;
    }
}

/* Landscape Orientation */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: var(--spacing-md) 0;
    }
    
    .design-philosophy,
    .case-studies-preview {
        padding: var(--spacing-lg) 0;
    }
}
