/* Media Page Styles */

/* Hero Section */
.media-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 100px 0;
    color: white;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 1;
    color: #e0e0e0;
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #1e3a8a;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #f59e0b;
    border-radius: 2px;
}

/* Photo Gallery */
.photo-gallery {
    padding: 60px 0;
    background: #f9fafb;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-6);
}

.gallery-item {
    overflow: hidden;
    transition: transform 0.3s;
    /* Removed background, shadow, and border-radius for a cleaner look */
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Show full image without cropping */
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #3b82f6;
    background: transparent;
    color: #3b82f6;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: #3b82f6;
    color: white;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.image-placeholder i {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* Default gallery images are cropped to fit */
.photo-gallery .gallery-item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    aspect-ratio: 1 / 1; /* Enforce a square aspect ratio */
    transition: transform 0.3s ease;
}

.photo-gallery .gallery-item:hover {
    transform: scale(1.05);
}

.photo-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop image to cover the container */
    display: block;
}

.load-more-container {
    text-align: center;
    margin-top: 40px;
}

/* Print media gallery with a responsive, masonry-style layout */
.print-media-gallery .gallery-grid {
    column-count: 4; /* Default for large screens */
    column-gap: 20px;
}

.print-media-gallery .gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid; /* Prevents images from breaking across columns */
}

.print-media-gallery .gallery-item img {
    width: 100%;
    height: auto; /* Height is automatic to maintain aspect ratio */
    display: block;
}

/* Video Gallery */
.video-gallery {
    padding: 60px 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.video-item .video-link {
    text-decoration: none;
    color: inherit;
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1f2937;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    transition: background-color 0.3s ease;
    background-size: cover;
    background-position: center;
    position: relative;
}

.video-placeholder i {
    z-index: 2;
    transition: opacity 0.3s ease;
}

.video-link:hover .video-placeholder {
    background-color: #c21a1a; /* YouTube Red */
}

.video-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-link:hover .video-placeholder::after {
    opacity: 0;
}

.video-item h3 {
    margin-top: 1rem;
    font-size: 1.25rem;
    color: #1e3a8a;
}

/* ICCDR Videos Section */
.iccdr-videos-section {
    padding: 60px 0;
    background: #ffffff; /* White background to differentiate */
}

/* Print Media Gallery */
.print-media-gallery {
    padding: 60px 0;
    background: #f9fafb; /* Alternating background color */
}

/* In the News Section */
.in-the-news {
    padding: 60px 0;
    background: #f9fafb;
}

.news-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.news-item {
    background: white;
    padding: 20px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.news-item:hover {
    background: #1e3a8a;
    color: white;
    transform: translateY(-5px);
}

.iccdr-videos-section video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover; /* Ensures video fills the container */
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #000; /* Adds a black background for videos that don't load immediately */
}

.in-the-news-section {
    padding: var(--space-16) 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.news-card {
    background-color: var(--white);
    padding: var(--space-6);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-card h4 {
    margin-bottom: var(--space-4);
    font-size: 1.1rem;
    flex-grow: 1;
}

.news-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.news-card p {
    margin-bottom: var(--space-4);
    color: var(--gray-700);
}

.read-more-link {
    display: inline-block;
    margin-top: auto;
    font-weight: 700;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive adjustments for the print media gallery */
@media (max-width: 1200px) {
    .print-media-gallery .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .print-media-gallery .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .print-media-gallery .gallery-grid {
        column-count: 1;
    }
}
