/**
 * Gallery Styles - News, Photos, Videos
 *
 * @package    Apprenticeshiphq_Directory
 * @subpackage Apprenticeshiphq_Directory/public/css
 */

/* ==========================================================================
   Shared Gallery Styles
   ========================================================================== */

.ahq-gallery-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 40px 0;
}

/* Organization content within gallery headers should be left-aligned */
.ahq-gallery-header .ahq-org-content,
.ahq-gallery-header .ahq-organization-content {
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

.ahq-gallery-header h2 {
    color: #212529;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 15px;
}

.ahq-gallery-description,
.ahq-news-description {
    color: #6c757d;

    max-width: 600px;
    margin: 0 auto;
}

/* Loading Spinner */
.ahq-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a4d8f;
    border-radius: 0; /* Square design */
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   News Gallery
   ========================================================================== */

.ahq-news-gallery {
    padding-bottom: 40px;
}

.ahq-news-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 40px 0;
}

/* Organization content within news headers should be left-aligned */
.ahq-news-header .ahq-org-content,
.ahq-news-header .ahq-organization-content {
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

.ahq-news-header h2 {
    color: #212529;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 15px;
}

.ahq-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 0 40px;
    margin-bottom: 40px;
}

.ahq-news-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0; /* Square design */
    padding: 25px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ahq-news-card:hover {
    border-color: #1a4d8f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* News card with featured image */
.ahq-news-card-with-image .ahq-news-card-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    height: 100%;
}

.ahq-news-card-with-image .ahq-news-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ahq-news-card-with-image .ahq-news-card-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 0; /* Square design */
}

.ahq-news-card-with-image .ahq-news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ahq-news-card-with-image .ahq-news-card-image a:hover img {
    transform: scale(1.05);
}

/* Regular news card without image */
.ahq-news-card:not(.ahq-news-card-with-image) .ahq-news-card-inner {
    height: 100%;
}

.ahq-news-card:not(.ahq-news-card-with-image) .ahq-news-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ahq-news-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 15px;
    flex: 1;
}

.ahq-news-title a {
    color: #212529;
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ahq-news-title a:hover {
    color: #1a4d8f;
}

.ahq-news-title i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.9rem;
    opacity: 0.6;
}

.ahq-news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.ahq-news-tag {
    background: #e9ecef;
    border-radius: 0; /* Square design */
    color: #495057;
    font-size: 0.85rem;
    padding: 4px 12px;
}

.ahq-news-actions {
    margin-top: auto;
}

/* News Pagination */
.ahq-news-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 40px;
    margin-bottom: 20px;
}

.ahq-pagination-btn {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0; /* Square design */
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    transition: all 0.3s ease;
}

.ahq-pagination-btn:hover:not(:disabled) {
    background: #1a4d8f;
    border-color: #1a4d8f;
    color: #fff;
}

.ahq-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ahq-pagination-pages {
    display: flex;
    gap: 5px;
}

.ahq-pagination-page {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0; /* Square design */
    color: #495057;
    cursor: pointer;
    font-weight: 500;
    height: 40px;
    min-width: 40px;
    padding: 0 12px;
    transition: all 0.3s ease;
}

.ahq-pagination-page:hover {
    background: #e9ecef;
}

.ahq-pagination-page.ahq-page-active {
    background: #1a4d8f;
    border-color: #1a4d8f;
    color: #fff;
}

/* Load More Button */
.ahq-news-load-more {
    text-align: center;
    padding: 0 40px;
    display: none;
}

.ahq-load-more-btn {
    min-width: 200px;
}

/* ==========================================================================
   Photo Gallery
   ========================================================================== */

.ahq-photo-gallery {
    padding-bottom: 40px;
}

/* Photo Filters */
.ahq-photo-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0 40px;
}

.ahq-filter-btn {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0; /* Square design */
    color: #495057;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.ahq-filter-btn:hover {
    background: #e9ecef;
}

.ahq-filter-btn.ahq-filter-active {
    background: #1a4d8f;
    border-color: #1a4d8f;
    color: #fff;
}

/* Photo Grid */
.ahq-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0 40px;
}

.ahq-photo-item {
    opacity: 1;
    transition: all 0.3s ease;
}

.ahq-photo-item.ahq-hidden {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    pointer-events: none;
}

.ahq-photo-figure {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 0; /* Square design */
    background: #f8f9fa;
}

.ahq-photo-link {
    display: block;
    position: relative;
    cursor: zoom-in;
}

.ahq-photo-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.ahq-photo-link:hover .ahq-photo-img {
    transform: scale(1.05);
}

.ahq-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ahq-photo-link:hover .ahq-photo-overlay {
    opacity: 1;
}

.ahq-photo-overlay i {
    color: #fff;
    font-size: 2rem;
}

.ahq-photo-caption {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.9rem;
    padding: 10px 15px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.ahq-photo-figure:hover .ahq-photo-caption {
    transform: translateY(0);
}

/* No Photos Message */
.ahq-no-photos-message {
    text-align: center;
    padding: 60px 40px;
    color: #6c757d;
}

/* Photo Lightbox */
.ahq-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ahq-lightbox.ahq-lightbox-active {
    opacity: 1;
    visibility: visible;
}

.ahq-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.ahq-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0; /* Square design */
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.ahq-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ahq-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0; /* Square design */
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    height: 60px;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ahq-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ahq-lightbox-prev {
    left: 20px;
}

.ahq-lightbox-next {
    right: 20px;
}

.ahq-lightbox-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.ahq-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ahq-lightbox-image.ahq-loaded {
    opacity: 1;
}

.ahq-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ahq-lightbox-caption {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;

    padding: 15px 20px;
    text-align: center;
    margin-top: 20px;
}

.ahq-lightbox-counter {
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.8;
    text-align: center;
    margin-top: 10px;
}

/* ==========================================================================
   Video Gallery
   ========================================================================== */

.ahq-video-gallery {
    padding-bottom: 40px;
}

.ahq-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 0 40px;
}

.ahq-video-card {
    background: #fff;
    border-radius: 0; /* Square design */
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.ahq-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.ahq-video-thumbnail {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.ahq-video-thumb-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ahq-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a4d8f;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ahq-video-placeholder i {
    color: rgba(255, 255, 255, 0.3);
    font-size: 4rem;
}

.ahq-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 0; /* Square design */
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    height: 70px;
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ahq-video-play-btn:hover {
    background: #1a4d8f;
    transform: translate(-50%, -50%) scale(1.1);
}

.ahq-video-play-btn i {
    margin-left: 5px;
}

.ahq-video-duration {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0; /* Square design */
    color: #fff;
    font-size: 0.85rem;
    padding: 4px 8px;
}

.ahq-vimeo-icon {
    font-weight: 700;
    font-family: Arial, sans-serif;
}

.ahq-video-info {
    padding: 20px;
}

.ahq-video-title {
    color: #212529;

    font-weight: 600;
    margin: 0 0 10px;
}

.ahq-video-description {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Video Modal */
.ahq-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ahq-video-modal.ahq-video-modal-active {
    opacity: 1;
    visibility: visible;
}

.ahq-video-modal-content {
    background: #000;
    border-radius: 0; /* Square design */
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    max-width: 1200px;
    position: relative;
}

.ahq-video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0; /* Square design */
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.ahq-video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ahq-video-modal-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.ahq-video-modal-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
    flex: 1;
}

.ahq-video-modal-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ahq-video-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0; /* Square design */
    color: #fff;
    cursor: pointer;

    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ahq-video-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.ahq-video-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ahq-video-counter {
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.8;
}

.ahq-video-container {
    position: relative;
    background: #000;
}

.ahq-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
}

.ahq-video-wrapper iframe,
.ahq-video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ahq-video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.ahq-video-loading.ahq-loading-active {
    display: block;
}

.ahq-video-modal-description {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 15px 20px;
}

/* ==========================================================================
   Organization Content Left Alignment in Galleries
   ========================================================================== */

/* Ensure organization content is left-aligned in all gallery contexts */
.ahq-gallery-org-content,
.ahq-news-org-content,
.ahq-video-org-content,
.ahq-photo-org-content {
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

/* Organization logos in galleries */
.ahq-gallery-org-logo,
.ahq-news-org-logo,
.ahq-video-org-logo,
.ahq-photo-org-logo {
    align-self: flex-start !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Organization titles in galleries */
.ahq-gallery-org-title,
.ahq-news-org-title,
.ahq-video-org-title,
.ahq-photo-org-title {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Organization descriptions in galleries */
.ahq-gallery-org-description,
.ahq-news-org-description,
.ahq-video-org-description,
.ahq-photo-org-description {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* News card organization sections */
.ahq-news-card .ahq-org-section,
.ahq-news-item .ahq-org-section {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Video card organization sections */
.ahq-video-card .ahq-org-section,
.ahq-video-item .ahq-org-section {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Photo item organization sections */
.ahq-photo-item .ahq-org-section,
.ahq-photo-figure .ahq-org-section {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 991px) {
    .ahq-news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .ahq-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .ahq-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 767px) {
    .ahq-gallery-header,
    .ahq-news-header {
        padding: 30px 20px 0;
    }
    
    .ahq-gallery-header h2,
    .ahq-news-header h2 {
        font-size: 1.5rem;
    }
    
    .ahq-news-grid,
    .ahq-photo-grid,
    .ahq-video-grid {
        padding: 0 20px;
        gap: 20px;
    }
    
    .ahq-news-grid {
        grid-template-columns: 1fr;
    }
    
    /* News cards with images on mobile - image above content */
    .ahq-news-card-with-image .ahq-news-card-inner {
        flex-direction: column;
    }
    
    .ahq-news-card-with-image .ahq-news-card-image {
        width: 100%;
        height: 200px;
        margin-bottom: 15px;
        order: -1; /* Move image above content */
    }
    
    .ahq-news-card-with-image .ahq-news-card-content {
        order: 1; /* Ensure content comes after image */
    }
    
    .ahq-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .ahq-video-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hide pagination on mobile, show load more */
    .ahq-news-pagination {
        display: none;
    }
    
    .ahq-news-load-more {
        display: block;
    }
    
    /* Lightbox mobile adjustments */
    .ahq-lightbox-nav {
        height: 50px;
        width: 50px;
        font-size: 1.2rem;
    }
    
    .ahq-lightbox-prev {
        left: 10px;
    }
    
    .ahq-lightbox-next {
        right: 10px;
    }
    
    /* Video modal mobile adjustments */
    .ahq-video-modal-content {
        margin: 20px;
    }
    
    .ahq-video-modal-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .ahq-video-modal-title {

    }
}

@media (max-width: 480px) {
    .ahq-photo-filters {
        padding: 0 20px;
    }
    
    .ahq-filter-btn {
        font-size: 0.85rem;
        padding: 6px 15px;
    }
}