/* =========================================================
   STILE.CSS - Tema Televideo Retro per Teleguida
   Versione chiara: sfondo bianco, testo nero
   ========================================================= */

/* --- RESET E IMPOSTAZIONI BASE --- */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    max-width: 850px;
    margin: 0 auto !important;
    padding: 15px !important;
    line-height: 1.5;
}

/* --- HEADER PAGINA (STILE 501) --- */
.teletext-header {
    background-color: #ffffff;
    color: #000000;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #000000;
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-size: 16px;
}

/* --- TELECOMANDO (MENU NAVIGAZIONE) --- */
.tg {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 20px 0 !important;
    background: #ffffff !important;
    border: 2px solid #d4aa00 !important;
}

.tg td,
.tg th {
    border: 1px solid #d4aa00 !important;
    padding: 10px 2px !important;
    text-align: center !important;
}

.tg-0pky a {
    color: #0066cc !important;
    font-weight: bold !important;
    text-decoration: none !important;
    font-size: 16px;
    display: block;
    width: 100%;
    cursor: pointer;
}

.tg-0pky a:hover {
    background-color: #0066cc !important;
    color: #ffffff !important;
}

/* --- BOX PALINSESTO --- */
.tab {
    background: #ffffff !important;
    margin-bottom: 25px !important;
    padding: 15px !important;
    border: 1px solid #0066cc !important;
}

/* --- INTESTAZIONE CANALE --- */
.giallo,
.giallo a {
    font-size: 24px !important;
    font-weight: bold !important;
    color: #0066cc !important;
    text-decoration: none !important;
    background-color: #ffffff;
    display: inline-block;
}

.giallo {
    margin-bottom: 15px !important;
    border-bottom: 2px solid #0066cc;
}

/* --- FORMATTAZIONE LISTE PROGRAMMI --- */
pre {
    background: transparent !important;
    font-family: inherit !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #000000 !important;
}

ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

li {
    padding: 10px 0 !important;
    border-bottom: 1px dashed #bbbbbb !important;
    font-size: 16px !important;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    color: #000000 !important;
}

li:last-child {
    border-bottom: none !important;
}

/* --- COLORI CATEGORIE --- */
.sport {
    color: #b8860b !important;
    font-weight: bold;
    font-size: 18px !important;
}

.altri {
    color: #b000b5 !important;
    font-weight: bold;
    font-size: 18px !important;
}

.film {
    color: #008a2e !important;
    font-weight: bold;
    font-size: 18px !important;
}

.cult {
    color: #0066cc !important;
    font-weight: bold;
    font-size: 18px !important;
}

/* --- BADGE [SCHEDA] --- */
a[class$="h"] {
    display: inline-block !important;
    font-size: 12px !important;
    font-weight: bold !important;
    text-decoration: none !important;
    margin-left: 10px !important;
    padding: 2px 6px !important;
    color: #b8860b !important;
    border: 1px solid #d4aa00 !important;
    background: #ffffff !important;
}

a[class$="h"]:hover {
    background: #d4aa00 !important;
    color: #000000 !important;
}

/* --- BOTTONI E UTILITY --- */
#btn-home {
    background-color: #008a2e !important;
    color: #ffffff !important;
    border: 2px solid #008a2e !important;
    padding: 10px 20px !important;
    font-family: inherit;
    font-weight: bold !important;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 16px;
    margin: 20px auto !important;
    width: 100%;
    max-width: 300px;
    display: block;
}

#btn-home:hover {
    background-color: #ffffff !important;
    color: #008a2e !important;
}

.cbezero {
    margin-top: 20px;
}

hr {
    border: 0;
    border-top: 2px solid #000000;
    margin: 20px 0;
}

.end {
    border-top: 2px solid #d4aa00;
}

/* --- ANIMAZIONI --- */
.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

/* =========================================================
   RESPONSIVE MOBILE
   ========================================================= */
@media (max-width: 600px) {
    body {
        padding: 10px !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .teletext-header {
        font-size: 16px;
    }

    .tg td {
        padding: 8px 2px !important;
        font-size: 16px !important;
    }

    .giallo {
        font-size: 20px !important;
    }

    li {
        font-size: 16px !important;
    }

    .sport,
    .altri,
    .film,
    .cult {
        font-size: 18px !important;
    }

    a[class$="h"] {
        margin-top: 5px;
    }
}

.home-carousel-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 20px auto 30px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.home-carousel-title {
    color: #b8860b;
    font-size: 20px;
    text-align: center;
    margin-bottom: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.home-carousel-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 2px 10px 2px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.home-carousel-track::-webkit-scrollbar {
    height: 8px;
}

.home-carousel-track::-webkit-scrollbar-thumb {
    background: #d4aa00;
    border-radius: 10px;
}

.home-carousel-track::-webkit-scrollbar-track {
    background: #eeeeee;
}

.home-carousel-card {
    flex: 0 0 145px;
    background: #ffffff;
    border: 2px solid #d4aa00;
    text-decoration: none;
    color: #000000 !important;
    padding: 6px;
    box-sizing: border-box;
}

.home-carousel-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f3f3;
}

.home-carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-carousel-channel {
    color: #b8860b;
    font-size: 14px;
    font-weight: bold;
    margin-top: 6px;
    line-height: 1.2;
}

.home-carousel-program {
    color: #000000 !important;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.25;
    text-transform: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 30px;
}

@media (max-width: 768px) {
    .home-carousel-wrapper {
        padding: 0 6px;
    }

    .home-carousel-title {
        font-size: 18px;
    }

    .home-carousel-card {
        flex: 0 0 132px;
        padding: 5px;
    }

    .home-carousel-channel {
        font-size: 13px;
    }

    .home-carousel-program {
        font-size: 11px;
    }
}

.descrizione {
    width: 100%;
    font-size: 16px;
    margin-top: 5px;
    color: #000000 !important;
    font-weight: 500;
    text-shadow: none;
    text-transform: none;
}
.scheda-link {
    display: inline-block;
    background: #000000;
    color: #ffff00;
    border: 1px solid #ffff00;
    padding: 2px 6px;
    margin-left: 8px;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    font-family: monospace;
}

.scheda-link:hover {
    background: #ffff00;
    color: #000000;
}
/* === BANNER ADSENSE === */
.banner-adsense {
    display: block;
    width: 100%;
    max-width: 728px;
    margin: 25px auto;
    padding: 10px 0;
    text-align: center;
    min-height: 100px;
    overflow: hidden;
    box-sizing: border-box;
}

.banner-adsense ins {
    display: block !important;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .banner-adsense {
        max-width: 100%;
        margin: 18px auto;
        min-height: 90px;
    }
}