/* =========================================================
   PROGRAMS PAGE (programs.php) — builds on home.css (.hm)
   ========================================================= */

.pg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Hero ---------- */
.hm .pg-hero {
    position: relative;
    padding: clamp(40px, 5vw, 80px) 0 clamp(40px, 5vw, 72px);
    background:
        radial-gradient(60% 70% at 85% 20%, rgba(20, 184, 166, 0.14) 0%, rgba(20, 184, 166, 0) 70%),
        radial-gradient(40% 50% at 0% 100%, rgba(254, 205, 211, 0.3) 0%, rgba(254, 205, 211, 0) 70%),
        linear-gradient(180deg, #f6fdfb 0%, #ffffff 100%);
    overflow: hidden;
}

.pg-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: clamp(32px, 5vw, 72px);
}

.pg .hm-hero-title {
    font-size: clamp(2.2rem, 4.2vw, 3.5rem);
}

/* Search */
.pg-search {
    position: relative;
    margin-top: 28px;
    max-width: 560px;
    display: flex;
    align-items: center;
}

.pg-search > svg {
    position: absolute;
    left: 20px;
    width: 20px;
    height: 20px;
    color: var(--muted);
    pointer-events: none;
}

.pg-search input {
    width: 100%;
    height: 60px;
    padding: 0 52px 0 54px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: var(--shadow-md);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pg-search input::placeholder {
    color: #94a3b8;
}

.pg-search input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15), var(--shadow-md);
}

.pg-search input::-webkit-search-cancel-button {
    display: none;
}

.pg-search-clear {
    position: absolute;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--soft);
    color: var(--muted);
    cursor: pointer;
}

.pg-search-clear[hidden] {
    display: none;
}

.pg-search-clear svg {
    width: 16px;
    height: 16px;
}

.pg-search-clear:hover {
    background: #e2e8f0;
    color: var(--ink);
}

.pg-trust {
    list-style: none;
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.pg-trust li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-2);
}

.pg-trust svg {
    width: 18px;
    height: 18px;
    color: var(--teal);
}

.pg-float-link {
    text-decoration: none;
}

.pg-float-link:hover {
    border-color: rgba(13, 148, 136, 0.45);
}

/* ---------- Sticky category tabs ---------- */
.pg-tabs-bar {
    position: sticky;
    top: 66px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.pg-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.pg-tabs::-webkit-scrollbar {
    display: none;
}

.pg-tabs .hm-filter svg {
    width: 16px;
    height: 16px;
}

/* ---------- Catalog ---------- */
.pg-catalog {
    padding: clamp(24px, 3vw, 40px) 0 clamp(48px, 5vw, 80px);
    background: #ffffff;
}

.hm .pg-cat {
    padding: clamp(24px, 3vw, 40px) 0;
    scroll-margin-top: 140px;
}

.pg-cat[hidden] {
    display: none;
}

.pg-cat + .pg-cat .container {
    border-top: 1px solid var(--line);
    padding-top: clamp(32px, 4vw, 48px);
}

.pg-cat-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.pg-cat-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(145deg, var(--teal-2), var(--teal-d));
    box-shadow: 0 10px 20px -8px rgba(13, 148, 136, 0.6);
}

.pg-cat-icon svg {
    width: 24px;
    height: 24px;
}

.hm .pg-cat-title {
    font-family: var(--font-h);
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.pg-cat-sub {
    margin-top: 2px;
    font-size: 0.9rem;
    color: var(--muted);
}

.pg-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
}

/* Subject tags inside course cards */
.pg-subjects {
    list-style: none;
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pg-subjects li {
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--mint);
    border: 1px solid rgba(13, 148, 136, 0.18);
    color: var(--teal-d);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-subjects .pg-subjects-more {
    background: var(--soft);
    border-color: var(--line);
    color: var(--muted);
}

/* Empty state */
.pg-empty {
    margin: 24px auto 0;
    max-width: 560px;
    padding: 40px 28px;
    border-radius: 24px;
    border: 1px dashed #cbd5e1;
    background: var(--soft);
    text-align: center;
}

.pg-empty[hidden] {
    display: none;
}

.pg-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: var(--teal);
    border: 1px solid var(--line);
}

.pg-empty-icon svg {
    width: 26px;
    height: 26px;
}

.hm .pg-empty h3 {
    font-family: var(--font-h);
    font-size: 1.3rem;
    font-weight: 800;
    word-break: break-word;
}

.pg-empty p {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.6;
}

.pg-empty-actions {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.hm .pg-btn-plain {
    padding: 0 22px;
}

/* ---------- Every program includes ---------- */
.hm .pg-includes {
    background: var(--soft);
    border-top: 1px solid var(--line);
}

.pg-feature-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.pg-feature-grid li {
    padding: 26px 24px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pg-feature-grid li:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.pg-feature-grid li > span {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--mint);
    color: var(--teal-d);
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.pg-feature-grid svg {
    width: 22px;
    height: 22px;
}

.hm .pg-feature-grid h3 {
    margin-top: 18px;
    font-family: var(--font-h);
    font-size: 1.1rem;
    font-weight: 700;
}

.pg-feature-grid p {
    margin-top: 6px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--muted);
}

/* ---------- CTA stats ---------- */
.pg-cta-stats {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pg-cta-stats li {
    padding: 18px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    text-align: center;
}

.pg-cta-stats strong {
    display: block;
    font-family: var(--font-h);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
}

.pg-cta-stats span {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    color: rgba(204, 251, 241, 0.8);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .pg-feature-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .pg-hero-grid {
        grid-template-columns: 1fr;
    }

    .pg-hero-visual {
        max-width: 560px;
        width: 100%;
        margin: 0 auto;
    }

    .pg-tabs-bar {
        top: 64px;
    }

    .pg-search {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .pg-search input {
        height: 54px;
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .pg-trust {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .pg-feature-grid {
        gap: 12px;
    }

    .pg-feature-grid li {
        padding: 18px 16px;
    }

    .pg-feature-grid li > span {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .hm .pg-feature-grid h3 {
        margin-top: 12px;
        font-size: 0.98rem;
    }

    .pg-feature-grid p {
        font-size: 0.82rem;
    }

    .pg-cat-icon {
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .hm .pg-cat {
        scroll-margin-top: 130px;
    }
}

/* =====================================================================
   HERO — orbit layout (.pg-orbit-hero): centred search, subject tiles floating around it
   ===================================================================== */
.hm .pg-orbit-hero { padding: clamp(56px, 7vw, 100px) 0 clamp(56px, 6vw, 88px); background:
    radial-gradient(45% 60% at 50% 45%, rgba(20, 184, 166, .16) 0%, rgba(20, 184, 166, 0) 70%),
    radial-gradient(30% 40% at 8% 90%, rgba(254, 205, 211, .35) 0%, rgba(254, 205, 211, 0) 70%),
    radial-gradient(30% 40% at 92% 10%, rgba(253, 230, 138, .3) 0%, rgba(253, 230, 138, 0) 70%),
    linear-gradient(180deg, #f6fdfb 0%, #ffffff 100%); }
.pg-orbit-rings { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.pg-orbit-rings span { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1.5px dashed rgba(13, 148, 136, .2); transform: translate(-50%, -50%); animation: pg-ring-spin 80s linear infinite; }
.pg-orbit-rings span:nth-child(1) { width: 560px; height: 560px; }
.pg-orbit-rings span:nth-child(2) { width: 860px; height: 860px; border-style: solid; border-color: rgba(13, 148, 136, .08); animation-direction: reverse; }
.pg-orbit-rings span:nth-child(3) { width: 1160px; height: 1160px; border-color: rgba(245, 158, 11, .14); animation-duration: 120s; }
@keyframes pg-ring-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.pg-orbit { position: relative; min-height: 470px; display: grid; place-items: center; }
.pg-orbit-center { position: relative; z-index: 2; max-width: 640px; text-align: center; }
.pg-orbit-center .hm-hero-sub { margin-left: auto; margin-right: auto; }
.pg-orbit-center .pg-search { margin-left: auto; margin-right: auto; box-shadow: 0 24px 50px -24px rgba(15, 118, 110, .45); border-radius: 999px; }
.pg-orbit-center .pg-trust { justify-content: center; }

.pg-orbit-tiles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.pg-orb-tile { position: absolute; pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 230px; padding: 12px 16px 12px 12px; border-radius: 20px; text-align: left;
    background: rgba(255, 255, 255, .82); border: 1px solid rgba(13, 148, 136, .14); box-shadow: 0 18px 40px -22px rgba(15, 23, 42, .35);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font: inherit; color: var(--ink, #0f172a); cursor: pointer; text-decoration: none;
    animation: pg-orb-in .9s cubic-bezier(.16, 1, .3, 1) backwards, pg-orb-float 6s ease-in-out infinite;
    animation-delay: calc(.35s + var(--k) * .12s), calc(var(--k) * -1.1s);
    transition: box-shadow .25s ease, border-color .25s ease, scale .25s ease; }
.pg-orb-tile:hover, .pg-orb-tile:focus-visible { scale: 1.05; border-color: rgba(13, 148, 136, .45); box-shadow: 0 24px 50px -20px rgba(15, 118, 110, .45); }
.pg-orb-tile:focus-visible { outline: 3px solid #fbbf24; outline-offset: 3px; }
.pg-orb-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #2dd4bf, #0f766e); color: #fff; }
.pg-orb-icon svg, .pg-orb-icon img { width: 20px; height: 20px; }
.pg-orb-2 .pg-orb-icon { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.pg-orb-3 .pg-orb-icon { background: linear-gradient(135deg, #fb7185, #be123c); }
.pg-orb-4 .pg-orb-icon { background: linear-gradient(135deg, #38bdf8, #0369a1); }
.pg-orb-5 .pg-orb-icon { background: linear-gradient(135deg, #fbbf24, #b45309); }
.pg-orb-gift { background: linear-gradient(135deg, #0f766e, #134e4a); border-color: transparent; color: #fff; }
.pg-orb-gift .pg-orb-icon { background: rgba(255, 255, 255, .16); }
.pg-orb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pg-orb-text strong { font-family: var(--font-h); font-size: .98rem; line-height: 1.2; }
.pg-orb-text small { font-size: .8rem; color: var(--muted, #64748b); font-weight: 600; }
.pg-orb-gift .pg-orb-text small { color: #99f6e4; }
.pg-orb-1 { left: 0; top: 2%; } .pg-orb-2 { left: 3%; top: 41%; } .pg-orb-3 { left: 0; top: 80%; }
.pg-orb-4 { right: 0; top: 2%; } .pg-orb-5 { right: 3%; top: 41%; } .pg-orb-6 { right: 0; top: 80%; }
@keyframes pg-orb-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes pg-orb-float { 50% { translate: 0 -10px; } }

@media (max-width: 1180px) {
    .pg-orbit { min-height: 0; }
    .pg-orbit-tiles { position: static; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; width: 100%; }
    .pg-orb-tile { position: static; width: auto; animation: pg-orb-in .9s cubic-bezier(.16, 1, .3, 1) backwards; animation-delay: calc(.35s + var(--k) * .12s); }
    .pg-orbit-rings span:nth-child(1) { width: 420px; height: 420px; }
}
@media (max-width: 640px) {
    .pg-orbit-tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; margin-left: -4px; margin-right: -4px; scrollbar-width: none; }
    .pg-orbit-tiles::-webkit-scrollbar { display: none; }
    .pg-orb-tile { flex: 0 0 210px; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
    .pg-orbit-rings span, .pg-orb-tile { animation: none; }
}
