/* Core Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --card-bg: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    
    --shadow: 0 8px 20px rgba(0,0,0,0.08);
}

body.dark-mode {
    --card-bg: #2d2d2d;
    --text-main: #f0f0f0;
    --text-muted: #bbbbbb;
    --shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.play-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    overflow: hidden;
}

.play-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* IMAGE INTEGRITY: Maintain original aspect ratio */
.play-featured-image {
    width: 100%;
    max-width: 100%;
}

.play-featured-image img {
    width: 100%;
    height: auto; /* Keeps original aspect ratio */
    max-height: 500px; /* Prevents ultra-tall images from breaking layout */
    object-fit: contain; /* Shows full image without cropping */
    border-radius: 8px;
    display: block;
    background: rgba(0,0,0,0.02); /* Subtle placeholder tint */
}

/* Ensure the details area fills the space if thumbnails are missing */
.play-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* The comments will push down as much as needed */
.play-comments {
    flex-grow: 1; 
    margin-bottom: 1rem;
}

/* Thumbnails will stay at the bottom of the text area if they exist */
.play-other-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto; /* Pushes thumbnails to the bottom of the flex container */
    padding-top: 1rem;
}

.thumbnail-wrapper {
    flex: 0 1 auto; /* Don't force them to grow, keep original size */
    max-height: 100px; /* Optional: limit thumbnail height for consistency */
}

.thumbnail-wrapper img {
    max-height: 100px;
    width: auto; /* Keeps ratio */
    border-radius: 4px;
}

.thumbnail-wrapper:hover {
    transform: scale(1.05);
}

.thumbnail-wrapper img {
    width: 100%;
    height: auto; /* Respects original ratio */
    display: block;
}

/* Buttons and Typography */
.play-header h2 { margin: 0; color: var(--text-main); font-size: 1.75rem; }
.play-date { color: var(--accent); font-weight: bold; margin-bottom: 1rem; }
.play-comments { color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; }

.button-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1rem;
}

.btn {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-weight: bold;
}

/* Desktop: Side-by-side layout */
@media (min-width: 992px) {
    .play-content {
        flex-direction: row;
        align-items: flex-start;
    }

    .play-featured-image {
        flex: 0 0 40%; /* Featured image takes 40% width */
    }

    .button-container {
        flex-direction: row;
    }
    
    .btn {
        padding: 0 2rem;
    }
}


/* The Header Row */
.play-header {
    display: flex;
    justify-content: space-between; /* Pushes text left, buttons right */
    align-items: flex-start;        /* Aligns them to the top */
    gap: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

/* Sub-column 1: Title & Year */
.header-text {
    flex: 1; /* Takes up available space */
}

/* Sub-column 2: Buttons */
.button-container {
    display: flex;
    flex-direction: row; /* Side by side buttons */
    gap: 0.5rem;
    flex-shrink: 0;      /* Prevents buttons from squishing */
}

/* Button Styling Refinement */
.btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    min-height: 40px;    /* Proper touch target */
    white-space: nowrap; /* Keeps button text on one line */
    /* ... your other styles ... */
}

.btn-admin {
    background: #444 !important;
}

/* Mobile Responsive: Stack them if the screen is too narrow */
@media (max-width: 600px) {
    .play-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .button-container {
        width: 100%;
    }
    
    .btn {
        flex: 1; /* Buttons take equal width on mobile */
        text-align: center;
    }
}