/* Valerie Horvath Photography - Stylesheet */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Lora:wght@400;500&display=swap');

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    width: 100%;
}

body {
    font-family: 'Lato', sans-serif;
    color: #333;
    background: #fff;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Lora', serif;
    font-weight: 400;
}

/* Header */
.site-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-logo {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    color: #333;
    text-decoration: none;
}

.site-logo .photography {
    color: #7a9bb3;
}

/* Navigation */
.site-nav {
    display: flex;
    gap: 2rem;
}

.site-nav a {
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: #555;
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover {
    color: #333;
}

.site-nav a.active {
    font-weight: 700;
    color: #333;
    border-bottom-color: #333;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}

.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);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.site-footer {
    padding: 1.5rem 2rem;
    text-align: left;
    font-size: 0.85rem;
    color: #666;
}

/* Photo Grids */
.photo-grid {
    display: grid;
    gap: 1.5rem;
}

.photo-grid.grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
}

.photo-grid.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

.photo-grid.grid-4x3 {
    grid-template-columns: repeat(4, 1fr);
}

.photo-grid img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.photo-grid img:hover {
    opacity: 0.85;
}

/* Page Sections */
.page-section {
    margin-bottom: 3rem;
}

.section-header {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

/* Split Layout (for Crossing the Salish) */
.split-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
}

.video-container iframe,
.video-container .video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

.video-placeholder::after {
    content: '';
    width: 68px;
    height: 48px;
    background: rgba(255,0,0,0.9);
    border-radius: 10px;
}

.video-placeholder::before {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
    z-index: 1;
}

.video-credit {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

.project-statement {
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #444;
}

.project-statement p {
    margin-bottom: 1rem;
}

/* Common Threads Layout */
.ct-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* About Page */
.about-content {
    max-width: 700px;
    font-family: 'Lora', serif;
    font-size: 1rem;
    line-height: 1.9;
}

.about-content p {
    margin-bottom: 1.5rem;
}

.about-content a {
    color: #7a9bb3;
}

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

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* Responsive Design */
@media (max-width: 900px) {
    .split-layout,
    .ct-layout {
        grid-template-columns: 1fr;
    }

    .photo-grid.grid-4x3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .site-header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    .site-logo {
        font-size: 1.1rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .hamburger {
        display: block;
        flex-shrink: 0;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .site-nav.active {
        display: flex;
    }

    .site-nav a {
        display: block;
        width: 100%;
        padding: 1rem 2rem;
        border-bottom: 1px solid #eee;
        font-size: 1rem;
    }

    .site-nav a:last-child {
        border-bottom: none;
    }

    .site-nav a.active {
        border-bottom-color: #eee;
    }

    .photo-grid.grid-2x2 {
        grid-template-columns: 1fr;
    }

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

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

    /* Lightbox mobile */
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .lightbox-content img {
        max-width: 95vw;
        max-height: 80vh;
    }

    .lightbox-nav {
        font-size: 2rem;
        padding: 0;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        opacity: 1;
        z-index: 2002;
        line-height: 0;
        padding-bottom: 6px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .photo-grid.grid-3x3,
    .photo-grid.grid-4x3 {
        grid-template-columns: 1fr !important;
    }

    .photo-grid.grid-2x2 {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile layout overrides for page-specific styles */
@media (max-width: 768px) {
    .split-layout,
    .ct-layout {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .photo-grid.grid-3x3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .photo-grid.grid-2x2 {
        grid-template-columns: 1fr !important;
        justify-content: stretch !important;
    }

    .photo-grid.grid-2x2 img {
        width: 100% !important;
    }
}

/* Portrait mode - single column for Common Threads */
@media (max-width: 768px) and (orientation: portrait) {
    .photo-grid.grid-3x3 {
        grid-template-columns: 1fr !important;
    }

    .salish-content .video-section {
        margin-bottom: 0.25rem;
    }
}

/* Desktop/Mobile visibility toggles */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }

    /* Reorder sections on Crossing the Salish page */
    .salish-content {
        display: flex;
        flex-direction: column;
    }

    .salish-content .video-section {
        order: 1;
    }

    .salish-content .page-section:has(.photo-grid) {
        order: 2;
    }

    .salish-content .text-section {
        order: 3;
    }
}

/* Mobile landscape - responsive grids */
@media (max-height: 500px) and (orientation: landscape) {
    .photo-grid.grid-2x2 {
        grid-template-columns: 1fr 1fr !important;
        max-width: 100% !important;
        width: 100% !important;
        gap: 36px !important;
    }

    .photo-grid.grid-2x2 img {
        width: 100% !important;
    }

    .photo-grid.grid-3x3 {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .ct-layout {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Hide desktop text, show mobile text section */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .split-layout {
        grid-template-columns: 1fr !important;
    }

    .salish-content {
        display: flex;
        flex-direction: column;
    }

    .salish-content .video-section {
        order: 1;
    }

    .salish-content .page-section:has(.photo-grid) {
        order: 2;
    }

    .salish-content .text-section {
        order: 3;
    }

    .salish-content .video-section {
        margin-bottom: 0.5rem;
    }
}

/* Mobile landscape - show hamburger menu */
@media (max-height: 500px) and (orientation: landscape) {
    .site-header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        position: relative;
        padding: 12px 16px !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box;
    }

    .main-content {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden;
    }

    .site-logo {
        font-size: 1.1rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .hamburger {
        display: block !important;
        flex-shrink: 0;
        margin: 0 !important;
        padding: 0.5rem !important;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .site-nav.active {
        display: flex;
    }

    .site-nav a {
        display: block;
        width: 100%;
        padding: 1rem 2rem;
        border-bottom: 1px solid #eee;
        font-size: 1rem;
    }

    .site-nav a:last-child {
        border-bottom: none;
    }
}

/* Landscape mode adjustments for lightbox */
@media (max-height: 500px) and (orientation: landscape) {
    .lightbox-content {
        max-width: 98vw;
        max-height: 98vh;
    }

    .lightbox-content img {
        max-height: 95vh;
        max-width: 95vw;
    }

    .lightbox-nav {
        font-size: 1.5rem;
        padding: 0.25rem;
    }

    .lightbox-prev {
        left: 0.25rem;
    }

    .lightbox-next {
        right: 0.25rem;
    }

    .lightbox-close {
        top: 0.25rem;
        right: 0.25rem;
        width: 30px;
        height: 30px;
        font-size: 1.5rem;
    }
}
