/* ============================================================================
   mediaset-italia.css
   Dal Figma "Mediaset Italia"
   ============================================================================ */

/* ── INTRO ────────────────────────────────────────────────────────────────── */
/* Override box-shadow del vecchio style.css su #mainContent .wrapper */
.mi-intro__inner,
.mi-programs__inner {
    box-shadow: none !important;
    padding-top: 0 !important;
}
/* Wrapper del breadcrumb: 60px, stesso valore usato in tutto il sito
   (Markets, Contact, Footage, ecc.) per lo spazio tra header e breadcrumb */
#mainContent > .wrapper {
    box-shadow: none !important;
    padding-top: 70px !important;
}
.mi-intro {
    /* Era 60px 0 (70px totali col breadcrumb): ora 20px in alto, così con i 10px
       del breadcrumb arriva a 30px totali, standard del sito. 60px in basso invariato. */
    padding: 20px 0 60px 0;
}

.mi-intro__inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 80px;
    padding-right: 100px;
}

.mi-intro__left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mi-intro__title {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 36px;
    color: #2B75F5;
    margin: 0;
}

.mi-intro__subtitle {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: #323E48;
    margin: 0;
}

.mi-intro__description {
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 24px;
    color: #323E48;
}

.mi-intro__description p {
    margin: 0 0 12px 0;
}

.mi-intro__description strong {
    font-weight: 700;
}

.mi-intro__more-info {
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: #323E48;
    margin: 0;
}

.mi-intro__more-info strong {
    font-weight: 700 !important;
}

.mi-intro__more-info a {
    color: #2B75F5;
    text-decoration: none;
}

.mi-intro__more-info a:hover {
    text-decoration: underline;
}

.mi-intro__right {
    flex: 1;
}

.mi-intro__video {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
}

.mi-intro__video iframe {
    width: 100%;
    display: block;
    aspect-ratio: 16/9;
    border: none;
}

/* ── PROGRAMMING SCHEDULE ─────────────────────────────────────────────────── */
.mi-schedule {
    background-image: url('/wp-content/themes/mediasetdistribution-theme/assets/img/schedule-bg.png');
    background-size: cover;
    background-position: center;
    background-color: #0a1f5c;
    padding: 80px 0;
    width: 100%;
}

.mi-schedule .wrapper {
    max-width: 100%;
    padding-right: 0;
}

.mi-schedule__inner {
    display: flex;
    flex-direction: column;
    gap: 40px;
    background: transparent !important;
}

.mi-schedule__title {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 29px;
    color: #FFFFFF;
    margin: 0;
}

/* Griglia giorni */
.mi-schedule__grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mi-schedule__row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
}

.mi-schedule__day {
    flex: 0 0 120px;
    background: #FFFFFF;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #0a1f5c;
    padding: 15px 10px;
    text-align: center;
}

.mi-schedule__slots {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
    cursor: grab;
    /* Scrollbar nascosta (drag-to-scroll via JS, scroll nativo touch/trackpad invariato) */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mi-schedule__slots::-webkit-scrollbar {
    display: none;
}

.mi-schedule__slots.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

.mi-schedule__slot {
    flex: 0 0 180px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mi-slot__time {
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.mi-slot__name {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    margin: 0;
}

.mi-slot__cat {
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mi-slot__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Barra proporzionale categorie */
.mi-schedule__bar-wrap {
    width: 100%;
    padding-right: 100px;
    box-sizing: border-box;
}

.mi-schedule__bar {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 30px;
    border-radius: 20px;
    overflow: hidden;
}

.mi-bar__segment {
    height: 100%;
    flex-shrink: 0;
}

/* Legenda */
.mi-schedule__legend {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.mi-legend__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: #FFFFFF;
}

.mi-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Bottone Live Schedule */
.mi-schedule__btn-wrap {
    display: flex;
    justify-content: center;
}

.btn-live-schedule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    border: 1px solid #FFFFFF;
    border-radius: 50px;
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #FFFFFF;
    text-decoration: none;
    background: transparent;
}

.btn-live-schedule:hover {
    background: #FFFFFF;
    color: #2B75F5;
    text-decoration: none;
}

/* ── PROGRAMS ─────────────────────────────────────────────────────────────── */
.mi-programs {
    padding: 80px 0;
    background: #FFFFFF;
}

.mi-programs__inner {
    padding-right: 100px;
}

.mi-programs__title {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 29px;
    color: #323E48;
    margin: 0 0 40px 0;
}

.mi-programs__table {
    width: 100%;
}

/* Intestazione fissa (via codice, non editabile) — stesse larghezze colonna della tabella sotto */
.mi-programs__header {
    display: flex;
    flex-direction: row;
    padding-bottom: 15px;
    box-sizing: border-box;
}

.mi-programs__header > div {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    color: #2B75F5;
}

.mi-programs__header > div:first-child { flex: 0 0 20%; box-sizing: border-box; padding-right: 20px; }
.mi-programs__header > div:nth-child(2) { flex: 0 0 50%; box-sizing: border-box; padding-right: 20px; }
.mi-programs__header > div:last-child  { flex: 0 0 30%; box-sizing: border-box; }

/* Tabella editoriale (blocco Tabella di WordPress dentro il contenuto della pagina),
   stilizzata per apparire come il resto del design del sito. */
.mi-programs__table .wp-block-table {
    margin: 0;
    width: 100%;
}

.mi-programs__table table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* L'intestazione arriva già da codice sopra: se l'editoriale aggiunge comunque una
   riga di intestazione nel blocco Tabella, viene nascosta per evitare doppioni. */
.mi-programs__table thead {
    display: none;
}

.mi-programs__table tbody tr {
    border-top: 1px dashed #323E48;
}

.mi-programs__table tbody td {
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 20px;
    line-height: 24px;
    color: #323E48;
    padding: 15px 20px 15px 0;
    vertical-align: top;
}

/* Prima colonna (Tipology) in grassetto, come nel Figma */
.mi-programs__table tbody td:first-child {
    font-weight: 700;
    width: 20%;
}

/* Colonna centrale (Programming Schedule Allocation) */
.mi-programs__table tbody td:nth-child(2) {
    width: 50%;
}

/* Terza colonna (Programs/loghi) */
.mi-programs__table tbody td:last-child {
    width: 30%;
}

.mi-programs__table tbody td img {
    display: inline-block;
    max-width: 100%;
    object-fit: contain;
    margin: 0 8px 8px 0;
    vertical-align: middle;
}

/* Dimensione di default (loghi) SOLO se l'editoriale non ha impostato una larghezza:
   così il controllo "dimensioni" dell'editor di WordPress ha effetto. */
.mi-programs__table tbody td img:not([width]):not([style*="width"]) {
    height: 30px;
    width: auto;
    max-width: 120px;
}

/* Se la larghezza è impostata dall'editor, l'altezza segue in proporzione */
.mi-programs__table tbody td img[width],
.mi-programs__table tbody td img[style*="width"] {
    height: auto;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media screen and (max-width: 1200px) {
    .mi-intro__inner,
    .mi-schedule__inner,
    .mi-programs__inner { padding-right: 60px; }
    .mi-intro__right { flex: 0 0 380px; }
}

@media screen and (max-width: 900px) {
    .mi-intro__inner { flex-direction: column; padding-right: 40px; }
    .mi-intro__right { flex: none; width: 100%; }
    .mi-schedule__inner,
    .mi-programs__inner { padding-right: 40px; }
    .mi-schedule__day { flex: 0 0 80px; font-size: 12px; }
}

@media screen and (max-width: 600px) {
    .mi-schedule__inner,
    .mi-programs__inner { padding-right: 16px; }
}