/*
Theme Name:  MovieSurfer
Theme URI:   https://www.moviesurfer.it
Author:      WebSalad
Description: Tema leggero di MovieSurfer, senza page builder. Replica il layout costruito in precedenza con Elementor (header fisso con blur, footer a tre colonne, pagine a sfondo nero) e aggiunge barra di navigazione mobile e funzioni PWA.
Version:     1.0.0
Requires PHP: 8.0
License:     GPL-2.0+
Text Domain: moviesurfer
*/

/* ══════════════════════════════════════════════════════════════════════════
   Token
   ══════════════════════════════════════════════════════════════════════════ */
:root {
    --ms-bg:            #000000;
    --ms-text:          #ffffff;
    --ms-yellow:        #F9C405;
    --ms-blue:          #467FF7;
    --ms-copyright:     #0e87dc;
    --ms-dropdown-hover:#4A4A4A;
    --ms-content-width: 1140px;
    --ms-header-h:      100px;
    --ms-font-ui:       "Poppins", sans-serif;
    --ms-font-body:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --ms-safe-top:      env(safe-area-inset-top, 0px);
    --ms-safe-bottom:   env(safe-area-inset-bottom, 0px);
    --ms-bottomnav-h:   0px;
}

/* ══════════════════════════════════════════════════════════════════════════
   Reset (equivalente a quello di Hello Elementor)
   ══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { line-height: 1.15; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background-color: var(--ms-bg);
    color: #333;
    font-family: var(--ms-font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { margin-block-start: .5rem; margin-block-end: 1rem; font-family: inherit; font-weight: 500; line-height: 1.2; color: inherit; }
h1 { font-size: 2.5rem; } h2 { font-size: 2rem; } h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; } h5 { font-size: 1.25rem; } h6 { font-size: 1rem; }
p { margin-block-start: 0; margin-block-end: .9rem; }
a { background-color: transparent; color: #c36; text-decoration: none; }
a:hover, a:active { color: #336; }
img { border-style: none; height: auto; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; line-height: 1.5; margin: 0; }
input[type=email], input[type=number], input[type=password], input[type=search], input[type=text], input[type=url], select, textarea {
    border: 1px solid #666; border-radius: 3px; padding: .5rem 1rem; width: 100%;
}
button, [type=button], [type=submit] {
    background-color: transparent; border: 1px solid #c36; border-radius: 3px; color: #c36;
    cursor: pointer; display: inline-block; font-size: 1rem; font-weight: 400;
    padding: .5rem 1rem; text-align: center; white-space: nowrap; user-select: none;
}
ul, ol { padding-inline-start: 1.5em; }
table { width: 100%; border-collapse: collapse; }
.screen-reader-text {
    clip: rect(1px,1px,1px,1px); height: 1px; overflow: hidden; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
    clip: auto !important; background: #fff; color: #333; display: block; font-size: 1rem; height: auto;
    left: 5px; padding: 12px 24px; top: 5px; width: auto; z-index: 100000;
}

/* ══════════════════════════════════════════════════════════════════════════
   Header — fisso, nero 70% + blur (ex template Elementor #364)
   ══════════════════════════════════════════════════════════════════════════ */
.ms-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 999;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: var(--ms-header-h);
    padding: var(--ms-safe-top) 8% 0;
    background-color: rgba(0, 0, 0, .7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: min-height .2s ease, background-color .2s ease;
}
.ms-header__logo { flex: 0 0 15%; width: 15%; display: flex; padding: 10px; }
.ms-header__logo a { display: block; width: 100%; }
.ms-header__logo img {
    display: block; width: 100%; height: 80px; object-fit: contain; object-position: center center;
    transition: height .2s ease;
}
.ms-header__nav    { flex: 0 0 60%; width: 60%; display: flex; padding: 10px; }
.ms-header__search { flex: 0 0 25%; width: 25%; display: flex; padding: 10px; }
.ms-header__msearch,
.ms-header__toggle-wrap { display: none; }

/* Menu principale (ex widget nav-menu: Poppins 16px, bianco, attivo/hover #F9C405) */
.ms-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
.ms-menu > li { position: relative; margin: 0 15px; }
.ms-menu > li:first-child { margin-left: 0; }
.ms-menu > li:last-child  { margin-right: 0; }
.ms-menu a {
    display: flex; align-items: center;
    font-family: var(--ms-font-ui);
    font-size: 16px; font-weight: 400; line-height: 1em; letter-spacing: 0;
    text-transform: capitalize;
    color: #fff;
    padding: 5px 0;
    white-space: nowrap;
    transition: color .3s;
}
.ms-menu > li > a:hover,
.ms-menu > li > a:focus,
.ms-menu > li.current-menu-item > a,
.ms-menu > li.current-menu-ancestor > a,
.ms-menu > li.is-open > a { color: var(--ms-yellow); }

/* Freccia sottomenu */
.ms-menu .menu-item-has-children > a::after {
    content: "";
    width: 0; height: 0;
    margin-left: 12px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
}

/* Dropdown desktop */
.ms-menu .sub-menu {
    list-style: none; margin: 0; padding: 0;
    position: absolute; top: 100%; left: 0;
    min-width: 156px;
    background-color: #000;
    z-index: 2;
    display: none;
    box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.ms-menu li:hover > .sub-menu,
.ms-menu li:focus-within > .sub-menu,
.ms-menu li.is-open > .sub-menu { display: block; }
.ms-menu .sub-menu a {
    font-size: 12px; padding: 13px 20px; line-height: 20px; color: #fff;
    border-left: 8px solid transparent;
}
.ms-menu .sub-menu a:hover,
.ms-menu .sub-menu a:focus { background-color: var(--ms-dropdown-hover); color: #fff; }
.ms-menu .sub-menu .current-menu-item > a { color: var(--ms-yellow); background-color: #000; }

/* Toggle hamburger (mobile) */
.ms-menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; margin-left: auto;
    border: 0; border-radius: 3px;
    background: transparent; color: var(--ms-blue);
}
.ms-menu-toggle:hover, .ms-menu-toggle:focus { background: transparent; color: var(--ms-blue); }
.ms-menu-toggle svg { width: 26px; height: 26px; display: block; }
.ms-menu-toggle .ms-icon-close { display: none; }
.ms-menu-toggle[aria-expanded="true"] .ms-icon-open  { display: none; }
.ms-menu-toggle[aria-expanded="true"] .ms-icon-close { display: block; }

/* Ricerca nel header: barra del plugin a larghezza fissa (220px) come prima */

/* Header compatto dopo lo scroll */
.ms-header.is-scrolled { min-height: 72px; background-color: rgba(0, 0, 0, .82); }
.ms-header.is-scrolled .ms-header__logo img { height: 56px; }

/* ══════════════════════════════════════════════════════════════════════════
   Contenuto pagine (ex container Elementor: boxed 1140px, padding-top 10%)
   ══════════════════════════════════════════════════════════════════════════ */
.ms-main { background: var(--ms-bg); }
.ms-page {
    width: 100%;
    max-width: var(--ms-content-width);
    margin: 0 auto;
    padding: 10% 10px 2%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ms-page > * { max-width: 100%; }
.ms-page--wide { max-width: 1320px; }
.ms-page__title {
    font-family: var(--ms-font-ui); font-weight: 600; color: #fff; font-size: 2rem; margin: 0;
}
/* Testi scritti nell'editor (ex widget Titolo/Testo di Elementor: Poppins
   bianco). Gli shortcode del plugin mantengono il proprio font. */
.ms-entry > :first-child { margin-top: 0; }
.ms-entry > h1, .ms-entry > h2, .ms-entry > h3, .ms-entry > h4 { font-family: var(--ms-font-ui); font-weight: 600; color: #fff; }
.ms-entry > p, .ms-entry > ul, .ms-entry > ol { font-family: var(--ms-font-ui); color: #fff; }
.ms-entry > p a, .ms-entry > ul a, .ms-entry > ol a { color: var(--ms-yellow); }
.ms-entry > p a:hover { color: #fff; }
.ms-page__title { margin-bottom: 0; }
/* Paragrafi vuoti generati dagli shortcode in wpautop */
.ms-entry > p:empty { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   Footer (ex template Elementor #6313)
   ══════════════════════════════════════════════════════════════════════════ */
.ms-footer { background-color: #000; }
.ms-footer__main {
    display: flex; flex-direction: row; align-items: stretch;
    padding: 5% 8%;
}
.ms-footer__brand { width: 45%; padding: 0 20% 0 0; display: flex; flex-direction: column; gap: 50px; }
.ms-footer__brand img { width: 50%; margin-bottom: 20px; display: block; }
.ms-footer__brand p {
    font-family: var(--ms-font-ui); font-size: 16px; font-weight: 300; line-height: 1.5em; color: #fff; margin: 0;
}
.ms-footer__col { display: flex; flex-direction: column; gap: 20px; padding: 0 10px; }
.ms-footer__col--menu  { width: 20%; }
.ms-footer__col--about { width: 35%; }
.ms-footer__title {
    font-family: var(--ms-font-ui); font-size: 22px; font-weight: 600; line-height: 1.2em;
    text-transform: capitalize; color: #fff; margin: 0;
}
.ms-footer__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ms-footer__menu a {
    font-family: var(--ms-font-ui); font-size: 16px; font-weight: 300; line-height: 1.5em; color: #fff;
}
.ms-footer__menu a:hover, .ms-footer__menu a:focus { color: #C8D5DC; }
.ms-footer__about { font-family: var(--ms-font-ui); font-size: 14px; font-weight: 400; color: #fff; }
.ms-footer__about p { margin-block-end: .9rem; }
.ms-footer__copy {
    min-height: 45px; display: flex; flex-direction: column; justify-content: center;
    padding: 0 8%; background-color: var(--ms-copyright);
}
.ms-footer__copy p {
    margin: 0; text-align: center;
    font-family: var(--ms-font-ui); font-size: 16px; font-weight: 300; line-height: 1.5em; color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════
   Bottom navigation (solo smartphone)
   ══════════════════════════════════════════════════════════════════════════ */
.ms-bottomnav { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   Installazione PWA
   ══════════════════════════════════════════════════════════════════════════ */
.ms-install {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(12px + var(--ms-bottomnav-h) + var(--ms-safe-bottom));
    z-index: 1000;
    display: none; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: #161b22; border: 1px solid #30363d; border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.6);
    color: #e6edf3; font-family: var(--ms-font-ui); font-size: 14px;
    max-width: 520px; margin: 0 auto;
}
.ms-install.is-visible { display: flex; animation: msSlideUp .25s ease; }
.ms-install img { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; background: #000; object-fit: contain; }
.ms-install__text { flex: 1 1 auto; line-height: 1.35; }
.ms-install__text strong { display: block; color: #fff; font-weight: 600; }
.ms-install__text span { color: #8b949e; font-size: 12px; }
.ms-install__btn {
    border: 0; border-radius: 100px; padding: 8px 16px;
    background: var(--ms-yellow); color: #000; font-weight: 600; font-size: 13px; font-family: inherit;
}
.ms-install__btn:hover, .ms-install__btn:focus { background: #ffd43b; color: #000; }
.ms-install__close {
    border: 0; padding: 4px 6px; background: transparent; color: #8b949e; font-size: 20px; line-height: 1;
}
.ms-install__close:hover, .ms-install__close:focus { background: transparent; color: #fff; }
@keyframes msSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Banner offline */
.ms-offline {
    position: fixed; top: calc(var(--ms-header-h) + var(--ms-safe-top)); left: 0; right: 0; z-index: 998;
    display: none; padding: 6px 12px; text-align: center;
    background: #3a2a00; color: #ffd43b; font: 500 13px/1.4 var(--ms-font-ui);
}
body.is-offline .ms-offline { display: block; }

/* ══════════════════════════════════════════════════════════════════════════
   Tablet (≤1024px) — come i breakpoint Elementor
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .ms-header { padding-left: 5%; padding-right: 5%; }
    .ms-menu a { font-size: 14px; }
    .ms-menu > li { margin: 0 10px; }
    .ms-menu .sub-menu a { font-size: 14px; }

    .ms-footer__main { flex-direction: row-reverse; flex-wrap: wrap; padding: 8% 5%; }
    .ms-footer__brand { width: 100%; order: 99999; margin-top: 8%; padding: 0 35% 0 0; gap: 30px; }
    .ms-footer__col--menu  { width: 25%; }
    .ms-footer__col--about { width: 50%; padding: 0 15% 0 0; }
    .ms-footer__menu a { font-size: 14px; }
    .ms-footer__brand p { font-size: 14px; }
    .ms-footer__copy { padding: 0 5%; }
    .ms-footer__copy p { font-size: 14px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Smartphone (≤767px)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    :root { --ms-header-h: 64px; --ms-bottomnav-h: 62px; }

    body { padding-bottom: calc(var(--ms-bottomnav-h) + var(--ms-safe-bottom)); }

    .ms-header {
        flex-wrap: wrap;
        min-height: var(--ms-header-h);
        padding: var(--ms-safe-top) 1% 0;
    }
    .ms-header__logo { flex: 0 0 60%; width: 60%; padding: 0; }
    .ms-header__logo img { height: 56px; object-position: left center; }
    .ms-header.is-scrolled { min-height: 56px; }
    .ms-header.is-scrolled .ms-header__logo img { height: 46px; }

    .ms-header__msearch { display: flex; flex: 0 0 20%; width: 20%; justify-content: flex-end; padding: 0; }
    .ms-header__toggle-wrap { display: flex; flex: 0 0 20%; width: 20%; justify-content: flex-end; padding: 0 6px 0 0; }
    .ms-header__search { display: none; }

    /* Menu mobile: tendina a tutta larghezza sotto l'header */
    .ms-header__nav {
        position: fixed;
        top: calc(var(--ms-header-h) + var(--ms-safe-top));
        left: 0; right: 0;
        width: 100%;
        max-height: calc(100vh - var(--ms-header-h) - var(--ms-safe-top) - var(--ms-bottomnav-h) - var(--ms-safe-bottom));
        overflow-y: auto;
        padding: 0 0 16px;
        background: #000;
        display: none;
        box-shadow: 0 20px 40px rgba(0,0,0,.6);
    }
    .ms-header.menu-open .ms-header__nav { display: block; }
    .ms-menu { flex-direction: column; align-items: stretch; }
    .ms-menu > li { margin: 0; }
    .ms-menu a {
        font-size: 16px; padding: 14px 20px; line-height: 1.2em;
        border-left: 8px solid transparent;
    }
    .ms-menu > li > a:hover { background: var(--ms-dropdown-hover); color: #fff; }
    .ms-menu .menu-item-has-children > a::after { margin-left: 14px; }
    .ms-menu .sub-menu { position: static; box-shadow: none; min-width: 0; }
    .ms-menu li:hover > .sub-menu { display: none; }
    .ms-menu li.is-open > .sub-menu { display: block; }
    .ms-menu .sub-menu a { font-size: 15px; padding: 12px 20px 12px 40px; color: #c9d1d9; }

    .ms-page { padding: calc(var(--ms-header-h) + var(--ms-safe-top) + 16px) 10px 2%; }

    /* Footer mobile */
    .ms-footer__main { padding: 12% 5%; }
    .ms-footer__col--about { width: 100%; order: -99999; padding: 0; margin-bottom: 12%; }
    .ms-footer__col--menu  { width: 100%; }
    .ms-footer__menu { gap: 8px; }
    .ms-footer__title { font-size: 18px; }
    .ms-footer__brand { margin-top: 12%; padding: 0; gap: 0; }
    .ms-footer__brand img { margin-bottom: 0; width: 60%; }

    /* Bottom navigation */
    .ms-bottomnav {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001;
        height: calc(var(--ms-bottomnav-h) + var(--ms-safe-bottom));
        padding-bottom: var(--ms-safe-bottom);
        background: rgba(0, 0, 0, .88);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        border-top: 1px solid #21262d;
    }
    .ms-bottomnav a, .ms-bottomnav button {
        flex: 1 1 0;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        padding: 6px 2px 4px; margin: 0;
        border: 0; border-radius: 0; background: transparent;
        color: #8b949e;
        font: 500 10.5px/1.1 var(--ms-font-ui);
        letter-spacing: .1px;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }
    .ms-bottomnav a:hover, .ms-bottomnav button:hover,
    .ms-bottomnav a:focus, .ms-bottomnav button:focus { background: transparent; color: #fff; }
    .ms-bottomnav svg { width: 23px; height: 23px; display: block; }
    .ms-bottomnav .is-active { color: var(--ms-yellow); }
    .ms-bottomnav .ms-bottomnav__cta svg { color: #ff5f1f; }
    .ms-bottomnav .ms-bottomnav__cta.is-active svg { color: var(--ms-yellow); }

    .ms-offline { top: calc(var(--ms-header-h) + var(--ms-safe-top)); }
}

@media (prefers-reduced-motion: reduce) {
    .ms-header, .ms-header__logo img { transition: none; }
}
