/* CSS Custom Properties for theming */
:root {
    --color-bg: #fff;
    --color-text: #000;
    --color-text-secondary: #333;
    --color-text-muted: #666;
    --color-text-subtle: #999;
    --color-border: #e0e0e0;
    --color-surface: #f5f5f5;
    --color-link-border: #ddd;
}

/* Dark mode colors */
[data-theme="dark"] {
    --color-bg: #1a1a1a;
    --color-text: #e8e8e8;
    --color-text-secondary: #ccc;
    --color-text-muted: #999;
    --color-text-subtle: #777;
    --color-border: #333;
    --color-surface: #252525;
    --color-link-border: #444;
}

/* System preference fallback (when no explicit theme is set) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #1a1a1a;
        --color-text: #e8e8e8;
        --color-text-secondary: #ccc;
        --color-text-muted: #999;
        --color-text-subtle: #777;
        --color-border: #333;
        --color-surface: #252525;
        --color-link-border: #444;
    }
}

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

html,
body {
    height: 100%;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Container */
.container {
    display: block;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Web Component wrapper */
naor-sidebar {
    display: contents;
}

/* Sidebar */
.sidebar {
    width: 280px;
    padding: 40px 30px;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.logo {
    font-size: 18px;
    letter-spacing: 1px;
    margin-bottom: 60px;
    font-weight: normal;
    color: var(--color-text);
    text-decoration: none;
    display: block;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.6;
}

.nav-section {
    margin-bottom: 40px;
}

.nav-title {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-text-subtle);
    margin-bottom: 15px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 10px;
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 15px;
    transition: opacity 0.2s ease;
    display: block;
    padding: 3px 0;
}

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

.nav-links a.active {
    font-style: italic;
}

.legal-links a {
    font-size: 13px;
    opacity: 0.8;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 40px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.sidebar-footer a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: var(--color-text);
}

/* Theme Transition — circular reveal via View Transitions API */
@keyframes theme-circle-expand {
    from { clip-path: circle(0px at var(--theme-toggle-x, 50%) var(--theme-toggle-y, 50%)); }
    to   { clip-path: circle(150vmax at var(--theme-toggle-x, 50%) var(--theme-toggle-y, 50%)); }
}

/* Light → Dark: new (dark) snapshot expands as a circle from the button */
[data-theme-direction="dark"]::view-transition-new(root) {
    animation: theme-circle-expand var(--theme-transition-duration, 600ms) ease;
}
[data-theme-direction="dark"]::view-transition-old(root) {
    animation: none;
}

/* Dark → Light: old (dark) snapshot contracts back to the button */
[data-theme-direction="light"]::view-transition-old(root) {
    animation: theme-circle-expand var(--theme-transition-duration, 600ms) ease reverse;
    z-index: 1; /* must be on top so contraction reveals the new light snapshot below */
}
[data-theme-direction="light"]::view-transition-new(root) {
    animation: none;
    z-index: 0;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-text-muted);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.theme-toggle-btn {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.theme-toggle-btn::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--color-bg);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle-btn::after {
    transform: translateX(20px);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle-btn::after {
        transform: translateX(20px);
    }
}

.theme-toggle-label {
    cursor: pointer;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    position: relative;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px;
}

.main-content:not(.portfolio-page) > * {
    margin-top: auto;
    margin-bottom: auto;
}

/* Portfolio Pages — override .main-content defaults */
.portfolio-page {
    padding: 0;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
}

/* Home Page */
.home-content {
    text-align: center;
    max-width: 600px;
}

.home-content h1 {
    font-size: 32px;
    font-weight: normal;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.home-content p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* Work in Progress Notice */
.wip-notice {
    margin-top: 40px;
    padding: 25px 30px;
    background: var(--color-surface);
    border-radius: 4px;
    text-align: center;
}

.wip-notice p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.wip-notice p:last-child {
    margin-bottom: 0;
}

.wip-notice a {
    color: var(--color-text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--color-text-subtle);
    transition: border-color 0.2s ease;
}

.wip-notice a:hover {
    border-bottom-color: var(--color-text-secondary);
}

/* About Page, News Page, Legal Pages */
.about-content {
    max-width: 700px;
    font-size: 16px;
    line-height: 1.8;
}

.about-content h1 {
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 30px;
}

.about-content p {
    margin-bottom: 20px;
    color: var(--color-text-secondary);
}

/* Portfolio Pages */
.portfolio-grid {
    width: 100%;
    column-count: 4;
    column-gap: 8px;
    padding: 40px 40px 40px 30px;
}

.portfolio-grid::-webkit-scrollbar {
    display: none;
}

.portfolio-item {
    background: transparent;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: inline-block;
    width: 100%;
    margin-bottom: 8px;
    break-inside: avoid;
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Prijzen Page */
.prijzen-content {
    max-width: 800px;
    width: 100%;
}

.prijzen-content h1 {
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 40px;
}

.service-item {
    border-bottom: 1px solid var(--color-border);
    padding: 30px 0;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item h3 {
    font-size: 20px;
    font-weight: normal;
    margin-bottom: 10px;
}

.service-price {
    font-size: 18px;
    color: var(--color-text-muted);
    margin-bottom: 15px;
}

.service-details {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* Contact Page */
.contact-content {
    max-width: 500px;
    width: 100%;
}

.contact-content h2 {
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 30px;
}

.contact-info {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 40px;
}

.contact-info a {
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-link-border);
}

.contact-info a:hover {
    border-bottom-color: var(--color-text);
}

.contact-form {
    margin-top: 40px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-link-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: Georgia, serif;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-text);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    padding: 12px 40px;
    font-family: Georgia, serif;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.submit-btn:hover {
    opacity: 0.8;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        height: 100vh;
        padding: 20px;
        align-items: center;
    }

    .portfolio-grid {
        column-count: 2;
        column-gap: 6px;
        padding: 20px;
    }

    .home-content h1 {
        font-size: 24px;
    }

    .home-content p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        column-count: 1;
        column-gap: 6px;
        padding: 20px;
    }
}

/* Loading placeholder for images */
.image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-subtle);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* News Page */
.news-content {
    max-width: 700px;
    font-size: 16px;
    line-height: 1.8;
}

.news-content h1 {
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 30px;
}

.news-item {
    border-bottom: 1px solid var(--color-border);
    padding: 30px 0;
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-subtle);
    margin-bottom: 10px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.news-item h2 {
    font-size: 20px;
    font-weight: normal;
    margin-bottom: 15px;
}

.news-item p {
    color: var(--color-text-secondary);
    margin-bottom: 15px;
}

.news-image {
    width: 100%;
    height: auto;
    margin-bottom: 20px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px;
}

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

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: Arial, sans-serif;
    font-weight: 300;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: Arial, sans-serif;
    font-weight: 300;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 20px;
}

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

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-content {
        padding: 40px 20px;
    }

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

    .lightbox-nav {
        font-size: 30px;
        padding: 15px;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }
}
