/* Custom Utilities */
.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.text-gradient {
    background: linear-gradient(135deg, #047857 0%, #064e3b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header {
    position: relative;
    margin-bottom: 3rem;
    text-align: center;
}
.section-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #047857;
    margin: 1rem auto 0;
    border-radius: 2px;
    opacity: 0.8;
}

/* Slider Styles */
.slider-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    z-index: 0;
}
 .slider-image.active {
    opacity: 0.15; /* Subtle background fade */ 
}

details > summary {
    list-style: none;
}
details > summary::-webkit-details-marker {
    display: none;
}
sup {
    vertical-align: super;
    font-size: smaller;
}
/* Hide scrollbar for cleaner look */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
/* ---- Scrollable news panel (All News view) ----
   The list scrolls inside a fixed-height box so the rest of the page stays
   reachable. `.news-scroll` paints the top/bottom fades; `.news-scroll-area`
   is the element that actually scrolls. */
.news-scroll::before,
.news-scroll::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0.75rem;
    height: 2rem;
    pointer-events: none;
    z-index: 5;
}
.news-scroll::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0.95), rgba(248, 250, 252, 0));
}
.news-scroll::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(248, 250, 252, 0.95), rgba(248, 250, 252, 0));
}

.news-scroll-area {
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(4, 120, 87, 0.45) transparent;
}
.news-scroll-area::-webkit-scrollbar {
    width: 8px;
}
.news-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}
.news-scroll-area::-webkit-scrollbar-thumb {
    background-color: rgba(4, 120, 87, 0.35);
    border-radius: 9999px;
}
.news-scroll-area::-webkit-scrollbar-thumb:hover {
    background-color: rgba(4, 120, 87, 0.6);
}

/* Fades match the panel background, so they need the dark-mode counterpart. */
.dark .news-scroll::before {
    background: linear-gradient(to bottom, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0));
}
.dark .news-scroll::after {
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0));
}

/* ---- News ticker (home announcement bar) ----
   The track holds the item sequence twice, as two equal groups; the animation
   slides it by exactly half its width, so the second group lands where the
   first started and the loop never shows a seam. `--ticker-duration` is set
   from index.js off the measured group width, which keeps the reading speed
   constant however many items the feed has. */
.news-ticker {
    background: linear-gradient(90deg, #064e3b 0%, #047857 55%, #059669 100%);
    color: #ecfdf5;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px -20px rgba(4, 120, 87, 0.95);
}

.news-ticker__inner {
    display: flex;
    align-items: stretch;
    min-height: 3rem;
    padding: 0 0.75rem;
}

.news-ticker__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    padding-right: 0.9rem;
    margin-right: 0.9rem;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
}
.news-ticker__label i {
    font-size: 1.05rem;
}

/* The "live" dot - the same cue a broadcast ticker uses. */
.news-ticker__pulse {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #fbbf24;
    animation: ticker-pulse 2s ease-out infinite;
}
@keyframes ticker-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7); }
    70%  { box-shadow: 0 0 0 0.5rem rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* The mask fades items in and out at the edges instead of clipping them dead. */
.news-ticker__viewport {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 1.5rem, #000 calc(100% - 2rem), transparent);
    mask-image: linear-gradient(to right, transparent, #000 1.5rem, #000 calc(100% - 2rem), transparent);
}

.news-ticker__track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: ticker-scroll var(--ticker-duration, 60s) linear infinite;
}
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Hovering or tabbing into the bar holds it still, so an item stays clickable.
   Kept as two rules on purpose: a browser without :has() still gets the hover
   pause instead of dropping the whole declaration. The keyboard half uses
   :focus-visible rather than :focus-within - a *clicked* headline keeps DOM
   focus while the visitor is away, and plain focus would latch the marquee
   paused for good once they came back. */
.news-ticker:hover .news-ticker__track {
    animation-play-state: paused;
}
.news-ticker:has(:focus-visible) .news-ticker__track {
    animation-play-state: paused;
}

.news-ticker__group {
    display: flex;
    align-items: center;
}

.news-ticker__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    white-space: nowrap;
    color: inherit;
    text-decoration: none;
}
a.news-ticker__item:hover .news-ticker__title,
a.news-ticker__item:focus-visible .news-ticker__title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.news-ticker__tag {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.news-ticker__title {
    font-size: 0.875rem;
    font-weight: 600;
}
.news-ticker__date {
    font-size: 0.7rem;
    opacity: 0.75;
}

/* The breaker between two items: a small amber diamond, drawn rather than
   iconed so it can never fail to load. */
.news-ticker__sep {
    flex: 0 0 auto;
    width: 0.45rem;
    height: 0.45rem;
    margin: 0 1.15rem;
    border-radius: 1px;
    background: #fbbf24;
    transform: rotate(45deg);
}

.news-ticker__all {
    flex: 0 0 auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 200ms ease;
}
.news-ticker__all:hover {
    background: rgba(255, 255, 255, 0.28);
}

.news-ticker__loading {
    padding: 0.9rem 0;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* On a phone the label and the "all news" pill eat into the reading space, so
   everything tightens up and the edge fades pull in. */
@media (max-width: 639px) {
    .news-ticker__inner {
        min-height: 2.75rem;
        padding: 0 0.5rem;
    }
    .news-ticker__label {
        gap: 0.35rem;
        padding-right: 0.55rem;
        margin-right: 0.55rem;
    }
    .news-ticker__item {
        gap: 0.4rem;
    }
    .news-ticker__sep {
        margin: 0 0.8rem;
    }
    .news-ticker__all {
        margin-left: 0.35rem;
        padding: 0.35rem 0.5rem;
    }
    .news-ticker__viewport {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 0.75rem, #000 calc(100% - 1rem), transparent);
        mask-image: linear-gradient(to right, transparent, #000 0.75rem, #000 calc(100% - 1rem), transparent);
    }
}

/* With motion reduced the feed does not travel: index.js renders a single
   group and the visitor scrolls it by hand. */
@media (prefers-reduced-motion: reduce) {
    .news-ticker__track {
        animation: none;
    }
    .news-ticker__viewport {
        overflow-x: auto;
        scrollbar-width: none;
    }
    .news-ticker__viewport::-webkit-scrollbar {
        display: none;
    }
    .news-ticker__pulse {
        animation: none;
    }
}

/* ---- Team member morph card ----
   The panel is positioned by inline top/left/width/height, set in team.js: it
   starts on the card's rect and transitions to the centred one. Only those
   four properties and the radius animate, so the morph reads as the card
   itself growing. */
.member-modal[hidden], .morph-modal[hidden] { display: none; }

.member-modal, .morph-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
}

.member-modal__backdrop, .morph-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 320ms ease;
}
.member-modal.is-open .member-modal__backdrop, .morph-modal.is-open .morph-modal__backdrop { opacity: 1; }

.member-modal__panel, .morph-modal__panel {
    position: absolute;
    overflow: hidden;
    background: #ffffff;
    border-radius: 1rem;           /* matches the card's rounded-2xl */
    box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.45);
    will-change: top, left, width, height;
    transition:
        top 440ms cubic-bezier(0.22, 1, 0.36, 1),
        left 440ms cubic-bezier(0.22, 1, 0.36, 1),
        width 440ms cubic-bezier(0.22, 1, 0.36, 1),
        height 440ms cubic-bezier(0.22, 1, 0.36, 1),
        border-radius 440ms cubic-bezier(0.22, 1, 0.36, 1);
}
.member-modal.is-open .member-modal__panel, .morph-modal.is-open .morph-modal__panel { border-radius: 1.75rem; }
.dark .member-modal__panel, .dark .morph-modal__panel { background: #1e293b; }

.member-modal__content, .morph-modal__content {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    transition: opacity 200ms ease;
}
.member-modal.is-open .member-modal__content, .morph-modal.is-open .morph-modal__content {
    opacity: 1;
    transition-delay: 200ms;
}

.member-modal__close, .morph-modal__close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 1.25rem;
    color: #475569;
    background: rgba(241, 245, 249, 0.9);
    opacity: 0;
    transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
}
.member-modal.is-open .member-modal__close, .morph-modal.is-open .morph-modal__close {
    opacity: 1;
    transition-delay: 200ms;
}
.member-modal__close:hover, .morph-modal__close:hover {
    background: #047857;
    color: #ffffff;
}
.dark .member-modal__close, .dark .morph-modal__close {
    background: rgba(51, 65, 85, 0.9);
    color: #e2e8f0;
}

/* The photo the card could never show properly: large, rounded rectangle. */
.member-modal__photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 1.5rem;
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .member-modal__panel, .morph-modal__panel,
    .member-modal__backdrop, .morph-modal__backdrop,
    .member-modal__content, .morph-modal__content,
    .member-modal__close, .morph-modal__close {
        transition: none;
    }
}

/* ---- Team page backdrop ----
   The 2026 group photo sits behind the whole team page. Two scrims are stacked
   over it: a dark one that knocks the photo back so it reads as a backdrop
   rather than a picture, and a light one so the slate text and white cards on
   top keep their contrast. The element is fixed, so the photo holds still while
   the cards scroll over it. */
.team-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(248, 250, 252, 0.523), rgba(248, 250, 252, 0.367)),
        linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.55)),
        url('../assets/outings/outing1-2026.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Dark mode wants the opposite pairing: no light veil, a heavier dark one. */
.dark .team-backdrop {
    background-image:
        linear-gradient(rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.82)),
        url('../assets/outings/outing1-2026.jpg');
}
