/* Central design tokens used across the site for theming. */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --nav-bg: var(--bg-color);
    --nav-border: #ccc;
    --nav-hover: #f0f0f0;
    --link-color: #0066cc;
}

/* Override design tokens for dark theme via class switching. */
body.dark {
    --bg-color: #303030;
    --text-color: #ffffff;
    --nav-bg: var(--bg-color);
    --nav-border: #555;
    --nav-hover: #505050;
    --link-color: #4da3ff;
}

/* Apply global typography and enable smooth theme transitions. */
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Default link styling using theme colour. */
a {
    color: var(--link-color);
}

    a:hover {
        text-decoration: none;
    }

/* Enable smooth scrolling for anchor navigation. */
html {
    scroll-behavior: smooth;
}

/* Navigation container with theming support. */
.nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    transition: background 0.3s ease;
}

/* Flex-based navigation layout with centred content. */
.nav-container {
    max-width: 1200px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header row aligns utility elements to the right. */
.nav-header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

/* Row container supporting wrapping layout. */
.nav-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Main navigation row distributes left, centre and right sections. */
.nav-main {
    display: flex;
    align-items: center;
    width: 100%;
}

.nav-left {
    flex: 1;
}

.nav-center {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* Interactive navigation links with hover and active state. */
.nav a {
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-color);
}

    .nav a:hover {
        background: var(--nav-hover);
    }

    /* Active link indicator using bottom border. */
    .nav a.active {
        font-weight: bold;
        border-bottom: 3px solid var(--text-color);
    }

/* Theme toggle control with visual feedback on interaction. */
.modeswitcher {
    cursor: pointer;
    padding: 10px 15px;
    font-size: 20px;
    user-select: none;
    transition: transform 0.2s ease;
}

    .modeswitcher img {
        height: 20px;
        width: auto;
        display: block;
        transition: transform 0.15s ease;
    }

    .modeswitcher:hover img {
        transform: scale(1.0);
    }

/* Main content container with horizontal padding. */
.content {
    padding-left: 20px;
    padding-right: 20px;
}

    .content h1 {
        margin-bottom: 20px;
        text-align: center;
    }

/* Footer layout using grid for balanced alignment. */
.footer {
    text-align: center;
    padding: 30px;
    padding-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 98%;
    max-width: 1080px;
    margin: 0 auto;
}

.footer-left {
    justify-self: start;
    text-align: left;
}

    .footer-left a {
        line-height: 1.4;
        text-decoration: none;
        white-space: pre-line;
        cursor: pointer;
    }

.footer-center {
    text-align: center;
}

.footer-right {
    text-align: right;
}

/* Footer links with hover animation. */
.footer-link {
    text-align: center;
    margin: 10px auto;
}

    .footer-link a {
        display: inline-block;
    }

    .footer-link img {
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

        .footer-link img:hover {
            opacity: 0.85;
            transform: scale(1.02);
        }

/* Theme-dependent logo visibility. */
.footer-logo-light,
.footer-logo-dark {
    width: 400px;
    height: auto;
}

.footer-logo-dark {
    display: none;
}

body.dark .footer-logo-light {
    display: none;
}

body.dark .footer-logo-dark {
    display: block;
}

.foto-light {
    display: block;
}

.foto-dark {
    display: none;
}

body.dark .foto-light {
    display: none;
}

body.dark .foto-dark {
    display: block;
}

/* Layout for travel page with sticky navigation. */
.anreise-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.anreise-nav {
    min-width: 150px;
    position: sticky;
    top: 20px;
}

    .anreise-nav ul {
        list-style: disc;
        padding: 0;
        margin: 0;
    }

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

    .anreise-nav a {
        text-decoration: none;
        display: block;
        padding: 8px 10px;
        border-radius: 4px;
    }

        .anreise-nav a:hover {
            background: var(--nav-hover);
        }

.anreise-content {
    flex: 1;
}

    .anreise-content section {
        margin-bottom: 70px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--nav-border);
    }

        .anreise-content section h2 {
            margin-top: 40px;
        }

        .anreise-content section:last-child {
            border-bottom: none;
        }

    /* Offset scroll position to account for fixed navigation. */
    .anreise-content section {
        scroll-margin-top: 80px;
    }

/* Table layout for ISW overview. */
.isw-table {
    margin: 20px auto;
    border-collapse: collapse;
}

    .isw-table a {
        display: flex;
        align-items: center;
        text-decoration: none;
        gap: 15px;
    }

    .isw-table span {
        display: flex;
        align-items: center;
    }

    .isw-table td {
        padding: 10px 20px;
        vertical-align: middle;
        text-align: left;
    }

/* Table layout for airport information. */
.airport-table {
    margin-bottom: 30px;
    border-collapse: collapse;
}

    .airport-table th {
        text-align: left;
        padding: 6px 15px 6px 0;
        vertical-align: top;
        white-space: nowrap;
    }

    .airport-table td {
        padding: 6px 0;
    }

/* Placeholder shown until external content is enabled. */
.placeholder-box {
    padding: 15px;
    border: 1px solid var(--nav-border);
    border-radius: 8px;
    margin-bottom: 10px;
    max-width: 620px;
    background: #303030;
    color: #ffffff;
}

body.dark .placeholder-box {
    background: #ffffff;
    color: #000000;
}

/* Button used to trigger consent-based content loading. */
.enable-content-btn {
    padding: 10px 15px;
    cursor: pointer;
    background: var(--nav-bg);
    color: var(--text-color);
    border: 1px solid var(--nav-border);
    border-radius: 4px;
}

    .enable-content-btn:hover {
        background: var(--nav-hover);
    }

/* Container remains hidden until external widget is initialised. */
.weather-frame {
    display: none;
    position: relative;
    z-index: 1;
    min-height: 250px;
}

    .weather-frame > div {
        width: 300px;
        height: 250px;
    }

/* Interactive cursor selection UI with visual state indication. */
.cursor-selector {
    text-align: right;
    font-size: 12px;
    display: inline-block;
}

.cursor-title {
    margin-bottom: 6px;
    font-weight: bold;
}

.cursor-selector label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    cursor: pointer;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #b1b1b1;
    transition: background 0.2s ease, transform 0.1s ease;
}

.cursor-selector img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.cursor-selector input {
    margin-right: 2px;
}

.cursor-selector label:hover img {
    transform: scale(1.2);
}

.cursor-selector label:hover {
    transform: scale(1.05);
}

.cursor-selector input:checked + img {
    outline: 1px solid var(--text-color);
    border-radius: 4px;
}

    .cursor-selector input:checked + img + span,
    .cursor-selector input:checked {
        font-weight: bold;
    }

/* Definition list styling for GPS coordinates. */
.gps-coordinates {
    margin: 10px 0;
}

    .gps-coordinates dt {
        font-weight: bold;
        margin-bottom: 5px;
    }

    .gps-coordinates dd {
        margin: 0;
        padding-left: 0;
    }

/* List styling for external map links. */
.map-links {
    list-style: disc;
    margin: 10px 0 20px 20px;
    padding: 0;
}

    .map-links li {
        margin-bottom: 5px;
    }

/* Utility background colours. */
.bg-primary {
    background-color: #556B2F;
}

.bg-secondary {
    background-color: #5B6259;
}

.bg-intermediate-spaces {
    background-color: #646A6C;
}

.bg-lightgrey {
    background-color: #f2f2f2;
}

/* Utility class for centring content inside table cells. */
.cell-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

    .cell-center img {
        display: block;
    }

/* Decorative background image used within cells. */
.bg-eisernes-kreuz {
    background-image: url("../images/eisernes_kreuz.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Small visual feedback text for save actions. */
.save-hint {
    margin-left: 10px;
    color: green;
    font-size: 12px;
}

/* Responsive adjustments for navigation and layout. */
@media (max-width: 768px) {

    .nav-row {
        flex-direction: column;
        width: 100%;
    }

    .nav a {
        text-align: center;
        border-bottom: 1px solid #eee;
    }

    .anreise-layout {
        flex-direction: column;
    }

    .anreise-nav {
        position: static;
        width: 100%;
    }

    .placeholder-box {
        max-width: 100%;
    }
}
