/* ── Infographics Tool Styles ────────────────────────── */

.ig-view {
    padding-top: 2.5rem;
    padding-bottom: 4rem;
}

/* ── Page header ── */
.ig-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.ig-page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-heading);
    margin-bottom: 0.4rem;
}

.ig-page-desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    max-width: 560px;
}

.ig-download-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}

/* ── Grid ── */
.ig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ── Card ── */
.ig-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.18s, transform 0.18s;
}
.ig-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
[data-theme="dark"] .ig-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.35);
}

.ig-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-surface);
    border: none;
    padding: 0;
    cursor: zoom-in;
    display: block;
}

.ig-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.22s;
}
.ig-thumb-wrap:hover .ig-thumb {
    transform: scale(1.03);
}

.ig-zoom-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    padding: 0.4rem;
    opacity: 0;
    transition: opacity 0.18s;
}
.ig-thumb-wrap:hover .ig-zoom-hint {
    opacity: 1;
}

.ig-card-body {
    padding: 1rem 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ig-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 0.45rem;
    line-height: 1.4;
}

.ig-card-desc {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    flex: 1;
    margin-bottom: 0.9rem;
}

.ig-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ig-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.ig-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.ig-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    border: 1.5px solid var(--color-accent);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.ig-dl-btn:hover {
    background: var(--color-accent);
    color: #fff;
}

/* ── Lightbox ── */
.ig-lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ig-lightbox[hidden] { display: none; }

.ig-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
}

.ig-lb-panel {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    max-width: min(92vw, 900px);
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
[data-theme="dark"] .ig-lb-panel {
    background: #1e2130;
}

.ig-lb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.ig-lb-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ig-lb-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ig-lb-dl {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
    text-decoration: none;
}

.ig-lb-hires-note {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-style: italic;
    white-space: nowrap;
    opacity: 0.8;
}

.ig-lb-close {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.ig-lb-close:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.ig-lb-img-wrap {
    flex: 1;
    overflow: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    background: var(--color-surface);
}

.ig-lb-img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.ig-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    font-size: 2rem;
    line-height: 1;
    width: 44px;
    height: 64px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 2;
}
.ig-lb-nav:hover { background: rgba(0,0,0,0.7); }
.ig-lb-nav:disabled { opacity: 0.2; cursor: default; }
.ig-lb-prev { left: 0.5rem; }
.ig-lb-next { right: 0.5rem; }

.ig-lb-img.is-loading {
    opacity: 0.25;
    transition: opacity 0.1s;
}
.ig-lb-img:not(.is-loading) {
    opacity: 1;
    transition: opacity 0.18s;
}

.ig-lb-desc {
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
    margin: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .ig-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .ig-grid { grid-template-columns: 1fr; }
    .ig-page-header { flex-direction: column; }
    .ig-download-all { width: 100%; justify-content: center; }
    .ig-lb-panel { max-width: 100vw; border-radius: 0; max-height: 100dvh; }
    .ig-lb-nav { display: none; }
}
