@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    /* Modern UI tokens */
    --shadow-sm: 0 6px 18px rgba(0,0,0,0.08);
    --shadow-md: 0 10px 28px rgba(0,0,0,0.10);
    --border-soft: 1px solid rgba(0,0,0,0.06);
    --container-pad: 1rem;

    /* Hauptfarben – angepasst */
    --color-primary: #F9CA69;
    --color-primary-dark: #D9A856;

    --color-accent: #f3a8c1;

    /* Light Theme (Default) */
    --color-bg: #f6f6f6;
    --color-text: #333333;
    --color-surface: #ffffff;
    --color-footer-bg: #e6e6e6;
    --color-footer-text: #444444;

    --header-grad-1: var(--color-primary);
    --header-grad-2: #F6B94D;

    --content-grad-1: #fff7d9;
    --content-grad-2: #fff1c3;

    /* Rundungen */
    --radius-box: 12px;
    --radius-button: 10px;

    --font-base: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Dark Theme */
:root[data-theme="dark"] {
    color-scheme: dark;

    --color-bg: #0f1216;
    --color-text: #e7eaf0;
    --color-surface: #171b22;

    --color-footer-bg: #141821;
    --color-footer-text: #c7ceda;

    /* Primärfarbe bleibt „warm“, aber etwas gedimmt */
    --header-grad-1: #8a6a27;
    --header-grad-2: #5a3f12;

    --content-grad-1: #1a1f27;
    --content-grad-2: #151a22;

    --border-soft: 1px solid rgba(255,255,255,0.10);
    --shadow-sm: 0 10px 28px rgba(0,0,0,0.45);
    --shadow-md: 0 14px 42px rgba(0,0,0,0.55);
}

/* Basic reset / Layout */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-base);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

/* HEADER */

.site-header {
    background-color: var(--color-bg); /* nicht mehr weiß */
    margin-bottom: 1.5rem;
    border-bottom: none; /* Strich unter dem Header entfernen */
    box-shadow: var(--shadow-sm);
    border-radius: 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 0.75rem;
}

/* Tag/Nacht Switch (oben rechts) */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.theme-btn {
    appearance: none;
    border: var(--border-soft);
    background: rgba(255,255,255,0.75);
    color: var(--color-text);
    border-radius: 999px;
    width: 34px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.10);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

:root[data-theme="dark"] .theme-btn {
    background: rgba(23,27,34,0.9);
    box-shadow: 0 10px 22px rgba(0,0,0,0.45);
}

.theme-btn:hover {
    transform: translateY(-1px);
}

.theme-btn:focus-visible {
    outline: 3px solid rgba(217,168,86,0.55);
    outline-offset: 2px;
}

.theme-btn.is-active {
    border-color: rgba(0,0,0,0.22);
    box-shadow: 0 12px 26px rgba(0,0,0,0.14);
}

:root[data-theme="dark"] .theme-btn.is-active {
    border-color: rgba(255,255,255,0.22);
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-logo-link {
    text-decoration: none;
    color: var(--color-primary-dark);
}

.site-title {
    font-size: 1.6rem;
    font-weight: 600;
}

/* Grafischer Headerbereich (Bild) */
.header-graphic {
    width: 100%;
    min-height: 120px;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--header-grad-1), var(--header-grad-2));
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: var(--radius-box);
    overflow: hidden;
}

/* NAVIGATION */

.site-nav {
    display: flex;
    align-items: center;
}

/* Joomla Menü-Modul Standard-Output: ul.nav / li */
.site-nav ul {
    list-style: none;
    display: flex;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
}

.site-nav li {
    position: relative;
}

.site-nav a {
    display: block;
    padding: 0.55rem 0.95rem;
    text-decoration: none;
    color: #ffffff;

    /* Lösung B beibehalten (gelb), aber hochwertiger */
    background: linear-gradient(180deg, var(--color-primary) 0%, #f3b84e 100%);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-button);

    font-size: 0.95rem;
    font-weight: 600;

    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.10);
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav .current a,
.site-nav .active > a {
    background: linear-gradient(180deg, var(--color-primary-dark) 0%, #b88b33 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.14);
}

.site-nav a:focus-visible {
    outline: 3px solid rgba(217,168,86,0.55);
    outline-offset: 2px;
}

/* Burger-Button */

.nav-toggle {
    display: none; /* Desktop ausgeblendet */
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 4px 0;
    background-color: var(--color-primary-dark);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

/* HAUPTINHALT */

.site-main {
    /* warm statt „steril gelb“ (immer noch nah am Wunschton) */
    background: linear-gradient(180deg, var(--content-grad-1) 0%, var(--content-grad-2) 100%);
    padding: 1.4rem 1.15rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-box);

    /* Fade-Effekt nur für Content */
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* Wenn der Inhalt eingeblendet ist */
.site-main.main-loaded {
    opacity: 1;
}

/* Beim Rausblenden (Seitenwechsel) */
.site-main.main-fade-out {
    opacity: 0;
}

/* Content-Typografie (wirkt sofort „hochwertiger“) */
.site-main h1,
.site-main h2,
.site-main h3 {
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0.8rem 0 0.55rem;
}

.site-main h1 { font-size: 2rem; }
.site-main h2 { font-size: 1.45rem; }
.site-main h3 { font-size: 1.15rem; }

.site-main p {
    margin: 0 0 0.9rem;
}

.site-main a {
    color: #7a5516;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
}
.site-main a:hover { color: #5e3f0f; }
.site-main a:focus-visible {
    outline: 3px solid rgba(217,168,86,0.45);
    outline-offset: 2px;
    border-radius: 6px;
}

.site-main ul,
.site-main ol {
    padding-left: 1.2rem;
    margin: 0 0 1rem;
}

.site-main hr {
    border: none;
    height: 1px;
    background: rgba(0,0,0,0.10);
    margin: 1.25rem 0;
}

:root[data-theme="dark"] .site-main hr {
    background: rgba(255,255,255,0.14);
}

:root[data-theme="dark"] .site-main a {
    color: #f0c36a;
}

:root[data-theme="dark"] .site-main a:hover {
    color: #ffd88a;
}

/* Messages (Systemmeldungen) etwas hervorheben */
.alert,
.alert-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-box);
    margin-bottom: 1rem;
}

/* FOOTER */

.site-footer {
    padding: 1rem 0 2rem;
    border-top: none; /* orange/gelbe Linie im Footer entfernen */
    background-color: var(--color-footer-bg);
    font-size: 0.9rem;
    color: var(--color-footer-text);
    border-radius: var(--radius-box);
}

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

.footer-nav li {
    display: inline-block;
    margin-right: 1rem;
}

.footer-nav a {
    text-decoration: none;
    color: var(--color-footer-text);
    border-radius: var(--radius-button);
    padding: 0.25rem 0.4rem;
}

.footer-nav a:hover,
.footer-nav a:focus {
    text-decoration: underline;
}

.footer-copy {
    margin-top: 0.5rem;
    color: var(--color-footer-text);
}

/* PHOCA GALLERY (Bilder-Seite) – Thumbs größer, Texte ausblenden */

/* Grid angenehmer */
.site-main figure {
    margin: 0;
}

/* Thumbnails: größer + einheitliches Seitenverhältnis */
.site-main .pg-item-box-image,
.site-main .pg-item-box-image img,
.site-main img.pg-image {
    border-radius: 12px;
}

.site-main .pg-item-box-image img,
.site-main img.pg-image {
    width: 210px !important;
    height: 150px !important;
    object-fit: cover;
}

/* Titel/Dateinamen & Zusatzlinks ausblenden */
.site-main .pg-item-box-title,
.site-main .pg-item-box-name,
.site-main .pg-caption,
.site-main figcaption,
.site-main .pg-photoswipe-button-copy,
.site-main a[title="Detail"],
.site-main a[title="Download"] {
    display: none !important;
}

/* RSS Icon optional dezenter/ausblenden */
.site-main a[href*="format=feed"] {
    display: none !important;
}

/* Modal/Lightbox: falls Textteile sichtbar im Layout auftauchen, verstecken */
.site-main .modal-title,
.site-main .modal-footer,
.site-main .modal-header .btn-close,
.site-main button.close,
.site-main button[data-bs-dismiss="modal"],
.site-main .pg-modal {
    /* nur kosmetisch; wenn es echte Modals sind, bleiben sie via JS nutzbar */
}

@media (max-width: 768px) {
    .site-main .pg-item-box-image img,
    .site-main img.pg-image {
        width: 160px !important;
        height: 120px !important;
    }
}

/* RESPONSIVE */

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

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

    /* animiertes Auf-/Zu-Klappen */
    .site-nav {
        width: 100%;
        margin-top: 0.5rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition:
            max-height 0.3s ease,
            opacity 0.3s ease;
    }

    .site-nav.is-open {
        max-height: 800px;
        opacity: 1;
    }

    /* Full-width-Menüpunkte */
    .site-nav ul { 
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
        padding: 0.25rem 0;
    }

    .site-nav li {
        width: 100%;
    }

    .site-nav a {
        width: 100%;
        display: block;
        border-radius: var(--radius-button);
        padding: 0.75rem 1rem;
    }

    /* bis an den Bildschirmrand (gleicht wrapper-padding aus) */
    .site-nav {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .wrapper {
        padding: 0 0.75rem;
    }
}
@media (min-width: 769px) {
    .site-main {
        min-height: 600px;
    }
}

/* --- Modern Header Content (ab v103 weiterentwickelt) --- */

.header-graphic {
    min-height: 196px;          /* ~30% flacher als 280px */
    display: flex;
    align-items: flex-end;      /* Bild unten bündig */
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    width: 100%;
    padding: 1.1rem 1rem 0 1rem;
}

.header-text-wrap {
    display: flex;
    align-items: flex-start; /* rechter Button testweise oben ausrichten */
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.header-photo {
    height: 168px;              /* ~30% flacher als 240px */
    width: auto;
    max-width: 100%;
    align-self: flex-end;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.18));
}

.header-text {
    color: rgba(255,255,255,0.98);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.7rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 10px 22px rgba(0,0,0,0.14);
    backdrop-filter: blur(6px);
}

/* Home-Link im orangen Bereich */
.header-home-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
}
.header-home-link:hover {
    box-shadow: 0 14px 28px rgba(0,0,0,0.18);
    transform: translateY(-1px);
}

.header-jameda-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.75rem;
    border-radius: 14px;

    /* Schriftfarbe wie gewünscht, Umrandung neutral (nicht blau) */
    color: #01a3d4;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.10);

    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;

    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.header-jameda-link:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.55);
    box-shadow: 0 10px 22px rgba(0,0,0,0.14);
    transform: translateY(-1px);
}

.header-jameda-link:focus-visible {
    outline: 3px solid rgba(255,255,255,0.60);
    outline-offset: 3px;
}
.header-home-link:focus-visible {
    outline: 3px solid rgba(255,255,255,0.55);
    outline-offset: 3px;
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.header-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    opacity: 0.92;
}

/* Content modern: leichte Überlappung */
.site-main {
    margin-top: -18px;
    border: var(--border-soft);
    box-shadow: var(--shadow-sm);
}

/* Navigation modern: sanfter Hover (Basis bereits oben definiert) */

/* Mobile: Bild linksbündig */
@media (max-width: 768px) {
    .header-graphic {
        min-height: 168px;
        align-items: flex-end;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 0.9rem 1rem 0 1rem;
        gap: 0.6rem;
    }

    .header-text-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .header-jameda-link {
        white-space: normal;
    }

    .header-photo {
        height: 120px;
        align-self: flex-start;
    }

    .header-title {
        font-size: 1.55rem;
    }
}

/* Reduced motion */
.reduced-motion * { transition: none !important; animation: none !important; }

/* ---- Phoca Gallery overrides (final) ----
   Phoca lädt eigenes CSS teils nach dem Template – daher am Dateiende mit hoher Spezifität.
*/
body .pg-item-box-image img.pg-image,
body img.pg-image {
    width: 210px !important;
    height: 150px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
}

@media (max-width: 768px) {
    body .pg-item-box-image img.pg-image,
    body img.pg-image {
        width: 160px !important;
        height: 120px !important;
    }
}

/* Dateiname/Schrift in den Thumbs ausblenden */
body .pg-item-box-title,
body .pg-item-box-name,
body .pg-caption,
body figcaption,
body .pg-photoswipe-button-copy,
body .modal-title,
body .modal-footer,
body .modal-header {
    display: none !important;
}

/* RSS Icon ausblenden */
body a[href*="format=feed"] {
    display: none !important;
}
