/* ========================================
   Villa Bagaregården – Stylesheet
   ======================================== */

:root {
    --color-bg: #faf9f7;
    --color-bg-alt: #f0eeeb;
    --color-text: #2c2c2c;
    --color-text-light: #6b6b6b;
    --color-accent: #4a6741;
    --color-accent-light: #6b8f62;
    --color-border: #e0ddd8;
    --color-white: #ffffff;
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --max-width: 1100px;
    --header-height: 64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Header & Navigation ---- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(250, 249, 247, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text-light);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform 0.3s, opacity 0.3s;
}

/* ---- Hero ---- */
.hero {
    margin-top: var(--header-height);
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    text-align: center;
    padding: 80px 24px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.45) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--color-white);
    margin-bottom: 16px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* ---- Sections ---- */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 40px;
}

.section-intro {
    color: var(--color-text-light);
    margin-bottom: 32px;
    max-width: 600px;
}

.gallery-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 20px;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
}

.gallery-heading:first-of-type {
    margin-top: 0;
}

/* ---- Painting feature ---- */
.painting-feature {
    margin-top: 56px;
    display: flex;
    gap: 32px;
    align-items: center;
}

.painting-image {
    flex: 0 0 320px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.painting-image img {
    width: 100%;
    height: auto;
    display: block;
}

.painting-caption {
    color: var(--color-text-light);
    font-style: italic;
    line-height: 1.7;
}

/* ---- Projector gallery ---- */
.projector-gallery {
    margin-top: 40px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ---- Full-width image break ---- */
.section-image {
    max-height: 50vh;
    overflow: hidden;
}

.section-image img {
    width: 100%;
    height: 50vh;
    object-fit: cover;
}

/* ---- About ---- */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: start;
}

.about-image {
    border-radius: 8px;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.about-text p {
    margin-bottom: 16px;
    color: var(--color-text);
    line-height: 1.8;
}

.about-facts {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 32px;
    background: var(--color-bg-alt);
    border-radius: 8px;
}

.section-alt .about-facts {
    background: var(--color-white);
}

.fact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fact-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-light);
}

.fact-value {
    font-size: 1rem;
    font-weight: 500;
}

/* ---- Timeline ---- */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -32px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-white);
    border: 2px solid var(--color-border);
}

.timeline-marker.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.timeline-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.timeline-content p {
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ---- Gallery ---- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.gallery-item {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.gallery-placeholder,
.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 64px;
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    color: var(--color-text-light);
    grid-column: 1 / -1;
}

.gallery-placeholder svg,
.video-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

/* ---- Video ---- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.video-item {
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.video-item video {
    width: 100%;
    display: block;
}

.video-item .video-caption {
    padding: 16px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.video-feature {
    margin-bottom: 24px;
}

.video-feature .video-item {
    max-width: 100%;
}

.video-grid-portrait {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ---- Lightbox ---- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

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

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

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 2rem;
    padding: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 16px;
    right: 16px;
    font-size: 2.5rem;
}

.lightbox-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
}

.lightbox-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
}

/* ---- Link cards ---- */
.link-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.link-card {
    display: block;
    text-decoration: none;
    color: var(--color-text);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.link-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.link-card-content {
    padding: 24px;
}

.link-card-content h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 8px;
}

.link-card-content p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---- Page hero (subpages) ---- */
.page-hero {
    margin-top: var(--header-height);
    padding: 64px 0 48px;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.page-hero .hero-subtitle {
    color: var(--color-text-light);
    font-size: 1rem;
    max-width: 600px;
    text-shadow: none;
}

.nav-links a.active {
    color: var(--color-accent);
    font-weight: 600;
}

/* ---- Footer ---- */
.site-footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 8px;
    font-size: 0.8rem;
}

.footer-links a {
    color: var(--color-text-light);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s, opacity 0.3s;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .painting-feature {
        flex-direction: column;
    }

    .painting-image {
        flex: none;
        max-width: 100%;
    }

    .link-cards {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 56px 0;
    }

    .hero {
        min-height: 50vh;
        padding: 56px 24px;
    }

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

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

    .video-grid-portrait {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .gallery-item {
        border-radius: 4px;
    }
}
