<?php header('Content-Type: text/html; charset=UTF-8'); ?>

<?php

header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: SAMEORIGIN');
header('X-XSS-Protection: 1; mode=block');
header('Referrer-Policy: strict-origin-when-cross-origin');

?>

<!DOCTYPE html>
<html lang="it">
<head>
    <title><?php echo $title_site; ?></title>    
    <meta name="description" content="<?php echo $description_site; ?>">
    <meta name="application-name" content="<?php echo $title_site; ?>">
    <link rel="icon" type="image/png" href="<?php echo $logo_site; ?>">
    <meta charset="utf-8">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320"/>
    <meta name="viewport" content="minimal-ui, width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="robots" content="index, follow">    
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="application-name" content="<?php echo $title_site; ?>">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="apple-mobile-web-app-title" content="<?php echo $title_site; ?>">
    <meta name="theme-color" content="#2a377e">
    <link rel="apple-touch-icon" href="<?=$base_path?>/img/logoapp.png">
    <link rel="apple-touch-icon" sizes="152x152" href="<?=$base_path?>/img/icons/icon-152x152.png">
    <link rel="apple-touch-icon" sizes="192x192" href="<?=$base_path?>/img/icons/icon-192x192.png">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true">
    <meta name="apple-mobile-web-app-orientations" content="portrait">
    <meta name="browsermode" content="application">
    <link rel="manifest" href="<?=$base_path?>/manifest.json?v=<?=$version_app?>">
    <link rel="stylesheet" href="<?=$base_path?>/css/bootstrap.css">
    <link rel="stylesheet" href="<?=$base_path?>/css/style.css?v=<?=$version_app?>">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="<?=$base_path?>/css/animation.css?v=<?=$version_app?>">
    <script src="https://code.jquery.com/jquery-2.2.4.js?v=<?=$version_app?>"></script>
    <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
    <script src="<?=$base_path?>/js/bootstrap.js?v=<?=$version_app?>"></script>
    <script>
        // Passa il percorso base a JavaScript
        var BASE_PATH = "<?=$base_path?>";
        
        // Forza l'orientamento portrait
        if (window.screen && window.screen.orientation) {
            // Tenta di bloccare l'orientamento in portrait
            window.addEventListener('load', function() {
                if (screen.orientation && screen.orientation.lock) {
                    screen.orientation.lock('portrait').catch(function(error) {
                        console.log('Orientation lock not supported or failed:', error);
                    });
                }
            });
        }
        
        // Fallback per dispositivi che non supportano l'API
        // Mostra un avviso se l'utente ruota il dispositivo
        window.addEventListener('orientationchange', function() {
            if (window.orientation !== 0 && window.orientation !== 180) {
                // Il dispositivo è in landscape, ma non possiamo forzarlo
                console.log('Si prega di tenere il dispositivo in posizione verticale');
            }
        });
    </script>
</head>
<body class="<?php echo $show_app ? 'appBody' : 'desktopBody'; ?>">