/*
 * core.css
 * Site-wide vanilla CSS foundation for the rebuilt cnyfsc.com. This
 * replaces Bootstrap's role (grid, buttons, forms, cards, spacing
 * utilities) for any page that has been migrated off the old
 * Bootstrap/Unify theme (loaded via _inc/css.cfm). Migrated pages should
 * stop including css.cfm and include this file instead.
 *
 * Naming convention: every class is prefixed "c-" (core) so it can never
 * collide with legacy Bootstrap classes (.row, .col, .btn, etc.) still
 * used by pages that haven't been migrated yet.
 */

/* -------------------------------------------------------------------- */
/* Design tokens                                                        */
/* -------------------------------------------------------------------- */
@import url("../fonts/inter.css");

@font-face {
    font-family: "Bebas Neue Regular";
    src: url("../fonts/BebasNeue-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    --c-color-primary: #6294c4;      /* CNYFSC blue */
    --c-color-primary-dark: #1f3b4d; /* dark blue for buttons, links and panels (the scrolled header now uses #0c2d48, see header-v2.css) */
    --c-color-accent: #7dd43e;       /* "go" green, used for hover/active */
    --c-color-text: #333333;
    --c-color-text-muted: #6b6b6b;
    --c-color-border: #dfe3e6;
    --c-color-bg: #f4f4f4;
    --c-color-bg-alt: #f4f6f8;

    --c-font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --c-font-family-heading: "Bebas Neue Regular", sans-serif;
    --c-font-size-base: 14px;
    --c-line-height-base: 1.5;

    --c-space-1: 4px;
    --c-space-2: 8px;
    --c-space-3: 16px;
    --c-space-4: 24px;
    --c-space-5: 40px;

    --c-radius: 4px;
    --c-container-max: 1200px;
    --c-transition: 0.2s ease;
}

/* -------------------------------------------------------------------- */
/* Base / reset                                                         */
/* -------------------------------------------------------------------- */
html,
body {
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--c-font-family);
    font-weight: 400;
    font-size: var(--c-font-size-base);
    line-height: var(--c-line-height-base);
    color: var(--c-color-text);
    background: var(--c-color-bg);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--c-color-primary);
}

a:hover,
a:focus-visible {
    color: var(--c-color-accent);
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    font-family: "cubano", sans-serif;
}

/* Screen-reader-only helper (visible to assistive tech, hidden visually) */
.c-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------------------------- */
/* Layout: container + CSS Grid based row/col                           */
/* -------------------------------------------------------------------- */

/* Reserve space for the fixed site header (see header-v2.css --sh-header-height)
   on every page that uses the shared header-v2.cfm shell. Also a full-viewport-
   height flex column so footer-v2.cfm (margin-top: auto, see footer-v2.css)
   sticks to the bottom of the viewport on short pages instead of floating
   right under the content. */
.c-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--sh-header-height);
}

.c-container {
    width: 100%;
    max-width: var(--c-container-max);
    margin: 0 auto;
    padding: 0 var(--c-space-3);
}

.c-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--c-space-4);
}

/* Column span utilities: .c-col-1 .. .c-col-12, plus responsive variants */
.c-col-1 { grid-column: span 1; }
.c-col-2 { grid-column: span 2; }
.c-col-3 { grid-column: span 3; }
.c-col-4 { grid-column: span 4; }
.c-col-5 { grid-column: span 5; }
.c-col-6 { grid-column: span 6; }
.c-col-7 { grid-column: span 7; }
.c-col-8 { grid-column: span 8; }
.c-col-9 { grid-column: span 9; }
.c-col-10 { grid-column: span 10; }
.c-col-11 { grid-column: span 11; }
.c-col-12 { grid-column: span 12; }

@media only screen and (max-width: 767px) {
    /* Stack everything to full width by default on small screens */
    .c-row > [class*="c-col-"] {
        grid-column: span 12;
    }
}

.c-flex {
    display: flex;
}

.c-flex--center {
    align-items: center;
}

.c-flex--between {
    justify-content: space-between;
}

.c-flex--wrap {
    flex-wrap: wrap;
}

.c-flex--gap {
    gap: var(--c-space-3);
}

/* -------------------------------------------------------------------- */
/* Typography utilities                                                 */
/* -------------------------------------------------------------------- */
.c-text-center { text-align: center; }
.c-text-uppercase { text-transform: uppercase; }
.c-text-muted { color: var(--c-color-text-muted); }

.c-heading {
    font-family: var(--c-font-family-heading);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 var(--c-space-3);
}

.c-heading a {
    text-decoration: none;
}

/* -------------------------------------------------------------------- */
/* Spacing utilities (margin/padding, 1-5 scale matching --c-space-*)    */
/* -------------------------------------------------------------------- */
.c-mt-1 { margin-top: var(--c-space-1); }
.c-mt-2 { margin-top: var(--c-space-2); }
.c-mt-3 { margin-top: var(--c-space-3); }
.c-mt-4 { margin-top: var(--c-space-4); }
.c-mt-5 { margin-top: var(--c-space-5); }

.c-mb-1 { margin-bottom: var(--c-space-1); }
.c-mb-2 { margin-bottom: var(--c-space-2); }
.c-mb-3 { margin-bottom: var(--c-space-3); }
.c-mb-4 { margin-bottom: var(--c-space-4); }
.c-mb-5 { margin-bottom: var(--c-space-5); }

.c-py-1 { padding-top: var(--c-space-1); padding-bottom: var(--c-space-1); }
.c-py-2 { padding-top: var(--c-space-2); padding-bottom: var(--c-space-2); }
.c-py-3 { padding-top: var(--c-space-3); padding-bottom: var(--c-space-3); }
.c-py-4 { padding-top: var(--c-space-4); padding-bottom: var(--c-space-4); }
.c-py-5 { padding-top: var(--c-space-5); padding-bottom: var(--c-space-5); }

/* -------------------------------------------------------------------- */
/* Buttons                                                               */
/* -------------------------------------------------------------------- */
.c-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--c-space-2);
    font-family: "cubano", sans-serif;
    padding: 12px 20px;
    border: 0;
    border-radius: var(--c-radius);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--c-transition), color var(--c-transition);
}

.c-btn--primary {
    background-color: var(--c-color-primary);
    color: #fff;
}

.c-btn--primary:hover,
.c-btn--primary:focus-visible {
    background-color: var(--c-color-primary-dark);
    color: var(--c-color-accent);
}

.c-btn--small {
    padding: 6px 12px;
    font-size: 10px;
}

.c-btn--medium {
    padding: 9px 16px;
    font-size: 11px;
}

/* -------------------------------------------------------------------- */
/* Quick links (subtle, muted buttons - distinct from .c-btn)          */
/* -------------------------------------------------------------------- */
.c-quick-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--c-space-2);
}

.c-quick-link {
    display: flex;
    align-items: center;
    gap: var(--c-space-2);
    padding: 10px 14px;
    border-radius: var(--c-radius);
    background: var(--c-color-bg-alt);
    color: var(--c-color-text);
    font-size: 14px;
    text-decoration: none;
    transition: background-color var(--c-transition), color var(--c-transition);
}

.c-quick-link:hover,
.c-quick-link:focus-visible {
    background: var(--c-color-border);
    color: var(--c-color-primary);
}

.c-quick-link__icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--c-color-text-muted);
}

/* -------------------------------------------------------------------- */
/* Forms                                                                 */
/* -------------------------------------------------------------------- */
.c-field {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--c-color-border);
    border-radius: var(--c-radius);
    font-size: 14px;
    font-family: inherit;
    background-color: #fff;
}

.c-field:focus-visible {
    outline: 2px solid var(--c-color-primary);
    outline-offset: 1px;
}

.c-form-label {
    display: block;
    margin-bottom: var(--c-space-2);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--c-color-text-muted);
}

/* Label + field pair, used inside a .c-row of .c-col-N form fields */
.c-form-group {
    margin-bottom: var(--c-space-3);
}

textarea.c-field {
    min-height: 120px;
    resize: vertical;
}

/* Text input + submit button rendered as a single joined control */
.c-input-group {
    display: flex;
    border-radius: var(--c-radius);
    overflow: hidden;
}

.c-input-group .c-field {
    border-right: 0;
    border-radius: 0;
}

.c-input-group .c-btn {
    border-radius: 0;
}

/* -------------------------------------------------------------------- */
/* Cards (used for news/content grids)                                  */
/* -------------------------------------------------------------------- */
.c-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--c-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.home-utility-card {
    height: 100%;
    padding: var(--c-space-4);
}

.c-schedule-list {
    font-size: 14px;
}

.c-schedule-cta {
    display: flex;
    width: fit-content;
    margin: var(--c-space-3) auto 0;
}

.c-card__media img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.c-card__body {
    padding: var(--c-space-3);
}

.c-card__title {
    margin: 0 0 var(--c-space-2);
    font-size: 15px;
    font-family: var(--c-font-family-heading);
}

.c-card__title a {
    color: var(--c-color-text);
    text-decoration: none;
    font-size: 18px;
}

.c-card__title a:hover {
    color: var(--c-color-primary);
}

.c-card__text {
    margin: 0;
    font-size: 14px;
    color: var(--c-color-text-muted);
}

/* -------------------------------------------------------------------- */
/* Simple list widget (quick links, schedule rows, etc.)                */
/* -------------------------------------------------------------------- */
.c-list-plain {
    list-style: none;
    margin: 0;
    padding: 0;
}

.c-list-plain li + li {
    margin-top: var(--c-space-2);
}

/* -------------------------------------------------------------------- */
/* Carousel (used for sponsor logos; see core.js Core.createCarousel)   */
/* -------------------------------------------------------------------- */
.c-carousel {
    position: relative;
}

.c-carousel__track > [hidden] {
    display: none;
}

.c-carousel__track {
    transition: transform 0.45s ease;
}

.c-carousel__slide img {
    max-height: 80px;
    width: auto;
}

.c-carousel--feature {
    overflow: visible;
}

.c-carousel--feature .c-carousel__viewport {
    overflow: hidden;
    background: var(--c-color-bg-alt);
}

.c-carousel--sponsors {
    overflow: visible;
    padding: 0;
    background: #fff;
}

.c-carousel--sponsors .c-carousel__track {
    display: flex;
    align-items: center;
    margin: 0;
}

.c-carousel--sponsors .c-carousel__viewport {
    overflow: hidden;
}

.c-carousel--sponsors .c-carousel__slide {
    flex: 0 0 50%;
    justify-content: center;
    padding: var(--c-space-3);
}

.c-carousel--sponsors .c-carousel__slide img {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}

.c-sponsor-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.c-sponsor-trigger:focus-visible {
    outline: 2px solid var(--c-color-primary);
    outline-offset: 3px;
}

.c-sponsor-lightbox {
    position: fixed;
    width: min(760px, calc(100% - 32px));
    max-width: 760px;
    padding: var(--c-space-5);
    border: 0;
    border-radius: var(--c-radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.c-sponsor-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

.c-sponsor-lightbox__close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: transparent;
    color: var(--c-color-text-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.c-sponsor-lightbox__image-link,
.c-sponsor-lightbox__image {
    display: block;
}

.c-sponsor-lightbox__image {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    margin: 0 auto var(--c-space-3);
}

.c-sponsor-lightbox__name {
    margin: 0 0 var(--c-space-2);
    font-size: 20px;
}

.c-sponsor-lightbox__website {
    font-weight: 700;
}

@media only screen and (min-width: 520px) {
    .c-carousel--sponsors .c-carousel__slide {
        flex-basis: 33.333%;
    }
}

@media only screen and (min-width: 800px) {
    .c-carousel--sponsors .c-carousel__slide {
        flex-basis: 25%;
    }
}

@media only screen and (min-width: 1100px) {
    .c-carousel--sponsors .c-carousel__slide {
        flex-basis: 20%;
    }
}

.c-carousel--feature .c-carousel__track {
    min-height: 260px;
    display: grid;
}

.c-feature-slide {
    position: relative;
    grid-area: 1 / 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.c-feature-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.c-feature-slide__link {
    display: block;
    color: #fff;
    text-decoration: none;
}

.c-feature-slide img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

.c-feature-slide__caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: var(--c-space-3) var(--c-space-4);
    background: rgba(0, 0, 0, 0.7);
    font-size: 18px;
    font-weight: 700;
}

@media only screen and (max-width: 767px) {
    .c-carousel--feature .c-carousel__track {
        min-height: 180px;
    }

    .c-feature-slide img {
        min-height: 180px;
    }

    .c-feature-slide__caption {
        padding: var(--c-space-2) var(--c-space-3);
        font-size: 14px;
    }
}

.c-carousel__prev,
.c-carousel__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: rgba(0, 0, 0, 0.05);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-family: "cubano", sans-serif;
    font-size: 18px;
    z-index: 1;
    transition: background-color var(--c-transition), color var(--c-transition);
}

.c-carousel__prev:hover,
.c-carousel__next:hover,
.c-carousel__prev:focus-visible,
.c-carousel__next:focus-visible {
    background: var(--sh-color-sports-blue);
    color: var(--c-color-accent);
}

.c-carousel__prev { left: -28px; }
.c-carousel__next { right: -28px; }

/* Feature carousel in the classic 825 x 385 shape (the shape of the existing carousel images, same as
   the old site): full width, height follows, so whole images show uncropped. Remove the
   c-carousel--classic class in index.cfm to go back to the shorter crop. */
.c-carousel--classic .c-carousel__track {
    min-height: 0;
    aspect-ratio: 825 / 385;
}

.c-carousel--classic .c-feature-slide img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 825 / 385;
    object-fit: cover;
}

/* position dots under a single-slide carousel (core.js createCarousel fills [data-carousel-dots]);
   same quiet grey and hover colors as the side arrows */
.c-carousel__dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
}

.c-carousel__dots[hidden] {
    display: none;
}

.c-carousel__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: background-color var(--c-transition), transform var(--c-transition);
}

/* bigger tap target than the visible dot */
.c-carousel__dot {
    position: relative;
}

.c-carousel__dot::after {
    content: "";
    position: absolute;
    inset: -7px;
}

.c-carousel__dot:hover,
.c-carousel__dot:focus-visible {
    background: rgba(12, 45, 72, 0.55); /* sports blue, lighter than the current dot */
}

.c-carousel__dot.is-active {
    background: var(--sh-color-sports-blue);
    transform: scale(1.15);
}

.c-carousel__dot:focus-visible {
    outline: 2px solid var(--sh-color-sports-blue);
    outline-offset: 2px;
}

/* keep the side arrows centred on the picture, not on picture plus dots (12px gap + 10px dot) */
.c-carousel--feature .c-carousel__prev,
.c-carousel--feature .c-carousel__next {
    top: calc(50% - 11px);
}

/* -------------------------------------------------------------------- */
/* Loading / empty / error states for client-rendered (CFC+JSON) widgets */
/* -------------------------------------------------------------------- */
.c-status {
    padding: var(--c-space-3);
    font-size: 14px;
    color: var(--c-color-text-muted);
}

.c-status--error {
    color: #b3261e;
}

.c-status--loading {
    display: flex;
    align-items: center;
    gap: var(--c-space-2);
}

.c-spinner {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid var(--c-color-border);
    border-top-color: var(--c-color-primary);
    border-radius: 50%;
    animation: c-spin 0.7s linear infinite;
}

@keyframes c-spin {
    to {
        transform: rotate(360deg);
    }
}

/* -------------------------------------------------------------------- */
/* Photo gallery (reusable grid + lightbox, see assets/js/core.js's       */
/* Core.initGallery and _inc/photo-gallery-v2.cfm)                       */
/* -------------------------------------------------------------------- */
.c-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--c-space-3);
    margin: 0 0 var(--c-space-4);
    padding: 0;
    list-style: none;
}

.c-gallery__item {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: var(--c-radius);
    overflow: hidden;
}

.c-gallery__item:focus-visible {
    outline: 2px solid var(--c-color-primary);
    outline-offset: 3px;
}

.c-gallery__item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform var(--c-transition);
}

.c-gallery__item:hover img,
.c-gallery__item:focus-visible img {
    transform: scale(1.05);
}

.c-gallery-lightbox {
    position: fixed;
    width: min(90vw, 900px);
    max-height: 90vh;
    border: 0;
    padding: 0;
    background: transparent;
}

.c-gallery-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.8);
}

.c-gallery-lightbox__image {
    display: block;
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.c-gallery-lightbox__close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--c-color-text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.c-gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: var(--c-color-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.c-gallery-lightbox__nav--prev {
    left: var(--c-space-3);
}

.c-gallery-lightbox__nav--next {
    right: var(--c-space-3);
}

@media only screen and (max-width: 600px) {
    .c-gallery__item img {
        height: 110px;
    }
}
