/* ==========================================================
   dimosTV Design System
   DS4.1 — Premium Section Layout System
========================================================== */

/* ==========================================================
   Global section rhythm
========================================================== */

.dtv-front-section,
.dtv-carousel-section,
.dtv-continue-watching {
    position: relative;

    margin-block: clamp(56px, 6vw, 96px) !important;
}

/* Slightly tighter section after Live Strip */
.dtv-live-strip + .dtv-continue-watching,
.dtv-live-strip + .dtv-carousel-section {
    margin-top: clamp(48px, 5vw, 80px) !important;
}

/* ==========================================================
   Section Header Base
========================================================== */

.dtv-front-section-header,
.dtv-section-header {
    position: relative;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 20px;

    margin-bottom: clamp(22px, 2.4vw, 34px) !important;
    padding-inline: 0;
}

/* Decorative line */
.dtv-front-section-header::after,
.dtv-section-header::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: -12px;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            rgba(26,46,74,.14),
            rgba(26,46,74,.04) 55%,
            transparent
        );

    pointer-events: none;
}

/* Title */
.dtv-front-section-header h2,
.dtv-section-header h2 {
    position: relative;

    display: inline-flex !important;
    align-items: center;
    gap: 14px;

    margin: 0 !important;

    color: var(--dtv-color-text, #1A2E4A) !important;

    font-family: var(--dtv-font-heading, Oswald, sans-serif) !important;
    font-size: clamp(30px, 3.2vw, 44px) !important;
    font-weight: var(--dtv-font-weight-black, 900) !important;
    line-height: .95 !important;
    letter-spacing: .01em !important;

    text-transform: uppercase;
}

/* Red vertical accent */
.dtv-front-section-header h2::before,
.dtv-section-header h2::before {
    content: "";

    width: 5px;
    height: .95em;

    border-radius: var(--dtv-radius-pill, 999px);

    background: var(--dtv-color-primary, #CC0000);

    box-shadow: 0 8px 20px rgba(204,0,0,.20);
}

/* Link */
.dtv-front-section-header a,
.dtv-section-header a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;

    margin-bottom: 3px;

    color: var(--dtv-color-primary, #CC0000) !important;

    font-size: 14px !important;
    font-weight: var(--dtv-font-weight-black, 900) !important;
    line-height: 1 !important;
    letter-spacing: .01em !important;

    text-decoration: none !important;
    text-transform: none !important;

    transition:
        color var(--dtv-motion-normal, .22s ease),
        transform var(--dtv-motion-normal, .22s ease),
        opacity var(--dtv-motion-normal, .22s ease);
}

.dtv-front-section-header a:hover,
.dtv-section-header a:hover,
.dtv-front-section-header a:focus-visible,
.dtv-section-header a:focus-visible {
    color: var(--dtv-color-primary-hover, #E00000) !important;
    transform: translateX(3px);
}

.dtv-front-section-header a::after,
.dtv-section-header a::after {
    content: "→";
}

/* Avoid duplicate arrows if PHP already includes one */
.dtv-front-section-header a:has(> svg)::after,
.dtv-section-header a:has(> svg)::after {
    content: "";
}

/* ==========================================================
   Optional subtitle support
   Add:
   <p class="dtv-section-subtitle">...</p>
========================================================== */

.dtv-section-title-group {
    display: grid;
    gap: 8px;
}

.dtv-section-subtitle {
    max-width: 620px;

    margin: 0 0 0 20px;

    color: var(--dtv-color-text-soft, rgba(26,46,74,.72));

    font-size: var(--dtv-text-body-sm, 14px);
    font-weight: 600;
    line-height: 1.45;
}

/* ==========================================================
   Continue Watching exception
========================================================== */

.dtv-front-section-header--continue {
    margin-bottom: 22px !important;
}

.dtv-front-section-header--continue::after {
    display: none;
}

.dtv-front-section-header--continue h2 {
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.dtv-front-section-header--continue h2::before {
    display: none;
}

/* ==========================================================
   Carousel row spacing inside section
========================================================== */

.dtv-carousel-shell {
    margin-top: 0 !important;
}

.dtv-carousel-row {
    padding-top: 8px !important;
}

/* ==========================================================
   Empty / single-card sections
   Prevent huge vertical gaps from lonely carousel items
========================================================== */

.dtv-carousel-section:has(.dtv-carousel-row > .dtv-video-card:only-child) {
    margin-bottom: clamp(56px, 6vw, 88px) !important;
}

.dtv-carousel-section:has(.dtv-carousel-row > .dtv-video-card:only-child) .dtv-carousel-row {
    min-height: auto !important;
}

/* ==========================================================
   Mobile
========================================================== */

@media (max-width: 768px) {
    .dtv-front-section,
    .dtv-carousel-section,
    .dtv-continue-watching {
        margin-block: 58px !important;
    }

    .dtv-front-section-header,
    .dtv-section-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;

        margin-bottom: 24px !important;
        padding-inline: 0;
    }

    .dtv-front-section-header::after,
    .dtv-section-header::after {
        bottom: -10px;
    }

    .dtv-front-section-header h2,
    .dtv-section-header h2 {
        gap: 10px;

        font-size: clamp(28px, 8vw, 38px) !important;
        letter-spacing: .005em !important;
    }

    .dtv-front-section-header h2::before,
    .dtv-section-header h2::before {
        width: 4px;
    }

    .dtv-front-section-header a,
    .dtv-section-header a {
        margin-bottom: 4px;

        font-size: 13px !important;
        white-space: nowrap;
    }

    .dtv-section-subtitle {
        display: none;
    }
}

@media (max-width: 420px) {
    .dtv-front-section-header,
    .dtv-section-header {
        gap: 8px;
    }

    .dtv-front-section-header h2,
    .dtv-section-header h2 {
        font-size: 30px !important;
    }

    .dtv-front-section-header a,
    .dtv-section-header a {
        font-size: 12px !important;
    }
}
