/* Main video container – responsive 16:9 */
.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 ratio for video, image will adapt */
    background-color: #000; /* Background for when image loads or if iframe fails */
}

.video-container iframe,
.video-container img#player-placeholder-image { /* Target the placeholder image by ID */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover; /* Ensures image covers the area, might crop */
}

/* Initially hide the iframe and show the placeholder */
.video-container iframe#main-video {
    display: none;
}
.video-container img#player-placeholder-image {
    display: block; 
}

/* When a video is active, hide placeholder and show iframe */
.video-container.video-active iframe#main-video {
    display: block;
}
.video-container.video-active img#player-placeholder-image {
    display: none;
}


/* Button that might have been confused with notice-text */
.link-button { 
    display: block;
    text-align: center;
    padding: 8px;
    margin: 0px auto;
    background-color: #f89304; 
    color: #000; 
    font-size: 14px; 
    font-weight: bold;
    text-decoration: none;
    border-radius: 0; 
    width: 100%; 
    border: none;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.7); 
    transition: all 0.3s ease; 
}

.link-button:hover {
    background-color: #007bff; 
    color: #fff; 
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.8); 
}

/* Actual notice text style */
.notice-text { 
    background-color: #333;
    color: #ffcc00; 
    text-align: center;
    padding: 8px 0;
    font-size: 14px;
    font-weight: bold;
    width: 100%;
    border-bottom: 2px solid #ffcc00;
    margin-bottom: 10px; /* Added margin to separate from gallery */
}

/* Gallery */
.gallery {
    display: grid;
    background-color: #000;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* More responsive columns */
    gap: 10px; /* Increased gap slightly for better separation with text */
    overflow-y: scroll !important; 
    overflow-x: hidden;
    max-height: 400px; /* Adjusted max-height if text makes items taller */
    width: 100%; 
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ffcc00 #333;
    border-radius: 0 0 10px 10px; 
    -webkit-overflow-scrolling: touch; 
}

.gallery-item {
    background-color: #222; /* Darker background for each item */
    border-radius: 5px;
    overflow: hidden; /* To keep rounded corners with image */
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 204, 0, 0.3);
}

.gallery-item img {
    width: 100%;   
    height: 100px; 
    object-fit: cover; 
    display: block; /* Remove extra space below image */
}

.gallery-item-info {
    padding: 8px;
    color: #fff;
    text-align: center;
    flex-grow: 1; /* Allows this section to take available space if items have different text lengths */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers text vertically if space allows */
}

.gallery-item-title {
    font-size: 0.9em; /* Adjusted for better fit */
    font-weight: bold;
    color: #ffcc00; /* Yellow title */
    margin-bottom: 4px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-description {
    font-size: 0.75em; /* Adjusted for better fit */
    color: #ccc;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(0.75em * 1.3 * 2); /* Approximate height for 2 lines to help alignment */
}

.gallery::-webkit-scrollbar {
    width: 12px;
}

.gallery::-webkit-scrollbar-thumb {
    background: #ffcc00;
    border-radius: 6px;
}