/* ME-Hindi public website. Same palette as the Android app's dark theme (amber on dark navy). Mobile first. */

:root {
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #1f2937;
    --surface-3: #374151;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --amber: #f59e0b;
    --amber-soft: #fcd34d;
    --on-amber: #1f1300;
    --radius: 10px;
    --gutter: 16px;
    --max: 1240px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Nirmala UI", "Noto Sans Devanagari", sans-serif;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--amber-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--amber); color: var(--on-amber); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- header */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span b { color: var(--amber); font-weight: 800; }

.site-search { flex: 1; display: flex; justify-content: flex-end; min-width: 0; }
.site-search form { position: relative; width: 100%; max-width: 420px; }
.site-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px;
    border-radius: 999px;
    border: 1px solid var(--surface-3);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
}
.site-search input::placeholder { color: var(--text-muted); }
.site-search input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.site-search svg { position: absolute; left: 13px; top: 11px; width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }

@media (max-width: 480px) {
    .brand span { display: none; }
}

/* ---------------------------------------------------------------- page layout */

main { flex: 1; padding-bottom: 48px; }

.crumbs { font-size: 0.85rem; color: var(--text-muted); padding-top: 14px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li:not(:last-child)::after { content: "\203A"; margin-left: 6px; color: var(--surface-3); }
.crumbs a { color: var(--text-muted); }
.crumbs li:last-child { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

.page-head { padding: 22px 0 8px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-head h1 { font-size: clamp(1.45rem, 3.6vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; }
.page-head .intro { margin: 8px 0 0; color: var(--text-muted); max-width: 70ch; font-size: 0.97rem; }

.hero-tag { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: rgba(245, 158, 11, 0.14); color: var(--amber-soft); font-size: 0.8rem; font-weight: 600; }

/* Year picker (like the app's top-bar dropdown) */
.year-menu { position: relative; }
.year-menu summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px 0 16px;
    border: 1px solid var(--surface-3);
    border-radius: 999px;
    font-weight: 700;
    background: var(--surface);
    user-select: none;
}
.year-menu summary::-webkit-details-marker { display: none; }
.year-menu summary::after { content: ""; border: 5px solid transparent; border-top-color: currentColor; margin-top: 5px; }
.year-menu[open] summary { border-color: var(--amber); }
.year-menu ul {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    margin: 0;
    padding: 6px;
    list-style: none;
    min-width: 200px;
    max-height: 60vh;
    overflow: auto;
    background: var(--surface-2);
    border: 1px solid var(--surface-3);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.year-menu li a { display: flex; justify-content: space-between; gap: 16px; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.year-menu li a:hover, .year-menu li a[aria-current] { background: var(--surface-3); text-decoration: none; }
.year-menu li a small { color: var(--text-muted); }

/* Genre chips (the app's FilterChip row) */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--surface-3);
    color: var(--text);
    font-size: 0.9rem;
    white-space: nowrap;
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip[aria-current] { background: rgba(245, 158, 11, 0.16); border-color: var(--amber); color: var(--amber-soft); font-weight: 600; }
.chip small { color: var(--text-muted); margin-left: 4px; }

.count { color: var(--text-muted); font-size: 0.85rem; margin: 10px 0 12px; }

/* ---------------------------------------------------------------- movie grid */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px 10px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }

.card { display: block; color: var(--text); }
.card:hover { text-decoration: none; }
.card .poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.card .poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .poster img { transform: scale(1.04); }
.card .poster .no-poster { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.card .badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}
.card .badge svg { width: 12px; height: 12px; color: var(--amber); }
.card-title {
    margin: 8px 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-year { color: var(--text-muted); font-size: 0.78rem; }

.load-more-wrap { display: flex; justify-content: center; padding: 26px 0 0; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid var(--surface-3);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.btn-primary:hover { background: var(--amber-soft); }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }

.empty { padding: 48px 0; text-align: center; color: var(--text-muted); }

.search-big { margin-top: 14px; position: relative; max-width: 640px; }
.search-big input { width: 100%; height: 52px; padding: 0 18px 0 48px; border-radius: 999px; border: 1px solid var(--surface-3); background: var(--surface); color: var(--text); font: inherit; font-size: 1.05rem; }
.search-big input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.search-big svg { position: absolute; left: 17px; top: 16px; width: 20px; height: 20px; color: var(--text-muted); }

/* ---------------------------------------------------------------- movie page */

.movie-hero { position: relative; isolation: isolate; }
.movie-hero .backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.movie-hero .backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; opacity: .55; }
.movie-hero .backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,17,32,.35) 0%, rgba(11,17,32,.75) 55%, var(--bg) 100%), linear-gradient(90deg, rgba(11,17,32,.85) 0%, rgba(11,17,32,0) 70%); }

.movie-head { display: flex; gap: 18px; align-items: flex-end; padding: 28px 0 18px; }
.movie-head .poster { flex-shrink: 0; width: 120px; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
.movie-head .poster img { width: 100%; height: 100%; object-fit: cover; }
.movie-head h1 { font-size: clamp(1.5rem, 4.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.movie-head h1 .year { color: var(--text-muted); font-weight: 600; }
.movie-head .tagline { margin: 8px 0 0; font-style: italic; color: #d1d5db; }
.movie-head .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.movie-head .meta .chip { height: 30px; font-size: 0.85rem; background: rgba(17,24,39,.6); }
@media (min-width: 720px) {
    .movie-head { padding: 72px 0 28px; gap: 28px; }
    .movie-head .poster { width: 200px; }
}

.movie-body { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .movie-body { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

.section-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.section-title small { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.section-title .bar { width: 4px; height: 1.05em; background: var(--amber); border-radius: 4px; align-self: center; flex-shrink: 0; }
@media (max-width: 640px) { .section-title small { display: none; } }

/* Player (the app's player screen): a YouTube poster that turns into the embed on click. */
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-poster { position: absolute; inset: 0; display: block; cursor: pointer; }
.player-poster img { width: 100%; height: 100%; object-fit: cover; }
.player-poster::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(0,0,0,.05) 0%, rgba(0,0,0,.45) 100%); }
.play-btn {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 50%;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    border-radius: 50%;
    background: var(--amber);
    color: var(--on-amber);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    transition: transform .2s ease;
}
.player-poster:hover .play-btn { transform: scale(1.08); }
.play-btn svg { width: 34px; height: 34px; margin-left: 4px; }
.player-caption { margin: 12px 0 0; }
.player-caption strong { display: block; font-size: 1.02rem; line-height: 1.35; }
.player-caption span { color: var(--text-muted); font-size: 0.85rem; }

.video-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.video-card { display: flex; gap: 12px; align-items: center; padding: 6px; border-radius: 12px; color: var(--text); border: 1px solid transparent; }
.video-card:hover { background: var(--surface); text-decoration: none; }
.video-card.is-active { background: var(--surface); border-color: rgba(245, 158, 11, .5); }
.video-card .thumb { position: relative; flex-shrink: 0; width: 150px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card .thumb .mini-play { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; display: flex; align-items: center; justify-content: center; }
.video-card .thumb .mini-play svg { width: 16px; height: 16px; margin-left: 2px; }
.video-card .info { min-width: 0; }
.video-card .info strong { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.9rem; line-height: 1.35; }
.video-card .info span { color: var(--text-muted); font-size: 0.78rem; }
.video-card .now { color: var(--amber); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.story { background: var(--surface); border: 1px solid rgba(255,255,255,.05); border-radius: 14px; padding: 18px 18px 8px; }
.story p { margin: 0 0 12px; font-size: 1.02rem; line-height: 1.8; }
.story p[lang="hi"] { font-size: 1.08rem; }
.story details { border-top: 1px solid var(--surface-3); padding: 10px 0; }
.story summary { cursor: pointer; color: var(--amber-soft); font-size: 0.9rem; }
.story details p { margin-top: 10px; color: #d1d5db; font-size: 0.97rem; }

.facts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.9rem; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }

.related { margin-top: 40px; }
.related-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.related-head a { font-size: 0.9rem; white-space: nowrap; }

.attribution { margin-top: 28px; font-size: 0.78rem; color: var(--text-muted); }

/* ---------------------------------------------------------------- text pages */

.prose { max-width: 760px; padding-top: 10px; }
.prose h2 { font-size: 1.2rem; margin: 26px 0 8px; }
.prose p, .prose li { color: #d1d5db; }

/* ---------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid rgba(255,255,255,.06); background: var(--surface); color: var(--text-muted); font-size: 0.85rem; }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: grid; gap: 22px; }
@media (min-width: 720px) { .site-footer .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .tmdb { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--surface-2); padding-top: 16px; font-size: 0.78rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
