/* ==========================================================
   Astrophoto Gallery Styles
   Add to your child theme's style.css or enqueue separately
   ========================================================== */

/* Page header */
.ag-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 2rem 2rem 1rem;
}

.ag-page-title {
    font-size: 28px;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
}

.ag-page-count {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* Grid */
.ag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    padding: 1rem 2rem 3rem;
}

/* Card */
.ag-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #0a0a12;
    cursor: pointer;
}

.ag-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.ag-thumb:hover {
    opacity: 0.88;
}

.ag-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 13px;
}

/* Info button on card */
.ag-info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    font-family: serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.15s ease;
    line-height: 1;
}

.ag-info-btn:hover {
    background: rgba(80, 60, 160, 0.8);
}

/* Name bar at bottom of card */
.ag-name-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 12px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    pointer-events: none;
}

.ag-name-bar p {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 500;
    color: #eeeeee;
}

.ag-name-bar span {
    font-size: 11px;
    color: #aaaaaa;
}

/* Slide-in data panel on card */
.ag-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 64%;
    background: rgba(10, 8, 22, 0.94);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    overflow-y: auto;
    padding: 12px 12px 16px 14px;
    box-sizing: border-box;
    border-left: 0.5px solid rgba(120, 100, 200, 0.3);
}

.ag-panel.open {
    transform: translateX(0);
}

.ag-panel-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: #777;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
}

.ag-panel-close:hover {
    color: #ccc;
}

.ag-panel-title {
    font-size: 13px;
    font-weight: 500;
    color: #eeeeee;
    margin: 18px 0 2px;
}

.ag-panel-sub {
    font-size: 10px;
    color: #8877bb;
    margin: 0 0 2px;
}

.ag-panel-also {
    font-size: 10px;
    color: #666677;
    margin: 0;
}

/* Section labels */
.ag-section-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6655aa;
    margin: 10px 0 5px;
}

/* Key / value rows */
.ag-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    padding: 2px 0;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
}

.ag-row-notes {
    align-items: flex-start;
    flex-wrap: wrap;
}

.ag-row-notes .ag-val {
    text-align: left;
    flex: 1 1 100%;
    padding-top: 2px;
    color: #aaaacc;
}

.ag-key {
    font-size: 10px;
    color: #667788;
    white-space: nowrap;
    flex-shrink: 0;
}

.ag-val {
    font-size: 10px;
    color: #ccccdd;
    text-align: right;
}

/* Empty state */
.ag-empty {
    padding: 3rem 2rem;
    color: #666;
    font-size: 14px;
}

/* ==========================================================
   Lightbox
   ========================================================== */

.ag-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.93);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

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

.ag-lightbox-wrap {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ag-lb-img {
    display: block;
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 8px;
    object-fit: contain;
}

/* Close button */
.ag-lb-close {
    position: absolute;
    top: -38px;
    right: 0;
    background: none;
    border: none;
    color: #aaaaaa;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.ag-lb-close:hover {
    color: #ffffff;
}

/* Info button on lightbox */
.ag-lb-info-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    font-family: serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    transition: background 0.15s ease;
    line-height: 1;
}

.ag-lb-info-btn:hover {
    background: rgba(80, 60, 160, 0.85);
}

/* Lightbox slide-in panel */
.ag-lb-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 300px;
    max-width: 50%;
    background: rgba(10, 8, 22, 0.94);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 25;
    overflow-y: auto;
    padding: 14px 14px 20px 16px;
    box-sizing: border-box;
    border-left: 0.5px solid rgba(120, 100, 200, 0.3);
    border-radius: 0 8px 8px 0;
}

.ag-lb-panel.open {
    transform: translateX(0);
}

/* Responsive */
@media ( max-width: 768px ) {
    .ag-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        padding: 1rem;
        gap: 10px;
    }

    .ag-header {
        padding: 1.5rem 1rem 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .ag-panel {
        width: 80%;
    }

    .ag-lb-panel {
        width: 80%;
        max-width: 80%;
    }
}

@media ( max-width: 480px ) {
    .ag-grid {
        grid-template-columns: 1fr;
    }
}
