/* ============================================================
   Datei:    styles.css
   Pfad:     /www/htdocs/w0070fcf/bdsm-sex-dictionary.com/assets/css/styles.css
   Funktion: Public-Design (Mobile First).
   Fix v7:   Sidebar entfernt. Top-Bar + Footer-Spalten.
   Fix v9:   Google-Effekt: Hero fuellt ersten Viewport (Suche
             zentriert), Random-Eintraege erst beim Scrollen.
   ============================================================ */

/* ===== CSS-Variablen ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #16161d;
    --bg-card-light: #1e1e28;
    --pink: #e91e8c;
    --cyan: #00bcd4;
    --purple: #7b2ff7;
    --text: #e8e8ee;
    --text-dim: #9a9aa8;
    --tile-bg: #f5f5f7;
    --tile-text: #1a1a22;
    --border: #2a2a36;
    --radius: 12px;
    --font: Verdana, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ===== Reset / Basis ===== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(ellipse 600px 400px at 15% 10%, rgba(233, 30, 140, 0.18), transparent 60%),
        radial-gradient(ellipse 600px 400px at 85% 15%, rgba(0, 188, 212, 0.14), transparent 60%),
        radial-gradient(ellipse 500px 350px at 50% 95%, rgba(123, 47, 247, 0.12), transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; height: auto; }

a { color: var(--cyan); }
a:hover { color: var(--pink); }

h1, h2, h3, h4 {
    line-height: 1.3;
    color: #ffffff;
}

mark {
    background-color: #ffe600;
    color: #1a1a22;
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== Top-Bar (Logo + Seitenname) ===== */
.topbar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.topbar-brand img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 0.3px;
}

.topbar-brand:hover .topbar-title { color: var(--pink); }

/* ===== Content (immer zentriert) ===== */
main#content {
    padding: 16px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* ===== Hero (Startseite) – Google-Effekt: fuellt 1. Viewport =====
   Topbar ist ca. 69px hoch; Hero nimmt den Rest des Screens ein,
   Suche vertikal zentriert. Random-Eintraege erst beim Scrollen. */
.hero {
    min-height: calc(100vh - 69px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
}

.hero h1 {
    margin: 0 0 28px;
    font-size: 28px;
}

.hero-search {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* dezenter Scroll-Hinweis unter der Suche */
.hero-scroll {
    margin-top: 26px;
    font-size: 22px;
    color: var(--text-dim);
    animation: heroBounce 1.8s ease-in-out infinite;
    user-select: none;
}

@keyframes heroBounce {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50%      { transform: translateY(6px); opacity: 1; }
}

/* ===== Suchformulare ===== */
.searchform {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.searchform input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--tile-text);
    background-color: var(--tile-bg);
    border: none;
    border-radius: 24px;
    outline: none;
}

.searchform button {
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border: none;
    border-radius: 24px;
    cursor: pointer;
}

.searchform button:hover { opacity: 0.88; }

/* Such-Seite: Formular braucht normalen Abstand unten */
.searchform.page-search { margin-bottom: 16px; }

/* ===== Eintrags-Karten-Grid (Startseite) ===== */
.entry-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 8px;
    scroll-margin-top: 16px;
}

.entry-card {
    display: flex;
    flex-direction: row;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.entry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(233, 30, 140, 0.30);
    border-color: var(--pink);
    color: var(--text);
}

.entry-card-img {
    flex: 0 0 110px;
    width: 110px;
    height: 110px;
    object-fit: cover;
    background-color: var(--bg-card-light);
}

.entry-card-img.is-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-dim);
}

.entry-card-body {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
}

.entry-card-body h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: #fff;
    word-break: break-word;
}

.entry-card-body p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-dim);
}

/* ===== Zufallsspruch-Kachel ===== */
.quote-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 18px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-radius: var(--radius);
    color: #fff;
    min-height: 110px;
}

.quote-text {
    margin: 0;
    font-size: 16px;
    font-style: italic;
    line-height: 1.5;
}

.quote-author {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: bold;
    text-align: right;
    opacity: 0.9;
}

/* zentrierter Link */
.center-link {
    text-align: center;
    margin: 28px 0 8px;
}

.center-link a {
    display: inline-block;
    padding: 10px 24px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    border-radius: 24px;
    text-decoration: none;
}

.center-link a:hover { opacity: 0.88; color: #fff; }

/* ===== A-Z-Übersicht ===== */
.alpha-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 28px;
    padding: 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.alpha-jump a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-weight: bold;
    color: #fff;
    background-color: var(--bg-card-light);
    border-radius: 8px;
    text-decoration: none;
}

.alpha-jump a:hover {
    background: linear-gradient(135deg, var(--pink), var(--purple));
}

.alpha-block {
    margin-bottom: 28px;
    scroll-margin-top: 16px;
}

.alpha-letter {
    margin: 0 0 10px;
    padding-bottom: 6px;
    font-size: 22px;
    color: var(--pink);
    border-bottom: 2px solid var(--border);
}

.alpha-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.alpha-list li { margin: 0; }

.alpha-list a {
    display: block;
    padding: 8px 12px;
    color: var(--text);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
}

.alpha-list a:hover {
    border-color: var(--pink);
    color: #fff;
}

/* ===== Eintrag: Text + Medien (Float-Layout, Variante B) ===== */
.entry-body {
    display: flex;
    flex-direction: column-reverse;
}

.entry-media {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.entry-media .media-item {
    flex: 0 0 calc(50% - 5px);
    margin: 0;
    background-color: var(--bg-card-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.media-thumb {
    position: relative;
    display: block;
    cursor: pointer;
}

.media-thumb img {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    transition: transform 0.15s ease;
}

.media-thumb:hover img { transform: scale(1.04); }

.entry-media figcaption {
    padding: 6px 9px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-dim);
}

.media-rights {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    opacity: 0.8;
}

.media-video {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 130px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
}

.media-video-ph {
    font-size: 28px;
    color: #fff;
}

/* ===== Auto-Links (interne Verlinkung) ===== */
.auto-link {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
.auto-link:hover { color: var(--pink); }

/* ===== Externe Links unter dem Eintrag ===== */
.entry-links {
    clear: both;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.entry-links h2 { font-size: 16px; margin: 0 0 10px; }
.entry-links ul { list-style: none; margin: 0; padding: 0; }
.entry-links li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}
.entry-links li:last-child { border-bottom: none; }
.entry-links a {
    color: var(--cyan);
    text-decoration: none;
    word-break: break-word;
}
.entry-links a:hover { color: var(--pink); text-decoration: underline; }
.entry-links a::after { content: " ↗"; font-size: 12px; opacity: .7; }
.ad-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    flex-shrink: 0;
}

/* ===== Amazon-Rotator (max. 200px breit) ===== */
.entry-rotator {
    max-width: 200px;
}
.entry-rotator img,
.entry-rotator iframe,
.entry-rotator a img {
    max-width: 200px !important;
    width: 100% !important;
    height: auto !important;
    display: block;
}
.entry-rotator iframe { border: 0; }

/* ===== Leerzustand ===== */
.empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-dim);
    background-color: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ===== Artikel ===== */
article h1 { font-size: 24px; }

article {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

article table {
    border-collapse: collapse;
    width: 100%;
    margin: 14px 0;
}

article th,
article td {
    border: 1px solid var(--border);
    padding: 8px 10px;
}

article blockquote {
    margin: 14px 0;
    padding: 10px 16px;
    border-left: 4px solid var(--cyan);
    background-color: var(--bg-card-light);
    border-radius: 0 8px 8px 0;
}

article pre,
article code {
    background-color: var(--bg-card-light);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 13px;
}

article pre { padding: 12px; overflow-x: auto; }

.alignleft  { float: left;  margin: 5px; }
.alignright { float: right; margin: 5px; }
.aligncenter {
    display: block;
    margin: 5px auto;
    float: none;
}

.entry-text::after {
    content: "";
    display: block;
    clear: both;
}

article::after {
    content: "";
    display: block;
    clear: both;
}

.article-actions { margin-top: 16px; }

.btn-edit {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text);
    background-color: var(--bg-card-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
}

.btn-edit:hover { border-color: var(--pink); color: #fff; }

/* ===== Suche-Ergebnisse ===== */
.result-count { color: var(--text-dim); }

.search-hit {
    margin-bottom: 14px;
}

.search-hit h2 {
    margin: 0 0 6px;
    font-size: 17px;
}

.search-hit p {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
}

/* ===== Formulare ===== */
.auth-form,
#article-form {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    max-width: 460px;
}

#article-form { max-width: none; }

.auth-form label,
#article-form label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-dim);
}

.auth-form input,
#article-form input[type="text"] {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 10px 12px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--tile-text);
    background-color: var(--tile-bg);
    border: none;
    border-radius: 8px;
    outline: none;
}

.auth-form button,
.btn-save {
    display: inline-block;
    padding: 11px 26px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border: none;
    border-radius: 24px;
    cursor: pointer;
}

.auth-form button:hover,
.btn-save:hover { opacity: 0.88; }

.btn-save { margin-top: 14px; }

.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 1px;
    overflow: hidden;
}

#article-form .jodit-container {
    border-radius: 8px;
    margin-top: 5px;
}

/* ===== Meldungen ===== */
.flash,
.error,
.notice {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash {
    background-color: rgba(0, 188, 212, 0.12);
    border: 1px solid var(--cyan);
    color: #aef0f8;
}

.error {
    background-color: rgba(233, 30, 140, 0.12);
    border: 1px solid var(--pink);
    color: #ffc2e3;
}

.notice {
    background-color: var(--bg-card-light);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

/* ===== Footer (Spalten) ===== */
.site-footer {
    margin-top: 40px;
    padding: 28px 20px;
    border-top: 1px solid var(--border);
    background-color: rgba(0, 0, 0, 0.25);
    font-size: 13px;
    color: var(--text-dim);
}

.footer-cols {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    align-items: start;
}

.footer-col { min-width: 0; }

.footer-nav,
.footer-legal,
.footer-copy {
    margin: 0 0 8px;
    line-height: 1.8;
}

.site-footer a {
    color: var(--text-dim);
    text-decoration: none;
}
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-nav a { font-weight: bold; color: var(--text); }
.site-footer .sep { opacity: 0.4; margin: 0 6px; }

.footer-flags {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 8px;
    justify-content: start;
}

.footer-flags a,
.footer-flags span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 26px;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.footer-flags a { cursor: pointer; }

.footer-flags img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-flags a:hover {
    transform: translateY(-1px) scale(1.06);
    border-color: var(--cyan);
}

.footer-flags a.active {
    border-color: var(--pink);
    box-shadow: 0 0 0 1px var(--pink);
}

.footer-flags span.disabled {
    cursor: not-allowed;
    filter: grayscale(100%);
    opacity: 0.3;
}

.author-box {
    padding: 14px;
    background-color: var(--bg-card-light);
    border-radius: var(--radius);
    text-align: center;
}

.author-greeting,
.author-hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-dim);
}

.btn-new-article {
    display: inline-block;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, var(--pink), var(--cyan));
    border-radius: 24px;
    text-decoration: none;
}

.btn-new-article:hover { opacity: 0.88; color: #fff; }

.link-logout {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lightbox[hidden] { display: none; }

.lightbox-inner {
    position: relative;
    width: 100%;
    max-width: 860px;
    height: 85vh;
    background-color: #fff;
    border-radius: var(--radius);
    overflow: hidden;
}

.lightbox-inner iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.lightbox-inner iframe[hidden] { display: none; }

.lightbox-inner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

.lightbox-inner img[hidden] { display: none; }

#lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
    font-size: 22px;
    line-height: 1;
    color: #fff;
    background-color: var(--pink);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}

/* ============================================================
   Breakpoint: Tablet (>= 600px)
   ============================================================ */
@media (min-width: 600px) {
    .entry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .alpha-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero h1 { font-size: 34px; }

    .entry-body { display: block; }

    .entry-media {
        float: right;
        width: 230px;
        margin: 0 0 14px 22px;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .entry-media .media-item {
        flex: 0 0 auto;
        width: 100%;
    }

    .media-thumb img,
    .media-video { height: 160px; }

    .footer-cols {
        grid-template-columns: 1.2fr 0.8fr 1fr;
        gap: 30px;
    }
}

/* ============================================================
   Breakpoint: Desktop (>= 900px)
   ============================================================ */
@media (min-width: 900px) {
    main#content { padding: 28px 32px; }

    .alpha-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   Breakpoint: Large Desktop (>= 1200px)
   ============================================================ */
@media (min-width: 1200px) {
    .entry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}