/* ─────────────────────────────────────────────────────────
   WILLIAM GUNDERSON FOUNDATION — app.css
   ───────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Source+Sans+3:ital,wght@0,400;0,500;1,400&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
    --red-deep:     #4a0c0c;
    --red-dark:     #6b1010;
    --red:          #a11d1d;
    --red-bright:   #d13030;
    --gold:         #c8920a;
    --gold-light:   #e8b020;
    --black:        #0a0a0a;
    --charcoal:     #161616;
    --charcoal-mid: #1f1f1f;
    --cream:        #f2ede4;
    --white:        #fdfaf5;
    --font-display: 'Oswald', sans-serif;
    --font-heading: 'Oswald', sans-serif;
    --font-body:    'Source Sans 3', sans-serif;
}

/* ─── RESET / BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--black);
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 2px;
}

/* ─── BLAZOR ERROR / LOADING ─────────────────────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0; left: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; color: #fff; padding: 1rem 1rem 1rem 3.7rem; }
.blazor-error-boundary::after { content: "An error has occurred." }

.loading-progress {
    position: absolute; display: block;
    width: 8rem; height: 8rem;
    inset: 20vh 0 auto 0; margin: 0 auto;
}
.loading-progress circle {
    fill: none; stroke: #e0e0e0; stroke-width: .6rem;
    transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--red);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%;
    transition: stroke-dasharray .05s ease-in-out;
}
.loading-progress-text {
    position: absolute; text-align: center; font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto .2rem;
    font-family: var(--font-heading); color: var(--gold-light);
}
.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Loading"); }

/* ─── PAGE WRAPPER ───────────────────────────────────────── */
.wgf-page {
    width: 100%;
    overflow-x: hidden;
}

/* ─── REVEAL ANIMATIONS ──────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .8s ease, transform .8s ease;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ─── TAGLINE BAND ───────────────────────────────────────── */
.wgf-band--top {
    position: sticky;
    top: 0;
    z-index: 100;
}

.wgf-band {
    background: var(--red);
    color: var(--white);
    text-align: center;
    padding: .85rem 1rem;
    font-family: var(--font-heading);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .18em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── HERO ───────────────────────────────────────────────── */
.wgf-hero {
    position: relative;
    width: 100%;
    min-height: 70vh;
    background: var(--red-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wgf-hero__img-wrap {
    position: absolute;
    inset: 0;
}

.wgf-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.wgf-hero__vignette {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10,10,10,.55) 0%,
        rgba(74,12,12,.55) 55%,
        var(--black) 100%
    );
    pointer-events: none;
}

.wgf-hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 6rem 1.5rem;
    max-width: 720px;
}

.wgf-hero__eyebrow {
    font-family: var(--font-heading);
    font-size: .7rem;
    letter-spacing: .3em;
    color: var(--gold-light);
    margin-bottom: .8rem;
    display: block;
}

.wgf-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0,0,0,.6);
}

.wgf-hero__sub {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.05rem;
    color: rgba(242,237,228,.85);
    line-height: 1.6;
}

.wgf-hero__scroll-cue {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    z-index: 1;
    animation: fadeInUp 1.5s ease 1s both;
}

.wgf-hero__scroll-text {
    font-family: var(--font-heading);
    font-size: .65rem;
    letter-spacing: .25em;
    color: var(--gold-light);
    opacity: .8;
}

.wgf-hero__chevrons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.wgf-hero__chevrons span {
    display: block;
    width: 16px;
    height: 16px;
    border-right: 2px solid var(--gold-light);
    border-bottom: 2px solid var(--gold-light);
    transform: rotate(45deg);
    animation: chevronPulse 1.4s ease-in-out infinite;
    opacity: 0;
}
.wgf-hero__chevrons span:nth-child(1) { animation-delay: 0s; }
.wgf-hero__chevrons span:nth-child(2) { animation-delay: .2s; }
.wgf-hero__chevrons span:nth-child(3) { animation-delay: .4s; }

@keyframes chevronPulse {
    0%   { opacity: 0; transform: rotate(45deg) translate(-4px, -4px); }
    50%  { opacity: 1; }
    100% { opacity: 0; transform: rotate(45deg) translate(4px, 4px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ─── SHARED SECTION BASE ────────────────────────────────── */
.wgf-section {
    padding: 6rem 1.5rem;
}

.wgf-eyebrow {
    font-family: var(--font-heading);
    font-size: .7rem;
    letter-spacing: .3em;
    color: var(--gold-light);
    margin-bottom: .6rem;
    text-transform: uppercase;
    display: block;
}

.wgf-heading {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 3rem);
    color: var(--cream);
    line-height: 1.15;
}

/* ─── IN MEMORY ──────────────────────────────────────────── */
.wgf-memorial {
    background: var(--charcoal);
    text-align: center;
    border-bottom: 1px solid rgba(161,29,29,.15);
}

.wgf-memorial__grid {
    max-width: 720px;
    margin: 0 auto;
}

.wgf-memorial__img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border: 1px solid rgba(200,146,10,.25);
}

.wgf-memorial__caption {
    color: rgba(242,237,228,.75);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.8;
}

.wgf-memorial__dates {
    font-family: var(--font-heading);
    letter-spacing: .08em;
    color: var(--gold-light);
}

.wgf-memorial__quote {
    max-width: 640px;
    margin: 0 auto;
    padding-left: 1.2rem;
    border-left: 3px solid var(--red);
    font-style: italic;
    font-size: 1.05rem;
    color: rgba(242,237,228,.85);
    line-height: 1.8;
    text-align: left;
}

/* ─── SCHOLARSHIPS IN ACTION ─────────────────────────────── */
.wgf-scholarship-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.wgf-scholarship-row img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border: 1px solid rgba(161,29,29,.2);
}

@media (max-width: 768px) {
    .wgf-scholarship-row {
        grid-template-columns: 1fr;
    }
    .wgf-scholarship-row img {
        height: 220px;
    }
}

/* ─── EVENTS ─────────────────────────────────────────────── */
.wgf-events {
    background: var(--charcoal);
    border-top: 1px solid rgba(161,29,29,.15);
    border-bottom: 1px solid rgba(161,29,29,.15);
}

.mud-paper.wgf-event-card {
    background: var(--charcoal-mid) !important;
    border: 1px solid rgba(161,29,29,.2) !important;
    height: 100%;
    overflow: hidden;
    transition: border-color .3s, transform .3s;
}
.mud-paper.wgf-event-card:hover {
    border-color: rgba(200,146,10,.5) !important;
    transform: translateY(-3px);
}

.wgf-event-card__img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.wgf-event-card__body {
    padding: 1.4rem 1.6rem 1.8rem;
}

.wgf-event-card__when {
    font-family: var(--font-heading);
    font-size: .65rem;
    letter-spacing: .2em;
    color: var(--gold-light);
    display: block;
    margin-bottom: .4rem;
}

.wgf-event-card__title {
    font-family: var(--font-heading);
    color: var(--cream);
    margin-bottom: .6rem;
}

.wgf-event-card__desc {
    color: rgba(242,237,228,.65);
}

.wgf-events__followcta {
    text-align: center;
    color: rgba(242,237,228,.6);
}

.wgf-events__followlink {
    color: var(--gold-light) !important;
}

/* ─── GALLERY (IN THE FIELD) ─────────────────────────────── */
.wgf-gallery-section {
    background: var(--black);
}

/* Masonry via CSS columns -- each photo keeps its natural aspect ratio
   instead of being cropped to a uniform tile shape. */
.wgf-gallery {
    column-count: 2;
    column-gap: 10px;
}

@media (min-width: 641px) {
    .wgf-gallery { column-count: 3; }
}

@media (min-width: 1024px) {
    .wgf-gallery { column-count: 4; }
}

.wgf-gallery__item {
    break-inside: avoid;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid rgba(161,29,29,.18);
}

/* Slight stagger so columns don't all start/align at the same height */
.wgf-gallery__item:nth-child(3n+2) { margin-top: 22px; }
.wgf-gallery__item:nth-child(4n+3) { margin-top: 40px; }

.wgf-gallery__item img {
    width: 100%;
    height: auto;
    display: block;
}

/* ─── MISSION ────────────────────────────────────────────── */
.wgf-mission {
    background: var(--black);
    text-align: center;
}

.wgf-mission__body {
    font-size: 1.1rem;
    color: rgba(242,237,228,.78);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.85;
}

.wgf-divider { border-color: rgba(161,29,29,.35) !important; }

/* ─── FOCUS / PILLARS ────────────────────────────────────── */
.wgf-focus {
    background: var(--charcoal);
    border-top: 1px solid rgba(161,29,29,.15);
    border-bottom: 1px solid rgba(161,29,29,.15);
}

.mud-paper.wgf-pillar-card {
    background: var(--charcoal-mid) !important;
    border: 1px solid rgba(161,29,29,.18) !important;
    padding: 2rem 1.8rem;
    height: 100%;
    transition: border-color .3s, transform .3s;
}
.mud-paper.wgf-pillar-card:hover {
    border-color: rgba(200,146,10,.5) !important;
    transform: translateY(-3px);
}

.wgf-pillar-card__icon { font-size: 2.2rem; }

.wgf-pillar-card__title {
    font-family: var(--font-heading);
    color: var(--cream) !important;
}

.wgf-pillar-card__body {
    color: rgba(242,237,228,.65) !important;
}

/* ─── CAROUSEL ───────────────────────────────────────────── */
.wgf-carousel-section {
    width: 100%;
    overflow: hidden;
    background: var(--black);
}

.wgf-carousel__slide {
    position: relative;
    width: 100%;
    height: 100%;
}

.wgf-carousel__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.wgf-carousel__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(10,10,10,.5) 100%);
    pointer-events: none;
}

.wgf-carousel .mud-carousel-indicators button {
    background: rgba(200,146,10,.4) !important;
}
.wgf-carousel .mud-carousel-indicators button.active {
    background: var(--gold) !important;
}

/* ─── GET INVOLVED ───────────────────────────────────────── */
.wgf-involved {
    background: var(--black);
}

.mud-card.wgf-card {
    background: var(--charcoal-mid) !important;
    border: 1px solid rgba(161,29,29,.2) !important;
    height: 100%;
    transition: border-color .3s, transform .3s;
}
.mud-card.wgf-card:hover {
    border-color: rgba(200,146,10,.5) !important;
    transform: translateY(-3px);
}
.mud-card.wgf-card--primary {
    border-color: var(--red-bright) !important;
    background: linear-gradient(135deg, rgba(161,29,29,.12) 0%, var(--charcoal-mid) 60%) !important;
}

.wgf-card__icon { font-size: 2.2rem; }

.wgf-card__title {
    font-family: var(--font-heading);
    color: var(--cream) !important;
}

.wgf-card__body {
    color: rgba(242,237,228,.65) !important;
}

.wgf-card__note {
    color: rgba(242,237,228,.45) !important;
    font-style: italic;
}

.wgf-anchor-btn {
    display: block;
    width: 100%;
    padding: .75rem 1.2rem;
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, transform .2s, color .2s;
    border-radius: 2px;
    box-sizing: border-box;
}
.wgf-anchor-btn--filled {
    background: var(--red);
    color: var(--white) !important;
    border: 1px solid var(--red);
}
.wgf-anchor-btn--filled:hover {
    background: var(--red-bright);
    transform: translateY(-2px);
}
.wgf-anchor-btn--outlined {
    background: transparent;
    color: var(--gold-light) !important;
    border: 1px solid var(--gold);
}
.wgf-anchor-btn--outlined:hover {
    background: var(--gold);
    color: var(--black) !important;
    transform: translateY(-2px);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.wgf-footer {
    background: var(--black);
    text-align: center;
    padding: 4rem 1.5rem 3rem;
    border-top: 1px solid rgba(161,29,29,.25);
}

.wgf-footer__icon { font-size: 1.6rem; margin-bottom: 1rem; opacity: .8; }

.wgf-footer__title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--gold-light);
    margin-bottom: .4rem;
}

.wgf-footer__sub {
    font-family: var(--font-heading);
    font-size: .8rem;
    letter-spacing: .15em;
    color: rgba(242,237,228,.5);
    margin-bottom: .6rem;
}

.wgf-footer__handle {
    font-family: var(--font-heading);
    font-size: .85rem;
    color: var(--gold-light);
}

.wgf-footer__email {
    font-size: .85rem;
    color: rgba(242,237,228,.5);
}

.wgf-footer__pubcrawl {
    display: block;
    font-family: var(--font-heading);
    font-size: .8rem;
    letter-spacing: .1em;
    color: rgba(200,146,10,.55);
}

/* ─── MUDBLAZOR TYPOGRAPHY OVERRIDES ─────────────────────── */
.mud-typography-body1, .mud-typography-body2 {
    font-family: var(--font-body) !important;
}

.mud-typography-h1, .mud-typography-h2 {
    font-family: var(--font-display) !important;
}

.mud-typography-h3, .mud-typography-h4,
.mud-typography-h5, .mud-typography-h6,
.mud-typography-overline {
    font-family: var(--font-heading) !important;
}

/* ─── RESPONSIVE: MOBILE (≤640px) ───────────────────────── */
@media (max-width: 640px) {
    .wgf-section { padding: 3rem 1rem; }
    .wgf-band { white-space: normal; font-size: .6rem; letter-spacing: .1em; }
    .wgf-heading { font-size: clamp(1.4rem, 6vw, 1.8rem); }
    .wgf-eyebrow { font-size: .6rem; letter-spacing: .2em; }
    .wgf-hero { min-height: 60vh; }
    .wgf-hero__content { padding: 4rem 1rem; }
    .wgf-mission__body { font-size: .95rem; }
    .mud-card.wgf-card,
    .mud-paper.wgf-pillar-card { padding: 1.4rem 1.2rem !important; }
    .wgf-footer { padding: 2.5rem 1rem 2rem; }
}
