/* ============================================
   BANANA PSEUDOSTEM SHREDDER PROJECT PAGE
   File: project-banana-shredder.css (TABLET OPTIMIZED)
   Author: Donfack Fortune
   Description: Fully responsive with enhanced tablet support
   Last Updated: 2025
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --color-primary: #e02b20;
    --color-primary-dark: #b81d16;
    --color-primary-light: #ff3b2f;
    --color-accent: #0493f3;
    --color-text-dark: #111;
    --color-text-medium: #333;
    --color-text-light: #666;
    --color-text-lighter: #888;
    --color-bg-white: #ffffff;
    --color-bg-light: #f8f9fa;
    --color-bg-section: #f9f9f9;
    --color-border: #eee;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-shadow-hover: rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --line-height-base: 1.7;
    --line-height-heading: 1.3;
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 2.5rem;
    --space-8: 3rem;
    --space-10: 4rem;
    --space-12: 6rem;

    /* Layout */
    --container-max-width: 1280px;
    --container-padding: 5%;
    --grid-gap: 2rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Shadows */
    --shadow-sm: 0 2px 8px var(--color-shadow);
    --shadow-md: 0 4px 16px var(--color-shadow);
    --shadow-lg: 0 8px 32px var(--color-shadow-hover);

    /* Z-index scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 1000;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-medium);
    background-color: var(--color-bg-white);
    overflow-x: hidden;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   TYPOGRAPHY - FULLY RESPONSIVE
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
    color: var(--color-text-dark);
    margin-bottom: var(--space-4);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1 {
    font-size: clamp(1.75rem, 4vw + 0.5rem, 2.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3.5vw + 0.5rem, 2rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw + 0.5rem, 1.5rem);
}

h4 {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.25rem);
}

p {
    margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
    font-size: clamp(0.9375rem, 1.2vw + 0.5rem, 1.0625rem);
    line-height: 1.75;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

strong {
    font-weight: var(--font-weight-bold);
    color: var(--color-text-dark);
}

ul,
ol {
    margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
    padding-left: clamp(1.5rem, 4vw, 2rem);
}

li {
    margin-bottom: var(--space-2);
    line-height: 1.75;
    font-size: clamp(0.9375rem, 1.2vw + 0.5rem, 1.0625rem);
}

a {
    color: var(--color-text-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary);
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* Responsive container padding */
@media (min-width: 768px) {
    :root {
        --container-padding: 3.5%;
    }
}

@media (min-width: 1024px) {
    :root {
        --container-padding: 3%;
    }
}

@media (min-width: 1280px) {
    :root {
        --container-padding: 2rem;
    }
}

/* ============================================
   HEADER - OPTIMIZED FOR ALL DEVICES
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--color-bg-white);
    box-shadow: var(--shadow-sm);
    padding: clamp(1rem, 2.5vw, 1.5rem) 0;
    transition: all var(--transition-base);
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1rem, 2.5vw, 2rem);
}

/* Logo */
.header-left {
    flex-shrink: 0;
    min-width: fit-content;
}

.logo {
    margin: 0;
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}

.logo a {
    color: var(--color-text-dark);
    transition: color var(--transition-base);
    display: inline-block;
    padding: var(--space-2) 0;
}

.logo a:hover {
    color: var(--color-primary);
}

/* Navigation */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.header-center::-webkit-scrollbar {
    display: none;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: clamp(0.5rem, 2vw, 1.5rem);
    margin: 0;
    padding: 0;
    align-items: center;
    white-space: nowrap;
}

.nav-list li {
    margin: 0;
    flex-shrink: 0;
}

.nav-list a {
    display: inline-block;
    padding: clamp(0.5rem, 1.2vw, 0.625rem) clamp(0.875rem, 2vw, 1.25rem);
    color: var(--color-text-medium);
    font-weight: var(--font-weight-semibold);
    font-size: clamp(0.875rem, 1.1vw + 0.25rem, 1rem);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.nav-list a:hover,
.nav-list a:focus,
.nav-list a.active {
    color: var(--color-primary);
    background: rgba(224, 43, 32, 0.08);
}

/* Social Icons */
.header-right {
    display: flex;
    gap: clamp(0.75rem, 1.5vw, 1rem);
    align-items: center;
    flex-shrink: 0;
}

.social-icons {
    display: flex;
    gap: clamp(0.5rem, 1.5vw, 0.875rem);
    align-items: center;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(2.25rem, 4vw, 2.5rem);
    height: clamp(2.25rem, 4vw, 2.5rem);
    border-radius: var(--radius-full);
    background: var(--color-bg-light);
    color: var(--color-text-dark);
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.social-icons a:hover,
.social-icons a:focus {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 43, 32, 0.3);
}

.social-icons svg {
    display: block;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    padding: clamp(2.5rem, 6vw, 4rem) 0;
    min-height: calc(100vh - 300px);
}

/* ============================================
   PAGE TITLE
   ============================================ */
.page-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw + 0.5rem, 2.5rem);
    font-weight: var(--font-weight-bold);
    margin: clamp(1.5rem, 3vw, 2rem) auto clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.5px;
    line-height: var(--line-height-heading);
    max-width: 95%;
    color: var(--color-text-dark);
    padding: 0 var(--space-4);
}

/* ============================================
   PROJECT SECTIONS
   ============================================ */
.project-section {
    margin: clamp(2rem, 5vw, 4rem) 0;
}

.section-content {
    max-width: 100%;
}

.section-heading {
    font-size: clamp(1.5rem, 3.5vw + 0.5rem, 2rem);
    font-weight: var(--font-weight-bold);
    margin-bottom: clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--color-text-dark);
    position: relative;
    padding-bottom: var(--space-3);
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: clamp(50px, 8vw, 60px);
    height: 3px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
}

.subsection-heading {
    font-size: clamp(1.25rem, 2.5vw + 0.5rem, 1.5rem);
    font-weight: var(--font-weight-semibold);
    margin: clamp(1.5rem, 3.5vw, 2rem) 0 clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-dark);
}

.subsection-subheading {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.25rem);
    font-weight: var(--font-weight-semibold);
    margin: clamp(1.25rem, 2.5vw, 1.5rem) 0 clamp(0.875rem, 1.5vw, 1rem);
    color: var(--color-text-medium);
}

/* ============================================
   ABOUT SECTION (TABLET OPTIMIZED)
   ============================================ */
.about-section {
    margin: clamp(2.5rem, 5vw, 4rem) 0;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4vw, 3rem);
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ============================================
   DOWNLOADS SECTION
   ============================================ */
.downloads-section {
    background: var(--color-bg-section);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: var(--radius-lg);
    margin: clamp(2rem, 5vw, 3rem) 0;
    box-shadow: var(--shadow-sm);
}

.btn-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    flex-wrap: wrap;
}

.download-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    text-align: center;
    background: var(--color-primary);
    color: var(--color-bg-white);
    font-weight: var(--font-weight-semibold);
    padding: clamp(0.75rem, 1.8vw, 0.875rem) clamp(1.25rem, 3.5vw, 1.75rem);
    border-radius: var(--radius-md);
    font-size: clamp(0.9375rem, 1.3vw + 0.25rem, 1.0625rem);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    border: 2px solid transparent;
    min-height: 44px;
}

.download-btn:hover,
.download-btn:focus {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.download-btn:focus-visible {
    outline: 3px solid var(--color-text-dark);
    outline-offset: 4px;
}

.download-btn i {
    font-size: 1.1em;
}

/* ============================================
   IMAGES & FIGURES
   ============================================ */
.centered-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: clamp(2rem, 4vw, 3rem) 0;
    gap: clamp(0.75rem, 1.5vw, 1rem);
}

.responsive-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-slow);
}

.responsive-img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.img-caption {
    font-size: clamp(0.875rem, 1.3vw + 0.25rem, 0.9375rem);
    color: var(--color-text-light);
    text-align: center;
    font-style: italic;
    max-width: 95%;
    line-height: 1.6;
    padding: 0 var(--space-4);
}

/* ============================================
   PROJECT GALLERY
   ============================================ */
.project-gallery {
    margin: clamp(2.5rem, 6vw, 5rem) 0;
}

.gallery-heading {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    font-size: clamp(1.75rem, 4vw + 0.5rem, 2.25rem);
    color: var(--color-text-dark);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 3vw, 2rem);
}

.gallery-item {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-img {
    width: 100%;
    height: clamp(250px, 45vw, 450px);
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-caption {
    padding: clamp(1rem, 2.5vw, 1.5rem);
    font-size: clamp(0.9375rem, 1.3vw + 0.25rem, 1rem);
    color: var(--color-text-medium);
    text-align: center;
    background: var(--color-bg-white);
    line-height: 1.6;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   BACK BUTTON
   ============================================ */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-primary);
    color: var(--color-bg-white);
    font-weight: var(--font-weight-semibold);
    padding: clamp(0.75rem, 1.8vw, 0.875rem) clamp(1.5rem, 3.5vw, 2rem);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: clamp(1rem, 1.3vw + 0.25rem, 1.125rem);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    margin-top: clamp(2rem, 4vw, 3rem);
    border: 2px solid transparent;
    min-height: 44px;
}

.back-btn:hover,
.back-btn:focus {
    background: var(--color-primary-dark);
    transform: translateX(-5px);
    box-shadow: var(--shadow-lg);
}

.back-btn:focus-visible {
    outline: 3px solid var(--color-text-dark);
    outline-offset: 4px;
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: clamp(1.25rem, 3vw, 2rem);
    right: clamp(1.25rem, 3vw, 2rem);
    z-index: var(--z-dropdown);
    display: none;
    align-items: center;
    justify-content: center;
    width: clamp(2.75rem, 4.5vw, 3.125rem);
    height: clamp(2.75rem, 4.5vw, 3.125rem);
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    font-size: clamp(1.125rem, 1.8vw, 1.375rem);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(20px);
}

.back-to-top.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus {
    background: var(--color-primary-dark);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(224, 43, 32, 0.4);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-white);
    padding: clamp(1.5rem, 3vw, 2rem) 0;
    text-align: center;
    margin-top: clamp(3rem, 8vw, 6rem);
}

.footer p {
    margin: 0;
    font-size: clamp(0.875rem, 1.3vw + 0.25rem, 1rem);
    color: var(--color-text-light);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Small Tablets (600px - 767px) */
@media (min-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
        gap: 1.5rem;
    }

    .about-content {
        flex-direction: row;
        align-items: flex-start;
    }

    .about-text {
        flex: 1.2;
    }

    .about-image {
        flex: 0.8;
    }
}

/* ============================================
   TABLET PORTRAIT (768px - 1023px) - OPTIMIZED
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Header Optimization */
    .header {
        padding: 1.25rem 0;
    }

    .header-flex {
        gap: 1.5rem;
        flex-wrap: nowrap;
    }

    .header-left {
        flex: 0 0 auto;
    }

    .header-center {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0 var(--space-2);
    }

    .nav-list {
        gap: 0.75rem;
        justify-content: center;
    }

    .nav-list a {
        padding: 0.5rem 0.875rem;
        font-size: 0.9375rem;
    }

    .header-right {
        flex: 0 0 auto;
        gap: 0.75rem;
    }

    .social-icons {
        gap: 0.625rem;
    }

    .social-icons a {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    /* About Section Optimization */
    .about-content {
        flex-direction: row;
        gap: 2.5rem;
        align-items: flex-start;
    }

    .about-text {
        flex: 1.3;
    }

    .about-image {
        flex: 0.7;
        position: sticky;
        top: 6rem;
    }

    .about-image img {
        max-width: 100%;
    }

    /* Page Title */
    .page-title {
        max-width: 90%;
        font-size: 2rem;
        margin: 1.5rem auto 2.5rem;
    }

    /* Sections */
    .project-section {
        margin: 3rem 0;
    }

    .section-content {
        max-width: 100%;
    }

    /* Downloads Section */
    .downloads-section {
        padding: 2rem;
        margin: 2.5rem 0;
    }

    .btn-row {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }

    .download-btn {
        flex: 0 1 auto;
        min-width: 180px;
        max-width: 260px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .back-btn {
        padding: 0.75rem 1.5rem;
        margin-top: 2.5rem;
        font-size: 1rem;
    }

    /* Gallery Optimization */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem;
    }

    .gallery-img {
        height: 320px;
    }

    .gallery-caption {
        padding: 1.25rem;
        font-size: 0.9375rem;
    }

    /* Images & Figures */
    .centered-figure {
        margin: 2.5rem 0;
    }

    .responsive-img {
        max-width: 85%;
    }

    /* Back to Top Button */
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    /* Typography adjustments */
    p {
        font-size: 1rem;
        line-height: 1.75;
    }

    li {
        font-size: 1rem;
    }
}

/* ============================================
   TABLET LANDSCAPE (1024px - 1279px) - OPTIMIZED
   ============================================ */
@media (min-width: 1024px) and (max-width: 1279px) {

    /* Header */
    .header-flex {
        gap: 2rem;
    }

    .nav-list {
        gap: 1rem;
    }

    .nav-list a {
        padding: 0.625rem 1.125rem;
        font-size: 0.9375rem;
    }

    .social-icons a {
        width: 2.375rem;
        height: 2.375rem;
    }

    /* About Section */
    .about-content {
        flex-direction: row;
        gap: 3rem;
    }

    .about-text {
        flex: 1.4;
    }

    .about-image {
        flex: 0.6;
        position: sticky;
        top: 5.5rem;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .gallery-img {
        height: 360px;
    }

    /* Downloads Section */
    .downloads-section {
        padding: 2.25rem;
        margin: 3rem 0;
    }

    .btn-row {
        gap: 1.25rem;
        justify-content: center;
        align-items: center;
    }

    .download-btn {
        min-width: 200px;
        max-width: 280px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    /* Back Button */
    .back-btn {
        padding: 0.8rem 1.75rem;
        margin-top: 3rem;
        font-size: 1.0625rem;
    }

    /* Back to Top Button */
    .back-to-top {
        bottom: 1.75rem;
        right: 1.75rem;
        width: 3.125rem;
        height: 3.125rem;
        font-size: 1.25rem;
    }
}

/* ============================================
   DESKTOP (1280px and above)
   ============================================ */
@media (min-width: 1280px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-content {
        max-width: 95%;
    }

    .about-content {
        flex-direction: row;
        gap: 3.5rem;
    }

    .about-text {
        flex: 1.5;
    }

    .about-image {
        flex: 0.5;
        position: sticky;
        top: 5rem;
    }
}

/* ============================================
   MOBILE (below 768px)
   ============================================ */
@media (max-width: 767px) {
    .header {
        padding: var(--space-4) 0;
    }

    .header-flex {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .header-center {
        width: 100%;
    }

    .nav-list {
        width: 100%;
        gap: var(--space-3);
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-right,
    .social-icons {
        justify-content: center;
    }

    .about-content {
        flex-direction: column;
        gap: 2rem;
    }

    .about-image {
        order: -1;
    }

    .btn-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
    }

    .download-btn {
        width: 100%;
        max-width: none;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-img {
        height: clamp(250px, 60vw, 350px);
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    :root {
        --grid-gap: 1.25rem;
        --space-10: 3rem;
        --space-12: 4rem;
    }

    .header {
        padding: var(--space-3) 0;
    }

    .nav-list {
        gap: var(--space-2);
    }

    .nav-list a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .social-icons a {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    .page-title {
        padding: 0 var(--space-3);
    }

    .downloads-section {
        padding: var(--space-5);
    }

    .gallery-img {
        height: clamp(220px, 70vw, 300px);
    }

    .back-to-top {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }
}

/* Extra Small (360px and below) */
@media (max-width: 360px) {
    .nav-list {
        flex-direction: column;
        gap: var(--space-2);
    }

    .nav-list a {
        width: 100%;
        text-align: center;
    }

    .social-icons a {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   TABLET-SPECIFIC ORIENTATION FIXES
   ============================================ */

/* Tablet Portrait Orientation */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    .header-flex {
        flex-wrap: nowrap;
    }

    .nav-list {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    /* Button Spacing */
    .btn-row {
        gap: 1rem;
    }

    .download-btn {
        min-width: 170px;
        max-width: 250px;
    }

    .back-btn {
        margin-top: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-img {
        height: 300px;
    }
}

/* Tablet Landscape Orientation */
@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    .header {
        padding: 1rem 0;
    }

    .main-content {
        padding: 2rem 0;
    }

    .page-title {
        margin: 1rem auto 1.5rem;
    }

    .project-section {
        margin: 2rem 0;
    }

    .about-content {
        gap: 2rem;
    }

    /* Button Spacing */
    .downloads-section {
        padding: 1.75rem;
        margin: 2rem 0;
    }

    .btn-row {
        gap: 1.25rem;
    }

    .download-btn {
        min-width: 190px;
        max-width: 270px;
        padding: 0.75rem 1.375rem;
    }

    .back-btn {
        padding: 0.75rem 1.5rem;
        margin-top: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .gallery-img {
        height: 280px;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }
}

/* Landscape Orientation (All Devices) */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: var(--space-2) 0;
    }

    .main-content {
        padding: var(--space-6) 0;
    }

    .back-to-top {
        bottom: var(--space-3);
        right: var(--space-3);
        width: 2.5rem;
        height: 2.5rem;
    }

    .page-title {
        margin: 1rem auto 1.5rem;
    }
}

/* ============================================
   SPECIFIC TABLET DEVICE OPTIMIZATIONS
   ============================================ */

/* iPad (768px x 1024px) */
@media (min-width: 768px) and (max-width: 768px) {
    .nav-list a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* iPad Pro 11" (834px x 1194px) */
@media (min-width: 834px) and (max-width: 834px) {
    .nav-list {
        gap: 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iPad Pro 12.9" (1024px x 1366px) */
@media (min-width: 1024px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-content {
        gap: 3rem;
    }
}

/* ============================================
   ACCESSIBILITY & MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {

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

    .back-to-top {
        transition: opacity var(--transition-fast);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .nav-list a {
        border: 2px solid transparent;
    }

    .nav-list a:hover,
    .nav-list a:focus,
    .nav-list a.active {
        border-color: var(--color-primary);
    }

    .gallery-item,
    .downloads-section {
        border: 2px solid var(--color-border);
    }

    .download-btn,
    .back-btn,
    .back-to-top {
        border-color: var(--color-primary-dark);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-list a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .social-icons a {
        min-width: 44px;
        min-height: 44px;
    }

    .download-btn,
    .back-btn {
        min-height: 48px;
    }

    .back-to-top {
        min-width: 48px;
        min-height: 48px;
    }

    /* Prevent hover effects on touch devices */
    .gallery-item:hover {
        transform: none;
    }

    .responsive-img:hover {
        transform: none;
    }
}

/* Tablet Touch Optimizations */
@media (min-width: 768px) and (max-width: 1023px) and (hover: none) {
    .nav-list a {
        padding: 0.625rem 1rem;
        min-height: 44px;
    }

    .social-icons a {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 44px;
        min-height: 44px;
    }

    .download-btn,
    .back-btn {
        min-height: 48px;
        padding: 0.75rem 1.5rem;
    }

    .btn-row {
        gap: 1.125rem;
    }

    .back-to-top {
        width: 3.25rem;
        height: 3.25rem;
        min-width: 48px;
        min-height: 48px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .header,
    .footer,
    .back-btn,
    .back-to-top,
    .downloads-section,
    .social-icons {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .gallery-item {
        page-break-inside: avoid;
    }

    .responsive-img,
    .gallery-img {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .section-heading::after {
        display: none;
    }

    p,
    li {
        font-size: 12pt;
        line-height: 1.5;
    }

    .about-content {
        flex-direction: column;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ============================================
   UTILITY CLASSES FOR TABLET OPTIMIZATION
   ============================================ */

/* Hide on tablets */
.hide-on-tablet {
    display: block;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hide-on-tablet {
        display: none !important;
    }
}

/* Show only on tablets */
.show-on-tablet {
    display: none;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .show-on-tablet {
        display: block !important;
    }
}

/* Tablet-specific spacing */
@media (min-width: 768px) and (max-width: 1023px) {
    .tablet-spacing-sm {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .tablet-spacing-md {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .tablet-spacing-lg {
        margin-top: 3rem;
        margin-bottom: 3rem;
    }
}