/* ===========================
   Media Center Details — Page Styles
   All classes prefixed with .detail-
   =========================== */

/* ===========================
   Entrance Animation (bottom → top)
   =========================== */
@keyframes detailSlideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-content > *,
.detail-sidebar > * {
    opacity: 0;
    animation: detailSlideUp 1.4s ease-out forwards;
}

/* Stagger left column children (6 items: hero, date, text-block, video, text-block, share) */
.detail-content > :nth-child(1) {
    animation-delay: 0.1s;
}

.detail-content > :nth-child(2) {
    animation-delay: 0.2s;
}

.detail-content > :nth-child(3) {
    animation-delay: 0.3s;
}

.detail-content > :nth-child(4) {
    animation-delay: 0.5s;
}

.detail-content > :nth-child(5) {
    animation-delay: 0.7s;
}

.detail-content > :nth-child(6) {
    animation-delay: 0.9s;
}

/* Stagger sidebar children */
.detail-sidebar > :nth-child(1) {
    animation-delay: 0.4s;
}

.detail-sidebar > :nth-child(2) {
    animation-delay: 0.8s;
}

/* ===========================
   Layout
   =========================== */
.detail-section {
    padding-top: 160px;
    padding-bottom: 60px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 70px;
    align-items: start;
}

/* ===========================
   Content Column
   =========================== */
.detail-content {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* Text block wrapper (title + body paragraphs) */
.detail-text-block {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ===========================
   Hero Image
   =========================== */
.detail-hero-img {
    width: 100%;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ===========================
   Publish Date
   =========================== */
.detail-date {
    
    font-size: 14px;
    font-weight: 400;
    color: var(--color-primary-light);
    margin-top: -40px;
}

/* ===========================
   Article Content
   =========================== */
.detail-title {
    font-weight: 700;
    font-size: 34px;
    line-height: 44px;
    text-transform: uppercase;
    color: var(--color-white);
    margin: 0;
}

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

    .detail-body p {
        font-size: 15px;
        line-height: 23px;
        color: var(--color-white);
        text-align: justify;
        text-transform: capitalize;
        margin: 0;
    }

.detail-subtitle {
    font-weight: 700;
    font-size: 34px;
    line-height: 44px;
    text-transform: uppercase;
    color: var(--color-white);
    margin: 0;
}

/* ===========================
   Video
   =========================== */
.detail-video-wrap {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    padding: 2px;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

/* Works for both <img> and <video> elements */
.detail-video-poster {
    width: 100%;
    height: 450px;
    object-fit: cover;
    display: block;
    border-radius: 18px;
    background: var(--color-bg-1);
}

/* Hide native video controls — custom play button is used */
video.detail-video-poster::-webkit-media-controls {
    display: none;
}

/* When video is playing, hide overlay and play button */
.detail-video-wrap.is-playing .detail-video-overlay,
.detail-video-wrap.is-playing .detail-video-play {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Show controls on hover when playing */
.detail-video-wrap.is-playing:hover .detail-video-overlay,
.detail-video-wrap.is-playing:hover .detail-video-play {
    opacity: 1;
    pointer-events: auto;
}

.detail-video-overlay {
    position: absolute;
    inset: 2px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 1;
}

.detail-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(var(--color-bg-1-rgb), 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--color-white);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    z-index: 2;
}

    .detail-video-play:hover {
        transform: translate(-50%, -50%) scale(1.1);
        background: rgba(var(--color-primary-rgb), 0.4);
    }

/* ===========================
   Share Bar
   =========================== */
.detail-share {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 12px 0;
}

    .detail-share::before,
    .detail-share::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100vw;
        max-width: 100%;
        height: 1px;
        background: linear-gradient(230deg, var(--color-primary) 0%, var(--color-primary-light) 80%);
    }

    .detail-share::before {
        top: 0;
    }

    .detail-share::after {
        bottom: 0;
    }

.detail-share-label {
    
    font-weight: 700;
    font-size: 20px;
    line-height: 30px;
    text-transform: uppercase;
    color: var(--color-white);
}

.detail-share-icons {
    display: flex;
    align-items: center;
    gap: 7px;
}

    .detail-share-icons a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 9999px;
        border: none;
        background: rgba(255, 255, 255, 0.05);
        transition: background 0.3s ease;
    }

        .detail-share-icons a i {
            font-size: 13px;
            background: linear-gradient(230deg, var(--color-primary) 0%, var(--color-primary-light) 80%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .detail-share-icons a:hover {
            background: rgba(255, 255, 255, 0.1);
        }

/* ===========================
   Sidebar
   =========================== */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

/* ===========================
   Sidebar Title (shared)
   =========================== */
.detail-sidebar-title {
    
    font-weight: 700;
    font-size: 20px;
    line-height: 30px;
    text-transform: uppercase;
    color: var(--color-white);
    margin: 0;
}

/* ===========================
   Recent Posts
   =========================== */
/* Hide if Umbraco renders an empty container */
.detail-recent:empty,
.detail-recent-list:empty {
    display: none;
}

.detail-recent {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-recent-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-recent-card {
    display: flex;
    gap: 20px;
    align-items: center;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

    .detail-recent-card:hover {
        opacity: 0.85;
    }

    .detail-recent-card.active {
        opacity: 1;
    }

        .detail-recent-card.active .detail-recent-img-wrap {
            border-color: var(--color-primary-light);
            border-width: 1.5px;
            box-shadow: 0 0 12px rgba(69, 221, 230, 0.3);
        }

        .detail-recent-card.active .detail-recent-date {
            color: var(--color-primary-light);
        }

/* Image wrapper with overlay */
.detail-recent-img-wrap {
    position: relative;
    flex-shrink: 0;
    width: 97px;
    height: 93px;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    border: 0.5px solid var(--color-primary);
}

    .detail-recent-img-wrap::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(16, 97, 255, 0.2);
        pointer-events: none;
    }

.detail-recent-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-recent-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    text-transform: capitalize;
}

.detail-recent-date {
    
    font-size: 12px;
    font-weight: 400;
    color: var(--color-white);
}

.detail-recent-text {
    
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-white);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===========================
   Popular Tags
   =========================== */
.detail-tags {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.detail-tag {
    display: inline-flex;
    padding: 2px;
    border-radius: 32px;
    border: none;
    outline: none;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    transition: box-shadow 0.3s ease;
}

    .detail-tag span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 12px 30px;
        border-radius: 30px;
        background: var(--color-bg-2);
        color: var(--color-white);
        font-size: 14px;
        font-weight: 400;
        text-transform: capitalize;
        white-space: nowrap;
    }

    .detail-tag:hover {
        box-shadow: 0 0 14px rgba(69, 221, 230, 0.25);
    }

/* ===========================
   Responsive — 1200px
   =========================== */
@media (max-width: 1200px) {
    .detail-layout {
        grid-template-columns: 1fr 300px;
        gap: 40px;
    }

    .detail-content {
        gap: 40px;
    }

    .detail-video-poster {
        height: 350px;
    }
}

/* ===========================
   Responsive — 991px (Tablet/Mobile)
   =========================== */
@media (max-width: 991px) {
    .detail-section {
        padding-top: 140px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .detail-sidebar {
        position: static;
        gap: 60px;
    }

    .detail-video-poster {
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ===========================
   Responsive — 576px (Small Mobile)
   =========================== */
@media (max-width: 576px) {
    .detail-section {
        padding-top: 120px;
    }

    .detail-content {
        gap: 32px;
    }

    .detail-title {
        font-size: 24px;
        line-height: 32px;
    }

    .detail-subtitle {
        font-size: 24px;
        line-height: 32px;
    }

    .detail-text-block {
        gap: 20px;
    }

    .detail-body {
        gap: 20px;
    }

    .detail-video-play {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .detail-share-label {
        font-size: 16px;
    }

    .detail-recent-img-wrap {
        width: 80px;
        height: 75px;
    }

    .detail-tag span {
        padding: 8px 18px;
        font-size: 13px;
    }

    .detail-tags-list {
        gap: 10px;
    }

    .detail-date {
        margin-top: -20px;
    }
}

/* ===========================
   Reduced Motion
   =========================== */
@media (prefers-reduced-motion: reduce) {
    .detail-content > *,
    .detail-sidebar > * {
        animation: none;
        opacity: 1;
    }
}
