/* ==========================================================================
   1. Global Styles & Theme (Dramatic Dark Aesthetic)
   ========================================================================== */
body {
    margin: 0;
    padding: 0;
    background-color: #232937; /* Deep, dark dramatic blue/grey */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e6ed; /* Crisp light text for high readability */
    line-height: 1.6;
}

/* ==========================================================================
   2. Layout Container
   ========================================================================== */
.container {
    width: 90%;
    max-width: 1000px; /* Replicates the centered layout from your template */
    margin: 0 auto;
    background-color: #343d4e; /* Slightly lighter tone for the content area */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); /* Soft drop shadow for depth */
}

/* ==========================================================================
   3. Header & Navigation Menu
   ========================================================================== */
header {
    padding: 30px 40px;
    background: linear-gradient(to bottom, #434e63, #343d4e); /* Subtle top gradient */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #4a576d;
}

.logo-area h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #ffffff;
}

.logo-area p {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    color: #a0aec0;
    text-transform: uppercase;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

nav a {
    color: #cbd5e0;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

nav a:hover, nav a.active {
    color: #ffffff;
    border-bottom: 2px solid #ffffff;
    padding-bottom: 4px;
}

/* ==========================================================================
   4. Main Content Formatting
   ========================================================================== */
main {
    padding: 40px;
}

/* Professional look for the feature image (85% wide) */
.hero-image-container {
    text-align: center;
    margin-bottom: 35px;
}

.hero-image {
    width: 85%;
    height: auto;
    border: 4px solid #4a576d;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.welcome-text h2 {
    color: #ffffff;
    font-size: 1.8rem;
    border-bottom: 1px solid #4a576d;
    padding-bottom: 10px;
    margin-top: 0;
}

/* ==========================================================================
   5. Footer
   ========================================================================== */
footer {
    background-color: #232937;
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    color: #a0aec0;
    border-top: 1px solid #4a576d;
}

/* ==========================================================================
   6. Meet The Cast Page Layout (Responsive Flex Grid)
   ========================================================================== */

/* The main container holding all the cast cards */
.cast-container {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap to the next line instead of breaking */
    gap: 20px; /* Even spacing between your cards */
    justify-content: center; /* Centers the remaining items if a row isn't full */
    margin-top: 30px;
}

/* Individual Cast Member Cards */
.cast-card {
    background-color: #2a3240; /* Darker tile color to contrast with the page container */
    border: 1px solid #4a576d;
    border-radius: 4px;
    width: calc(20% - 16px); /* Perfect math for 5 columns accounting for the gaps */
    min-width: 160px; /* Stops cards from getting too squished on smaller viewports */
    box-sizing: border-box;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Interactive hover look */
.cast-card:hover {
    transform: translateY(-5px); /* Gentle float effect */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border-color: #ffffff;
}

/* Profile Picture Layout inside the card */
.cast-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Forces the image box to remain a perfect square */
    overflow: hidden;
    background-color: #232937;
    margin-bottom: 12px;
    border: 1px solid #343d4e;
}

.cast-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Keeps headshots proportional without stretching them */
}

/* Actor Real Name Text Styling */
.cast-card h3 {
    margin: 5px 0 2px 0;
    font-size: 1.15rem;
    font-weight: 700; /* Distinct bold font */
    color: #ffffff;
    line-height: 1.2;
}

/* Character/Cast Name Text Styling */
.cast-card p {
    margin: 4px 0 0 0;
    font-size: 0.9rem; /* Slightly smaller than the real name */
    font-weight: 500; /* Lighter bold weight */
    color: #cbd5e0; /* Slightly lighter gray text color */
    font-style: italic; /* Elegant slant */
}

/* Utility class to shift a photo down if the face is cut off */
.shift-down img {
    object-position: 50% 25% !important;
}

/* ==========================================================================
   7. Native Lightbox Overlay UI
   ========================================================================== */
.lightbox {
    display: none; /* Kept hidden until an image triggers it */
    position: fixed;
    z-index: 9999; /* Ensures it sits on top of navigation bars and layout blocks */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 18, 26, 0.9); /* Deep dramatic tint window blackout */
    justify-content: center;
    align-items: center;
}

/* The Popup Image Display Frame */
.lightbox-content {
    max-width: 85%;
    max-height: 80vh;
    border: 4px solid #4a576d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    animation: zoomIn 0.25s ease-out; /* Clean pop transition animation */
}

/* Close Window UI Button 'X' */
.lightbox-close {
    position: absolute;
    top: 25px;
    right: 40px;
    color: #cbd5e0;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease;
}

.lightbox-close:hover {
    color: #ffffff;
}

/* Smooth entry animation */
@keyframes zoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

