.gallery-hero,
.gallery-section {
    --gallery-navy: #001d40;
    --gallery-blue: #0077b6;
    --gallery-muted: #566b7f;
    --gallery-border: #dbe6ee;
}

.gallery-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(54px, 8vw, 92px) 0;
    border-bottom: 1px solid var(--gallery-border);
    background: radial-gradient(circle at 88% 10%, rgba(1, 167, 227, .13), transparent 30%), var(--color-bg);
}

.gallery-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    align-items: center;
    gap: clamp(34px, 7vw, 82px);
}

.gallery-eyebrow {
    margin: 0 0 10px;
    color: var(--gallery-blue);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.gallery-hero h1 {
    max-width: 760px;
    margin: 0;
    color: var(--gallery-navy);
    font-size: clamp(2.5rem, 5.5vw, 4.35rem);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.gallery-hero h1 + p {
    max-width: 760px;
    margin-top: 22px;
    color: #465c71;
    font-size: clamp(1.02rem, 1.7vw, 1.16rem);
    line-height: 1.75;
}

.gallery-hero-note {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
    padding: 26px;
    border: 1px solid var(--gallery-border);
    border-top: 3px solid #01a7e3;
    border-radius: 18px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 18px 42px rgba(0, 29, 64, .08);
}

.gallery-hero-note > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    background: #edf8fd;
    color: #0077b6;
}

.gallery-hero-note strong {
    color: var(--gallery-navy);
    font-size: 1.03rem;
}

.gallery-hero-note p {
    margin-top: 6px;
    color: var(--gallery-muted);
    font-size: .9rem;
    line-height: 1.6;
}

.gallery-jump {
    position: relative;
    z-index: 2;
    border-bottom: 1px solid #dbe6ee;
    background: rgba(255, 255, 255, .96);
}

.gallery-jump .container {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px 28px;
    overflow-x: auto;
    padding-block: 14px;
    scrollbar-width: none;
}

.gallery-jump .container::-webkit-scrollbar { display: none; }

.gallery-jump a {
    flex: 0 0 auto;
    padding: 5px 2px;
    color: #425a70;
    font-size: .85rem;
    font-weight: 750;
    white-space: nowrap;
}

.gallery-jump a:hover,
.gallery-jump a:focus-visible {
    color: #0077b6;
}

.gallery-section {
    padding: clamp(70px, 8vw, 104px) 0;
    scroll-margin-top: 104px;
}

.gallery-section--soft {
    border-block: 1px solid #e2ebf2;
    background: #f3f8fb;
}

.gallery-heading {
    max-width: 760px;
    margin: 0 auto 40px;
    text-align: center;
}

.gallery-heading h2 {
    margin: 0;
    color: var(--gallery-navy);
    font-size: clamp(1.9rem, 3.8vw, 2.9rem);
    line-height: 1.14;
    letter-spacing: -.035em;
}

.gallery-heading > p:last-child {
    margin-top: 16px;
    color: var(--gallery-muted);
    line-height: 1.7;
}

.gallery-video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    max-width: 1080px;
    margin: 0 auto;
}

.gallery-video-card,
.gallery-profile-card {
    --gallery-accent: #0781c5;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--gallery-border);
    border-top: 3px solid var(--gallery-accent);
    border-radius: 18px;
    background: var(--color-white);
    box-shadow: 0 14px 36px rgba(0, 29, 64, .07);
}

[data-theme="gymnastics"] { --gallery-accent: #15834f; }
[data-theme="summer"] { --gallery-accent: #d87618; }

.gallery-video-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #dce8ef;
}

.gallery-video-cover::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 18, 42, .58));
    content: "";
}

.gallery-video-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.gallery-video-cover:hover img,
.gallery-video-cover:focus-visible img {
    transform: scale(1.025);
}

.gallery-play {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    background: rgba(0, 29, 64, .76);
    color: #fff;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(6px);
}

.gallery-platform {
    position: absolute;
    z-index: 2;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(0, 29, 64, .82);
    color: #fff;
    font-size: .78rem;
    font-weight: 750;
}

.gallery-video-content {
    padding: 24px;
}

.gallery-video-content > p,
.gallery-profile-card > p {
    margin: 0 0 8px;
    color: var(--gallery-accent);
    font-size: .78rem;
    font-weight: 800;
}

.gallery-video-content h3,
.gallery-profile-card h3 {
    margin: 0;
    color: var(--gallery-navy);
    font-size: 1.2rem;
    line-height: 1.35;
}

.gallery-video-content > span,
.gallery-profile-card > span:not(.gallery-profile-icon) {
    display: block;
    margin-top: 10px;
    color: var(--gallery-muted);
    font-size: .92rem;
    line-height: 1.65;
}

.gallery-video-content > a,
.gallery-instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 20px;
    color: var(--gallery-accent);
    font-size: .9rem;
    font-weight: 800;
}

.gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.gallery-service-groups {
    display: grid;
    gap: 42px;
}

.gallery-service-group {
    --gallery-accent: #0781c5;
    min-width: 0;
}

.gallery-service-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.gallery-service-header p {
    margin: 0 0 4px;
    color: var(--gallery-accent);
    font-size: .76rem;
    font-weight: 800;
}

.gallery-service-header h3 {
    margin: 0;
    color: var(--gallery-navy);
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.gallery-rail-controls {
    display: flex;
    gap: 8px;
}

.gallery-rail-controls button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid #cbdce8;
    border-radius: 50%;
    background: #fff;
    color: var(--gallery-navy);
    font: inherit;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
}

.gallery-rail-controls button:hover,
.gallery-rail-controls button:focus-visible {
    border-color: var(--gallery-accent);
    color: var(--gallery-accent);
}

.gallery-rail-controls button:disabled {
    opacity: .38;
    cursor: default;
}

.gallery-photo-rail {
    display: grid;
    grid-auto-columns: calc((100% - 32px) / 3);
    grid-auto-flow: column;
    gap: 16px;
    overflow-x: auto;
    padding: 2px 2px 14px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #b8cad8 transparent;
    overscroll-behavior-inline: contain;
}

.gallery-photo-rail::-webkit-scrollbar { height: 6px; }
.gallery-photo-rail::-webkit-scrollbar-track {
    border-radius: 999px;
    background: transparent;
}
.gallery-photo-rail::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 999px;
    background: #b8cad8;
}

.gallery-photo-rail .gallery-photo {
    scroll-snap-align: start;
}

.gallery-photo {
    --gallery-accent: #0781c5;
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--gallery-border);
    border-top: 3px solid var(--gallery-accent);
    border-radius: 16px;
    background: #dfeaf1;
    box-shadow: 0 10px 26px rgba(0, 29, 64, .06);
}

.gallery-photo-link {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

.gallery-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.gallery-photo-link:hover img,
.gallery-photo-link:focus-visible img {
    transform: scale(1.025);
}

.gallery-photo figcaption {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 10px;
    background: rgba(0, 29, 64, .82);
    color: #fff;
    font-size: .84rem;
    font-weight: 750;
    backdrop-filter: blur(5px);
    pointer-events: none;
}

.gallery-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
}

.gallery-profile-card {
    display: flex;
    flex-direction: column;
    padding: 26px;
}

.gallery-profile-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 14px;
    background: #edf5f9;
    color: var(--gallery-accent);
}

.gallery-profile-card small {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 18px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #f2f6f9;
    color: #52677a;
    font-size: .75rem;
    font-weight: 750;
}

.gallery-profile-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: auto;
    padding-top: 22px;
}

.gallery-profile-actions > a:last-child {
    color: #465d72;
    font-size: .87rem;
    font-weight: 750;
}

@media (max-width: 900px) {
    .gallery-hero-inner { grid-template-columns: 1fr; }
    .gallery-hero-note { max-width: 640px; }
    .gallery-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-profile-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .gallery-section { padding: 66px 0; scroll-margin-top: 88px; }
    .gallery-video-grid { grid-template-columns: 1fr; }
    .gallery-photo-rail { grid-auto-columns: calc((100% - 16px) / 2); }
}

@media (max-width: 520px) {
    .gallery-hero { padding: 44px 0 54px; }
    .gallery-hero h1 { overflow-wrap: anywhere; }
    .gallery-hero-note { grid-template-columns: 38px minmax(0, 1fr); padding: 20px; }
    .gallery-hero-note > span { width: 38px; height: 38px; }
    .gallery-jump .container { justify-content: flex-start; gap: 4px 18px; }
    .gallery-profile-grid { grid-template-columns: 1fr; }
    .gallery-photo-rail { grid-auto-columns: 88%; }
    .gallery-photo-rail {
        scrollbar-width: auto;
        scrollbar-color: var(--gallery-accent) #dce8f0;
    }
    .gallery-photo-rail::-webkit-scrollbar { height: 9px; }
    .gallery-photo-rail::-webkit-scrollbar-track { background: #dce8f0; }
    .gallery-photo-rail::-webkit-scrollbar-thumb {
        border: 2px solid #dce8f0;
        background: var(--gallery-accent);
    }
    .gallery-rail-controls { display: none; }
    .gallery-photo-link {
        display: grid;
        aspect-ratio: auto;
        overflow: visible;
    }
    .gallery-photo img {
        aspect-ratio: 3 / 2;
        object-fit: cover;
    }
    .gallery-photo figcaption {
        position: static;
        min-height: 48px;
        padding: 10px 12px;
        border: 0;
        border-radius: 0;
        background: #fff;
        color: var(--gallery-navy);
        font-size: .78rem;
        line-height: 1.35;
        backdrop-filter: none;
    }
    .gallery-profile-card:last-child { grid-column: auto; }
    .gallery-video-content,
    .gallery-profile-card { padding: 21px; }
    .gallery-play { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-photo-rail { scroll-behavior: auto; }
    .gallery-video-cover img,
    .gallery-photo img { transition: none; }
}
