/* Eligible territories trigger and dialog.
 * Shared by the giveaway list and the giveaway detail page so both surfaces
 * present the same "All territories" affordance and country dialog.
 */

.giveaway-eligible-trigger {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    color: #1f2533;
    font: inherit;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.giveaway-eligible-trigger-label {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 0.16em;
}

.giveaway-eligible-trigger:hover,
.giveaway-eligible-trigger:focus-visible {
    color: var(--cc-forest);
}

.giveaway-eligible-trigger sup {
    margin-left: 0.08rem;
    color: var(--cc-forest);
    font-size: 0.8em;
    line-height: 0;
}

.giveaway-eligible-modal {
    position: fixed;
    inset: 0;
    z-index: 1056;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, var(--cc-safe-top)) max(1rem, var(--cc-safe-right)) max(1rem, var(--cc-safe-bottom)) max(1rem, var(--cc-safe-left));
}

.giveaway-eligible-modal[hidden] {
    display: none;
}

.giveaway-eligible-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(10, 16, 28, 0.65);
}

.giveaway-eligible-card {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(760px, 88vh);
    max-height: min(760px, calc(100dvh - max(1rem, var(--cc-safe-top)) - max(1rem, var(--cc-safe-bottom))));
    overflow: auto;
    padding: 1.4rem;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(12, 18, 35, 0.35);
}

.giveaway-eligible-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
}

.giveaway-eligible-head h2 {
    margin: 0;
    color: var(--cc-ink);
    font-family: 'Gabarito', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.giveaway-eligible-head p {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.4;
}

.giveaway-eligible-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(22, 26, 39, 0.12);
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
}

.giveaway-eligible-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.giveaway-eligible-group {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid rgba(22, 26, 39, 0.08);
    border-radius: 12px;
    background: #f8fafc;
}

.giveaway-eligible-group h3 {
    margin: 0 0 0.45rem;
    color: var(--cc-forest);
    font-size: 0.92rem;
    font-weight: 800;
}

.giveaway-eligible-group ul {
    display: grid;
    gap: 0.28rem;
    margin: 0;
    padding-left: 1rem;
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.35;
}

.giveaway-eligible-note {
    margin: 1rem 0 0;
    color: #526174;
    font-size: 0.9rem;
    line-height: 1.45;
}

.giveaway-eligible-note a {
    color: var(--cc-forest);
    font-weight: 800;
}

@media (max-width: 768px) {
    .giveaway-eligible-modal {
        align-items: flex-end;
        padding: max(0.85rem, var(--cc-safe-top)) max(0.85rem, var(--cc-safe-right)) max(0.85rem, var(--cc-safe-bottom)) max(0.85rem, var(--cc-safe-left));
    }

    .giveaway-eligible-card {
        max-height: 84vh;
        max-height: calc(100dvh - max(0.85rem, var(--cc-safe-top)) - max(0.85rem, var(--cc-safe-bottom)));
        padding: 1.1rem;
        border-radius: 16px;
    }

    .giveaway-eligible-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) and (max-height: 500px) and (orientation: landscape) {
    .giveaway-eligible-modal {
        align-items: flex-end;
    }
}

/* Giveaway detail page: the trigger sits in a right-aligned side stat row. */
.gw-side-stat-value .giveaway-eligible-trigger {
    justify-content: flex-end;
    text-align: right;
    color: var(--cc-ink);
    font-weight: 700;
}

.gw-side-stat-value .giveaway-eligible-trigger:hover,
.gw-side-stat-value .giveaway-eligible-trigger:focus-visible {
    color: var(--cc-forest-dark);
}

.gw-side-stat-value .giveaway-eligible-trigger sup {
    color: var(--cc-forest-dark);
}

/* Giveaway detail hero: the region chip becomes the dialog trigger when a
   giveaway is open to every eligible territory. It keeps the chip size and
   gains a 44px hit area through an invisible overlay. */
.gw-pill--trigger {
    position: relative;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
}

.gw-pill--trigger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    min-height: 44px;
}

.gw-pill--trigger:hover,
.gw-pill--trigger:focus-visible {
    background: rgba(47, 155, 211, 0.44);
}

.gw-pill--trigger sup {
    margin-left: 0.08rem;
    font-size: 0.8em;
    line-height: 0;
}
