/*
 * YourTown Cookie Consent - Frontend-Styles (Grav-Plugin ytcookieconsent)
 *
 * Gekapselt unter .ytcc-* (BEM-Praefix, keine generischen Klassen).
 * Farben/Radius kommen als CSS-Variablen (--ytcc-*) aus dem injizierten
 * Inline-Style auf :root; hier stehen nur Fallbacks (Work-on-Beauty-CI).
 * Schrift erbt bewusst von der Site (keine Font-Einbettung).
 * Mobile-first, z-index 9990, prefers-reduced-motion beachtet.
 *
 * Developer: Andreas Lerch / YourTown GbR
 */

/* ---- Wurzel-Overlay ---- */
.ytcc-root {
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
    color: var(--ytcc-text, #F4F7FB);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
.ytcc-root[hidden] { display: none; }
.ytcc-root.ytcc-active::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(12, 19, 28, 0.55);
    pointer-events: auto;
}

.ytcc-banner,
.ytcc-modal { pointer-events: auto; }
.ytcc-banner[hidden],
.ytcc-modal[hidden] { display: none; }

/* ---- Banner: untere Leiste (Default) ---- */
.ytcc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ytcc-panel, #1B2C40);
    border-top: 3px solid var(--ytcc-accent, #B29B63);
    box-shadow: 0 -6px 28px rgba(9, 14, 20, 0.35);
    animation: ytcc-slide-up 0.25s ease-out;
}

/* ---- Banner: zentrierte Box (Alternative) ---- */
.ytcc-root--box .ytcc-banner {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 560px;
    border: 1px solid var(--ytcc-accent, #B29B63);
    border-top-width: 3px;
    border-radius: var(--ytcc-radius, 10px);
    animation: none;
}

.ytcc-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 16px;
}

.ytcc-title {
    margin: 0 0 8px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ytcc-text, #F4F7FB);
}
.ytcc-text {
    margin: 0 0 10px;
    font-size: 0.875rem;
    line-height: 1.55;
}
.ytcc-links {
    margin: 0 0 14px;
    font-size: 0.8125rem;
}
.ytcc-links a {
    color: var(--ytcc-accent, #B29B63);
    text-decoration: underline;
}
.ytcc-links a:hover { filter: brightness(1.12); }

/* ---- Buttons (mobile-first: gestapelt, volle Breite) ---- */
.ytcc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ytcc-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    border-radius: var(--ytcc-radius, 10px);
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    width: 100%;
    transition: filter 0.15s ease;
}
.ytcc-btn-accept {
    background: var(--ytcc-primary, #8F7A45);
    color: var(--ytcc-text, #F4F7FB);
}
.ytcc-btn-essential {
    background: transparent;
    color: var(--ytcc-text, #F4F7FB);
    border-color: var(--ytcc-accent, #B29B63);
}
.ytcc-btn-settings {
    background: transparent;
    color: var(--ytcc-accent, #B29B63);
    border: none;
    padding: 8px 12px;
    text-decoration: underline;
    font-weight: 500;
}
.ytcc-btn:hover { filter: brightness(1.1); }
.ytcc-btn:focus-visible {
    outline: 3px solid var(--ytcc-accent, #B29B63);
    outline-offset: 2px;
}

/* ---- Einstellungs-Dialog (zweite Ebene) ---- */
.ytcc-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ytcc-modal-box {
    background: var(--ytcc-panel, #1B2C40);
    border: 1px solid var(--ytcc-accent, #B29B63);
    border-radius: var(--ytcc-radius, 10px);
    width: 100%;
    max-width: 580px;
    max-height: 86vh;
    overflow: auto;
    box-shadow: 0 14px 48px rgba(9, 14, 20, 0.5);
}

.ytcc-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 16px;
}
.ytcc-cat {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: rgba(244, 247, 251, 0.06);
    border: 1px solid rgba(178, 155, 99, 0.4);
    border-radius: var(--ytcc-radius, 10px);
    cursor: pointer;
}
.ytcc-cat-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
    accent-color: var(--ytcc-primary, #8F7A45);
}
.ytcc-cat-input:focus-visible {
    outline: 3px solid var(--ytcc-accent, #B29B63);
    outline-offset: 2px;
}
.ytcc-cat-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ytcc-cat-label {
    font-size: 0.875rem;
    font-weight: 600;
}
.ytcc-cat-desc {
    font-size: 0.8125rem;
    line-height: 1.45;
    opacity: 0.82;
}
.ytcc-required {
    font-style: normal;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.7;
}

/* ---- Floating-Button (Widerruf jederzeit) ---- */
.ytcc-float {
    position: fixed;
    bottom: 16px;
    z-index: 9980;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--ytcc-accent, #B29B63);
    background: var(--ytcc-panel, #1B2C40);
    color: var(--ytcc-text, #F4F7FB);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 14px rgba(9, 14, 20, 0.35);
    transition: filter 0.15s ease;
}
.ytcc-float[hidden] { display: none; }
.ytcc-float--left { left: 16px; }
.ytcc-float--right { right: 16px; }
.ytcc-float:hover { filter: brightness(1.15); }
.ytcc-float:focus-visible {
    outline: 3px solid var(--ytcc-accent, #B29B63);
    outline-offset: 2px;
}

/* ---- Geblockte Medien: Platzhalter + Iframes (Opt-in per data-ytcc-src) ---- */
.ytcc-media-placeholder {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 180px;
    padding: 20px;
    background: var(--ytcc-surface, #F7F4EE);
    border: 1px dashed var(--ytcc-accent, #B29B63);
    border-radius: var(--ytcc-radius, 10px);
    font-size: 0.875rem;
    color: var(--ytcc-panel, #1B2C40);
}
.ytcc-media-placeholder .ytcc-btn {
    width: auto;
    background: var(--ytcc-primary, #8F7A45);
    color: var(--ytcc-text, #F4F7FB);
}
iframe[data-ytcc-src] {
    background: var(--ytcc-surface, #F7F4EE);
    border: 1px dashed var(--ytcc-accent, #B29B63);
    min-height: 120px;
}

/* ---- Groessere Viewports: Buttons nebeneinander ---- */
@media (min-width: 640px) {
    .ytcc-inner { padding: 20px 24px; }
    .ytcc-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .ytcc-btn {
        width: auto;
        min-width: 170px;
        flex: 0 0 auto;
    }
    .ytcc-btn-settings { min-width: 0; }
}

/* ---- Animation + reduzierte Bewegung ---- */
@keyframes ytcc-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .ytcc-banner { animation: none; }
    .ytcc-btn,
    .ytcc-float { transition: none; }
}
