/* =============================================
   Activity Gallery Plugin v2.0 — Frontend Styles
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* ── Grid Layout ── */
.ag-grid {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

.ag-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ag-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ag-cols-1 { grid-template-columns: 1fr; }

@media (max-width: 1024px) {
    .ag-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .ag-cols-3,
    .ag-cols-2 { grid-template-columns: 1fr; }
}

/* ── Card ── */
.ag-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    display: flex;
    flex-direction: column;
}

.ag-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.14);
}

/* ── Card Thumbnail ── */
/* Use aspect-ratio instead of padding-top hack to avoid whitespace gap */
.ag-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    background: #e5e7eb;
    flex-shrink: 0;       /* prevent flex from squishing the thumb */
}

.ag-card-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;       /* kill inline whitespace */
    vertical-align: top;  /* belt-and-suspenders */
    transition: transform 0.3s ease;
    margin: 0;
    padding: 0;
    border: none;
}

.ag-card:hover .ag-card-thumb img {
    transform: scale(1.04);
}

/* ── Badge: image count — perfect circle ── */
.ag-img-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: rgba(0, 0, 0, 0.60);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50%;   /* always circle */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ── Card Body ── */
.ag-card-body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ag-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.35;
}

.ag-card-date {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    margin: 0;
}

.ag-card-excerpt {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #4b5563;
    line-height: 1.6;
    margin: 4px 0 0;
    flex: 1;
}

.ag-btn-view {
    margin-top: 14px;
    background: #001E4A;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-start;
}

.ag-btn-view:hover { background: #002d6e; }

/* ── Load More ── */
.ag-load-more-wrap {
    text-align: center;
    margin-top: 32px;
}

.ag-btn-load-more {
    background: #001E4A;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px 36px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ag-btn-load-more:hover {
    background: #002d6e;
    transform: translateY(-1px);
}

.ag-btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ag-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ag-spin 0.7s linear infinite;
    display: none;
    flex-shrink: 0;
}

.ag-spinner.visible { display: block; }

@keyframes ag-spin {
    to { transform: rotate(360deg); }
}

/* ── No Activities ── */
.ag-no-activities {
    text-align: center;
    color: #9ca3af;
    padding: 40px 0;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.ag-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.ag-lightbox.is-open {
    display: flex;
}

.ag-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.78);
    cursor: pointer;
}

.ag-lightbox-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: min(920px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: auto 1fr;
    z-index: 1;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

@media (max-width: 700px) {
    .ag-lightbox-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
}

/* Close button */
.ag-lightbox-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.ag-lightbox-close:hover { background: #e00; }

/* Gallery section */
.ag-lightbox-gallery {
    grid-column: 1;
    grid-row: 1 / 3;
    background: #111;
    border-radius: 16px 0 0 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 700px) {
    .ag-lightbox-gallery {
        grid-column: 1;
        grid-row: 1;
        border-radius: 16px 16px 0 0;
        min-height: 240px;
    }
}

/* Main image */
.ag-lightbox-main-img-wrap {
    position: relative;
    flex: 1;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#ag-lightbox-main {
    max-width: 100%;
    max-height: 460px;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s;
}

/* Prev / Next arrows */
.ag-gallery-prev,
.ag-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}

.ag-gallery-prev { left: 10px; }
.ag-gallery-next { right: 10px; }
.ag-gallery-prev:hover,
.ag-gallery-next:hover { background: rgba(0,0,0,0.75); }
.ag-gallery-prev.hidden,
.ag-gallery-next.hidden { display: none; }

/* Thumbnails strip */
.ag-lightbox-thumbs {
    display: flex;
    gap: 6px;
    padding: 10px;
    overflow-x: auto;
    background: #1a1a1a;
    flex-shrink: 0;
}

.ag-lightbox-thumbs img {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.55;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
    flex-shrink: 0;
    display: block;
}

.ag-lightbox-thumbs img.active,
.ag-lightbox-thumbs img:hover {
    opacity: 1;
    border-color: #2563eb;
}

/* Info section */
.ag-lightbox-info {
    grid-column: 2;
    grid-row: 1 / 3;
    padding: 30px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

@media (max-width: 700px) {
    .ag-lightbox-info {
        grid-column: 1;
        grid-row: 2;
        padding: 20px;
    }
}

#ag-lightbox-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.35;
    padding-right: 28px;
}

.ag-lightbox-date {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
}

.ag-lightbox-desc {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
    flex: 1;
}

.ag-lightbox-desc p { margin: 0 0 10px; }
