/* หน้าข้อมูลหนัง (ดีไซน์ใหม่) — pages/movie-info.php | หน้าเดิม: pages/movie-info-classic.php
   โครง: hero โปสเตอร์ใหญ่ + ข้อมูลข้าง ๆ จัดกลุ่มกลางจอ (พื้นหลัง = โปสเตอร์เบลอ) → เนื้อหาตรงกลาง: เรื่องย่อ (ซ้าย) / ข้อมูล (ขวา) */
/* style.css ตั้ง img { min-width: 150px } ทั้งเว็บ */
.mv-page img { min-width: 0; }

.mv-page {
    --mv-bg: #020d18;
    --mv-card: #0b1a2a;
    --mv-line: rgba(255, 255, 255, .08);
    --mv-text: #e8ecf0;
    --mv-muted: #abb7c4;
    --mv-dim: #6f8296;
    --mv-accent: #2984e8;
    --mv-accent-2: #4a9bf0;
    --mv-gutter: clamp(16px, 4vw, 64px);
    font-family: 'Noto Sans Thai', sans-serif;
    background: var(--mv-bg);
    color: var(--mv-muted);
    overflow-x: hidden;
}
.mv-ico { width: 20px; height: 20px; flex: 0 0 auto; }

/* ═════════ Hero: โปสเตอร์เป็นภาพหลัก ═════════ */
.mv-hero { position: relative; isolation: isolate; overflow: hidden; padding: 124px var(--mv-gutter) 64px; }
/* พื้นหลัง: ภาพแนวนอนหรี่ลง (ฝั่งซ้ายเข้มกว่า ให้โปสเตอร์กับตัวหนังสือเด่น) */
.mv-hero-bg { position: absolute; inset: 0; z-index: -1; background: #040c18; }
.mv-hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; opacity: .7; }
.mv-hero-bg::after {
    content: ''; position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 13, 24, .88) 0%, rgba(2, 13, 24, .6) 45%, rgba(2, 13, 24, .25) 100%),
        linear-gradient(0deg, var(--mv-bg) 0%, rgba(2, 13, 24, 0) 40%),
        linear-gradient(180deg, rgba(2, 13, 24, .6) 0%, rgba(2, 13, 24, 0) 22%);
}
/* ไม่มีภาพแนวนอน → โปสเตอร์แบบเบลอแทน */
.mv-hero-bg.is-poster img { filter: blur(60px) saturate(1.3); opacity: .5; transform: scale(1.2); }

.mv-hero-inner {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: clamp(260px, 30vw, 400px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center;
}
.mv-hero-poster {
    aspect-ratio: 7 / 10; border-radius: 16px; overflow: hidden; background: var(--mv-card);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .1);
    animation: mv-rise .6s ease-out both;
}
.mv-hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes mv-rise { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.mv-hero-content { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.mv-eyebrow {
    margin: 0 0 14px; padding: 4px 14px; border-radius: 999px; background: rgba(2, 13, 24, .45);
    border: 1px solid rgba(255, 255, 255, .25); color: #fff; font-size: 12px; font-weight: 500; letter-spacing: .3px;
}
.mv-page .mv-title { margin: 0 0 14px; color: #fff; font-size: clamp(28px, 3.2vw, 44px); font-weight: 700; line-height: 1.15; text-transform: none; }
.mv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin: 0 0 28px; padding: 0; list-style: none; font-size: 15px; color: var(--mv-text); }
.mv-meta li { display: inline-flex; align-items: center; }
.mv-meta li + li::before { content: ''; width: 4px; height: 4px; margin: 0 10px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.mv-meta li:first-child { margin-right: 12px; }
.mv-meta li:first-child + li::before { display: none; }
.mv-rate { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 5px; background: var(--rate, #3b82f6); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: help; }

/* ═════════ ปุ่ม ═════════ */
.mv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mv-page .mv-btn {
    position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 30px;
    border-radius: 999px; font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, transform .15s;
}
.mv-page .mv-btn.is-play { background: #fff; color: #06121f; min-width: 190px; }
.mv-page .mv-btn.is-play:hover { background: #dfe9f5; color: #06121f; transform: translateY(-1px); }
.mv-page .mv-btn.is-ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.mv-page .mv-btn.is-ghost:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.mv-btn-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(6, 18, 31, .15); }
.mv-btn-bar span { display: block; height: 100%; background: var(--mv-accent); }
.mv-round {
    width: 54px; height: 54px; padding: 0; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: background .15s, border-color .15s, color .15s;
}
.mv-round:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .4); }
.mv-round:disabled { opacity: .6; cursor: wait; }
.mv-round .mv-ico { width: 22px; height: 22px; }
/* span ห่อไอคอนเป็น inline → มีระยะ baseline ใต้ svg ทำให้หัวใจลอยขึ้น — ให้เป็น flex ไม่มี line-height */
.mv-fav-on, .mv-fav-off { display: inline-flex; line-height: 0; }
.mv-fav-on { display: none; }
.mv-round.is-on { color: #ff5a6e; border-color: rgba(255, 90, 110, .55); background: rgba(255, 90, 110, .15); }
.mv-round.is-on .mv-fav-on { display: inline-flex; animation: mv-pop .3s ease; }
.mv-round.is-on .mv-fav-off { display: none; }
@keyframes mv-pop { 50% { transform: scale(1.3); } }
.mv-btn:focus-visible, .mv-round:focus-visible { outline: 2px solid var(--mv-accent); outline-offset: 3px; }
.mv-resume-note { margin: 14px 0 0; font-size: 13px; color: var(--mv-text); }

/* ═════════ เนื้อหา: กลางจอ สองคอลัมน์สมดุล ═════════ */
.mv-body {
    max-width: calc(1100px + var(--mv-gutter) * 2); margin: 0 auto; padding: 24px var(--mv-gutter) 8px;
    display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 72px); align-items: start;
}
.mv-notes { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 32px; }
.mv-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); }
.mv-alert .mv-ico { color: #fbbf24; margin-top: 2px; }
.mv-alert p { margin: 0; font-size: 14px; line-height: 1.6; color: #e5e7eb; }
.mv-alert strong { color: #fbbf24; }
.mv-awards { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(245, 181, 10, .12); color: #f7c948; font-size: 14px; font-weight: 500; }
.mv-awards .mv-ico { width: 18px; height: 18px; }
.mv-page .mv-h2 { margin: 0 0 16px; color: #fff; font-size: 22px; font-weight: 600; text-transform: none; }
.mv-page .mv-h3 { margin: 20px 0 10px; color: #fff; font-size: 14px; font-weight: 600; text-transform: none; }
.mv-desc { margin: 0; font-size: 17px; line-height: 2; color: #c7d0d9; }

.mv-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 88px; }
.mv-facts { padding: 20px 20px 22px; border-radius: 14px; background: var(--mv-card); border: 1px solid var(--mv-line); }
.mv-facts .mv-h2 { font-size: 16px; margin-bottom: 14px; }
.mv-facts dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; margin: 0; }
.mv-facts dt { font-size: 13px; color: var(--mv-dim); font-weight: 400; }
.mv-facts dd { margin: 0; font-size: 13px; color: var(--mv-text); word-break: break-word; display: flex; flex-wrap: wrap; gap: 6px; }
.mv-page .mv-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .06); border: 1px solid var(--mv-line); color: var(--mv-text); font-size: 12px; text-decoration: none; transition: all .15s;
}
.mv-page .mv-chip:hover { border-color: var(--mv-accent); color: #fff; background: rgba(41, 132, 232, .15); }
.mv-chip .mv-ico { width: 12px; height: 12px; opacity: .7; }
.mv-social { display: flex; flex-wrap: wrap; gap: 8px; }

.mv-toast {
    position: fixed; left: 50%; bottom: 28px; z-index: 50; margin: 0; padding: 10px 18px; border-radius: 999px; transform: translate(-50%, 20px);
    background: rgba(11, 26, 42, .96); border: 1px solid var(--mv-line); color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.mv-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.mv-related { display: flex; flex-direction: column; gap: 36px; padding: 48px 0 80px; background: transparent; }

/* ═════════ Responsive ═════════ */
@media (max-width: 991px) {
    .mv-hero { margin-top: 60px; padding-top: 48px; } /* header ทึบตั้งแต่ ≤991px */
    .mv-hero-inner { grid-template-columns: 260px minmax(0, 1fr); gap: 32px; }
    .mv-eyebrow { display: none; } /* ป้ายฉายหนังครั้งที่ ซ่อนบนแท็บเล็ต/มือถือ (ยังดูได้ในการ์ดข้อมูล) */
    .mv-body { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 767px) {
    /* มือถือ: โปสเตอร์ใหญ่กลางจอ → ข้อมูลกลาง → เรื่องย่อ → ข้อมูลภาพยนตร์ */
    .mv-hero { padding: 24px 16px 28px; }
    .mv-hero-bg img { filter: blur(18px) saturate(1.2); transform: scale(1.12); opacity: .6; } /* มือถือ: เบลอให้โปสเตอร์เด่น */
    .mv-hero-bg::after { background: linear-gradient(180deg, rgba(2, 13, 24, .35) 0%, rgba(2, 13, 24, .65) 50%, var(--mv-bg) 100%); }
    .mv-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 22px; justify-items: center; text-align: center; }
    .mv-hero-poster { width: min(76vw, 340px); }
    .mv-hero-content { align-items: center; width: 100%; }
    .mv-page .mv-title { font-size: 28px; margin-bottom: 10px; }
    .mv-meta { justify-content: center; font-size: 13px; margin-bottom: 20px; }
    /* แถวแรก: เล่นหนังเต็มความกว้าง / แถวสอง: ตัวอย่าง + รายการโปรด + แชร์ */
    .mv-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; width: 100%; }
    .mv-page .mv-btn.is-play { grid-column: 1 / -1; }
    .mv-page .mv-btn { height: 48px; padding: 0 12px; font-size: 15px; min-width: 0; }
    .mv-round { width: 48px; height: 48px; }
    .mv-body { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 8px 16px 0; }
    .mv-side { position: static; }
    .mv-notes { align-items: stretch; margin-bottom: 24px; }
    .mv-awards { justify-content: center; border-radius: 10px; }
    .mv-desc { font-size: 15px; line-height: 1.9; }
    .mv-related { padding: 32px 0 60px; }
}

/* ═════════ แชร์ Stories (js/share-story.js) ═════════ */
.mv-share { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; font-family: 'Noto Sans Thai', sans-serif; }
.mv-share[hidden] { display: none; }
.mv-share-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .75); backdrop-filter: blur(4px); }
.mv-share-box {
    position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 20px 20px; border-radius: 18px;
    background: #0b1a2a; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); text-align: center;
}
.mv-share .mv-share-title { margin: 0 0 16px; color: #fff; font-size: 18px; font-weight: 600; text-transform: none; }
.mv-share-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #abb7c4; font-size: 26px; line-height: 1; cursor: pointer; }
.mv-share-close:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.mv-share-preview { position: relative; width: min(220px, 52vw); aspect-ratio: 9 / 16; margin: 0 auto 14px; border-radius: 12px; overflow: hidden; background: #061320; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.mv-share-preview img { width: 100%; height: 100%; object-fit: cover; display: block; min-width: 0; }
.mv-share-spinner { position: absolute; inset: 0; margin: auto; width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: #2984e8; animation: mv-spin .8s linear infinite; }
.mv-share-spinner[hidden] { display: none; }
@keyframes mv-spin { to { transform: rotate(360deg); } }
.mv-share-hint { margin: 0 0 16px; font-size: 13px; line-height: 1.6; color: #abb7c4; }
.mv-share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv-share-actions .mv-btn { height: 46px; padding: 0 12px; font-size: 15px; min-width: 0; border-radius: 10px; font-family: inherit; cursor: pointer; }
/* ปุ่มหลักใช้สีฟ้าของเว็บ — ต้อง specificity สูงกว่า .mv-page .mv-btn.is-play:hover (ปุ่มขาวใน hero) ไม่งั้น hover เป็นสีขาว */
.mv-page .mv-share-actions .mv-btn.is-play { grid-column: 1 / -1; background: var(--mv-accent); color: #fff; border: 0; }
.mv-page .mv-share-actions .mv-btn.is-play:hover { background: var(--mv-accent-2); color: #fff; transform: none; }
.mv-share-actions .mv-btn:disabled { opacity: .45; cursor: not-allowed; }
