/* ==========================================================================
   1. GAP REMOVER FOR MOVIES & TV SHOWS
   ========================================================================== */

/* Overpower Astra by targeting the #content ID directly */
body.single-movie #content.site-content,
body.single-tv-show #content.site-content,
body.single-tv_show #content.site-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Strip spacing from all inner Astra containers */
body.single-movie .ast-container,
body.single-tv-show .ast-container,
body.single-tv_show .ast-container,
body.single-movie .ast-article-single,
body.single-tv-show .ast-article-single,
body.single-tv_show .ast-article-single,
body.single-movie .site-content > .ast-container,
body.single-tv-show .site-content > .ast-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Nuke hidden padding added by the WordPress Block Editor (Gutenberg) */
body.single-movie .entry-content,
body.single-tv-show .entry-content,
body.single-tv_show .entry-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.single-movie .entry-content > *:first-child,
body.single-tv-show .entry-content > *:first-child,
body.single-tv_show .entry-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Hide the default Astra titles */
body.single-movie .entry-header,
body.single-tv-show .entry-header,
body.single-tv_show .entry-header {
    display: none !important;
}


/* ==========================================================================
   2. CLEAN FULL-WIDTH HERO LAYOUT
   ========================================================================== */

.mh-hero {
    position: relative;
    width: 100%;
    height: 620px;
    background-color: #0b1218;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #fff;
    display: flex;
    align-items: center;
    margin-bottom: 0 !important;
}

/* Force Astra's white content box to touch the hero image */
body.single-post .ast-separate-container .ast-article-single,
body.single-post .ast-separate-container .ast-article-post,
body.single-movie .ast-separate-container .ast-article-single,
body.single-movie .ast-separate-container .ast-article-post,
body.single-tv-show .ast-separate-container .ast-article-single,
body.single-tv-show .ast-separate-container .ast-article-post,
body.single-tv_show .ast-separate-container .ast-article-single,
body.single-tv_show .ast-separate-container .ast-article-post {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.single-post .site-content > .ast-container,
body.single-movie .site-content > .ast-container,
body.single-tv-show .site-content > .ast-container,
body.single-tv_show .site-content > .ast-container {
    padding-top: 0 !important;
}

/* Kill any remaining Astra article/post spacing for movie/TV pages */
body.single-movie .ast-article-single,
body.single-tv-show .ast-article-single,
body.single-tv_show .ast-article-single,
body.single-movie .ast-article-post,
body.single-tv-show .ast-article-post,
body.single-tv_show .ast-article-post {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Astra plain-container layout gap fix */
body.single-movie.ast-plain-container .site-content > .ast-container,
body.single-tv-show.ast-plain-container .site-content > .ast-container,
body.single-tv_show.ast-plain-container .site-content > .ast-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.single-movie .ast-plain-container #primary,
body.single-tv-show .ast-plain-container #primary,
body.single-tv_show .ast-plain-container #primary,
body.single-movie #primary,
body.single-tv-show #primary,
body.single-tv_show #primary {
    padding-top: 0 !important;
    margin-top: 0 !important;
}


/* ==========================================================================
   BACKDROP & OVERLAYS
   ========================================================================== */

.mh-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-size: cover;
    background-position: center 20%;
    filter: brightness(0.55);
    transform: scale(1.02);
}

.mh-gradient {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, rgba(11, 18, 24, 0.90) 0%, rgba(11, 18, 24, 0.55) 45%, rgba(11, 18, 24, 0.12) 100%);
}


/* ==========================================================================
   TMDB-STYLE LAYOUT
   ========================================================================== */

.mh-content {
    position: relative;
    z-index: 4;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
    display: flex;
    align-items: center;
    gap: 40px;
}


/* ==========================================================================
   POSTER COLUMN
   ========================================================================== */

.mh-poster-wrap {
    width: 300px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: block;
}

.mh-poster-wrap img {
    width: 100%;
    height: auto;
    display: block;
}


/* ==========================================================================
   INFO COLUMN
   ========================================================================== */

.mh-main-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mh-title {
    color: #fff !important;
    font-size: 2.6rem;
    font-weight: 800;
    margin: 0 0 10px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.mh-year {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.8em;
}

.mh-meta {
    color: #e0e0e0 !important;
    font-size: 1rem;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mh-cert {
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}


/* ==========================================================================
   SCORES
   ========================================================================== */

.mh-scores-row {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 20px;
}

.mh-score-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mh-score-circle {
    background: #081c22;
    border: 4px solid #01b4e4;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 0 10px rgba(1, 180, 228, 0.3);
}

.mh-score-label {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.5px;
    opacity: 0.9;
}


/* ==========================================================================
   SYNOPSIS
   ========================================================================== */

.mh-synopsis {
    font-size: 1rem;
    line-height: 1.5;
    color: #ddd;
    margin-bottom: 12px;
    max-width: 800px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Long / Full Synopsis expandable block */
.mh-long-summary { margin-bottom: 20px; max-width: 760px; }
.mh-summary-details { border: none; }
.mh-summary-toggle {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-family: 'Inter', 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 0;
    transition: color 0.2s;
    user-select: none;
}
.mh-summary-toggle::-webkit-details-marker { display: none; }
.mh-summary-toggle:hover { color: #fff; }
.mh-summary-caret {
    font-size: 1.1rem;
    transition: transform 0.25s ease;
    display: inline-block;
}
.mh-summary-details[open] .mh-summary-caret { transform: rotate(90deg); }
.mh-summary-body {
    margin-top: 10px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    animation: synopsisFadeIn 0.3s ease;
}
.mh-summary-body p { margin: 0 0 10px; }
@keyframes synopsisFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */

.mh-action-buttons {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 25px;
}

.mh-play-btn {
    background: transparent;
    color: #fff;
    border: none;
    padding: 0;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.mh-play-btn:hover {
    opacity: 0.7;
}

.mh-play-btn svg {
    width: 32px;
    height: 32px;
    transition: transform 0.2s;
}

.mh-play-btn:hover svg {
    transform: scale(1.1);
}

/* Share button */
.mh-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 24px;
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s, border-color 0.2s;
    font-family: 'Outfit', 'Montserrat', sans-serif;
}
.mh-share-btn:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.5); }
.mh-share-btn svg { width: 16px; height: 16px; }

/* Share modal */
.mh-share-modal-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 99000;
    background: rgba(0,0,0,0.6);
    align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
}
.mh-share-modal-overlay.active { display: flex; animation: lbFadeIn 0.2s ease; }
.mh-share-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    width: min(440px, 90vw);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: lbSlideUp 0.25s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}
.mh-share-modal-title {
    font-family: 'Playfair Display', 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1714;
    margin: 0 0 6px;
}
.mh-share-modal-sub {
    font-size: 0.82rem;
    color: #888;
    margin: 0 0 20px;
    font-family: 'Outfit', sans-serif;
}
.mh-share-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.mh-share-url-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.82rem;
    color: #444;
    font-family: monospace;
    background: #f8f8f8;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mh-share-copy-btn {
    background: #e50914;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}
.mh-share-copy-btn:hover { background: #c00812; }
.mh-share-copy-btn.copied { background: #16a34a; }
.mh-share-modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 30px; height: 30px; border-radius: 50%;
    background: #f0f0f0; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem; color: #555;
    transition: background 0.15s;
}
.mh-share-modal-close:hover { background: #e0e0e0; }

/* ==========================================================================
   WP ULIKE — WATCHLIST BUTTON OVERRIDE
   ========================================================================== */

.mh-watchlist-wrapper * {
    box-sizing: border-box !important;
}

.mh-watchlist-wrapper .wpulike,
.mh-watchlist-wrapper .wp_ulike_general_class {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.mh-watchlist-wrapper .wp_ulike_btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    padding: 6px 12px !important;
    min-width: unset !important;
    height: auto !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.mh-watchlist-wrapper .wp_ulike_btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: #fff !important;
}

.mh-watchlist-wrapper .count-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 0 0 0 8px !important;
    margin: 0 !important;
    min-width: unset !important;
    line-height: 1 !important;
}

.mh-watchlist-wrapper .count-box::before,
.mh-watchlist-wrapper .count-box::after {
    display: none !important;
}


/* ==========================================================================
   VIDEO BOXES LAYOUT
   ========================================================================== */

.mh-trailers-wrap {
    display: flex;
    gap: 15px;
    overflow: hidden;
}

.mh-trailer-box,
.mh-view-more-box {
    width: 180px;
    height: 101px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    text-decoration: none;
    overflow: hidden;
}

.mh-trailer-box:hover,
.mh-view-more-box:hover {
    transform: scale(1.05);
    border-color: #fff;
}

.mh-trailer-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
    pointer-events: none;
}

.mh-trailer-box > * {
    position: relative;
    z-index: 2;
}

.mh-vid-title {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mh-vid-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.mh-vid-play {
    width: 18px;
    height: 18px;
    fill: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.mh-vid-time {
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 5px;
    border-radius: 3px;
}

.mh-view-more-bg {
    position: absolute;
    inset: -15px;
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.4);
    z-index: 1;
}

.mh-view-more-btn {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 2px solid #fff;
    padding: 6px 12px;
    border-radius: 20px;
    align-self: center;
    margin-top: auto;
    margin-bottom: auto;
}


/* ==========================================================================
   RESPONSIVE — MOBILE
   ========================================================================== */

@media (max-width: 900px) {
    .mh-content {
        padding: 40px 20px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
        justify-content: flex-end;
    }

    .mh-gradient {
        background: linear-gradient(180deg, rgba(11, 18, 24, 0) 0%, rgba(11, 18, 24, 0.9) 50%, rgba(11, 18, 24, 1) 100%);
    }

    .mh-poster-wrap {
        display: none;
    }

    .mh-title {
        font-size: 1.8rem;
    }

    .mh-meta {
        justify-content: center;
    }

    .mh-scores-row {
        justify-content: center;
    }

    .mh-synopsis {
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .mh-action-buttons {
        justify-content: center;
    }

    .mh-trailers-wrap {
        justify-content: center;
    }

    .mh-hero {
        height: auto;
        min-height: 600px;
        padding-bottom: 20px;
    }
}


/* ==========================================================================
   MODAL
   ========================================================================== */

.mh-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.3s;
}

.mh-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.mh-modal-inner {
    width: 90%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    position: relative;
    background: #000;
}

.mh-modal-close {
    position: absolute;
    top: -36px;
    right: 0;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
}
