/* ========================================
   Custom Fonts
======================================== */
@font-face {
    font-family: 'The Girl Next Door';
    src: url('../assets/fonts/thegirlnextdoor-808ebfea.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   CSS Variables & Reset
======================================== */
:root {
    --color-bg-primary: #fff2e2;
    --color-accent: #32373c;
    --color-border: #eeeeee;
    --color-white: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-hero: 'The Girl Next Door', cursive, sans-serif;
    --font-size-small: 13px;
    --font-size-base: 16px;
    --font-size-medium: 20px;
    --font-size-large: 36px;
    --font-size-xlarge: 42px;

    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 60px;

    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg-primary);
}

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

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

ul {
    list-style: none;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Skip Link (Accessibility)
======================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-accent);
    color: var(--color-white);
    padding: var(--spacing-xs) var(--spacing-md);
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   Header Section (Logo + Portrait)
======================================== */
.header-section {
    padding: var(--spacing-md) 0;
}

.header-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding-left: 0;
}

.logo-wrapper {
    padding-left: var(--spacing-md);
}

.main-logo {
    max-width: 100%;
    height: auto;
    display: block;
}

.portrait-wrapper {
    width: 100%;
    padding-left: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.portrait-image {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
}

.floating-images-wrapper {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    max-width: 400px;
    width: auto;
}

.fond-bg {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.floating-illustration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 3s ease-in-out infinite;
    z-index: 2;
    max-width: 70%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ========================================
   Hero Section
======================================== */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg) var(--spacing-md);
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-family: var(--font-hero);
    font-size: var(--font-size-xlarge);
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero-subtitle {
    font-family: var(--font-hero);
    font-size: var(--font-size-medium);
    color: var(--color-text);
    line-height: 1.6;
}

/* ========================================
   Portfolio Section
======================================== */
.portfolio {
    padding: 0 0 130px 0;
}

/* ========================================
   Gallery
======================================== */
.gallery {
    margin-bottom: var(--spacing-xl);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    aspect-ratio: 1 / 1;
}

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

/* Landscape Gallery - 2 columns with 3:4 aspect ratio */
.landscape-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.landscape-grid .gallery-item img {
    aspect-ratio: 3 / 4;
}

/* Featured Gallery - Single column layout */
.featured-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

.featured-grid .gallery-item img {
    aspect-ratio: auto;
    width: 100%;
}

/* Fade-in animation class for lazy loading */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================
   Lightbox
======================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    border: none;
    font-size: 40px;
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 4px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    background-color: rgba(255, 255, 255, 0.4);
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* ========================================
   Footer
======================================== */
.footer {
    background-color: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-lg) 0;
}

.footer-content {
    display: flex;
    justify-content: flex-start;
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--color-accent);
    border-radius: 50%;
    transition: var(--transition);
    background-color: rgba(50, 55, 60, 0.05);
}

.social-link:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
    transform: translateY(-3px);
}

.social-link svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   Responsive Design
======================================== */

/* Tablet (1024px and below) */
@media screen and (max-width: 1024px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .main-logo {
        max-width: 300px;
    }
}

/* Small Tablet (778px and below) */
@media screen and (max-width: 778px) {
    .header-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .logo-wrapper {
        margin-bottom: var(--spacing-md);
        padding-left: 0;
        text-align: center;
    }

    .main-logo {
        max-width: 250px;
        margin: 0 auto;
    }

    .portrait-wrapper {
        padding-left: 0;
        display: flex;
        justify-content: center;
    }

    .portrait-image {
        max-width: 80%;
        width: 80%;
    }

    .floating-images-wrapper {
        transform: translateY(-50%) translateX(10%);
    }

    .hero {
        min-height: 50vh;
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--spacing-sm);
    }

    .landscape-grid {
        gap: var(--spacing-md);
    }
}

/* Mobile (480px and below) */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .header-section {
        padding: var(--spacing-sm) 0;
    }

    .main-logo {
        max-width: 200px;
    }

    .portrait-wrapper {
        padding-left: 0;
        display: flex;
        justify-content: center;
    }

    .portrait-image {
        display: none;
    }

    .floating-images-wrapper {
        position: relative;
        transform: none;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        max-width: 90%;
    }

    .fond-bg {
        max-width: 100%;
        width: 100%;
        height: auto;
    }

    .floating-illustration {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 60%;
        width: 60%;
        animation: float 3s ease-in-out infinite;
    }

    .hero {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

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

    .landscape-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .lightbox-image {
        max-width: 95%;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        padding: var(--spacing-xs);
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .portfolio {
        padding: var(--spacing-md) 0 var(--spacing-xl) 0;
    }

    .footer {
        padding: var(--spacing-md) 0;
    }
}

/* Very Small Mobile (320px and below) */
@media screen and (max-width: 320px) {
    :root {
        --font-size-base: 14px;
        --spacing-sm: 12px;
        --spacing-md: 16px;
    }

    .main-logo {
        max-width: 180px;
    }

    .hero-title {
        font-size: 20px;
        line-height: 1.3;
    }

    .gallery-grid {
        gap: var(--spacing-xs);
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }

    .social-link svg {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   Animations
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, -50%);
    }
    50% {
        transform: translate(-50%, calc(-50% - 15px));
    }
}

.gallery-item {
    animation: fadeIn 0.6s ease-out;
}

/* Smooth scrolling for Safari */
@media screen and (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
