/* =====================================================
   Telegraph Breaking Bar — v2
   Aceeași poziție (jos, fixed) și formă (badge + titlu + ×)
   ca v1, cu împrospătare subtilă + variabile + a11y.
===================================================== */

.tbb2-bar {
    --tbb2-accent: #e60000;
    --tbb2-bg:     #ffffff;
    --tbb2-text:   #111111;
    --tbb2-maxw:   1200px;  /* lățimea containerului — pune-o cât a temei */
    --tbb2-gutter: 16px;    /* margini laterale — la fel ca tema */
    --tbb2-offset: 0px;     /* ridică bara deasupra bannerului Google */

    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--tbb2-offset, 0px);   /* ridică bara compactă deasupra reclamei */

    background: var(--tbb2-bg);
    border-top: 4px solid var(--tbb2-accent);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.15);
    z-index: 99999;

    transform: translateY(calc(100% + var(--tbb2-offset, 0px)));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.tbb2-bar.show,
.tbb2-bar.is-fill.show {
    transform: translateY(0);
}

/* Mod „Lipită jos": fără gol niciodată — bara crește în jos cu offset-ul,
   iar reclama (dacă apare) acoperă doar banda de jos, nu textul. */
.tbb2-bar.is-fill {
    bottom: 0;
    transform: translateY(100%);
}

.tbb2-bar.is-fill .tbb2-container {
    padding-bottom: calc(clamp(10px, 1.6vw, 16px) + var(--tbb2-offset, 0px));
}

.tbb2-container {
    max-width: var(--tbb2-maxw, 1200px);
    margin: 0 auto;
    padding: clamp(10px, 1.6vw, 16px) var(--tbb2-gutter, 16px);
    position: relative;
}

.tbb2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ----- BADGE ----- */

.tbb2-badge {
    display: inline-flex;
    align-items: center;

    background-color: var(--tbb2-accent);
    color: #ffffff;

    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.3px;

    padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2vw, 13px);
    border-radius: 4px;

    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ----- TITLU ROTATIV ----- */

.tbb2-title {
    display: none;
    margin-top: clamp(10px, 2vw, 14px);

    font-size: clamp(1.25rem, 3.4vw, 1.75rem);
    font-weight: 700;
    color: var(--tbb2-text);
    line-height: 1.35;
    text-decoration: none;

    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.tbb2-title.active {
    display: block;
    opacity: 1;
    transform: none;
}

.tbb2-title:hover {
    color: var(--tbb2-accent);
}

.tbb2-title:focus-visible {
    outline: 2px solid var(--tbb2-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ----- BUTON ÎNCHIDERE ----- */

.tbb2-close {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;            /* tema poate adăuga padding pe button → l-ar lăți */
    cursor: pointer;

    position: relative;    /* pentru X-ul desenat din pseudo-elemente */
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    min-width: 0;          /* unele teme pun min-width pe button */
    flex: 0 0 40px;        /* fixează lățimea în flex, nu „auto" */
    aspect-ratio: 1 / 1;   /* garanție în plus de cerc perfect */

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 0;          /* ascunde caracterul „×"; X-ul e desenat mai jos */
    line-height: 1;
    color: #666;
    border-radius: 50%;

    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

/* X desenat din două linii — centrat perfect, independent de font */
.tbb2-close::before,
.tbb2-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.tbb2-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.tbb2-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.tbb2-close:hover {
    color: var(--tbb2-accent);
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.tbb2-close:focus-visible {
    outline: 2px solid var(--tbb2-accent);
    outline-offset: 2px;
}

/* ----- PREFERINȚE UTILIZATOR ----- */

@media (prefers-reduced-motion: reduce) {
    .tbb2-bar,
    .tbb2-title,
    .tbb2-close { transition: none; }

    .tbb2-title { transform: none; }
}

@media (prefers-color-scheme: dark) {
    .tbb2-bar {
        --tbb2-bg: #15171a;
        --tbb2-text: #f3f4f6;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.5);
    }
    .tbb2-close { color: #9aa0a6; }
    .tbb2-close:hover { background: rgba(255, 255, 255, 0.08); }
}

@media (max-width: 782px) {
    .tbb2-header { gap: 8px; }
}