/* 1. Imports */
@import url("https://fonts.googleapis.com/css?family=Raleway:200,300,400,500&display=swap");

/* 2. CSS Variables */
:root {
  --primary-color: hsl(255, 40%, 73%);
  --primary-dark: hsl(254, 49%, 65%);
  --white: #ffffff;
  --border-light: rgba(218, 218, 218, 0.4);
  
  /* Spacing */
  --nav-height: 70px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

/* 3. Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Raleway", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  background: var(--white);
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 4. Base Styles */
main {
  margin-top: var(--nav-height);
  width: 100%;
}

/* 5. Navigation Styles */
.nav-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    z-index: 1000;
    padding-top: env(safe-area-inset-top, 0);
}

.nav-container {
    height: var(--nav-height);
    padding: 0 var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-logo {
    color: var(--white);
    font-size: 32px;
    font-weight: 500;
    padding: 0 var(--spacing-sm);
    text-decoration: none;
}

.nav-divider {
    width: 1px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.3);
}

.nav-tagline {
    color: var(--white);
    font-weight: 200;
    font-size: 20px;
    padding-left: var(--spacing-sm);
}

.nav-right {
    position: relative;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.nav-links a {
    color: var(--white);
    font-weight: 300;
    font-size: 16px;
    text-transform: lowercase;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: var(--spacing-sm);
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px 0;
    background-color: var(--white);
    transition: transform 0.3s ease;
}

/* 6. Gallery Styles */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
    background: #f5f5f5;
    grid-column: span 1;
    grid-row: span 1;
    min-width: 0;
    touch-action: manipulation;
    cursor: pointer;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.gallery-item.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    word-wrap: break-word;
}

.gallery-description {
    font-size: 0.875rem;
    margin: 0;
    word-wrap: break-word;
}

/* 7. Media Queries */

/* Desktop hover styles */
@media (hover: hover) {
    .gallery-item:hover {
        transform: translateY(-5px);
    }
    
    .gallery-item:hover .gallery-overlay {
        opacity: 1;
    }
}

/* Touch device styles */
@media (hover: none) {
    .gallery-item:active {
        transform: translateY(-2px);
    }

    .gallery-overlay {
        opacity: 0;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
        transition: none;
    }

    .gallery-item.active .gallery-overlay {
        opacity: 1;
    }
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
    .nav-container {
        padding: 0 var(--spacing-md);
    }

    .nav-logo {
        font-size: 28px;
    }

    .nav-tagline {
        font-size: 18px;
    }

    .hamburger {
        display: block;
        position: relative;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        right: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 40px;
        gap: var(--spacing-xl);
        transition: transform 0.3s ease;
        transform: translateX(100%);
    }

    .nav-links.active {
        transform: translateX(0);
        right: 0;
    }

    .nav-links a {
        font-size: 18px;
        padding: var(--spacing-sm);
    }

    /* Hamburger Animation */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Tablet */
@media screen and (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
}

/* Mobile Gallery */
@media screen and (max-width: 640px) {
    html {
        font-size: 14px;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .gallery-item.featured {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .gallery-title {
        font-size: 1.1rem;
    }
    
    .gallery-description {
        font-size: 0.8rem;
    }
}

/* 8. iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .nav-wrapper {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .nav-links {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .gallery {
        gap: max(1rem, env(safe-area-inset-bottom));
        padding: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
    }
}

.footer {
    width: 100%;
    padding: var(--spacing-lg) 0;
    background-color: var(--primary-color);
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: var(--spacing-xl);
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    text-transform: lowercase;
    font-weight: 300;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: purple;
}

.footer-copyright {
    color: var(--white);
    font-weight: 300;
    font-size: 0.9rem;
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: var(--spacing-lg);
        padding: 0 var(--spacing-md);
        text-align: center;
    }

    .footer-links {
        gap: var(--spacing-lg);
    }
}

/* iOS safe area support */
@supports (-webkit-touch-callout: none) {
    .footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}


.purchase-button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 5px 15px;
    font: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
  }
  
  .purchase-button:hover {
    opacity: 0.8;
  }
  
  /* Optional: Add any existing gallery styles here */
  .gallery-item {
    position: relative;
    display: block;
    /* Add your existing gallery item styles */
  }
  
  