/* HSM YouTube Consent - Dialog fuer das Popup-Gate.
   Bewusst eigener Namensraum (.ytg-*), damit nichts mit Bootstrap,
   Magnific Popup oder dem Theme kollidiert. z-index liegt ueber
   Magnific (1042) und Cookieman. */

.ytg-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
}

.ytg-overlay[hidden] {
    display: none !important;
}

html.ytg-open {
    overflow: hidden;
}

.ytg-box {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 32rem;
    padding: 2rem 1.75rem 1.5rem;
    border-radius: 6px;
    background: #fff;
    color: #222;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    text-align: left;
}

.ytg-close {
    position: absolute;
    top: 0.35rem;
    right: 0.6rem;
    padding: 0.2rem 0.4rem;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.ytg-close:hover,
.ytg-close:focus-visible {
    color: #111;
}

.ytg-title {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
    line-height: 1.3;
    font-weight: 700;
    color: inherit;
}

.ytg-text {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    line-height: 1.55;
}

.ytg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.ytg-btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.ytg-btn--primary {
    background: #cc0000;
    border-color: #cc0000;
    color: #fff;
}

.ytg-btn--primary:hover,
.ytg-btn--primary:focus-visible {
    background: #a80000;
    border-color: #a80000;
}

.ytg-btn--ghost {
    background: transparent;
    border-color: #ccc;
    color: #333;
}

.ytg-btn--ghost:hover,
.ytg-btn--ghost:focus-visible {
    border-color: #999;
    background: #f4f4f4;
}

.ytg-btn:focus-visible,
.ytg-close:focus-visible {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* ===========================================================================
   Bild-Variante: Overlay direkt auf dem Bild.
   Greift, wenn der video-popup-Link ein <img> (oder ein Element mit
   Hintergrundbild) enthaelt. Textlinks bekommen weiterhin den Dialog oben.
   Akzentfarbe = HSM-Petrol (#02779E, die Farbe eurer Ueberschriften).

   Der Datenschutzhinweis ist IMMER sichtbar - auch auf kleinen Bildern.
   Statt Inhalte auszublenden, werden Schriftgroessen und Abstaende in zwei
   Stufen reduziert; passt die Karte dann immer noch nicht, skaliert das JS
   sie zusaetzlich per --ytg-scale herunter.
   =========================================================================== */

.ytg-media {
    position: relative;
}

.ytg-cover {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    padding: 1rem 1.35rem;
    border-radius: inherit;
    text-align: center;
}

.ytg-cover__tint {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 34, 48, 0.42) 0%, rgba(6, 34, 48, 0.58) 100%);
}

.ytg-cover__card {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 22rem;
    padding: 1rem 1.1rem 0.9rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    transform: scale(var(--ytg-scale, 1));
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ytg-media:hover .ytg-cover__card,
.ytg-media:focus-visible .ytg-cover__card {
    transform: scale(var(--ytg-scale, 1)) translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
}

.ytg-cover__play {
    position: relative;
    display: block;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.55rem;
    border: 2px solid #02779e;
    border-radius: 50%;
    background: transparent;
    transition: background 0.18s ease;
}

.ytg-cover__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-38%, -50%);
    border-style: solid;
    border-width: 0.42rem 0 0.42rem 0.68rem;
    border-color: transparent transparent transparent #02779e;
    transition: border-color 0.18s ease;
}

.ytg-media:hover .ytg-cover__play {
    background: #02779e;
}

.ytg-media:hover .ytg-cover__play::before {
    border-left-color: #fff;
}

.ytg-cover__title {
    display: block;
    color: #0d3a4c;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.ytg-cover__sub {
    display: block;
    margin-top: 0.15rem;
    color: #5d6f78;
    font-size: 0.85rem;
    line-height: 1.3;
}

.ytg-cover__legal {
    display: block;
    margin-top: 0.55rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e4eaed;
    color: #6b7a82;
    font-size: 0.72rem;
    line-height: 1.4;
    hyphens: auto;
}

/* Stufe 1 - schmalere/niedrigere Bilder */
.ytg-cover--tight {
    padding: 0.75rem 1rem;
}

.ytg-cover--tight .ytg-cover__card {
    padding: 0.8rem 0.85rem 0.75rem;
}

.ytg-cover--tight .ytg-cover__play {
    width: 2.3rem;
    height: 2.3rem;
    margin-bottom: 0.45rem;
}

.ytg-cover--tight .ytg-cover__play::before {
    border-width: 0.36rem 0 0.36rem 0.58rem;
}

.ytg-cover--tight .ytg-cover__title {
    font-size: 0.95rem;
}

.ytg-cover--tight .ytg-cover__sub {
    font-size: 0.78rem;
}

.ytg-cover--tight .ytg-cover__legal {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    font-size: 0.66rem;
    line-height: 1.35;
}

/* Stufe 2 - sehr kleine Bilder */
.ytg-cover--tiny {
    padding: 0.55rem 0.7rem;
}

.ytg-cover--tiny .ytg-cover__card {
    padding: 0.6rem 0.6rem 0.55rem;
    border-radius: 8px;
}

.ytg-cover--tiny .ytg-cover__play {
    width: 1.9rem;
    height: 1.9rem;
    margin-bottom: 0.35rem;
    border-width: 2px;
}

.ytg-cover--tiny .ytg-cover__play::before {
    border-width: 0.3rem 0 0.3rem 0.48rem;
}

.ytg-cover--tiny .ytg-cover__title {
    font-size: 0.85rem;
}

.ytg-cover--tiny .ytg-cover__sub {
    font-size: 0.72rem;
}

.ytg-cover--tiny .ytg-cover__legal {
    margin-top: 0.35rem;
    padding-top: 0.3rem;
    font-size: 0.6rem;
    line-height: 1.3;
}

/* ---------------------------------------------------------------------------
   YouTube-Badge nach erteilter Einwilligung.
   Das Consent-Overlay verschwindet dann - ohne Markierung waere dem Besucher
   nicht mehr anzusehen, dass hinter dem Bild ein YouTube-Video liegt.
   Rein dekorativ (aria-hidden), der Link traegt ein aria-label.
   --------------------------------------------------------------------------- */

.ytg-badge-wrap {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

.ytg-badge {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    display: block;
    width: 2.4rem;
    height: 1.7rem;
    border-radius: 0.42rem;
    background: #ff0000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: background 0.18s ease, transform 0.18s ease;
}

.ytg-badge::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-38%, -50%);
    border-style: solid;
    border-width: 0.32rem 0 0.32rem 0.52rem;
    border-color: transparent transparent transparent #fff;
}

.ytg-media:hover .ytg-badge {
    background: #cc0000;
    transform: scale(1.06);
}

.ytg-badge-wrap--tiny .ytg-badge {
    right: 0.4rem;
    bottom: 0.4rem;
    width: 1.9rem;
    height: 1.35rem;
    border-radius: 0.34rem;
}

.ytg-badge-wrap--tiny .ytg-badge::before {
    border-width: 0.26rem 0 0.26rem 0.42rem;
}

/* Verlinktes Wort "Datenschutzerklaerung" - im Dialog ein echtes <a>, im
   Bild-Overlay ein span[role=link] (verschachtelte <a> waeren ungueltig). */
.ytg-policy {
    color: #02779e;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    cursor: pointer;
}

.ytg-policy:hover,
.ytg-policy:focus-visible {
    color: #015b78;
}

.ytg-policy:focus-visible {
    outline: 2px solid #02779e;
    outline-offset: 2px;
    border-radius: 2px;
}

.ytg-text .ytg-policy {
    color: #02779e;
}
