/* =================================================================
   STYLESHEET: Alpen-Wohnung
   ================================================================= */

/* --- Variables & Base Styles --- */
:root {
    /* New, refined color palette */
    --color-primary: #56caa4;
    --color-primary-dark: #aa9229;
    /* yellow / brown for hover/active states */
    --color-nav-bg: #273447;
    /* A dark for the navigation */
    --color-nav-text: #f9fafb;
    /* Off-white for nav text */
    --color-background: #f9fafb;
    /* A very light grey for the page background */
    --color-card-bg: #ffffff;
    /* White for content cards */
    --color-text-header: #070708;
    /* Almost black for main headings */
    --color-text-body: #070708;
    /* Dark grey for body text */
    --color-accent: #56caa4;
    /* for accents */
    --color-border: #e5e7eb;
    /* Light grey for borders */

    --nav-width: 250px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-background);
    color: var(--color-text-body);
    line-height: 1.7;
    font-size: 16px;
}

.page-wrapper {
    display: grid;
    grid-template-columns: var(--nav-width) 1fr;
    min-height: 100vh;
}

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

main {
    padding: 20px 40px 40px 40px;
    flex-grow: 1;
    /* Hide content initially to prevent flickering. JS will make it visible. */
    visibility: hidden;
    transition: visibility 0s 0.2s; /* Small delay to ensure content is ready */
}

h1,
h2,
h3 {
    color: var(--color-text-header);
    font-weight: 700;
}

h2 {
    font-size: 2.25rem;
    border-bottom: 3px solid var(--color-accent);
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 30px;
}

h3 {
    font-size: 1.5rem;
    color: var(--color-primary-dark);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

section {
    margin-bottom: 50px;
    padding: 40px;
    background-color: var(--color-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- Left Navigation --- */
.sidebar {
    background-color: var(--color-nav-bg);
    color: var(--color-nav-text);
    padding: 30px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 40px 0;
    text-align: center;
    color: var(--color-nav-text);
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav ul li a {
    color: var(--color-nav-text);
    text-decoration: none;
    padding: 15px 20px;
    margin-bottom: 5px;
    display: block;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    font-weight: 700;
    font-size: 1.1rem;
}

.main-nav ul li a:hover {
    background-color: #374151;
    /* Slightly lighter than nav bg */
}

.main-nav ul li a.active {
    background-color: var(--color-primary);
    color: var(--white);
}

/* --- Header & Language Switcher --- */
.content-header {
    padding: 20px 40px 0 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.lang-switcher {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    background-color: #e5e7eb;
}

.lang-switcher a {
    color: var(--color-text-body);
    text-decoration: none;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.lang-switcher a:hover {
    background-color: #d1d5db;
    color: var(--color-text-header);
}

.lang-switcher a.active {
    background-color: var(--color-primary);
    color: var(--color-card-bg);
    cursor: default;
}

/* Class to hide elements specifically on mobile */
@media (max-width: 768px) {
    .desktop-only { display: none; }
}

/* Hide the language switcher inside the sidebar by default (for desktop) */
.sidebar .lang-switcher {
    display: none;
}


/* --- Page Content Sections (reusable styles) --- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.4s ease;
}

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

.availability {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #14532d;
    padding: 30px;
    border-radius: 8px;
    margin: 40px 0;
    text-align: center;
    border: 1px solid #bbf7d0;
}

.availability p {
    margin: 0;
    font-size: 1.1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list li strong {
    color: var(--color-text-header);
    margin-right: 15px;
}

.info-list li span .bullet {
    color: var(--color-nav-bg); /* #273447 */
    margin-right: 8px;
    font-size: 0.8em;
    vertical-align: middle;
}

.info-images img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
}

.webcam-container {
    text-align: center;
}

.webcam-container img {
    max-width: 100%;
    border: 5px solid var(--color-card-bg);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.webcam-container figcaption a {
    color: #F7931A;
    font-weight: 700;
}

.webcam-container figcaption a:hover {
    /* A slightly darker orange for the hover effect */
    color: #E68917;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0;
    width: 35px;
    height: 22px; /* Height to contain the 3 bars */
    cursor: pointer;
    position: relative; /* For z-index and absolute positioning of spans */
}

.mobile-nav-toggle span {
    display: block;
    background-color: var(--color-text-header); /* Use dark text color for light header */
    height: 3px;
    width: 100%;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    position: absolute;
    left: 0;
}

.mobile-nav-toggle span:nth-child(1) { top: 0; }
.mobile-nav-toggle span:nth-child(2) { top: 9px; }
.mobile-nav-toggle span:nth-child(3) { top: 18px; }

/* Animate to 'X' when sidebar is open. We use the sibling selector (~) because the button
   is in the .content-area, which is a sibling of the .sidebar */
.sidebar.is-open ~ .content-area .mobile-nav-toggle span:nth-child(1) { transform: rotate(45deg); top: 9px; }
.sidebar.is-open ~ .content-area .mobile-nav-toggle span:nth-child(2) { opacity: 0; }
.sidebar.is-open ~ .content-area .mobile-nav-toggle span:nth-child(3) { transform: rotate(-45deg); top: 9px; }

/* --- Styles for the ANIMATED image modal --- */
/* Das Overlay, das die Seite abdunkelt und über allem liegt */
.modal-overlay {
    position: fixed;
    /* Das ist der entscheidende Befehl! */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;

    /* Startzustand für die Animation: Unsichtbar */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Zustand, wenn das Modal sichtbar ist */
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Der Container für das Bild */
.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.95);
    /* Leichter Zoom-Effekt beim Start */
    transition: transform 0.3s ease;
}

/* Bild-Container, wenn das Modal sichtbar ist */
.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Der Schliessen-Button (X) */
.modal-close {
    position: absolute;
    top: -10px;
    right: 10px;
    color: #fff;
    font-size: 45px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- Footer --- */
footer {
    background-color: var(--color-card-bg);
    color: var(--color-text-body);
    padding: 30px 40px;
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    /* Pushes footer to the bottom */
}

footer a {
    color: var(--color-primary-dark);
    font-weight: 700;
}

footer .footer-icon-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle; /* Helps align with surrounding text if needed */
}

footer .footer-bitcoin-badge {
    max-width: 120px;
    margin-top: 10px;
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
    :root {
        --nav-width: 200px;
    }

    .page-wrapper {
        grid-template-columns: var(--nav-width) 1fr;
    }

    main,
    .content-header {
        padding: 20px;
    }

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

@media (max-width: 768px) {

    :root {
        --nav-width: 100%;
    }

    .content-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: var(--color-background);
        padding: 15px 25px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        display: flex;
        justify-content: flex-end;
        z-index: 1001; /* Place header (and button) above the sidebar overlay */
    }

    .page-wrapper {
        display: block;
        /* Stack nav and main content */
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: var(--nav-width);
        height: 100vh;
        background-color: var(--color-nav-bg);
        color: var(--color-nav-text);
        padding: 20px;
        z-index: 1000; /* Ensure it's on top of page content */
        /* Ensure it's on top */
        overflow-y: auto;
        /* In case content is longer than screen */

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        padding: 15px;

        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .site-title {
        margin: 0;
        font-size: 1.5rem;
        text-align: left;
    }

    .main-nav {
        /* This part could be enhanced with JS for a mobile menu toggle */
        display: block;
        margin-top: 20px;
    }

    /* Make mobile nav links more compact */
    .main-nav ul li a {
        padding: 12px 15px;
        font-size: 1rem;
    }

    /* Show the language switcher inside the sidebar on mobile */
    .sidebar .lang-switcher {
        display: flex;
        margin-top: 20px;
    }


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

    main {
        /* Add space for the fixed header */
        padding-top: 70px;
        /* The 900px breakpoint sets padding to 20px. We reduce horizontal padding here. */
        padding-left: 15px;
        padding-right: 15px;
    }

    h2 {
        font-size: 1.7rem;
        padding-bottom: 10px;
        margin-bottom: 25px;
    }

    h3 {
        font-size: 1.2rem;
    }

    section {
        padding: 20px 15px;
        border-radius: 8px;
    }
}