/* =========================================
   Globale Styles
   ========================================= */

body {
    background-image: url('/images/background/Opacarophile0.5.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

main > .container {
    padding-top: 80px; 
    padding-bottom: 20px;
}

.bg-ivory {
    background-color: rgb(255, 255, 240) !important;
}

/* =========================================
   Schriftarten (Fonts)
   ========================================= */

/* Caveat Variable Font (Normal & Fett in einer Datei) */
@font-face {
    font-family: 'Caveat';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/caveat-variable.woff2') format('woff2');
}

/* Lora Variable Font (Normal & bold) */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/lora-variable.woff2') format('woff2');
}

/* Lora Variable Font (Kursiv & Kursiv-Fett) */
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/lora-variable-italic.woff2') format('woff2');
}

/* =========================================
   Navigation (Menüleiste oben)
   ========================================= */
.navbar .nav-link {
    font-family: 'Caveat', cursive; 
    font-size: 1.8rem;              
    padding-left: 1.5rem !important;  
    padding-right: 1.5rem !important; 
    color: #555555;                 
    transition: color 0.3s ease;    
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #d63384; 
}

.navbar .nav-link.active {
    color: #d63384;
    font-weight: 700;
}

/* =========================================
   Formulare & Controls
   ========================================= */
.custom-checkbox .custom-control-input:checked:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 255, 0, 0.25);
}

.custom-checkbox .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 0, 0, 0.25);
}

.custom-checkbox .custom-control-input:active ~ .custom-control-label::before {
    background-color: #C8FFC8;
}

audio::-webkit-media-controls-enclosure {
    background-color: transparent;
}   


/* =========================================
   GURU WISDOM CARD LAYOUT
   ========================================= */
.wisdom-card {
    background: #ffffff;
    max-width: 700px;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.2s ease;
    cursor: pointer;
}

.wisdom-card:hover {
    transform: none; /* detail translateY(-4px) translateX(5px); for a subtle lift and right shift */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.08), 0 24px 48px rgba(0, 0, 0, 0.12); 
    background-color: #f8f9fa !important; /* Ein sanftes Hellgrau/Weiß statt Schwarz! */
}


.image-container img {
    width: 100%;
    height: auto;
    max-height: 450px; 
    object-fit: cover;
    display: block;
}

/* --- Aktionsleiste (Audio & Buttons) --- */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.audio-player {
    flex-grow: 1;
    margin: 0 15px;
}

.audio-player audio {
    width: 100%;
    height: 40px;
    outline: none;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-btn img {
    width: 32px;
    height: auto;
}

.nav-btn:hover { background-color: #f0f2f5; }
.nav-btn:active { transform: scale(0.9); }

#lupe-icon { transition: transform 0.4s ease; }
.open-icon #lupe-icon { transform: rotate(90deg); }


/* =========================================
   Akkordeon & Preview (Weiche Animationen)
   ========================================= */

/* --- Vorspann (Preview) --- */
.preview-container {
    display: grid;
    cursor: pointer; 
    grid-template-rows: 1fr; /* Start: Offen */
    transition: background-color 0.2s ease, grid-template-rows 0.4s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1;
}

.preview-container:hover { background-color: #f8f9fa; }
.preview-container.hidden { grid-template-rows: 0fr; opacity: 0; }
.preview-content { overflow: hidden; min-height: 0; }

/* --- Details (Markdown Text) --- */
.text-container {
    display: grid;
    grid-template-rows: 0fr; /* Start: Geschlossen */
    transition: grid-template-rows 0.4s ease-in-out, opacity 0.4s ease-in-out;
    opacity: 0;
    background-color: #fafafa;
}

#detailsContainer {
    scroll-margin-top: 40px; /* Höhe deiner Navbar + ein bisschen Luft zum Atmen */
}

.text-container.open { grid-template-rows: 1fr; opacity: 1; }
.text-content { overflow: hidden; min-height: 0; }


/* =========================================
   Typografie in der Karte (Markdown & Preview)
   ========================================= */
   
/* Globale Text-Einstellungen für das Innere der Karte */
.wisdom-card {
    font-family: 'Lora', serif;
    font-size: 18px;          
    line-height: 1.7;         
    color: #333333; 
}

/* Handschriftliche Titel */
.wisdom-card h1,
.wisdom-card h2,
.wisdom-card h3,
.handwritten-text {
    font-family: 'Caveat', cursive;
    text-align: center;
}

.handwritten-text { font-size: 2.5em; margin-bottom: 20px; }

/* Spezifische Titelgrößen */
.wisdom-card h1 { font-size: 2.8rem; margin-top: 0; }
.wisdom-card h2 { font-size: 1.8rem; color: #6c757d; margin-bottom: 1.5rem; }
.wisdom-card h3 { font-size: 1.5rem; color: #6c757d; margin-top: 1.5rem; }

/* Markdown Extras */
#markdown-body blockquote {
    padding: 15px 20px;
    font-style: italic;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    border-left: 4px solid #fdcb0d; 
    background-color: rgba(255, 255, 240, 0.5); 
}

#markdown-body img {
    max-width: 100%;    
    height: auto;       
    display: block;     
    border-radius: 8px; 
}


/* =========================================
   Rechtliches & Footer
   ========================================= */
.impressum, .datenschutz {
  font-family: 'Lora', serif;
  line-height: 1.6;
  color: #333; 
  max-width: 800px;
  margin: 0 auto;
}

footer#footer {
    border-top: 1px solid #f0f0f0; 
    background-color: #ffffff;
    font-family: 'Lora', serif;    
    color: #6c757d;                
}

footer#footer small { font-size: 0.9rem; letter-spacing: 0.05rem; }

footer#footer .footer-brand {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: #d63384; 
    margin-right: 10px;
    vertical-align: middle;
}

footer#footer a { transition: opacity 0.3s ease; }
footer#footer a:hover { opacity: 0.7; }

.reverse-email {
    unicode-bidi: bidi-override;
    direction: rtl;
    text-align: left;
    display: inline-block;
}

/* =========================================
   Mobile-Optimierung (Smartphones)
   ========================================= */
@media (max-width: 480px) {
    .action-bar {
        flex-wrap: wrap;       
        padding: 16px 12px 12px 12px; 
    }
    
    .audio-player {
        width: 100%;           
        order: -1;             
        margin: 0 0 16px 0;    
    }
    
    /* --- Edler 3D-Knopf (Zartes Viereck) - NUR AUF DEM HANDY --- */
    .nav-btn {
        flex: 1;                   
        max-width: 100%;           
        border-radius: 12px;       
        margin: 0 6px;             
        padding: 14px 0;           
        
        background-color: #ffffff; 
        border: 1px solid rgba(0, 0, 0, 0.06); 
        
        box-shadow: 
            0 4px 6px rgba(0, 0, 0, 0.05),  
            0 1px 3px rgba(0, 0, 0, 0.03);  
            
        transition: all 0.2s ease; 
    }

    /* Klick-Effekt auf dem Handy */
    .nav-btn:active {
        transform: translateY(2px); 
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); 
        background-color: #fdfdfd;
    }
    
    .nav-btn img {
        width: 32px !important;
        height: auto;
    }
} /* <--- WICHTIG: HIER WIRD DIE MOBILE ANSICHT GESCHLOSSEN! */


/* =========================================
   Zwei-Klick-Lösung (YouTube / Externe Medien)
   ========================================= */
.two-click-container {
    position: relative;
    background-color: rgba(255, 255, 240, 0.5); 
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 315px; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.two-click-placeholder {
    max-width: 80%;
    margin: 0 auto;
}

.two-click-placeholder p {
    font-family: 'Lora', serif;
    color: #333333;
    margin-bottom: 15px;
}

.load-media-btn {
    font-family: 'Caveat', cursive; 
    font-size: 1.8rem;
    background-color: #d63384;      
    color: #ffffff;
    border: none;
    padding: 6px 30px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(214, 51, 132, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.load-media-btn:hover {
    background-color: #b02a6c;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(214, 51, 132, 0.3);
}

.load-media-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(214, 51, 132, 0.2);
}

/* =========================================
   STARTSEITE: DIE MAGISCHE SCHRIFTROLLE
   ========================================= */

/* --- 1. DER SCHRIFTROLLEN-CONTAINER --- */
.wisdom-scroll-area {
    max-height: 400px; /* Passe diesen Wert an, je nachdem wie viele Karten sichtbar sein sollen */
    overflow-y: hidden;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column; 
    align-items: center; 
}

/* Der unsichtbare, schwerelose Hintergrund der gesamten Schriftrolle */
.mystic-scroll-bg {
    background-color: transparent;
    border: none;                  
    box-shadow: none;              
    border-radius: 15px;       

/* Der Hintergrund der Schriftrolle (Pergament / Bild) */
    /* 1. Pfad zu deinem Bild (bitte anpassen!) */
    background-image: url('/images/icons/gurueye.webp'); 
    
    /* 2. Wie soll sich das Bild verhalten? */
    background-size: 100% 100%; /* Zieht das Bild exakt auf die Größe des Containers */
    /* Alternativ: background-size: cover; (schneidet Ränder ab, behält aber die Proportionen) */
    
    
    /* 3. Optischer Feinschliff */
    border-radius: 15px; /* Rundet die Ecken deines Bildes ab */
    padding: 20px;       /* Sorgt dafür, dass die Karten nicht direkt am Bildrand kleben */
    
    /* Optional: Ein leichter innerer Schatten, um es dreidimensionaler wirken zu lassen */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5); 

    background-size: 90% auto; 
    
    /* 2. BILD WEITER NACH OBEN SCHIEBEN */
    /* 'center' hält es in der Mitte (links/rechts). 
       'top' zieht es ganz nach oben an den inneren Rand des Containers. 
       Geheimtipp: Wenn es noch HÖHER soll (über den Rand hinaus), 
       kannst du auch negative Pixel nutzen, z.B.: center -30px; */
    background-position: center top; 
    
    background-repeat: no-repeat;
    border-radius: 15px; 
    padding: 20px;


}


/* --- 2. DIE MYSTISCHEN SCROLL-BUTTONS --- */
.mystic-scroll-bar {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(214, 51, 132, 0.05) 50%, 
        rgba(255, 255, 255, 0.2) 100%
    );
    border: 1px solid rgba(214, 51, 132, 0.15); /* Feiner, pink angehauchter Rand */
    color: #6c757d;
    border-radius: 15px; 
    padding: 10px 0; 
    height: 45px; /* Komfortable Klick-Höhe */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none; 
    transition: all 0.3s ease;
}

.mystic-scroll-bar:hover {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(115, 187, 28, 0.05) 50%, 
        rgba(138, 35, 35, 0.2) 100%
    );
    border-color: rgba(214, 51, 132, 0.3);
}

.mystic-scroll-bar:active {
    transform: translateY(2px); /* Sanftes Eindrücken beim Klicken */
}


/* --- 3. DIE WISDOM CARDS (HAUPTKARTEN) --- */

/* Verstecken für die Live-Suche */
.wisdom-link-wrapper.hidden {
    display: none !important;
}

/* Die Link-Hülle darf die volle Breite nutzen */
.wisdom-link-wrapper {
    width: 100%; 
    max-width: 100%; 
    flex-shrink: 0; 
    text-decoration: none; 
    display: block;
    margin: 0 auto; 
}

/* Die Karte selbst: Passt sich dem Inhalt an, wird nicht gequetscht */
.wisdom-scroll-area .wisdom-card {
    width: 100%;
    max-width: 100% !important;
    height: max-content !important; /* Klammert sich eng an den Inhalt */
    flex-shrink: 0 !important;      /* Schutzschild gegen das Quetschen */
    margin-top: 0 !important;
    margin-bottom: 0px !important;    /* Außenabstände werden per HTML mb-1/mb-2 gesteuert */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}


/* --- 4. BILD & THUMBNAIL-CONTAINER --- */

/* Der Bild-Container (Setzt das Bild auf 50% Breite mit Abstand nach rechts) */
.wisdom-card .wisdom-thumb-container {
    width: 50% !important;
    min-width: 50% !important;
    max-width: 50% !important;
    height: auto !important; 
    flex-shrink: 0 !important; 
    
    margin: 0 15px 0 0 !important; /* Abstand zum Text rechts daneben */
    border-radius: 12px;
    position: relative;
    overflow: visible; /* Extrem wichtig für den Hover-Zoom! */
    z-index: 10;
}

/* Das Bild selbst */
.wisdom-card .wisdom-thumb-img {
    display: block;
    position: relative; 
    width: 100% !important;
    height: auto !important; 
    max-height: 280px; /* Sicherheitsgrenze für Hochkant-Bilder */
    object-fit: cover !important;
    
    border-radius: 12px;
    z-index: 2;
    cursor: zoom-in;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

/* --- 5. INTERAKTIONEN & TEXT --- */

/* Der klickbare Bereich (Wird meist per Bootstrap d-flex flex-row gesteuert) */
.wisdom-clickable-area {
    display: flex;
    width: 100%;
}

/* Sanfter Farbwechsel des Titels beim Hover über die Karte */
.wisdom-clickable-area:hover .card-title {
    color: #d63384 !important; /* Guru-Wisdom Pink */
    transition: color 0.2s ease;
}

/* Container für die Tags am Boden */
.wisdom-tags-area {
    width: 100%;
}

/* =========================================
   REPARATUR: DETAILSEITE (HAUPT-WISDOM)
   ========================================= */

.wisdom-card {
    background: #ffffff;
    max-width: 700px;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Hintergrund-Wechsel entfernt */
    cursor: default; /* Standard-Cursor */
}

/* 2. Das große Bild auf der Detailseite zähmen */
.wisdom-card .image-container {
    width: 100%;
    position: relative;
}

.wisdom-card .image-container img {
    width: 100%;
    height: auto;
    max-height: 60vh; /* Macht das Bild nicht endlos hoch (maximal 60% der Bildschirmhöhe) */
    object-fit: cover;
    border-top-left-radius: 15px;  /* Passt sich den runden Ecken der Karte an */
    border-top-right-radius: 15px;
}

/* =========================================
   SCHUTZSCHILD FÜR DIE SCHRIFTROLLE (STARTSEITE)
   ========================================= */

/* Hier überschreiben wir die Detail-Regeln wieder, damit die Liste perfekt bleibt! */
.wisdom-scroll-area .wisdom-card {
    background-color: #ffffff; 
    box-shadow: none !important; /* Bootstrap (shadow-sm) übernimmt hier */
    max-width: 100% !important;  /* In der Liste darf sie die volle Breite nutzen */
    margin: 0 !important;        /* Abstand wird über HTML mb-1 gesteuert */
    border-radius: 12px;


}
.wisdom-scroll-area .wisdom-text-container {
    text-align: center !important;
}

.wisdom-scroll-area {
    max-height: 400px; 
    overflow-y: hidden;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column; 
    align-items: center; 
    position: relative; 
    padding-top: 150px; 
    padding-bottom: 150px; 
    
    /* NEU: Das erzeugt den perfekten, gleichmäßigen Abstand zwischen den Karten! */
    gap: 5px; 
}

.wisdom-card.wisdom-card-link:hover {
    transform: none; /* overview translateY(-4px) translateX(5px); for a subtle lift and right shift */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.08), 0 24px 48px rgba(0, 0, 0, 0.12); 
    background-color: #f8f9fa !important; 
    cursor: pointer; /* Nur hier wird der Cursor zum Zeiger */
}

.lang-support-button {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.55rem;
    color: #6c757d;
    border: 1px solid #dee2e6;
    background-color: transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}

.lang-support-button:hover {
    color: #212529;
    border-color: #adb5bd;
    background-color: #f8f9fa;
}