/* ============================================================
   CMSA Modern Overrides
   ------------------------------------------------------------
   Visual refinements layered OVER the Evently (public) and
   EliteAdmin (member/admin) templates. Loaded last in both
   layouts so template files stay untouched and upgradeable.

   Design goals: softer depth, consistent radii, calmer motion,
   clearer focus states. No layout changes — polish only.
   ============================================================ */

:root {
    --cmsa-radius: 12px;
    --cmsa-radius-sm: 8px;
    --cmsa-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
    --cmsa-shadow-hover: 0 2px 4px rgba(16, 24, 40, .06), 0 12px 28px rgba(16, 24, 40, .10);
    --cmsa-border: rgba(16, 24, 40, .08);
    --cmsa-ease: cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------------------------------------
   Cards — softer layered shadows, consistent rounding
   ------------------------------------------------------------ */
.card {
    border-radius: var(--cmsa-radius);
    overflow: hidden; /* keep header/footer corners clipped to the radius */
}

.card.shadow-sm {
    box-shadow: var(--cmsa-shadow) !important;
    transition: box-shadow .25s var(--cmsa-ease);
}

/* Lift only cards that contain a primary link/action */
.card.shadow-sm:has(a.stretched-link):hover,
a > .card.shadow-sm:hover {
    box-shadow: var(--cmsa-shadow-hover) !important;
}

.card-header {
    border-bottom-color: var(--cmsa-border);
}

/* ------------------------------------------------------------
   Buttons — calmer transitions, subtle press feedback
   ------------------------------------------------------------ */
.btn {
    border-radius: var(--cmsa-radius-sm);
    transition: background-color .18s var(--cmsa-ease),
                border-color .18s var(--cmsa-ease),
                color .18s var(--cmsa-ease),
                box-shadow .18s var(--cmsa-ease),
                transform .12s var(--cmsa-ease);
}

.btn:active {
    transform: scale(.985);
}

/* Visible keyboard focus everywhere (a11y win, modern look) */
.btn:focus-visible,
a:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.page-link:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--accent-color, #f87500);
    outline-offset: 2px;
    box-shadow: none;
}

/* ------------------------------------------------------------
   Forms — accent-tinted focus ring instead of stock blue
   ------------------------------------------------------------ */
.form-control,
.form-select {
    border-radius: var(--cmsa-radius-sm);
    transition: border-color .18s var(--cmsa-ease), box-shadow .18s var(--cmsa-ease);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color, #f87500);
    box-shadow: 0 0 0 .2rem rgba(248, 117, 0, .12);
}

/* ------------------------------------------------------------
   Tables — quieter chrome, clearer scan lines
   ------------------------------------------------------------ */
.table > thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    color: #6b7280;
    border-bottom-width: 1px;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: rgba(16, 24, 40, .02);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: rgba(248, 117, 0, .045);
}

.table > tbody td {
    vertical-align: middle;
}

/* ------------------------------------------------------------
   Badges, pills, list groups
   ------------------------------------------------------------ */
.badge {
    border-radius: 6px;
    letter-spacing: .02em;
    font-weight: 600;
}

.nav-pills .nav-link {
    border-radius: var(--cmsa-radius-sm);
    transition: background-color .18s var(--cmsa-ease), color .18s var(--cmsa-ease);
}

.nav-pills .nav-link:not(.active):hover {
    background: rgba(16, 24, 40, .05);
}

.list-group-item-action {
    transition: background-color .15s var(--cmsa-ease), padding-left .15s var(--cmsa-ease);
}

.list-group-item-action:not(.active):hover {
    background: rgba(248, 117, 0, .05);
}

/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border-color: transparent;
    transition: background-color .15s var(--cmsa-ease);
}

.pagination .page-item.active .page-link {
    box-shadow: var(--cmsa-shadow);
}

.pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background: rgba(16, 24, 40, .06);
}

/* ------------------------------------------------------------
   Modals & dropdowns — deeper soft shadow, rounded
   ------------------------------------------------------------ */
.modal-content {
    border: none;
    border-radius: var(--cmsa-radius);
    box-shadow: 0 8px 16px rgba(16, 24, 40, .08), 0 24px 64px rgba(16, 24, 40, .16);
}

.dropdown-menu {
    border: 1px solid var(--cmsa-border);
    border-radius: var(--cmsa-radius-sm);
    box-shadow: var(--cmsa-shadow-hover);
}

.dropdown-item {
    border-radius: 6px;
    margin: 0 4px;
    width: auto;
    transition: background-color .12s var(--cmsa-ease);
}

/* ------------------------------------------------------------
   Alerts
   ------------------------------------------------------------ */
.alert {
    border-radius: var(--cmsa-radius-sm);
    border-width: 0;
    border-left: 4px solid currentColor;
}

/* ------------------------------------------------------------
   Images & media polish
   ------------------------------------------------------------ */
.event-ads img,
.card-img-top {
    transition: opacity .2s var(--cmsa-ease);
}

.event-ads a:hover img {
    opacity: .9;
}

/* Calendar date tiles (event pages) — match card rounding */
.cal-tile {
    border-radius: var(--cmsa-radius-sm) !important;
    border-color: var(--cmsa-border) !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

/* ------------------------------------------------------------
   Sponsor strips — borderless logo rows that blend into the page
   ------------------------------------------------------------ */
.sponsor-strip {
    margin-bottom: 1.5rem;
}

.sponsor-strip-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #9aa0a6;
    margin-bottom: 16px;
}

/* hairline rules either side of the title */
.sponsor-strip-title::before,
.sponsor-strip-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(16, 24, 40, .1);
}

.sponsor-strip-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 30px;
}

.sponsor-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    width: 128px;
    padding: 4px;
    text-decoration: none;
    transition: transform .18s var(--cmsa-ease), opacity .18s var(--cmsa-ease);
}

.sponsor-tile img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    /* soften the hard white boxes of JPG logos against the light page */
    mix-blend-mode: multiply;
}

a.sponsor-tile:hover {
    transform: translateY(-2px);
    opacity: .85;
}

@media (max-width: 575px) {
    .sponsor-strip-grid {
        gap: 8px 18px;
    }

    .sponsor-tile {
        height: 52px;
        width: 104px;
    }
}

/* ------------------------------------------------------------
   Facebook feed — borderless, sits on the page (no card chrome)
   ------------------------------------------------------------ */
.fb-feed-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #9aa0a6;
    margin-bottom: 14px;
}

.fb-feed-title .bi-facebook {
    color: var(--accent-color, #f87500);
    margin-right: 6px;
}

.fb-feed-title a {
    text-transform: none;
    letter-spacing: 0;
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    color: var(--accent-color, #f87500);
}

.fb-feed-title a:hover {
    text-decoration: underline;
}

#fb-page-embed {
    display: flex;
    justify-content: center;
}

#fb-page-embed iframe {
    max-width: 100%;
}

/* ------------------------------------------------------------
   Home sidebar — scrollable featured-events rail
   ------------------------------------------------------------ */
.event-rail-scroll {
    max-height: 880px;
    overflow-y: auto;
}

.event-rail-scroll::-webkit-scrollbar {
    width: 8px;
}

.event-rail-scroll::-webkit-scrollbar-thumb {
    background: rgba(16, 24, 40, .18);
    border-radius: 4px;
}

.event-rail-scroll::-webkit-scrollbar-track {
    background: rgba(16, 24, 40, .04);
}

/* ------------------------------------------------------------
   Footer branding — tagline in Kaushan Script
   ------------------------------------------------------------
   Brush-script motto spanning the footer left-to-right in the
   antique cream that the old name line used. Font loaded in
   layouts/public; scoped to #footer so the legacy header rules
   in main.css are untouched. */
#footer .header-logo-motto {
    font-family: 'Kaushan Script', cursive;
    font-size: 1.7rem;
    font-weight: 400;
    font-style: normal; /* the script slant replaces the old italic */
    line-height: 1.4;
    letter-spacing: .02em;
    color: #e8d9b8;
    margin-bottom: 28px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .45);
    /* centered, with a hairline running through to either side of the text */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    white-space: nowrap;
}

#footer .header-logo-motto::before,
#footer .header-logo-motto::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: rgba(232, 217, 184, .28);
}

@media (max-width: 767px) {
    #footer .header-logo-motto {
        font-size: 1.3rem;
        gap: 12px;
        white-space: normal;
    }
}

/* ------------------------------------------------------------
   Motion comfort — respect reduced-motion preference
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------------------------------------
   Scrollbars (WebKit) — slimmer, calmer
   ------------------------------------------------------------ */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(16, 24, 40, .18);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(16, 24, 40, .04);
}
