/* gallery.css — W7 — theme browser layout. Hero + filter pills +
   responsive card grid + empty-state. Reuses the buyer-package
   primitives (`.demo-card`, `.demo-pill`, `.demo-btn`, tokens). */

.demo-gallery {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--demo-space-7, 56px) var(--demo-space-5, 24px) var(--demo-space-9, 96px);
}

/* ── Hero ───────────────────────────────────────────────── */

.demo-gallery__hero {
    text-align: center;
    margin-bottom: var(--demo-space-7, 56px);
}

.demo-gallery__eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--demo-accent, #4338ca);
    margin: 0 0 var(--demo-space-3, 12px);
}

.demo-gallery__title {
    font-size: clamp(28px, 4.5vw, 48px);
    line-height: 1.1;
    font-weight: 700;
    margin: 0 0 var(--demo-space-3, 12px);
    letter-spacing: -0.02em;
    color: var(--demo-text, #18181b);
}

.demo-gallery__lede {
    font-size: 16px;
    line-height: 1.6;
    color: var(--demo-text-muted, #71717a);
    margin: 0 auto var(--demo-space-5, 24px);
    max-width: 640px;
}

.demo-gallery__search-wrap {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}

.demo-gallery__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--demo-text-muted, #71717a);
    font-size: 20px;
    pointer-events: none;
}

.demo-gallery__search {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 44px;
    font: inherit;
    font-size: 15px;
    color: var(--demo-text, #18181b);
    background: var(--demo-bg-elevated, #fff);
    border: 1px solid var(--demo-border, #d4d4d8);
    border-radius: 10px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.demo-gallery__search:focus {
    outline: none;
    border-color: var(--demo-accent, #4338ca);
    box-shadow: 0 0 0 3px var(--demo-accent-soft, #e0e7ff);
}

.demo-gallery__search::placeholder {
    color: var(--demo-text-muted, #71717a);
}

/* ── Filter pills ───────────────────────────────────────── */

.demo-gallery__filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--demo-space-2, 8px);
    justify-content: center;
    margin-bottom: var(--demo-space-6, 32px);
}

.demo-gallery__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--demo-text, #18181b);
    background: var(--demo-bg-elevated, #fff);
    border: 1px solid var(--demo-border, #d4d4d8);
    border-radius: 999px;
    cursor: pointer;
    transition: all 120ms ease;
}

.demo-gallery__pill:hover {
    border-color: var(--demo-accent, #4338ca);
    color: var(--demo-accent, #4338ca);
}

.demo-gallery__pill:focus-visible {
    outline: 2px solid var(--demo-accent, #4338ca);
    outline-offset: 2px;
}

.demo-gallery__pill.is-active {
    background: var(--demo-accent, #4338ca);
    color: #fff;
    border-color: var(--demo-accent, #4338ca);
}

.demo-gallery__pill.is-active:hover {
    background: var(--demo-accent-strong, #3730a3);
    border-color: var(--demo-accent-strong, #3730a3);
}

.demo-gallery__pill-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--demo-bg-subtle, #f4f4f5);
    color: var(--demo-text-muted, #71717a);
}

.demo-gallery__pill.is-active .demo-gallery__pill-count {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

/* ── Card grid ──────────────────────────────────────────── */

.demo-gallery__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--demo-space-5, 24px);
}

.demo-gallery__item {
    min-width: 0;
}

.demo-gallery__item[hidden] {
    display: none;
}

.demo-gallery__card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--demo-bg-elevated, #fff);
    border: 1px solid var(--demo-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
    height: 100%;
}

.demo-gallery__card:hover {
    border-color: var(--demo-accent, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.demo-gallery__card:focus-visible {
    outline: 2px solid var(--demo-accent, #4338ca);
    outline-offset: 2px;
}

.demo-gallery__card-media {
    aspect-ratio: 496/558;
    background: var(--demo-bg-subtle, #f4f4f5);
    overflow: hidden;
    position: relative;
}

.demo-gallery__card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.demo-gallery__card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--demo-text-muted, #71717a);
}

.demo-gallery__card-placeholder .material-symbols-outlined {
    font-size: 48px;
}

.demo-gallery__card-body {
    display: flex;
    flex-direction: column;
    gap: var(--demo-space-2, 8px);
    padding: var(--demo-space-4, 16px);
    flex: 1;
    min-width: 0;
}

.demo-gallery__card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--demo-text, #18181b);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.demo-gallery__card-cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--demo-accent, #4338ca);
    transition: gap 120ms ease;
}

.demo-gallery__card:hover .demo-gallery__card-cta {
    gap: 8px;
}

.demo-gallery__card-cta .material-symbols-outlined {
    font-size: 16px;
}

/* ── Empty state ───────────────────────────────────────── */

.demo-gallery__empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--demo-space-3, 12px);
    padding: var(--demo-space-7, 56px) var(--demo-space-5, 24px);
    text-align: center;
    background: var(--demo-bg-subtle, #f4f4f5);
    border: 1px dashed var(--demo-border, #d4d4d8);
    border-radius: 12px;
    color: var(--demo-text-muted, #71717a);
    margin-top: var(--demo-space-5, 24px);
}

.demo-gallery__empty .material-symbols-outlined {
    font-size: 40px;
    color: var(--demo-text-muted, #71717a);
}

.demo-gallery__empty p {
    margin: 0;
    font-size: 14px;
}

/* ── "Always growing" section ─────────────────────────── */

.demo-gallery__growing {
    margin-top: var(--demo-space-9, 96px);
}

.demo-gallery__growing-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--demo-space-5, 24px);
    padding: var(--demo-space-6, 32px);
    background: linear-gradient(
        135deg,
        var(--demo-accent-soft, #e0e7ff) 0%,
        var(--demo-bg-elevated, #fff) 100%
    );
    border: 1px solid var(--demo-border, #e5e7eb);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.demo-gallery__growing-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--demo-accent, #4338ca);
    color: #fff;
    border-radius: 16px;
    flex-shrink: 0;
}

.demo-gallery__growing-icon .material-symbols-outlined {
    font-size: 32px;
}

.demo-gallery__growing-body {
    min-width: 0;
}

.demo-gallery__growing-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--demo-accent, #4338ca);
    margin: 0 0 var(--demo-space-2, 8px);
}

.demo-gallery__growing-title {
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 var(--demo-space-2, 8px);
    color: var(--demo-text, #18181b);
    letter-spacing: -0.01em;
}

.demo-gallery__growing-lede {
    font-size: 14px;
    line-height: 1.6;
    color: var(--demo-text-muted, #71717a);
    margin: 0 0 var(--demo-space-4, 16px);
}

.demo-gallery__growing-lede code {
    background: var(--demo-bg-subtle, #f4f4f5);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.92em;
    color: var(--demo-text, #18181b);
}

.demo-gallery__growing-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--demo-space-3, 12px);
}

.demo-gallery__growing-points li {
    display: flex;
    align-items: flex-start;
    gap: var(--demo-space-3, 12px);
    font-size: 13px;
    line-height: 1.5;
    color: var(--demo-text, #18181b);
}

.demo-gallery__growing-points .material-symbols-outlined {
    font-size: 20px;
    color: var(--demo-success, #15803d);
    flex-shrink: 0;
    margin-top: 1px;
}

.demo-gallery__growing-points code {
    background: var(--demo-bg-subtle, #f4f4f5);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.92em;
}

/* ── Cross-CTA strip ────────────────────────────────────── */

.demo-gallery__cta-strip {
    margin-top: var(--demo-space-9, 96px);
}

.demo-gallery__cta-strip-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 var(--demo-space-2, 8px);
    text-align: center;
    color: var(--demo-text, #18181b);
    letter-spacing: -0.01em;
}

.demo-gallery__cta-strip-lede {
    text-align: center;
    color: var(--demo-text-muted, #71717a);
    margin: 0 0 var(--demo-space-6, 32px);
    font-size: 15px;
}

.demo-gallery__cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--demo-space-4, 16px);
}

.demo-gallery__cta-card {
    display: flex;
    flex-direction: column;
    gap: var(--demo-space-2, 8px);
    text-decoration: none;
    color: inherit;
    background: var(--demo-bg-elevated, #fff);
    border: 1px solid var(--demo-border, #e5e7eb);
    border-radius: 12px;
    padding: var(--demo-space-5, 24px);
    transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.demo-gallery__cta-card:hover {
    border-color: var(--demo-accent, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.demo-gallery__cta-card:focus-visible {
    outline: 2px solid var(--demo-accent, #4338ca);
    outline-offset: 2px;
}

.demo-gallery__cta-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--demo-accent-soft, #e0e7ff);
    color: var(--demo-accent, #4338ca);
    border-radius: 10px;
    margin-bottom: var(--demo-space-1, 4px);
}

.demo-gallery__cta-icon .material-symbols-outlined {
    font-size: 24px;
}

.demo-gallery__cta-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--demo-text, #18181b);
}

.demo-gallery__cta-body {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--demo-text-muted, #71717a);
    flex: 1;
}

.demo-gallery__cta-body code {
    background: var(--demo-bg-subtle, #f4f4f5);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.92em;
    color: var(--demo-text, #18181b);
}

.demo-gallery__cta-action {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--demo-accent, #4338ca);
    transition: gap 120ms ease;
}

.demo-gallery__cta-card:hover .demo-gallery__cta-action {
    gap: 8px;
}

.demo-gallery__cta-action .material-symbols-outlined {
    font-size: 16px;
}

/* ── FAQ disclosures ─────────────────────────────────────── */

.demo-gallery__faq {
    margin-top: var(--demo-space-9, 96px);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.demo-gallery__faq-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 var(--demo-space-5, 24px);
    text-align: center;
    color: var(--demo-text, #18181b);
    letter-spacing: -0.01em;
}

.demo-gallery__faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--demo-space-2, 8px);
}

.demo-gallery__faq-item {
    background: var(--demo-bg-elevated, #fff);
    border: 1px solid var(--demo-border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 120ms ease;
}

.demo-gallery__faq-item:hover {
    border-color: var(--demo-accent, #4338ca);
}

.demo-gallery__faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: var(--demo-space-4, 16px) var(--demo-space-5, 24px);
    font-size: 14px;
    font-weight: 600;
    color: var(--demo-text, #18181b);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--demo-space-3, 12px);
}

.demo-gallery__faq-item summary::-webkit-details-marker {
    display: none;
}

.demo-gallery__faq-item summary::after {
    content: '+';
    font-size: 20px;
    line-height: 1;
    color: var(--demo-text-muted, #71717a);
    flex-shrink: 0;
    transition: transform 120ms ease;
    width: 20px;
    text-align: center;
}

.demo-gallery__faq-item[open] summary::after {
    content: '−';
    transform: rotate(0deg);
}

.demo-gallery__faq-item summary:focus-visible {
    outline: 2px solid var(--demo-accent, #4338ca);
    outline-offset: -2px;
}

.demo-gallery__faq-item p {
    margin: 0;
    padding: 0 var(--demo-space-5, 24px) var(--demo-space-4, 16px);
    font-size: 13px;
    line-height: 1.6;
    color: var(--demo-text-muted, #71717a);
}

.demo-gallery__faq-item code {
    background: var(--demo-bg-subtle, #f4f4f5);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.92em;
    color: var(--demo-text, #18181b);
}

.demo-gallery__faq-item a {
    color: var(--demo-accent, #4338ca);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Mobile ─────────────────────────────────────────────── */

@media (max-width: 640px) {
    .demo-gallery {
        padding-top: var(--demo-space-5, 24px);
    }
    .demo-gallery__filter {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        margin-left: calc(var(--demo-space-5, 24px) * -1);
        margin-right: calc(var(--demo-space-5, 24px) * -1);
        padding-left: var(--demo-space-5, 24px);
        padding-right: var(--demo-space-5, 24px);
    }
    .demo-gallery__pill {
        flex-shrink: 0;
    }
    .demo-gallery__grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--demo-space-4, 16px);
    }
}
