/* --- Final Stacked 3D Theme - Restored & Refined --- */

:root {
    --bg-gradient: linear-gradient(170deg, #1a1a2e 0%, #003da6 50%, #6C86CB 100%);
    --card-bg: #1a1a2e;
    --accent-color:#003da6; 
    --border-radius: 20px;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: white;
    padding: 0 20px 50px 20px; /* Added side padding for mobile breathing room */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Header & Nav --- */
header h1 {
    font-size: clamp(2rem, 8vw, 3.5rem); /* Scales between 2rem and 3.5rem based on screen */
    text-transform: uppercase;
    margin: 50px 0;
    text-align: center;
    background: linear-gradient(to bottom, #003da6 0%, #6C86CB 70%, #F4F6FB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
/* Specifically targets the title on video detail pages */
/* 2.625rem is 25% smaller than your main 3.5rem title */
body:has(.video-container) header h1 {
    font-size: clamp(1.5rem, 6vw, 2.625rem); 
    margin: 30px 0; /* Slightly tighter margins for the smaller text */
}

/* Subtitle matching footer style */
.header-subtitle {
    text-align: center;
    margin: -35px 0 35px 0; /* Pulls it closer to the title and pushes the nav down */
    opacity: 0.5;           /* Matches the footer opacity */
    font-size: 2rem;        /* Standard text size */
    font-weight: normal;
}

nav {
    display: flex;
    flex-wrap: wrap; /* Allows buttons to wrap on very small phones */
    justify-content: center;
    gap: 10px;
}

nav a {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 25px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: white;
    font-weight: bold;
    display: inline-block;
    transition: all 0.3s ease;
}

nav a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

/* --- Responsive Gallery Container --- */
.gallery {
    width: 100%;
    max-width: 1300px; /* Limits the gallery width on huge monitors */
    display: flex;
    justify-content: center;
    overflow-x: hidden; /* Prevents side scrolling */
}

/* --- 3D Table Gallery --- */
table {
    width: 100%; /* Makes table take up available container space */
    border-collapse: separate; 
    border-spacing: clamp(10px, 2vw, 20px); /* Smaller spacing on smaller screens */
}

td {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 4px;
    width: 25%; /* Divide into 4 equal columns */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 5px 0 0 #0f3460, 
        0 10px 0 0 #16213e,
        0 15px 30px rgba(0,0,0,0.5);
}

td:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6); 
}

/* --- Thumbnail Overlay Logic --- */
.thumb-wrapper {
    position: relative; 
    width: 100%;       /* Fills the TD width */
    max-width: 300px;  /* Keeps original max size */
    margin: 0 auto;    /* Centers inside TD */
    aspect-ratio: 16 / 9; /* Replaces fixed height for fluid scaling */
    overflow: hidden;
    border-radius: calc(var(--border-radius) - 10px);
}

.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.overlay-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    padding: 8px 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    font-size: clamp(0.6rem, 1.5vw, 0.85rem); /* Text scales down on small screens */
    pointer-events: none; 
}

/* --- Video Player Responsive Fix --- */
.video-container {
    width: 100%;
    max-width: 1024px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

video {
    width: 100%;
    max-width: 1024px;
    height: auto; /* Allows height to scale with width */
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: #000;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 3px solid rgba(255,255,255,0.1);
}

footer {
    text-align: center;
    margin-top: 100px;
    opacity: 0.5;
}
/* Targets the name ONLY on pages with a video player */
body:has(.video-container) .header-subtitle {
    margin-top: -15px; /* Moves the name down (less negative than the default) */
    margin-bottom: 45px; /* Adds space above the navigation buttons */
}