/* =====================================================
   EASTON CAIN GALLERY CATALOG — EMERALD THINKER GALLERY
   Matches emeraldthinker.com aesthetic:
   Refined luxury / editorial / deep forest greens + cream
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

:root {
    --ec-green:       #4a7c59;
    --ec-green-dark:  #2d5240;
    --ec-green-light: #e8f0eb;
    --ec-gold:        #c9a84c;
    --ec-cream:       #f9f7f3;
    --ec-white:       #ffffff;
    --ec-charcoal:    #1a1a1a;
    --ec-grey:        #6b6b6b;
    --ec-light-grey:  #e2e2de;
    --ec-border:      #ddd8d0;
    --ec-font-serif:  'Cormorant Garamond', Georgia, serif;
    --ec-font-sans:   'Montserrat', 'Helvetica Neue', sans-serif;
    --ec-shadow:      0 4px 24px rgba(0,0,0,0.10);
    --ec-shadow-lg:   0 12px 48px rgba(0,0,0,0.16);
    --ec-radius:      4px;
    --ec-transition:  0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── WRAPPER ─────────────────────────────────────── */
#ec-catalog-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
    font-family: var(--ec-font-sans);
    color: var(--ec-charcoal);
    background: var(--ec-cream);
}

/* ── HEADER ──────────────────────────────────────── */
.ec-catalog-header {
    text-align: center;
    padding: 64px 24px 40px;
    border-bottom: 1px solid var(--ec-border);
    margin-bottom: 40px;
}

.ec-catalog-label {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ec-green);
    margin: 0 0 16px;
}

.ec-catalog-title {
    font-family: var(--ec-font-serif);
    font-size: clamp(42px, 6vw, 72px);
    font-weight: 300;
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin: 0 0 6px;
    color: var(--ec-charcoal);
}

.ec-catalog-subtitle {
    font-family: var(--ec-font-serif);
    font-size: clamp(16px, 2.2vw, 22px);
    font-weight: 300;
    font-style: italic;
    color: var(--ec-grey);
    margin: 0 0 12px;
}

.ec-catalog-meta-line {
    font-family: var(--ec-font-sans);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-grey);
    margin: 0 0 28px;
}

.ec-catalog-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 28px;
    max-width: 320px;
}

.ec-catalog-divider span {
    flex: 1;
    height: 1px;
    background: var(--ec-border);
}

.ec-catalog-intro {
    font-family: var(--ec-font-serif);
    font-size: 17px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--ec-grey);
    max-width: 660px;
    margin: 0 auto;
}

/* ── FILTER BAR ──────────────────────────────────── */
.ec-filter-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.ec-filter-btn {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 9px 20px;
    border: 1px solid var(--ec-border);
    background: var(--ec-white);
    color: var(--ec-grey);
    cursor: pointer;
    border-radius: 2px;
    transition: var(--ec-transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ec-filter-btn:hover {
    border-color: var(--ec-green);
    color: var(--ec-green);
}

.ec-filter-btn.active {
    background: var(--ec-green);
    border-color: var(--ec-green);
    color: var(--ec-white);
}

.ec-filter-count {
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 9px;
}

.ec-filter-btn.active .ec-filter-count {
    background: rgba(255,255,255,0.3);
}

/* ── GRID ────────────────────────────────────────── */
.ec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

/* ── CARD ────────────────────────────────────────── */
.ec-card {
    background: var(--ec-white);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    transition: var(--ec-transition);
    box-shadow: var(--ec-shadow);
    animation: ec-fade-in 0.55s ease both;
}

.ec-card:hover {
    box-shadow: var(--ec-shadow-lg);
    transform: translateY(-3px);
    border-color: var(--ec-green-light);
}

.ec-card.ec-hidden {
    display: none;
}

@keyframes ec-fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger delays */
.ec-card:nth-child(1)  { animation-delay: 0.05s; }
.ec-card:nth-child(2)  { animation-delay: 0.10s; }
.ec-card:nth-child(3)  { animation-delay: 0.15s; }
.ec-card:nth-child(4)  { animation-delay: 0.20s; }
.ec-card:nth-child(5)  { animation-delay: 0.25s; }
.ec-card:nth-child(6)  { animation-delay: 0.30s; }
.ec-card:nth-child(7)  { animation-delay: 0.35s; }
.ec-card:nth-child(8)  { animation-delay: 0.40s; }
.ec-card:nth-child(9)  { animation-delay: 0.45s; }
.ec-card:nth-child(10) { animation-delay: 0.50s; }
.ec-card:nth-child(n+11) { animation-delay: 0.55s; }

.ec-card-image-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0ede8;
}

.ec-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}

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

/* SOLD ribbon */
.ec-sold-ribbon {
    position: absolute;
    top: 14px;
    left: -1px;
    background: var(--ec-charcoal);
    color: var(--ec-white);
    font-family: var(--ec-font-sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.20em;
    padding: 5px 12px;
    text-transform: uppercase;
}

/* EV Badge */
.ec-ev-badge {
    position: absolute;
    top: 14px;
    right: 12px;
    background: var(--ec-green);
    color: var(--ec-white);
    font-family: var(--ec-font-sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    padding: 4px 8px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Card body */
.ec-card-body {
    padding: 18px 20px 20px;
}

.ec-card-title {
    font-family: var(--ec-font-serif);
    font-size: 20px;
    font-weight: 400;
    margin: 0 0 6px;
    line-height: 1.25;
    color: var(--ec-charcoal);
}

.ec-card-year-medium {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--ec-grey);
    margin: 0 0 4px;
}

.ec-card-dims {
    font-family: var(--ec-font-sans);
    font-size: 11px;
    color: var(--ec-grey);
    margin: 0 0 16px;
    opacity: 0.8;
}

.ec-card-footer {
    border-top: 1px solid var(--ec-border);
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* EV BUTTON */
.ec-ev-btn {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ec-green-dark);
    background: var(--ec-green-light);
    border: 1px solid rgba(74,124,89,0.3);
    border-radius: 2px;
    padding: 8px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--ec-transition);
}

.ec-ev-btn:hover {
    background: var(--ec-green);
    color: var(--ec-white);
    border-color: var(--ec-green);
}

.ec-ev-btn:focus-visible {
    outline: 2px solid var(--ec-green);
    outline-offset: 2px;
}

/* ── MODAL OVERLAY ───────────────────────────────── */
#ec-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,14,12,0.72);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: ec-overlay-in 0.22s ease;
}

#ec-modal-overlay[hidden] {
    display: none;
}

@keyframes ec-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ec-modal {
    background: var(--ec-white);
    border-radius: var(--ec-radius);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 40px 36px;
    position: relative;
    box-shadow: var(--ec-shadow-lg);
    animation: ec-modal-in 0.28s cubic-bezier(0.4,0,0.2,1);
}

@keyframes ec-modal-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close button */
#ec-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--ec-grey);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s;
    font-family: var(--ec-font-sans);
}

#ec-modal-close:hover {
    color: var(--ec-charcoal);
}

/* Modal header */
.ec-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.ec-modal-vault-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ec-font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.20em;
    color: var(--ec-green-dark);
    text-transform: uppercase;
}

.ec-modal-subtitle-label {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ec-grey);
    margin: 0;
    margin-left: auto;
}

.ec-modal-divider {
    height: 1px;
    background: var(--ec-border);
    margin: 20px 0;
}

.ec-modal-title-painting {
    font-family: var(--ec-font-serif);
    font-size: 30px;
    font-weight: 300;
    margin: 0 0 4px;
    line-height: 1.15;
    color: var(--ec-charcoal);
}

.ec-modal-artist {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ec-green);
    margin: 0 0 24px;
}

.ec-modal-artist span {
    color: var(--ec-light-grey);
}

/* Modal field grid */
.ec-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ec-modal-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ec-field-label {
    font-family: var(--ec-font-sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ec-grey);
}

.ec-field-value {
    font-family: var(--ec-font-serif);
    font-size: 16px;
    font-weight: 400;
    color: var(--ec-charcoal);
    line-height: 1.3;
}

.ec-status-sold {
    color: var(--ec-charcoal);
    font-weight: 600;
}

.ec-status-sold::before {
    content: '';
}

.ec-private-collector {
    color: var(--ec-grey);
    font-style: italic;
}

.ec-redacted {
    font-family: var(--ec-font-sans) !important;
    font-size: 11px !important;
    letter-spacing: 0.12em;
    color: var(--ec-light-grey) !important;
    background: #f0ede8;
    padding: 3px 8px;
    border-radius: 2px;
    border: 1px solid var(--ec-border);
    align-self: flex-start;
    margin-top: 2px;
}

/* Verified / unverified block */
.ec-modal-verified-block,
.ec-modal-unverified-block {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 12px 16px;
    border-radius: 2px;
    margin: 4px 0;
}

.ec-modal-verified-block {
    background: var(--ec-green-light);
    color: var(--ec-green-dark);
    border: 1px solid rgba(74,124,89,0.25);
}

.ec-modal-unverified-block {
    background: #f5f5f3;
    color: var(--ec-grey);
    border: 1px solid var(--ec-border);
}

.ec-modal-verified-block[hidden],
.ec-modal-unverified-block[hidden] {
    display: none;
}

/* Modal footer links */
.ec-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.ec-modal-link {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-green-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.ec-modal-link:hover {
    color: var(--ec-green);
}

.ec-modal-link-secondary {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ec-grey);
    text-decoration: none;
    transition: color 0.2s;
}

.ec-modal-link-secondary:hover {
    color: var(--ec-charcoal);
}

/* ── CATALOG FOOTER ──────────────────────────────── */
.ec-catalog-footer {
    margin-top: 80px;
    border-top: 1px solid var(--ec-border);
    padding-top: 48px;
}

.ec-catalog-footer-inner {
    text-align: center;
}

.ec-footer-gallery {
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--ec-green);
    margin: 0 0 8px;
}

.ec-footer-copy {
    font-family: var(--ec-font-serif);
    font-size: 14px;
    color: var(--ec-grey);
    margin: 0 0 24px;
    font-style: italic;
}

.ec-footer-cta {
    display: inline-block;
    font-family: var(--ec-font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--ec-white);
    background: var(--ec-green);
    padding: 14px 32px;
    border-radius: 2px;
    text-decoration: none;
    transition: background 0.2s;
}

.ec-footer-cta:hover {
    background: var(--ec-green-dark);
    color: var(--ec-white);
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 640px) {
    .ec-grid {
        grid-template-columns: 1fr;
    }

    .ec-modal {
        padding: 28px 22px 28px;
    }

    .ec-modal-grid {
        grid-template-columns: 1fr;
    }

    .ec-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .ec-modal-subtitle-label {
        margin-left: 0;
    }

    .ec-modal-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .ec-catalog-header {
        padding: 40px 12px 28px;
    }
}

@media (max-width: 900px) {
    .ec-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

/* ── ACCESSIBILITY ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ec-card,
    .ec-card-img,
    #ec-modal-overlay,
    .ec-modal {
        animation: none !important;
        transition: none !important;
    }
}

/* Body scroll lock when modal open */
body.ec-modal-open {
    overflow: hidden;
}
