/* ========================================
   Artwork Gallery - Complete Styles
   Artist page + Modal (Left 1/3 Info + Right 2/3 Image) + Zoom
   ======================================== */

.ag-artist-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    color: #1a1a1a;
    max-width: 100%;
    margin: 0 auto;
}

/* ========================================
   Sticky Header Nav
   ======================================== */
.ag-sticky-nav {
    position: sticky; top: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid #eee;
    padding: 18px 40px; transition: box-shadow 0.3s ease;
}
.ag-sticky-nav.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
.ag-sticky-nav-inner {
    display: flex; align-items: center; gap: 30px;
    max-width: 1400px; margin: 0 auto;
}
.ag-sticky-nav-title { font-size: 18px; font-weight: 600; color: #111; margin-right: auto; }
.ag-sticky-nav-inner a {
    text-decoration: none; color: #999; font-size: 13px;
    letter-spacing: 0.5px; text-transform: lowercase;
    padding: 4px 0; border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.ag-sticky-nav-inner a:hover,
.ag-sticky-nav-inner a.active { color: #111; border-bottom-color: #111; }

/* ========================================
   Overview Section
   ======================================== */
.ag-overview-section { padding: 0; }
.ag-overview-layout { display: flex; min-height: 60vh; max-width: 1400px; margin: 0 auto; }
.ag-overview-image { flex: 0 0 45%; position: relative; }
.ag-overview-image img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 500px; }
.ag-photo-credit {
    position: absolute; bottom: 16px; left: 16px;
    font-size: 11px; color: #999; background: rgba(255,255,255,0.8); padding: 4px 8px; margin: 0;
}
.ag-overview-text { flex: 0 0 55%; padding: 60px 50px 40px; display: flex; flex-direction: column; justify-content: center; }
.ag-bio-text { font-size: 14px; line-height: 1.8; color: #444; margin-bottom: 24px; }
.ag-bio-text p { margin: 0 0 16px; }
.ag-cv-link a {
    display: inline-block; text-decoration: none; color: #333; font-size: 13px;
    letter-spacing: 0.5px; padding-bottom: 2px; border-bottom: 1px solid #ccc;
    transition: border-color 0.2s;
}
.ag-cv-link a:hover { border-bottom-color: #333; }
.ag-share-btn {
    margin-top: 20px; background: none; border: none; color: #aaa; font-size: 13px;
    cursor: pointer; padding: 8px 0; text-align: left; letter-spacing: 0.5px;
}
.ag-share-btn:hover { color: #333; }

/* ========================================
   Section Headings
   ======================================== */
.ag-section { padding: 40px; max-width: 1400px; margin: 0 auto; }
.ag-section-heading {
    font-size: 20px; font-weight: 400; text-transform: lowercase;
    margin: 0 0 30px; color: #111; letter-spacing: 0.5px;
}

/* ========================================
   Works Grid - Flexbox (natural flow, no gaps)
   ======================================== */
.ag-works-section { padding-top: 20px; }
.ag-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    margin: 0;
}
.ag-columns-2 .ag-artwork-card { width: calc(50% - 5px); }
.ag-columns-3 .ag-artwork-card { width: calc(33.333% - 6.67px); }
.ag-columns-4 .ag-artwork-card { width: calc(25% - 7.5px); }
.ag-columns-5 .ag-artwork-card { width: calc(20% - 8px); }
.ag-no-works { color: #999; font-size: 14px; padding: 40px 0; width: 100%; }

/* Artwork Card */
.ag-artwork-card { cursor: pointer; overflow: hidden; position: relative; }
.ag-artwork-card:hover .ag-card-image img { transform: scale(1.03); }
.ag-card-image { position: relative; width: 100%; overflow: hidden; background: #f5f5f5; }
.ag-card-image img { width: 100%; height: auto; display: block; transition: transform 0.4s ease; }
.ag-card-placeholder { width: 100%; aspect-ratio: 3/4; background: #e8e8e8; }
.ag-card-info { padding: 6px 0 2px; font-size: 13px; line-height: 1.5; color: #333; }
.ag-card-title { }
.ag-card-year { color: #888; }

/* Scroll fade-in */
.ag-artwork-card { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.ag-artwork-card.ag-visible { opacity: 1; transform: translateY(0); }

/* ========================================
   MODAL OVERLAY
   ======================================== */
.ag-modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff;
    z-index: 99998;
}
.ag-modal-overlay.active { display: block; }

.ag-modal-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Left panel: Info (1/3) */
.ag-modal-left {
    flex: 0 0 33.333%;
    overflow-y: auto;
    border-right: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}
.ag-modal-inner {
    padding: 60px 40px 40px;
    width: 100%;
}

/* Right panel: Image (2/3) */
.ag-modal-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px 60px 40px;
    cursor: zoom-in;
    background: #fafafa;
    position: relative;
}
.ag-modal-right img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
}

/* Close button */
.ag-modal-close {
    position: fixed; top: 18px; right: 30px;
    width: 44px; height: 44px;
    background: none; border: none;
    font-size: 36px; color: #333;
    cursor: pointer; z-index: 100001;
    line-height: 1; font-weight: 300;
    transition: opacity 0.2s;
}
.ag-modal-close:hover { opacity: 0.4; }

/* Edge navigation arrows (faint) */
.ag-modal-edge {
    position: fixed; top: 50%; transform: translateY(-50%);
    width: 48px; height: 80px;
    background: none; border: none;
    font-size: 38px; color: #ccc;
    cursor: pointer; z-index: 100000;
    transition: color 0.25s;
    font-weight: 200; font-family: serif;
}
.ag-modal-edge:hover { color: #666; }
.ag-modal-prev { left: 6px; }
.ag-modal-next { right: 6px; }

/* ========================================
   Modal Info Content Styles
   ======================================== */
.ag-modal-artist {
    font-size: 22px; font-weight: 600;
    margin: 0 0 6px; color: #111;
}
.ag-modal-title {
    font-size: 16px; font-style: italic;
    color: #555; margin: 0 0 18px; line-height: 1.5;
}
.ag-modal-dims { font-size: 13px; color: #999; margin-bottom: 8px; line-height: 1.7; }
.ag-modal-medium-text {
    font-size: 13px; color: #777; margin-bottom: 28px;
    padding-bottom: 24px; border-bottom: 1px solid #eee;
}
.ag-enquire-btn {
    display: inline-block; padding: 10px 30px;
    border: 1px solid #333; background: transparent; color: #333;
    font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
    cursor: pointer; transition: all 0.25s ease; margin-bottom: 36px;
}
.ag-enquire-btn:hover { background: #333; color: #fff; }

.ag-modal-thumbs-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
    color: #aaa; margin-bottom: 14px; font-weight: 500;
}
.ag-modal-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.ag-modal-thumb {
    width: 60px; height: 60px; object-fit: cover; cursor: pointer;
    border: 2px solid transparent; transition: border-color 0.2s, opacity 0.2s;
}
.ag-modal-thumb:hover { opacity: 0.7; }
.ag-modal-thumb.active { border-color: #333; }

.ag-modal-readmore {
    display: block; width: 100%; padding: 16px 0;
    border: none; border-top: 1px solid #eee; background: transparent;
    color: #888; font-size: 13px; text-align: left; cursor: pointer; letter-spacing: 0.5px;
}
.ag-modal-readmore:hover { color: #333; }
.ag-modal-content { display: none; padding: 18px 0 0; font-size: 14px; line-height: 1.8; color: #666; }
.ag-modal-content.expanded { display: block; }
.ag-modal-share-btn {
    margin-top: 16px; background: none; border: none; color: #aaa;
    font-size: 13px; cursor: pointer; padding: 8px 0; letter-spacing: 0.5px;
}
.ag-modal-share-btn:hover { color: #333; }

/* ========================================
   Image Zoom Overlay
   ======================================== */
.ag-zoom-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.96);
    z-index: 99999; align-items: center; justify-content: center;
}
.ag-zoom-overlay.active { display: flex; }
.ag-zoom-inner { position: relative; display: flex; align-items: center; justify-content: center; max-width: 92vw; max-height: 92vh; }
.ag-zoom-inner img { max-width: 90vw; max-height: 90vh; object-fit: contain; display: block; }
.ag-zoom-close {
    position: fixed; top: 22px; right: 30px; width: 44px; height: 44px;
    background: none; border: none; font-size: 38px; color: #fff;
    cursor: pointer; z-index: 100001; line-height: 1; font-weight: 200;
}
.ag-zoom-close:hover { opacity: 0.5; }
.ag-zoom-prev, .ag-zoom-next {
    position: fixed; top: 50%; transform: translateY(-50%);
    width: 60px; height: 100px; background: none; border: none;
    font-size: 40px; color: #fff; cursor: pointer; z-index: 100001;
    font-weight: 200;
}
.ag-zoom-prev:hover, .ag-zoom-next:hover { opacity: 0.5; }
.ag-zoom-prev { left: 20px; } .ag-zoom-next { right: 20px; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .ag-overview-layout { flex-direction: column; }
    .ag-overview-image { flex: none; }
    .ag-overview-image img { min-height: 300px; }
    .ag-overview-text { flex: none; padding: 30px 20px; }
    .ag-sticky-nav { padding: 14px 20px; }
    .ag-sticky-nav-inner { gap: 16px; overflow-x: auto; }
    .ag-section { padding: 24px 20px; }
    .ag-columns-3 .ag-artwork-card,
    .ag-columns-4 .ag-artwork-card,
    .ag-columns-5 .ag-artwork-card { width: calc(50% - 5px); }
    .ag-modal-container { flex-direction: column-reverse; }
    .ag-modal-left { flex: none; border-right: none; border-top: 1px solid #f0f0f0; }
    .ag-modal-inner { padding: 30px 20px; }
    .ag-modal-right { flex: none; padding: 40px 20px 20px; min-height: 50vh; }
    .ag-modal-edge { display: none; }
}

@media (max-width: 480px) {
    .ag-columns-2, .ag-columns-3, .ag-columns-4, .ag-columns-5 { column-count: 1; }
}
