:root {
    --site-bg: #f6f7fb;
    --site-surface: #fff;
    --site-surface-muted: #eef1f6;
    --site-text: #172033;
    --site-muted: #5b6475;
    --site-brand: #1864d8;
    --site-brand-dark: #0f47a1;
    --site-accent: #e84f2b;
    --site-border: #dce1ea;
    --site-radius: .8rem;
    --site-shadow: 0 .6rem 2rem rgba(23, 32, 51, .09);
    --site-content: 75rem;
    --site-reading-content: 68rem;
    --site-content-start: clamp(1.5rem, 3vw, 2.25rem);
}

html { scroll-behavior: smooth; }
body { width: 100%; max-width: 1300px; min-height: 100vh; margin: 0 auto; background: var(--site-bg); color: var(--site-text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; }
body > main, body > .groupArea, body > #content { min-height: 45vh; }
img { max-width: 100%; height: auto; }
a { color: var(--site-brand-dark); text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; }
button, .button, .buttonsm, .buttonlrg, .nextStep { min-height: 2.75rem; border: 0; border-radius: .45rem; padding: .65rem 1rem; background: var(--site-brand); color: #fff; cursor: pointer; font-weight: 700; text-decoration: none; }
button:hover, .button:hover, .buttonsm:hover, .buttonlrg:hover, .nextStep:hover { background: var(--site-brand-dark); color: #fff; }
:focus-visible { outline: .2rem solid #f5a623; outline-offset: .18rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: .5rem; left: .5rem; transform: translateY(-200%); background: #fff; color: #111; padding: .6rem 1rem; border-radius: .35rem; }
.skip-link:focus { transform: none; }

/*
 * DAILY BANNERS ARE ACTIVE
 *
 * ColorBanners supplies the masthead and footer background images through
 * Thymeleaf's colorHeader and colorFooter model attributes.
 *
 * QUICK SOLID-COLOR OPTION:
 * Uncomment both rules below to restore this redesign's original solid-color
 * masthead and footer. !important intentionally overrides the daily inline
 * banner styles, so no Java or template change is necessary.
 *
 * .site-header { background: rgba(16, 24, 39, .97) !important; }
 * .site-footer { background: #101827 !important; }
 */
.site-header { position: sticky; top: 0; z-index: 100; border: 0; border-bottom: 1px solid rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(12px); }
.site-header__inner { width: min(100% - 2rem, var(--site-content)); min-height: 4.5rem; margin: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; }
.site-brand { display: inline-flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; line-height: 1.1; letter-spacing: .01em; }
.site-brand img { width: 2.45rem; height: 3.5rem; object-fit: cover; border-radius: .25rem; }
.site-brand strong, .site-brand small { display: block; }
.site-brand strong { font-size: 1.05rem; }
.site-brand small { margin-top: .2rem; color: #bbc7da; font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; }
.nav-toggle { width: 2.8rem; min-height: 2.8rem; padding: .65rem; display: grid; gap: .27rem; align-content: center; border: 1px solid #58657a; background: transparent; }
.nav-toggle span[aria-hidden] { display: block; height: 2px; background: currentColor; }
.primary-nav { display: none; grid-column: 1 / -1; margin: 0 -1rem; padding: .25rem 1rem 1rem; background: #101827; }
.primary-nav.is-open { display: grid; }
.site-header .primary-nav a,
.site-header .account-nav a,
.site-header .account-nav button {
    color: #f8fafc;
    background: transparent;
    text-decoration: none;
    font-family: "Arial Black", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 1px;
}
.primary-nav a { padding: .75rem .35rem; border-bottom: 1px solid #313d50; }
.primary-nav a:hover, .account-nav a:hover, .account-nav button:hover { color: #8fc1ff; background: transparent; }
.account-nav { display: none; }
.primary-nav.is-open + .account-nav { display: flex; grid-column: 1 / -1; align-items: center; gap: .8rem; margin: -1rem -1rem 0; padding: .75rem 1rem 1rem; background: #101827; }

.member-nav { background: #e9edf4; border-bottom: 1px solid var(--site-border); }
.member-nav__inner { width: min(100% - 2rem, var(--site-content)); margin: auto; display: flex; gap: .35rem 1.2rem; overflow-x: auto; padding: .55rem 0; }
.member-nav a { white-space: nowrap; color: #27344a; font-size: .9rem; font-weight: 650; text-decoration: none; }

.site-footer { margin-top: 4rem; padding: 2.5rem 1rem 1.25rem; color: #c8d1df; }
.site-footer__inner { width: min(100%, var(--site-content)); margin: auto; display: grid; gap: 2rem; }
.site-footer__brand { color: #fff; font-size: 1.2rem; font-weight: 800; text-decoration: none; }
.site-footer nav { display: flex; flex-wrap: wrap; align-content: start; gap: .5rem 1rem; }
.site-footer a { color: #e6edf8; }
.site-footer__legal { width: min(100%, var(--site-content)); margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid #344055; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; font-size: .78rem; }

.page-shell { width: min(100% - 2rem, var(--site-content)); margin: 0 auto; }
.content-page { width: min(100% - 2rem, var(--site-reading-content)); }
.page-section { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.eyebrow { margin: 0 0 .7rem; color: var(--site-brand); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }
.hero { display: grid; align-items: center; gap: 2rem; padding: clamp(2.5rem, 7vw, 6rem) 0; }
.hero h1 { max-width: 15ch; margin: 0; font-size: clamp(2.4rem, 7vw, 5.4rem); line-height: .98; letter-spacing: -.045em; }
.hero__lead { max-width: 42rem; color: var(--site-muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.button--secondary { border: 1px solid var(--site-border); background: var(--site-surface); color: var(--site-text); }
.button--secondary:hover { background: var(--site-surface-muted); color: var(--site-text); }
.section-heading { max-width: 45rem; margin-bottom: 1.5rem; }
.section-heading h2 { margin: 0 0 .5rem; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.1; }
.section-heading p { color: var(--site-muted); }
.card-grid { display: grid; gap: 1rem; }
.card { border: 1px solid var(--site-border); border-radius: var(--site-radius); background: var(--site-surface); box-shadow: var(--site-shadow); overflow: hidden; }
.card__body { padding: 1.2rem; }
.card h2, .card h3 { margin-top: 0; }
.video-grid { display: grid; gap: 1rem; }
.video-card { position: relative; aspect-ratio: 16 / 9; background: #101827; }
.video-card--short { aspect-ratio: 9 / 16; max-height: 34rem; }
.video-card iframe { width: 100%; height: 100%; border: 0; }
.album-grid { display: grid; gap: 1rem; }
.album-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.service-links { display: flex; flex-wrap: wrap; gap: .55rem; }
.service-links a { border: 1px solid var(--site-border); border-radius: 999px; padding: .4rem .75rem; background: #fff; text-decoration: none; font-weight: 650; }
.notice { border-left: .3rem solid var(--site-brand); border-radius: .25rem; padding: .85rem 1rem; background: #eaf3ff; }
.notice--success { border-color: #18864b; background: #eaf8f0; }
.notice--warning { border-color: #c77800; background: #fff5df; }
.media-link-list { margin: 0; padding: 0; list-style: none; }
.media-link-list li + li { border-top: 1px solid var(--site-border); }
.media-link-list a { display: block; padding: .8rem 0; font-weight: 650; }
.home-catalog { background: #e9edf4; }
.home-services { justify-content: center; margin-top: 1.5rem; }
.membership-cta { max-width: 58rem; text-align: center; }
.membership-cta .actions { justify-content: center; }
.feature-heading { max-width: 52rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.feature-heading h1 { max-width: 16ch; margin: 0; font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -.04em; }
.feature-heading > p:last-child { max-width: 46rem; margin: 1rem 0 0; color: var(--site-muted); font-size: 1.08rem; }
.legacy-content > img, .legacy-content p > img { border-radius: var(--site-radius); }
.admin-grid { display: grid; gap: 1rem; }
.admin-card { color: var(--site-text); text-decoration: none; }
.admin-card:hover { border-color: var(--site-brand); transform: translateY(-2px); }
.admin-card h2 { font-size: 1.15rem; }
.admin-card p { margin-bottom: 0; color: var(--site-muted); }
.feature-management-section { margin-top: 3rem; }
.feature-management-card { color: var(--site-text); }
.feature-management-card .card__body { display: grid; gap: .8rem; }
.feature-management-card h3, .feature-management-card p { margin: 0; }
.feature-management-card label, .feature-management-create label { display: grid; gap: .25rem; font-weight: 650; }
.feature-management-card input, .feature-management-card select,
.feature-management-create input, .feature-management-create select { box-sizing: border-box; width: 100%; min-height: 2.6rem; padding: .4rem .55rem; border: 1px solid var(--site-border); border-radius: .35rem; background: #fff; color: var(--site-text); }
.feature-management-card button:disabled { cursor: not-allowed; opacity: .5; }
.feature-management-create { margin-top: 1rem; padding: 1.2rem; }
.feature-management-create summary { cursor: pointer; font-weight: 750; }
.feature-management-create form { display: grid; gap: .8rem; margin-top: 1rem; }
.feature-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.feature-status { width: fit-content; border-radius: 999px; padding: .2rem .65rem; background: var(--site-surface-muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.feature-status--on { background: #eaf8f0; color: #176b3a; }
.subscriber-management-section { margin-top: 3rem; }
.subscriber-assignment { max-width: 52rem; }
.subscriber-assignment .card__body { display: grid; gap: 1rem; }
.subscriber-assignment label { display: grid; gap: .3rem; font-weight: 650; }
.subscriber-assignment input, .subscriber-assignment select { box-sizing: border-box; width: 100%; min-height: 2.6rem; padding: .4rem .55rem; border: 1px solid var(--site-border); border-radius: .35rem; background: #fff; color: var(--site-text); }
.subscriber-assignment small { color: var(--site-muted); font-weight: 400; }
.subscriber-table { min-width: 68rem; }
.subscriber-table form { margin: 0; }
.subscriber-table button { min-height: 2.25rem; padding: .4rem .7rem; }
.help-page > section, .legal-page > section { margin-top: 2rem; }
.help-page details { border-top: 1px solid var(--site-border); padding: 1rem 0; }
.help-page details:last-child { border-bottom: 1px solid var(--site-border); }
.help-page summary { cursor: pointer; font-weight: 750; }
.help-page details p { margin: .75rem 0 0; }
.gear-image-dialog { box-sizing: border-box; width: min(94vw, 70rem); max-height: 90vh; border: 1px solid var(--site-border); border-radius: var(--site-radius); padding: 1rem; }
.gear-image-dialog::backdrop { background: rgba(5, 9, 16, .78); }
.gear-image-dialog__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--site-border); }
.gear-image-dialog__toolbar h2 { margin: 0; }
.gear-image-dialog #secCode img { display: block; max-width: 100%; height: auto; margin: 1rem auto; }
.operations-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.operations-summary { display: grid; gap: 1rem; }
.operations-summary strong, .operations-summary span { display: block; overflow-wrap: anywhere; }
.operations-summary strong { font-size: 1.8rem; }
.operations-summary span { color: var(--site-muted); font-size: .85rem; }
.operations-section { margin-top: 3rem; }
.operations-table { width: 100%; border-collapse: collapse; background: var(--site-surface); font-size: .86rem; }
.operations-table th, .operations-table td { padding: .7rem; border: 1px solid var(--site-border); text-align: left; vertical-align: top; }
.operations-table th { background: var(--site-surface-muted); }
.operations-table code { overflow-wrap: anywhere; }
.operations-table td small { display: block; color: var(--site-muted); }
.operations-table__custom { background: #eef7ff; }
.metric-value { display: inline-block; margin: 0 .75rem .35rem 0; }
.metric-value strong { display: block; white-space: nowrap; }
.operations-log { max-height: 42rem; margin: 0; padding: 1rem 1rem 1rem 3.5rem; overflow: auto; border-radius: var(--site-radius); background: #101827; color: #e6edf8; font-size: .78rem; }
.operations-log li { padding: .2rem .4rem; border-bottom: 1px solid #27344a; }
.operations-log code { white-space: pre-wrap; overflow-wrap: anywhere; }

/*
 * Keep the first page content a consistent distance below either the public
 * masthead or the authenticated member navigation. The stronger selectors
 * intentionally replace older page-specific top padding while leaving each
 * page's side and bottom spacing intact.
 */
body > main:first-of-type,
body > #masthead ~ div:not(#navbarHorizontal):not(#footer):first-of-type {
    padding-top: var(--site-content-start) !important;
}

/* The home hero previously supplied its own top gap; the shared main gap now does that. */
body > #masthead + main > .hero:first-child { padding-top: 0; }

@media (min-width: 42rem) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .site-footer__inner { grid-template-columns: 1.5fr 1fr 1fr; }
    .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 60rem) {
    .site-header__inner { grid-template-columns: auto 1fr auto; }
    .nav-toggle { display: none; }
    .primary-nav { display: flex; grid-column: auto; justify-content: center; gap: .15rem; margin: 0; padding: 0; background: transparent; }
    .primary-nav a { padding: .6rem .7rem; border: 0; }
    .account-nav { display: flex; align-items: center; gap: .75rem; }
    .account-nav form { margin: 0; }
    .account-nav button { min-height: auto; padding: .3rem 0; }
    .hero { grid-template-columns: minmax(0, 1.15fr) minmax(20rem, .85fr); }
    .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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