/* ════════════════════════════════════════════════════════════════════════
   Home-page "Digital Platforms" strip
   Two grouped sets of emphasised link cards:
     • Group 1 — Competitive-exam prep platforms (BharatNotes, Ujiyari)
     • Group 2 — School's own portals   (SAARTHI Career, RBSE Result Explorer)
   ════════════════════════════════════════════════════════════════════════ */

.portals {
    position: relative;
    padding: 64px 0 72px;
    /* keeps the #platforms anchor clear of the sticky site header */
    scroll-margin-top: 96px;
    background:
        radial-gradient(60% 80% at 12% 0%, rgba(30, 64, 175, 0.10) 0%, rgba(30, 64, 175, 0) 70%),
        radial-gradient(55% 70% at 92% 100%, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0) 70%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    overflow: hidden;
}

.portals .portals-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 40px;
}
.portals .portals-label {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #1e40af;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.portals .portals-head h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}
.portals .portals-head p {
    margin: 10px auto 0;
    color: #475569;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 62ch;
}

/* ── Group ─────────────────────────────────────────────────────────────── */
.portal-group + .portal-group { margin-top: 44px; }

.portal-group-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
.portal-group-head h3 {
    margin: 0;
    font-size: clamp(1.08rem, 2.1vw, 1.3rem);
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 9px;
}
.portal-group-head .pg-hi {
    font-size: 0.92rem;
    font-weight: 600;
    color: #64748b;
}
.portal-group-head .pg-tag {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    white-space: nowrap;
}
.portal-group.school .portal-group-head { border-bottom-color: #bbf7d0; }
.portal-group.school .portal-group-head .pg-tag { background: #d1fae5; color: #065f46; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
}

.portal-card {
    --pc: #1e40af;
    --pc-dark: #1e3a8a;
    --pc-soft: #eff6ff;
    --pc-border: #c7d2fe;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 12px 28px rgba(15, 23, 42, 0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.portal-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--pc) 0%, var(--pc-dark) 100%);
}
.portal-card:hover,
.portal-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06), 0 22px 44px rgba(15, 23, 42, 0.13);
    border-color: var(--pc);
}
.portal-card:focus-visible {
    outline: 3px solid var(--pc);
    outline-offset: 3px;
}

.portal-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 22px 0;
}
.portal-mark {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.55rem;
    background: var(--pc-soft);
    border: 1px solid var(--pc-border);
    color: var(--pc-dark);
    line-height: 1;
}
.portal-titles { min-width: 0; flex: 1 1 auto; }
.portal-titles h4 {
    margin: 0;
    font-size: 1.16rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.portal-titles .portal-hi {
    display: block;
    margin-top: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pc-dark);
}
.portal-arrow {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.95rem;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}
.portal-card:hover .portal-arrow,
.portal-card:focus-visible .portal-arrow {
    background: var(--pc);
    color: #fff;
    transform: translate(2px, -2px);
}

.portal-card p.portal-desc {
    margin: 14px 0 0;
    padding: 0 22px;
    color: #475569;
    font-size: 0.94rem;
    line-height: 1.68;
}

.portal-feats {
    list-style: none;
    margin: 16px 0 0;
    padding: 0 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.portal-feats li {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 5px 11px;
    border-radius: 8px;
    background: var(--pc-soft);
    color: var(--pc-dark);
    border: 1px solid var(--pc-border);
}

.portal-foot {
    margin-top: auto;
    padding: 16px 22px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.portal-domain {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pc-dark);
    font-family: "Inter", "Segoe UI", sans-serif;
    letter-spacing: 0.01em;
    word-break: break-all;
}
.portal-badge {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}
.portal-badge.free { background: #d1fae5; color: #065f46; }
.portal-badge.ours { background: #fef3c7; color: #92400e; }

/* ── Per-card brand accents ────────────────────────────────────────────── */
.portal-card.pc-bharatnotes { --pc: #4338ca; --pc-dark: #312e81; --pc-soft: #eef2ff; --pc-border: #c7d2fe; }
.portal-card.pc-ujiyari     { --pc: #d97706; --pc-dark: #92400e; --pc-soft: #fffbeb; --pc-border: #fde68a; }
.portal-card.pc-saarthi     { --pc: #173ff0; --pc-dark: #1e3a8a; --pc-soft: #eff6ff; --pc-border: #bfdbfe; }
.portal-card.pc-result      { --pc: #0d9488; --pc-dark: #0f172a; --pc-soft: #f0fdfa; --pc-border: #99f6e4; }

/* ── Footnote ──────────────────────────────────────────────────────────── */
.portals-note {
    margin: 34px auto 0;
    max-width: 74ch;
    text-align: center;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.7;
}
.portals-note strong { color: #334155; }

@media (max-width: 640px) {
    .portals { padding: 48px 0 56px; }
    .portal-grid { grid-template-columns: 1fr; gap: 18px; }
    .portal-group-head .pg-tag { margin-left: 0; }
    .portal-card-head { padding: 18px 18px 0; }
    .portal-card p.portal-desc, .portal-feats { padding: 0 18px; }
    .portal-foot { padding: 14px 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-card, .portal-arrow { transition: none; }
    .portal-card:hover, .portal-card:focus-visible { transform: none; }
    .portal-card:hover .portal-arrow, .portal-card:focus-visible .portal-arrow { transform: none; }
}
