/* Critical CSS for Sitembem - Above the fold optimization */

/* Critical reset and base styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Font loading optimization */
@font-face {
    font-family: 'Noto Sans JP';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/notosansjp/v52/NotoSansJP-Regular.woff2') format('woff2');
    unicode-range: U+3040-309F, U+30A0-30FF, U+4E00-9FAF;
}

/* Critical body styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Noto Sans JP';
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Critical header styles for above-the-fold */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/header-pattern.svg') repeat;
    opacity: 0.1;
    z-index: 1;
}

header > * {
    position: relative;
    z-index: 2;
}

/* Critical typography */
h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.4rem);
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* Container optimization */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Critical content styles */
.content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* Critical loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Critical responsive breakpoints */
@media (max-width: 768px) {
    header {
        padding: 40px 15px;
    }
    
    .content {
        padding: 25px 20px;
        margin: 0 10px 20px;
    }
    
    .container {
        padding: 10px;
    }
}

/* Critical image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent layout shift */
.movie-poster {
    aspect-ratio: 2/3;
    width: 100%;
    max-width: 200px;
    object-fit: cover;
    background-color: #f0f0f0;
}

/* Critical button styles */
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2em;
    margin: 20px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    min-width: 200px;
}

.cta-button:hover, .cta-button:focus {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(238, 90, 36, 0.3);
    outline: none;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
a:focus, button:focus, input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #667eea;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}
