/* ==========================================================
   DimosTV FE-06 — Homepage UX & Editorial Hierarchy
   Structural refinements loaded after the component system.
========================================================== */

/* Stronger navigation targets without changing the established identity. */
.dtv-section-header a,
.dtv-front-section-header a,
.dtv-home-block-head a {
    min-height: 44px;
    padding-inline: 12px;
    border-radius: 999px;
}

.dtv-section-header a:focus-visible,
.dtv-front-section-header a:focus-visible,
.dtv-home-block-head a:focus-visible {
    outline: 3px solid rgba(0, 102, 204, .34);
    outline-offset: 3px;
}

/* Four complete short cards on wide desktop; no accidental half-card endcap. */
@media (min-width: 1200px) {
    .dtv-carousel-section[data-dtv-section-layout="short"] .dtv-carousel-row {
        gap: 24px;
    }

    .dtv-carousel-section[data-dtv-section-layout="short"] .dtv-video-card--short {
        flex-basis: calc((100% - 72px) / 4) !important;
        width: calc((100% - 72px) / 4) !important;
        max-width: none !important;
    }

    .dtv-carousel-section[data-dtv-section-layout="landscape"] .dtv-carousel-row {
        gap: 24px;
    }

    .dtv-carousel-section[data-dtv-section-layout="landscape"] .dtv-video-card--landscape {
        flex-basis: calc((100% - 48px) / 3) !important;
        width: calc((100% - 48px) / 3) !important;
        max-width: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .dtv-carousel-section[data-dtv-section-layout="short"] .dtv-video-card--short {
        flex-basis: calc((100% - 40px) / 3) !important;
        width: calc((100% - 40px) / 3) !important;
        max-width: none !important;
    }
}

/* Shows use a recognisably different landscape rhythm. */
.dtv-carousel-section[data-dtv-section-key="shows"] {
    padding: clamp(24px, 3vw, 38px);
    border-radius: 26px;
    background:
        radial-gradient(circle at 90% 0%, rgba(204, 0, 0, .10), transparent 30%),
        linear-gradient(135deg, #eef3f9, #ffffff);
    box-shadow: 0 18px 54px rgba(26, 46, 74, .08);
}

.dtv-carousel-section[data-dtv-section-key="shows"] .dtv-section-header {
    margin-bottom: 24px !important;
}

.dtv-carousel-section[data-dtv-section-key="shows"][data-dtv-item-count="1"] .dtv-carousel-row {
    overflow: visible;
}

.dtv-carousel-section[data-dtv-section-key="shows"][data-dtv-item-count="1"] .dtv-video-card--landscape {
    flex-basis: min(760px, 100%) !important;
    width: min(760px, 100%) !important;
    max-width: 760px !important;
}

.dtv-carousel-section[data-dtv-section-key="shows"][data-dtv-item-count="1"] .dtv-carousel-arrow,
.dtv-carousel-section[data-dtv-section-key="shows"][data-dtv-item-count="1"] .dtv-carousel-progress {
    display: none !important;
}

/* Compact municipality discovery: it no longer stretches to Popular height. */
.dtv-home-after-highlights {
    align-items: start;
}

.dtv-home-discover-municipalities {
    align-self: start;
    padding: 24px 26px 22px;
}

.dtv-home-municipality-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(12px, 1.5vw, 20px);
}

.dtv-home-municipality-logo {
    width: clamp(68px, 6vw, 94px);
    height: clamp(68px, 6vw, 94px);
}

.dtv-home-municipality-chip {
    min-height: 132px;
    justify-content: flex-start;
    min-width: 0;
}

.dtv-home-municipality-chip > strong {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.25;
}

@media (min-width: 1280px) {
    .dtv-home-after-highlights {
        grid-template-columns: minmax(0, 1.35fr) minmax(420px, .95fr);
    }
}

/* Live is one clear route: status → programme → watch action. */
.dtv-live-strip {
    grid-template-columns: minmax(140px, .7fr) minmax(420px, 1.65fr) minmax(290px, 1fr);
    gap: clamp(18px, 2.2vw, 32px);
}

.dtv-live-strip__status {
    align-self: center;
}

.dtv-live-strip__current {
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
}

.dtv-live-strip__info :is(h2, h4) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dtv-live-strip__badge {
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dtv-live-strip__watch {
    min-height: 44px;
    padding-inline: 16px;
}

/* Titles remain readable on imagery and never consume the whole card. */
.dtv-video-card__copy h3 {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    text-wrap: balance;
}

.dtv-video-card--landscape .dtv-video-card__copy h3 {
    -webkit-line-clamp: 2;
}

/* Continue Watching becomes useful rather than a sparse decorative rail. */
.dtv-continue-watching__row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
}

.dtv-continue-card {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.dtv-continue-card__open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    text-align: inherit;
    cursor: pointer;
}

.dtv-continue-card__open:focus-visible {
    outline: 3px solid rgba(0, 102, 204, .42);
    outline-offset: 4px;
}

.dtv-continue-card__remove {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(15, 23, 42, .82);
    color: #fff;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
    cursor: pointer;
}

.dtv-continue-card__remove:hover,
.dtv-continue-card__remove:focus-visible {
    background: #CC0000;
}

.dtv-continue-card__remove:focus-visible {
    outline: 3px solid rgba(0, 102, 204, .42);
    outline-offset: 3px;
}

.dtv-continue-card__percent {
    right: 54px;
}

@media (max-width: 1024px) {
    .dtv-live-strip {
        grid-template-columns: 1fr;
    }

    .dtv-live-strip__epg {
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, .14);
        padding: 20px 0 0;
    }

    .dtv-continue-watching__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dtv-carousel-section[data-dtv-section-key="shows"] {
        margin-inline: -12px !important;
        padding: 24px 18px;
        border-radius: 22px;
    }

    .dtv-carousel-section[data-dtv-section-key="shows"] .dtv-video-card--landscape {
        flex-basis: 86vw !important;
        width: 86vw !important;
    }

    .dtv-home-after-highlights {
        gap: 20px;
    }

    .dtv-home-municipality-grid {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        padding: 4px 2px 12px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .dtv-home-municipality-grid::-webkit-scrollbar {
        display: none;
    }

    .dtv-home-municipality-chip {
        flex: 0 0 92px;
        min-height: 118px;
        scroll-snap-align: start;
    }

    .dtv-home-municipality-logo {
        width: 76px;
        height: 76px;
    }

    .dtv-live-strip__current {
        grid-template-columns: 1fr;
    }

    .dtv-continue-watching__row {
        display: flex;
        overflow-x: auto;
    }

    .dtv-continue-card {
        flex: 0 0 82vw;
        width: 82vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dtv-home-municipality-logo,
    .dtv-section-header a,
    .dtv-front-section-header a {
        transition: none !important;
    }
}

/* FE-08 canonical Live Preview wins over the earlier three-column status layout. */
@media (min-width: 1101px) {
    .dtv-live-strip {
        grid-template-columns: minmax(420px, 1.35fr) minmax(280px, .65fr);
        align-items: stretch;
    }

    .dtv-live-strip__current {
        grid-template-columns: minmax(260px, 1.1fr) minmax(210px, .9fr);
    }
}
