/* GamerHeadlines deals presentation — minimal, token-driven, standalone-safe.
   Uses the GH custom props (--headline, --mono, --accent) with fallbacks, so it
   works inside the custom theme and degrades cleanly on its own. Light/dark
   via the theme's .is-dark/.is-light classes plus a prefers-color-scheme base. */

.gh-deals {
    --gh-bg: #ffffff;
    --gh-surface: #f6f7f9;
    --gh-text: #101114;
    --gh-muted: #5c626c;
    --gh-border: #e3e6ea;
    --gh-accent: var(--accent, #e03e52);
    --gh-accent-contrast: #ffffff;
    --gh-headline: var(--headline, 'Archivo Narrow', 'Oswald', 'Arial Narrow', sans-serif);
    --gh-body: var(--gh-body-fallback, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif);
    --gh-mono: var(--mono, 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace);
    box-sizing: border-box;
    color: var(--gh-text);
    background: var(--gh-bg);
    font-family: var(--gh-body);
    line-height: 1.5;
}

.gh-deals *,
.gh-deals *::before,
.gh-deals *::after {
    box-sizing: inherit;
}

.gh-deals__header {
    margin-bottom: 1.5rem;
}

.gh-deals__title {
    font-family: var(--gh-headline);
    font-size: 2rem;
    line-height: 1.1;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.gh-deals__description {
    color: var(--gh-muted);
    margin: 0;
    max-width: 60ch;
}

.gh-deals__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.gh-deals__empty {
    color: var(--gh-muted);
}

/* ---- card ---- */

.gh-deal-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--gh-surface);
    border: 1px solid var(--gh-border);
    border-radius: 10px;
    padding: 1rem;
}

.gh-deal-card--expired {
    opacity: 0.62;
}

.gh-deal-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.gh-deal-card__label {
    font-family: var(--gh-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--gh-accent);
    text-transform: uppercase;
}

.gh-deal-card__badge {
    font-family: var(--gh-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    border: 1px solid currentColor;
}

.gh-deal-card__badge--expired {
    color: #b3261e;
}

.gh-deal-card__badge--ending {
    color: #9a6700;
}

.gh-deal-card__title {
    font-family: var(--gh-headline);
    font-size: 1.15rem;
    margin: 0;
}

.gh-deal-card__store {
    color: var(--gh-muted);
    font-size: 0.85rem;
    margin: 0;
}

.gh-deal-card__price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.gh-deal-card__current {
    font-size: 1.3rem;
    font-weight: 700;
}

.gh-deal-card__regular {
    color: var(--gh-muted);
    font-size: 0.9rem;
}

.gh-deal-card__percent {
    font-family: var(--gh-mono);
    font-size: 0.8rem;
    color: var(--gh-accent);
}

.gh-deal-card__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--gh-muted);
    font-size: 0.8rem;
}

.gh-deal-card__cta {
    margin-top: auto;
    display: inline-block;
    align-self: flex-start;
    padding: 0.5rem 0.9rem;
    background: var(--gh-accent);
    color: var(--gh-accent-contrast);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.gh-deal-card__cta:hover {
    filter: brightness(1.08);
}

/* ---- pagination ---- */

.gh-deals__pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1.5rem;
    align-items: center;
}

.gh-deals__page {
    display: inline-block;
    min-width: 2.2rem;
    padding: 0.35rem 0.6rem;
    text-align: center;
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    color: var(--gh-text);
    text-decoration: none;
}

.gh-deals__page--current {
    background: var(--gh-accent);
    color: var(--gh-accent-contrast);
    border-color: var(--gh-accent);
}

/* ---- dark ---- */

.gh-deals.is-dark,
.is-dark .gh-deals {
    --gh-bg: #14161a;
    --gh-surface: #1d2025;
    --gh-text: #eef0f3;
    --gh-muted: #a3aab4;
    --gh-border: #2c313a;
}

.gh-deals.is-light,
.is-light .gh-deals {
    --gh-bg: #ffffff;
    --gh-surface: #f6f7f9;
    --gh-text: #101114;
    --gh-muted: #5c626c;
    --gh-border: #e3e6ea;
}

@media (prefers-color-scheme: dark) {
    .gh-deals:not(.is-light):not(.is-dark) {
        --gh-bg: #14161a;
        --gh-surface: #1d2025;
        --gh-text: #eef0f3;
        --gh-muted: #a3aab4;
        --gh-border: #2c313a;
    }
}

/* ---- responsive ---- */

@media (max-width: 560px) {
    .gh-deals__grid {
        grid-template-columns: 1fr;
    }

    .gh-deals__title {
        font-size: 1.5rem;
    }
}
