/* ============================================================================
   ICOPAD — Opportunities index
   PRD: §5, §11, §14, §19, §20
   ============================================================================ */

/* Compact filter bar with one dropdown */
.filter-bar--opps {
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .filter-bar--opps {
        grid-template-columns: minmax(0, 280px) auto;
        justify-content: start;
    }
}

/* ── Grid ──────────────────────────────────────────────────────────── */

.opps-index {
    padding-block: clamp(2rem, 1.5rem + 3vw, 3.5rem);
}

.opps-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 640px)  { .opps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .opps-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

/* ── Card ──────────────────────────────────────────────────────────── */

.opp-card {
    position: relative;
    display: flex;
}

.opp-card__link {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 1.25rem 1.25rem 1.125rem;
    height: 100%;
    width: 100%;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
    position: relative;
    overflow: hidden;
}
.opp-card__link:hover,
.opp-card__link:focus-visible {
    border-color: color-mix(in srgb, var(--brand, #0a4d8c) 40%, var(--border, #e5e5e5));
    transform: translateY(-3px);
    box-shadow:
        0 1px 2px rgb(0 0 0 / .04),
        0 18px 36px -18px color-mix(in srgb, var(--brand, #0a4d8c) 40%, transparent);
    outline: none;
}

/* ── Card head: type badge + deadline ──────────────────────────────── */

.opp-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.opp-card__type {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: var(--bg-muted, #f1f1f1);
    color: var(--text-muted, #555);
}
.opp-card__type--funding               { background: #dcfce7; color: #166534; }
.opp-card__type--grant                 { background: #d1fae5; color: #065f46; }
.opp-card__type--consultation          { background: #dbeafe; color: #1e40af; }
.opp-card__type--call-for-applications { background: #e0e7ff; color: #3730a3; }
.opp-card__type--fellowship            { background: #fce7f3; color: #9d174d; }
.opp-card__type--research              { background: #ede9fe; color: #5b21b6; }
.opp-card__type--speaking              { background: #fef3c7; color: #92400e; }
.opp-card__type--training              { background: #cffafe; color: #155e75; }
.opp-card__type--partnership           { background: #fed7aa; color: #9a3412; }
.opp-card__type--other                 { background: var(--bg-muted, #f1f1f1); color: var(--text-muted, #555); }

.opp-card__deadline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted, #666);
    font-variant-numeric: tabular-nums;
}
.opp-card__deadline.is-urgent {
    color: #b91c1c;
}
.opp-card__deadline.is-urgent svg {
    color: #dc2626;
}
.opp-card__deadline--open {
    color: #047857;
    font-weight: 600;
}

/* ── Body ──────────────────────────────────────────────────────────── */

.opp-card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.015em;
    margin: 0;
    color: var(--text, #111);
    text-wrap: balance;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.opp-card__desc {
    font-size: .875rem;
    line-height: 1.55;
    color: var(--text-muted, #555);
    margin: 0;
    text-wrap: pretty;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Meta line ─────────────────────────────────────────────────────── */

.opp-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: .75rem;
    color: var(--text-subtle, #777);
    padding-top: 4px;
    border-top: 1px solid var(--border-subtle, #eaeaea);
    margin-top: auto;
}
.opp-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.opp-card__meta-item svg {
    color: var(--brand, #0a4d8c);
    flex-shrink: 0;
}

/* ── CTA ───────────────────────────────────────────────────────────── */

.opp-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--brand, #0a4d8c);
    transition: gap .2s ease;
}
.opp-card__link:hover .opp-card__cta,
.opp-card__link:focus-visible .opp-card__cta {
    gap: 8px;
}
.opp-card__cta svg {
    transition: transform .2s ease;
}
.opp-card__link:hover .opp-card__cta svg,
.opp-card__link:focus-visible .opp-card__cta svg {
    transform: translateX(2px);
}

/* ── Reduced motion ────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .opp-card__link,
    .opp-card__cta,
    .opp-card__cta svg {
        transition-duration: .01ms !important;
    }
}

/* ============================================================================
   ICOPAD — Opportunity detail (extensions)
   PRD: §11, §19
   ============================================================================ */

/* Deadline status card */
.detail-card--urgent {
    background: color-mix(in srgb, #f59e0b 8%, var(--surface, #fff));
    border-color: color-mix(in srgb, #f59e0b 35%, var(--border, #e5e5e5));
}
.detail-card--urgent .detail-card__icon {
    background: color-mix(in srgb, #f59e0b 20%, transparent);
    color: #b45309;
}
.detail-card--urgent .detail-card__title {
    color: #92400e;
}

/* Prominent deadline date */
.detail-card__deadline {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text, #111);
    margin: 0;
    line-height: 1.4;
    text-wrap: pretty;
}
.detail-card__deadline--open {
    color: #047857;
}

/* Countdown line */
.detail-card__countdown {
    font-size: .875rem;
    font-weight: 700;
    color: var(--brand, #0a4d8c);
    margin: 0;
}
.detail-card__countdown.is-urgent {
    color: #b45309;
}
.detail-card__countdown--expired {
    color: var(--text-muted, #666);
    font-weight: 600;
}

/* External-link hint under the CTA */
.event-detail__external-hint {
    font-size: .8125rem;
    color: var(--text-muted, #666);
    margin: 8px 0 0;
    line-height: 1.5;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .detail-card--urgent .detail-card__icon {
        transition-duration: .01ms !important;
    }
}