/* ===== EITIE V18504 - PRIDE CSS (Neuaufbau) ===== */
/* Minimal, aufgeräumt, barrierefrei */
/* Alle Farben kommen via CSS-Variablen aus walls_yh.php (DB/Fallbacks) */

/* ===== BASE / RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text);
    background-color: var(--page-bg);
    min-height: 100vh;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Focus-Styles: kein Rahmen bei Links */
a:focus {
    outline: none;
}

a:focus-visible {
    text-decoration: underline;
    outline: none;
}

/* Bilder */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Focus-Styles für Tastaturnavigation (außer Links) */
:focus-visible:not(a) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Motion reduzieren für Nutzer mit prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Screen-Reader-Only (für versteckte Überschriften) */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===== CSS VARIABLES (nur Geometrie; Farben kommen aus walls_yh.php) ===== */
:root {
    /* Geometrie */
    --wall-max: 730px;
    --openframe-width: 20px;
    --gap: 20px;
}

/* ===== LAYOUT ===== */

/* Wall: 730px breit, zentriert, Flex-Container für 3 Spalten */
.wall {
    display: flex;
    width: var(--wall-max, 730px);
    max-width: 100%;
    margin: 0 auto;
}

/* Openframe-Balken: links/rechts, je 20px fix */
.openframe-left {
    flex: 0 0 var(--openframe-width, 20px);
    width: var(--openframe-width, 20px);
    min-width: var(--openframe-width, 20px);
    background-color: var(--openframe-left);
}

.openframe-right {
    flex: 0 0 var(--openframe-width, 20px);
    width: var(--openframe-width, 20px);
    min-width: var(--openframe-width, 20px);
    background-color: var(--openframe-right);
}

/* Content-Container: Breite = 100% - 40px (zwei Gaps), mittig */
.coco {
    /* Feste Innenabstände 20px je Seite; Breite kompensiert diese 40px */
    width: calc(100% - 40px);
    padding-left: 20px;
    padding-right: 20px;
    margin: 0 auto;
}

/* ===== TILES ===== */

/* Tile: Basis-Karte */
.tile {
    width: 100%;
    background-color: var(--tile-bg);
    color: var(--text);
    border-radius: 0.3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    padding: 1.1rem 1.2rem;
    margin-bottom: 2.2rem;
    transition: box-shadow 0.2s;
}

.tile:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Panel: semantischer Abschnitt (später erweitern) */
.panel {
    margin-bottom: 2rem;
}

/* ===== TILE VARIANTS ===== */

/* onepic: Bild-Container für 1pic-Tiles (tile_type 1 und 4) */
/* Diese Klasse regelt NUR den Abstand unter dem Bild, nicht den Tile-Abstand */
.onepic {
    margin-bottom: 1rem; /* Abstand unter dem Bild zum Autor-Block oder Body-Text */
}

.onepic img {
    width: 100%;
    height: auto;
    border-radius: 0.2rem;
}

/* onepic-Link Hover-Effekt */
.onepic a {
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.onepic a:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.onepic a:hover img {
    filter: brightness(1.1);
}

/* Vote-Card (tile_type=6): pic3 → (pic1+pic2) → pic4 */
.vote-seamless {
    display: flex;
    flex-direction: column;
    gap: 3px; /* Sehr kleine Lücke zwischen Bild-Ebenen */
}

.vote-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0; /* Standard: keine Rundungen */
}

/* Vote-Double: pic1 und pic2 nebeneinander */
.vote-double {
    display: flex;
    gap: 2%; /* 2% Abstand zwischen pic1 und pic2 */
    margin-bottom: 0;
}

.vote-image {
    flex: 0 0 49%; /* Jedes Bild 49% Breite (49% + 2% + 49% = 100%) */
    overflow: hidden;
}

/* Vote-Link Hover-Effekt (wie onepic) */
.vote-link {
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.vote-link:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.vote-link:hover .vote-img {
    filter: brightness(1.1);
}

/* Vote-Card spezifische Rundungen */
/* Pic3: nur oben gerundet (erstes Bild in vote-seamless) */
.vote-seamless > .vote-img:first-child {
    border-radius: 0.2rem 0.2rem 0 0;
}

/* Pic1 und Pic2: keine Rundungen (explizit überschreiben) */
.vote-seamless .vote-double .vote-img {
    border-radius: 0;
}

/* Pic4: nur unten gerundet (letztes Bild in vote-seamless) */
.vote-seamless > .vote-img:last-child {
    border-radius: 0 0 0.2rem 0.2rem;
}

/* 2pic: Zwei Bilder nebeneinander */
[class*="2pic_left"],
[class*="2pic_right"] {
    display: inline-block;
    width: calc(50% - 0.25rem);
    vertical-align: top;
}

[class*="2pic_left"] {
    margin-right: 0.5rem;
}

[class*="2pic_right"] {
    margin-left: 0.5rem;
}

[class*="2pic_left"] img,
[class*="2pic_right"] img {
    width: 100%;
    height: auto;
    border-radius: 0.2rem;
}

/* ===== AUTHOR BLOCK ===== */

/* Logo/Profilbild */
.logo {
    display: inline-block;
    width: 38px;
    height: 38px;
    border-radius: 0.2rem;
    margin-right: 0.8rem;
    vertical-align: middle;
    flex-shrink: 0;
    background: #f5f5f5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.logo img {
    width: 100%;
    height: 100%;
    border-radius: 0.2rem;
    object-fit: contain;
}

/* Logo-Link Hover-Effekt */
a.logo {
    transition: transform 0.2s ease;
    text-decoration: none;
}

a.logo:hover {
    transform: scale(1.02);
    text-decoration: none;
}

a.logo:hover img {
    filter: brightness(1.1);
}

/* Author-Zeilen */
.firstline {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    color: var(--text);
}

.firstline a {
    color: inherit;
    text-decoration: none;
}

.firstline a:hover,
.firstline a:focus {
    color: var(--accent);
    text-decoration: underline;
}

.secondline {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.2;
    margin: 0.2rem 0 0 0;
    color: var(--text);
    opacity: 0.8;
}

/* ===== MARKDOWN / CONTENT ===== */

/* Blockquote */
.quote {
    border-left: 4px solid var(--openframe-left);
    margin: 0.8rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.03);
    font-style: italic;
    color: var(--text);
    border-radius: 0.2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quote p {
    margin: 0.5rem 0;
}

/* ===== TYPOGRAPHY ===== */

h1, h2, h3, h4, h5 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    margin: 1.5rem 0 1rem 0;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

/* ===== FOOTER ===== */

footer {
    position: sticky;
    bottom: 0;
    z-index: 50;
    width: 100%;
    background-color: var(--tile-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
}

footer .footer-wall {
    display: flex;
    width: var(--wall-max, 730px);
    max-width: 100%;
    margin: 0 auto;
}

footer .footer-coco {
    /* Gleiche Logik wie Main-Bereich: 100% - 40px, mit 20px Padding je Seite */
    width: calc(100% - 40px);
    padding-left: 20px;
    padding-right: 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Footer-Links-Gruppe (Logo + Suchfeld) */
footer .footer-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    min-width: 0;
}

/* Footer-Content (Logo, Suche, Icons) */
footer .footer-logo {
    display: block;
    width: auto;
    height: 2rem;
    margin-right: 20px;
    flex-shrink: 0;
    text-decoration: none;
}

footer .footer-logo img {
    height: 2rem;
    width: auto;
    border-radius: 0;
    display: block;
}

/* Suche */
footer .footer-form {
    display: block;
    flex: 1;
    max-width: 400px;
    margin: 0;
    min-width: 0;
}

footer input[type="text"] {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.25rem;
    font-size: 0.9rem;
    font-family: 'Barlow Condensed', Arial, sans-serif;
    background-color: var(--tile-bg);
    color: var(--text);
    line-height: 1.4;
}

footer input[type="text"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: transparent;
}

/* Footer-Icons */
footer .footer-icons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

footer .footer-icon {
    color: var(--text);
    opacity: 0.6;
    text-decoration: none;
    transition: opacity 0.2s;
}

footer .footer-icon:hover,
footer .footer-icon:focus {
    opacity: 1;
    outline: none;
}

footer .footer-icon img {
    width: 1.5rem;
    height: 1.5rem;
    display: block;
}

/* Pride-Flagge (Regenbogen-Gradient) */
.y-pride-flag {
    background: linear-gradient(
        to bottom,
        #e40303 0%,      /* Red */
        #e40303 9.09%,
        #ff8c00 9.09%,   /* Orange */
        #ff8c00 18.18%,
        #ffed00 18.18%,  /* Yellow */
        #ffed00 27.27%,
        #008026 27.27%,  /* Green */
        #008026 36.36%,
        #24408e 36.36%,  /* Blue */
        #24408e 45.45%,
        #732982 45.45%,  /* Purple */
        #732982 54.54%,
        #ffffff 54.54%,  /* White */
        #ffffff 63.63%,
        #f6a9b8 63.63%,  /* Pink */
        #f6a9b8 72.72%,
        #55cdfc 72.72%,  /* Light Blue */
        #55cdfc 81.81%,
        #613915 81.81%,  /* Brown */
        #613915 90.9%,
        #000000 90.9%,   /* Black */
        #000000 100%
    );
    height: 100%;
    width: var(--openframe-width, 20px);
    min-height: 40px;
    flex: 0 0 var(--openframe-width, 20px);
}

/* ===== KPO (Klakker Phase One) minimal styles ===== */
.kpo-form {
    background: var(--tile-bg);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 0.3rem;
    padding: 0.8rem;
    margin: 0.5rem 0;
}
.kpo-header h3 { margin: 0 0 0.25rem 0; font-size: 1.1rem; }
.kpo-meta { margin: 0 0 0.5rem 0; font-size: 0.85rem; opacity: 0.7; }
.kpo-label { display: block; margin: 0.4rem 0 0.2rem; font-weight: 600; }
.kpo-input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 0.25rem;
    font-family: 'Barlow Condensed', Arial, sans-serif;
}
.kpo-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.kpo-actions { display: flex; justify-content: flex-end; margin-top: 0.6rem; }
.kpo-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    padding: 0.35rem 0.9rem;
    cursor: pointer;
}
.kpo-submit:hover { filter: brightness(0.95); }
.kpo-error { padding: 0.6rem; background: #fff4f4; border: 1px solid #f5c2c7; border-radius: 0.25rem; color: #842029; }
.kpo-success { padding: 0.6rem; background: #d1e7dd; border: 1px solid #badbcc; border-radius: 0.25rem; color: #0f5132; margin-bottom: 1rem; }

/* ===== RESPONSIVE (Mobile) ===== */
@media (max-width: 768px) {
    .wall {
        width: 100%;
    }
    
    .openframe-left,
    .openframe-right,
    .y-pride-flag {
        width: var(--openframe-width, 20px);
        min-width: var(--openframe-width, 20px);
    }
    
    .coco {
        width: calc(100% - (2 * var(--gap, 20px)));
    }
    
    /* Footer bleibt auch auf Mobile horizontal - leicht kompakter, aber größer als vorher */
    footer .footer-logo {
        height: 1.6rem;
        margin-right: 20px;
    }
    
    footer .footer-logo img {
        height: 1.6rem;
    }
    
    footer .footer-form {
        max-width: 38%;
        min-width: 120px;
        margin: 0;
    }
    
    footer input[type="text"] {
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }
    
    footer .footer-icons {
        gap: 0.4rem;
    }
    
    footer .footer-icon img {
        width: 1.3rem;
        height: 1.3rem;
    }
}
