/* ============================================
   CSS VARIABLEN
   ============================================ */
:root {
    --accent: #94b294;
    --bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --nav-h: 100px;
    --footer-h: 120px;
}

/* ============================================
   GRUNDLEGENDE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

/* ============================================
   NAVIGATION
   ============================================ */
.main-nav {
    background: var(--accent);
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.nav-left {
    flex-shrink: 0;
}

.school-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.nav-center {
    flex: 1;
    text-align: center;
}

.main-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0.25rem 0 0 0;
}

.nav-right {
    flex-shrink: 0;
}

.home-icon {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: opacity 0.2s;
}

.home-icon:hover {
    opacity: 0.8;
}

.nav-divider {
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin-top: 0.5rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    padding-top: calc(var(--nav-h) + 2rem);
    padding-bottom: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    background: var(--bg);
    border-radius: 8px;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
}

/* Alle Überschriften in grün */
.container h1,
.container h2,
.container h3,
.container h4,
.container h5,
.container h6 {
    color: var(--accent);
}

/* ============================================
   HOMEPAGE LAYOUT
   ============================================ */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    padding: 2rem;
    align-items: start;
}

.home-image-side {
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
}

.home-image-frame {
    background: white;
    border: 3px solid var(--accent);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px var(--shadow);
}

.home-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.home-content-side {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.home-intro {
    margin-bottom: 1rem;
}

.home-hero-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.home-hero-lead {
    font-size: 1.1rem;
    color: var(--text-light);
    margin: 0;
}

.home-stations {
    margin-top: 1rem;
}

.home-stations-header {
    margin-bottom: 1.5rem;
}

.home-stations-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.home-stations-sub {
    color: var(--text-light);
    margin: 0;
}

.audio-guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.audio-guide-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.audio-guide-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateY(-2px);
}

.audio-guide-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.audio-guide-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================
   SUPPORT INLINE
   ============================================ */
.support-inline {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--accent);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

.support-inline a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.support-inline a:hover {
    text-decoration: underline;
}

/* ============================================
   AUDIO GUIDE PAGE
   ============================================ */
.guide-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.audio-player-section {
    margin-top: 2rem;
    text-align: center;
}

.audio-play-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--shadow);
}

.audio-play-btn:hover {
    background: #7a9a7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.instruction-box {
    background: #f8f9fa;
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.instruction-box h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.instruction-box p {
    color: var(--text);
    line-height: 1.8;
    margin: 0;
}

/* ============================================
   ADMIN STYLES
   ============================================ */
.admin-section {
    padding: 2rem;
}

.admin-section h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.admin-actions {
    margin-bottom: 2rem;
}

.btn-primary,
.btn-secondary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary:hover,
.btn-secondary:hover {
    background: #7a9a7a;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--shadow);
}

.btn-secondary {
    background: var(--text-light);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.guides-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.guide-item {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.guide-item-info {
    flex: 1;
}

.guide-item-info h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.guide-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #c82333;
}

.admin-form {
    background: #f8f9fa;
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.admin-form h3 {
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

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

.small-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.guide-image-preview {
    max-width: 200px;
    max-height: 200px;
    margin-top: 1rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: block;
}

/* ============================================
   LEGAL PAGES (IMPRESSUM, DATENSCHUTZ)
   ============================================ */
.legal-section {
    padding: 2rem;
    margin-bottom: 2rem;
}

.legal-section h2 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.legal-section h3 {
    color: var(--accent);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.legal-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.legal-section ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.legal-section li {
    margin-bottom: 0.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--accent);
    color: white;
    padding: 1.5rem 0;
    position: static;
    margin-top: 2rem;
    box-shadow: 0 -2px 8px var(--shadow);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-left {
    flex-shrink: 0;
}

.school-logo-footer {
    height: 40px;
    width: auto;
    object-fit: contain;
}

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

.footer-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.footer-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.footer-copyright {
    font-size: 0.8rem;
    opacity: 0.8;
}

.footer-right {
    flex-shrink: 0;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
/* Standard: Elemente sind sichtbar (Fallback wenn JS nicht lädt) */
.reveal {
    opacity: 1;
    transform: translate(0, 0);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

/* Wenn JavaScript läuft, werden Elemente initial versteckt */
.js-enabled .reveal:not(.in-view) {
    opacity: 0;
}

.js-enabled .reveal[data-reveal="up"]:not(.in-view) {
    transform: translateY(20px);
}

.js-enabled .reveal[data-reveal="down"]:not(.in-view) {
    transform: translateY(-20px);
}

.js-enabled .reveal[data-reveal="left"]:not(.in-view) {
    transform: translateX(-20px);
}

.js-enabled .reveal[data-reveal="right"]:not(.in-view) {
    transform: translateX(20px);
}

.reveal.visible,
.reveal.in-view {
    opacity: 1;
    transform: translate(0, 0);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    /* Navigation auch auf Mobile fixed */
    .main-nav {
        position: fixed;
    }

    .nav-container {
        padding: 0 1rem;
        flex-wrap: wrap;
    }

    .main-title {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .school-logo {
        height: 40px;
    }

    /* Homepage Layout: Stack auf Mobile */
    .home-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }

    .home-image-side {
        position: static;
    }

    .home-image-frame {
        padding: 0.75rem;
    }

    .home-hero-title {
        font-size: 1.5rem;
    }

    .audio-guides-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Footer: Static auf Mobile */
    .site-footer {
        position: static;
        margin-top: 2rem;
    }
    
    .main-content {
        padding-top: calc(var(--nav-h) + 1rem);
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .footer-left,
    .footer-title,
    .footer-subtitle {
        display: none;
    }

    .footer-center {
        order: 2;
    }

    .footer-right {
        order: 1;
        width: 100%;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .main-content {
        padding-bottom: 2rem;
    }

    .container {
        padding: 0 1rem;
        margin: 0 1rem;
    }

    /* Audio Guide Page verwendet jetzt home-layout, daher keine separaten Mobile-Styles nötig */

    .admin-section {
        padding: 1.5rem;
    }

    .admin-form {
        padding: 1.5rem;
    }

    .guide-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .guide-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Reveal Animationen auf Mobile: nur translateY */
    .reveal[data-reveal="left"],
    .reveal[data-reveal="right"] {
        transform: translateY(30px);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .home-layout {
        grid-template-columns: 1fr 1.2fr;
        gap: 2rem;
    }

    .audio-guides-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (min-width: 1025px) {
    .container {
        padding: 0 3rem;
    }

    .home-layout {
        padding: 3rem;
    }
}
