/**
 * Archihub Projects Section - Compact Grid with Modal
 * 
 * 4-column card grid on desktop, responsive stacking on smaller screens.
 * Click card to open modal with full gallery and project details.
 * 
 * @package Archihub
 * @since 0.2.3
 */

/* ========================================
   PROJECTS GRID
   ======================================== */

.archihub-section--projects-compact {
    margin: 48px 0;
    padding: 0 24px;
}

.archihub-projects-header {
    margin-bottom: 32px;
}

.archihub-section-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.archihub-projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Project Card */
.archihub-project-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.archihub-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.archihub-project-card.featured {
    border: 2px solid #f59e0b;
}

.archihub-project-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f59e0b;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.archihub-project-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background: #f3f4f6;
}

.archihub-project-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.archihub-project-card:hover .archihub-project-thumb img {
    transform: scale(1.05);
}

.archihub-project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.archihub-project-card:hover .archihub-project-overlay {
    opacity: 1;
}

.archihub-project-overlay i {
    font-size: 32px;
    color: #fff;
}

.archihub-project-info {
    padding: 16px;
}

.archihub-project-info h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.archihub-project-year {
    font-size: 13px;
    color: #6b7280;
}

/* ========================================
   PROJECT MODAL
   ======================================== */

.archihub-project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.archihub-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
}

.archihub-modal-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.archihub-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.archihub-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.archihub-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
}

.archihub-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.archihub-modal-header h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.archihub-featured-tag {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.archihub-featured-tag i {
    color: #f59e0b;
}

.archihub-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.archihub-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #4b5563;
}

.archihub-meta-item strong {
    font-weight: 600;
    color: #111827;
}

.archihub-meta-item i {
    color: #6b7280;
}

.archihub-meta-item.status-built { color: #059669; }
.archihub-meta-item.status-construction { color: #f59e0b; }
.archihub-meta-item.status-design { color: #3b82f6; }
.archihub-meta-item.status-concept { color: #8b5cf6; }

/* Modal Gallery */
.archihub-modal-gallery {
    margin-bottom: 32px;
    position: relative;
}

.archihub-modal-gallery-main {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.archihub-gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.archihub-gallery-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.archihub-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.archihub-modal-gallery-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 18px;
    color: #111827;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.archihub-modal-gallery-nav button:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.archihub-gallery-prev {
    left: 16px;
}

.archihub-gallery-next {
    right: 16px;
}

.archihub-modal-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding: 4px 0;
}

.archihub-gallery-thumb-item {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    border: 2px solid transparent;
}

.archihub-gallery-thumb-item.active {
    opacity: 1;
    border-color: #0a6896;
}

.archihub-gallery-thumb-item:hover {
    opacity: 1;
}

.archihub-gallery-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Description */
.archihub-modal-description {
    margin-bottom: 24px;
}

.archihub-modal-description h3 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px;
}

.archihub-modal-description p {
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 12px;
}

/* Modal Details */
.archihub-modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.archihub-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.archihub-detail-item strong {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.archihub-detail-item span {
    font-size: 15px;
    color: #111827;
}

/* Modal Tags */
.archihub-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.archihub-tag {
    background: #e0f2fe;
    color: #075985;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1199px) {
    .archihub-projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .archihub-projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .archihub-section--projects-compact {
        padding: 0 16px;
        margin: 32px 0;
    }

    .archihub-modal-container {
        width: 95%;
        margin: 2.5vh auto;
        max-height: 95vh;
    }

    .archihub-modal-content {
        padding: 24px 20px;
    }

    .archihub-modal-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 767px) {
    .archihub-projects-grid {
        grid-template-columns: 1fr;
    }

    .archihub-modal-details {
        grid-template-columns: 1fr;
    }
}
