﻿/* =========================================================
   SAN ROBOTICS | STEM ACTIVITIES
   Scoped styles; follows About page navy / blue / cyan palette.
   ========================================================= */

.stem-activities-page {
    --stem-navy: #031126;
    --stem-navy-mid: #061A3A;
    --stem-navy-light: #062B55;
    --stem-blue: #087ED1;
    --stem-blue-bright: #129BEF;
    --stem-cyan: #45D9FF;
    --stem-text: #24364d;
    --stem-muted: #68778c;
    --stem-light: #f4f8fc;
    --stem-border: rgba(8, 126, 209, .13);
    color: var(--stem-text);
    background: #fff;
    font-family: inherit;
}

.stem-activities-page *,
.stem-lightbox * { box-sizing: border-box; }

.stem-container {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

/* Compact heading: the activity content starts immediately below it. */
.stem-page-heading {
    position: relative;
    overflow: hidden;
    padding: 34px 0 28px;
    background:
        radial-gradient(circle at 90% 10%, rgba(18,155,239,.10), transparent 28%),
        linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    border-bottom: 1px solid rgba(8,126,209,.08);
}

.stem-page-heading::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 3px;
    left: max(24px, calc((100% - 1180px) / 2));
    bottom: 0;
    background: linear-gradient(90deg, var(--stem-blue), var(--stem-cyan), transparent);
}

.stem-eyebrow,
.stem-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--stem-blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.stem-eyebrow { margin-bottom: 12px; }
.stem-eyebrow-line,
.stem-section-label span {
    display: inline-block;
    width: 26px;
    height: 2px;
    background: linear-gradient(90deg, var(--stem-blue), var(--stem-cyan));
}

.stem-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.stem-heading-row h1 {
    margin: 0;
    color: var(--stem-navy);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(27px, 3.2vw, 42px);
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.16;
}

.stem-heading-row h1 span {
    color: var(--stem-blue);
}

.stem-heading-row p {
    margin: 9px 0 0;
    color: var(--stem-muted);
    font-size: 13px;
    line-height: 1.65;
}

.stem-activity-count {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid rgba(8,126,209,.16);
    border-radius: 30px;
    color: var(--stem-blue);
    background: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    box-shadow: 0 8px 24px rgba(3,17,38,.04);
}

.stem-activities-list {
    padding: 28px 0 58px;
    background: var(--stem-light);
}

.stem-activity-card {
    overflow: hidden;
    border: 1px solid var(--stem-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 42px rgba(3,17,38,.065);
    transition: box-shadow .35s ease, transform .35s ease;
}

.stem-activity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 54px rgba(3,17,38,.10);
}

.stem-activity-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 22px;
    border-bottom: 1px solid rgba(8,126,209,.09);
    background: linear-gradient(100deg, #fff, #f7fbff);
}

.stem-activity-type,
.stem-activity-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 800;
}

.stem-activity-type {
    color: var(--stem-blue);
    letter-spacing: 1.25px;
}

.stem-activity-date {
    color: var(--stem-muted);
    font-weight: 600;
    letter-spacing: .2px;
}

.stem-activity-layout {
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
    gap: 30px;
    align-items: start;
    padding: 25px;
}

/* Small image boxes: contain keeps every source image's full proportions visible. */
.stem-activity-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-content: start;
}

.stem-gallery-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 142px;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(8,126,209,.13);
    border-radius: 10px;
    background: #eef4fa;
    cursor: zoom-in;
    isolation: isolate;
    transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}

.stem-gallery-item-featured {
    grid-column: 1 / -1;
    height: 190px;
}

.stem-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: filter .3s ease, transform .3s ease;
}

.stem-gallery-item:hover,
.stem-gallery-item:focus-visible {
    z-index: 1;
    border-color: rgba(8,126,209,.55);
    box-shadow: 0 8px 24px rgba(3,17,38,.13);
    outline: none;
}

.stem-gallery-item:hover img,
.stem-gallery-item:focus-visible img {
    filter: brightness(.82);
}

.stem-image-open {
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    color: #fff;
    background: rgba(3,17,38,.78);
    font-size: 11px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}

.stem-gallery-item:hover .stem-image-open,
.stem-gallery-item:focus-visible .stem-image-open { opacity: 1; transform: translateY(0); }

.stem-activity-details { min-width: 0; }
.stem-section-label { margin-bottom: 12px; }

.stem-activity-details h2 {
    margin: 0 0 12px;
    color: var(--stem-navy);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(23px, 2.3vw, 32px);
    font-weight: 800;
    letter-spacing: -.65px;
    line-height: 1.2;
}

.stem-activity-details h2 span { color: var(--stem-blue); }

.stem-institute {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--stem-blue);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.55;
}

.stem-institute i { margin-top: 3px; }

.stem-activity-details p {
    margin: 0 0 11px;
    color: #586a80;
    font-size: 12px;
    line-height: 1.8;
}

.stem-activity-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
}

.stem-activity-tags span {
    padding: 7px 10px;
    border: 1px solid rgba(8,126,209,.13);
    border-radius: 30px;
    color: #0b4f9c;
    background: rgba(8,126,209,.055);
    font-size: 10px;
    font-weight: 700;
}

.stem-more-note {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 18px;
    padding: 17px 20px;
    border: 1px solid rgba(8,126,209,.11);
    border-radius: 14px;
    background: #fff;
}

.stem-note-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--stem-blue), var(--stem-blue-bright));
    box-shadow: 0 8px 18px rgba(8,126,209,.18);
}

.stem-more-note strong {
    display: block;
    margin-bottom: 3px;
    color: var(--stem-navy);
    font-size: 12px;
}

.stem-more-note p {
    margin: 0;
    color: var(--stem-muted);
    font-size: 11px;
    line-height: 1.6;
}

.stem-contact-link {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: var(--stem-blue);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: gap .25s ease, color .25s ease;
}

.stem-contact-link:hover { gap: 12px; color: var(--stem-navy); }

/* Lightbox */
.stem-lightbox {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 64px 70px 28px;
    background: rgba(2,10,25,.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.stem-lightbox.is-open { opacity: 1; visibility: visible; }
body.stem-lightbox-open { overflow: hidden; }

.stem-lightbox-stage {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.stem-lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    object-fit: contain;
    object-position: center;
    border: 1px solid rgba(69,217,255,.22);
    border-radius: 8px;
    box-shadow: 0 20px 70px rgba(0,0,0,.35);
}

.stem-lightbox-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(100%, 900px);
    padding-top: 13px;
    color: rgba(255,255,255,.82);
    font-size: 12px;
    line-height: 1.5;
}

.stem-lightbox-counter { flex-shrink: 0; color: var(--stem-cyan); font-weight: 800; }

.stem-lightbox-close,
.stem-lightbox-nav {
    position: absolute;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(69,217,255,.22);
    border-radius: 50%;
    color: #fff;
    background: rgba(6,26,58,.85);
    cursor: pointer;
    transition: background .25s ease, border-color .25s ease, transform .25s ease;
}

.stem-lightbox-close { top: 18px; right: 22px; font-size: 20px; }
.stem-lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.stem-lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.stem-lightbox-close:hover,
.stem-lightbox-nav:hover { border-color: var(--stem-cyan); background: var(--stem-blue); }
.stem-lightbox-prev:hover { transform: translateY(-50%) scale(1.06); }
.stem-lightbox-next:hover { transform: translateY(-50%) scale(1.06); }
.stem-lightbox-nav:disabled { opacity: .4; cursor: default; }

@media (max-width: 900px) {
    .stem-activity-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; padding: 20px; }
    .stem-gallery-item { height: 120px; }
    .stem-gallery-item-featured { height: 165px; }
    .stem-activity-details p { font-size: 11.5px; }
}

@media (max-width: 680px) {
    .stem-container { width: min(100% - 30px, 560px); }
    .stem-page-heading { padding: 25px 0 22px; }
    .stem-heading-row { align-items: flex-start; flex-direction: column; gap: 13px; }
    .stem-heading-row h1 { font-size: clamp(27px, 7vw, 36px); }
    .stem-heading-row p { font-size: 12px; }
    .stem-activity-count { padding: 8px 11px; }
    .stem-activities-list { padding: 18px 0 38px; }
    .stem-activity-topline { align-items: flex-start; flex-direction: column; gap: 8px; padding: 13px 15px; }
    .stem-activity-layout { grid-template-columns: 1fr; gap: 22px; padding: 15px; }
    .stem-activity-gallery { gap: 8px; }
    .stem-gallery-item { height: 112px; border-radius: 8px; }
    .stem-gallery-item-featured { height: 170px; }
    .stem-activity-details h2 { font-size: 25px; }
    .stem-activity-details p { font-size: 12px; }
    .stem-more-note { align-items: flex-start; flex-wrap: wrap; padding: 15px; }
    .stem-more-note > div { flex: 1; min-width: 0; }
    .stem-contact-link { margin-left: 57px; }
    .stem-lightbox { gap: 0; padding: 60px 12px 22px; }
    .stem-lightbox-image { max-width: 100%; max-height: calc(100vh - 145px); }
    .stem-lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }
    .stem-lightbox-prev { left: 8px; top: auto; bottom: 14px; width: 38px; height: 38px; transform: none; }
    .stem-lightbox-next { right: 8px; top: auto; bottom: 14px; width: 38px; height: 38px; transform: none; }
    .stem-lightbox-prev:hover, .stem-lightbox-next:hover { transform: scale(1.05); }
    .stem-lightbox-caption { padding: 12px 36px 0; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    .stem-activities-page *,
    .stem-lightbox,
    .stem-lightbox * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* Flexible activity galleries: works with four or up to eight photographs. */
.stem-flexible-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
}

.stem-flexible-gallery .stem-gallery-item {
    height: 150px;
    aspect-ratio: 4 / 3;
}

.stem-flexible-gallery .stem-gallery-item img {
    object-fit: contain;
}

/* Keep the four existing seminar photos balanced in a 2 × 2 grid. */
.stem-seminar-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stem-seminar-gallery .stem-gallery-item {
    height: 150px;
}

@media (max-width: 900px) {
    .stem-flexible-gallery .stem-gallery-item,
    .stem-seminar-gallery .stem-gallery-item {
        height: 125px;
    }
}

@media (max-width: 680px) {
    .stem-flexible-gallery .stem-gallery-item,
    .stem-seminar-gallery .stem-gallery-item {
        height: 125px;
    }
}
