/* Phone and tablet refinements shared by every page. Keep content within its
   container rather than hiding horizontal overflow at the document level. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { line-height: 1.5; }
.content { overflow-wrap: anywhere; padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
.content h1, .content h2, .content h3 { max-width: 100%; overflow-wrap: anywhere; }
.content :is(button, .btn, input, select, textarea) { font-family: inherit; }
.content :is(button, .btn, select, input:not([type="checkbox"]):not([type="radio"])),
.navbar-toggler, .nav-scrollable .nav-link { min-height: 44px; }
.content :is(button, .btn) { white-space: normal; overflow-wrap: anywhere; }
.content input, .content select, .content textarea { font-size: max(1rem, 16px); }
.content :is(input, textarea, select) { scroll-margin-block: 5rem; }
.content input[type="checkbox"], .content input[type="radio"] { width: 1.4rem; height: 1.4rem; }
:is(a, button, input, textarea, select, summary, [tabindex="0"]):focus-visible { outline: 3px solid #e49a00 !important; outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -6rem; z-index: 12000; padding: .8rem 1rem; background: white; color: #003b80; font-weight: 700; }
.skip-link:focus { top: 1rem; }
.nav-scrollable .nav-link { line-height: 1.4; white-space: normal; height: auto; }
.nav-scrollable .nav-bullet, .nav-scrollable .oi { flex-shrink: 0; }
.sidebar .sponsor-address { white-space: normal; }

/* Fix nested viewport-width forms at every window size. */
.content .form-section { width: min(100%, 60rem); }
.content .form-section input { min-height: 44px; }
.content .form-section .year-input { max-width: 8ch; }
.content .ticket-help-button { min-width: 0; max-width: 100%; }
.content .form-section .headline span { white-space: normal; }
.content .parking-page .card { max-width: 100%; }
.content .map-hint { font-size: 1rem; margin: .75rem 0 0; }
.content .wide-row-header { white-space: normal; }
.content .container { max-width: 100%; }
.content .video-thumb-wrap { display: block; border: 0; padding: 0; background: #000; }
.content .video-thumb-wrap[hidden], .content .video-iframe-hidden { display: none; }
.content .video-thumb { aspect-ratio: 4 / 3; object-fit: cover; }
.content .video-iframe { min-height: 0; }

/* A short landscape screen must be able to scroll the whole ticket notice. */
.content .ticket-notice-overlay {
    padding: max(.75rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
    overflow-y: auto;
    overscroll-behavior: contain;
}
.content .ticket-notice-modal {
    width: min(100%, 900px);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.content .ticket-notice-close-x { min-width: 44px; min-height: 44px; }
body:has(.ticket-notice-overlay), body:has(.photo-viewer[open]) { overflow: hidden; }

/* Thumbnails are buttons; full-size photos use the browser's modal focus handling. */
.content :is(button.image-item, button.gallery-item) {
    display: block; min-width: 0; width: 100%; padding: 0; border: 0;
    border-radius: 8px; background: transparent; color: inherit; cursor: pointer;
    align-self: start;
}
.content .image-label { display: block; }
.content button.image-item img { aspect-ratio: 4 / 3; object-fit: cover; }
.content button.gallery-item img { aspect-ratio: 16 / 9; object-fit: contain; background: #eef3fa; }
.content .gallery-hint { text-align: center; color: #344966; margin: .5rem 0 1rem; }
.content .photo-viewer {
    position: fixed; inset: 0; margin: auto; padding: 0; border: 0;
    width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    height: 100dvh; overflow: hidden; background: transparent; color: #fff;
}
.photo-viewer::backdrop { background: rgba(0, 12, 30, .95); }
.photo-viewer-content { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 64px 12px max(12px, env(safe-area-inset-bottom)); }
.photo-viewer-content img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.content .photo-viewer-close {
    position: absolute; z-index: 1; top: max(8px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
    width: 48px; height: 48px; padding: 0; border: 2px solid #fff; border-radius: 50%;
    background: #0c2340; color: white; font-size: 2rem; line-height: 1;
}

/* On wide screens, keep the announcement and all three videos in one row. */
@media (min-width: 1600px) {
    .content .top-layout { display: grid; grid-template-columns: 150px minmax(0, 1fr) clamp(510px, 33vw, 720px); margin-inline: 0; }
    .content .top-content { min-width: 0; }
    .content .donate-card { width: 100%; }
    .content .video-card-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
    .content .video-card { width: 100%; min-width: 0; }
    .content .event-husky-image { width: clamp(120px, 8vw, 170px); }
    .content .event-banner { padding: 1rem .75rem; }
    .content .event-banner-main { font-size: clamp(2.5rem, 3.2vw, 5rem); }
    .content .event-banner-title { font-size: clamp(2rem, 2.5vw, 3.8rem); }
    .content .event-banner-date { font-size: clamp(1.8rem, 2.1vw, 3.2rem); }
}

/* Desktop composition needs room for the sidebar and the three home columns. */
@media (max-width: 1599.98px) {
    .content .top-layout { display: grid; grid-template-columns: minmax(0, 1fr); margin-inline: 0; }
    .content .top-content { min-width: 0; order: -1; }
    .content .donate-card { width: 100%; flex-basis: auto; }
    .content .video-card-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
    .content .video-card { width: 100%; min-width: 0; flex-basis: auto; }
    .content .event-banner-main { font-size: clamp(2rem, 4vw, 3.4rem); }
    .content .event-banner-title { font-size: clamp(1.8rem, 3.5vw, 3rem); }
    .content .event-banner-date { font-size: clamp(1.5rem, 3vw, 2.6rem); }
}

@media (max-width: 991.98px) {
    .page .content { padding: 1rem max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)) !important; }
    .sidebar .top-row { padding-inline: max(.5rem, env(safe-area-inset-left)) max(.5rem, env(safe-area-inset-right)) !important; }
    .sidebar .navbar-toggler { min-width: 48px; }
    .sidebar .navbar-brand { margin-right: .5rem; }
    .sidebar .nav-scrollable { max-height: calc(100vh - 3.5rem); max-height: calc(100dvh - 3.5rem); overflow-y: auto; overscroll-behavior: contain; }
    .sidebar .nav-item { padding-bottom: .25rem; }
    .sidebar .nav-item .nav-link { padding-block: .7rem; }
    .content .tribute-form-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .content .form-section { padding-inline: 0; }
    .content .form-section label { font-size: 1.05rem; line-height: 1.45; }
    .content .form-section :is(.text-input, input[type="email"]) { display: block; width: 100%; max-width: 100%; margin-left: 0; }
    .content .form-section :is(.labelError, .labelSuccess) { font-size: 1.1rem; }
    .content .admin-card, .content .admin-login-card { margin-block: 1rem; padding: clamp(1rem, 3vw, 2rem); }
    .content .admin-card h1 { font-size: clamp(1.6rem, 5vw, 2rem); }
    .content .selected-picture { flex-wrap: wrap; }
    .content .bulk-mailer { padding: .8rem; }
    .content .bulk-confirmation { padding: .75rem; }
    .content .starting-record { grid-template-columns: minmax(0, 1fr) minmax(0, 7rem); }
    .content .preview-table { min-width: 0; table-layout: fixed; }
    .content .preview-table th:first-child, .content .preview-table td:first-child { width: 3rem; white-space: nowrap; }
    .content .preview-table th:nth-child(2) { width: 35%; }
    .content .preview-table-wrapper { max-width: 100%; }
    .content .parking-page { padding: 1rem .75rem 1.5rem; }
    .content .parking-page :is(.card-header, .card-body, .details-section) { padding: 1rem; }
    .content .parking-page .details-section p { white-space: normal; font-size: 1.2rem; overflow: visible; animation: none; }
    .content .wide-row-header { white-space: normal; }
    .content .image-large { min-width: 0; }
    .content .right-blurb { white-space: normal; }
    .content .help-layout { grid-template-columns: minmax(0, 1fr); }
    .content .continue-button { animation: none; }
    .content .hero-grid, .content .event-info-bar, .content .right-blurb { max-width: 100%; }
    .content .hero-img1, .content .hero-img2 { max-height: none; object-fit: contain; }
    .content .ticket-notice-modal { padding: 3.5rem 1rem 1rem; border-width: 3px; }
    .content .ticket-notice-modal h2 { margin: 0 0 .8rem; font-size: clamp(1.5rem, 5vw, 2rem); }
    .content .ticket-notice-modal p { font-size: 1.05rem; line-height: 1.5; margin-bottom: 1rem; }
    .content .ticket-notice-modal .event-name { white-space: normal; }
    .content .ticket-notice-actions .ticket-notice-close { min-width: 0; max-width: 100%; padding: .85rem 1rem; font-size: 1.05rem; }
    .content .ticket-notice-deadlines p { animation: none; }
}

@media (max-width: 599.98px) {
    .page .content { padding-inline: max(.75rem, env(safe-area-inset-left)) max(.75rem, env(safe-area-inset-right)) !important; }
    .content h1 { display: block; font-size: clamp(1.7rem, 7vw, 2.25rem); text-align: center; line-height: 1.2; }
    .content h2 { font-size: clamp(1.3rem, 5.5vw, 1.65rem); line-height: 1.3; }
    .content .top-layout { gap: 1rem; }
    .content .event-feature { flex-direction: column; }
    .content .event-banner { padding: .8rem .5rem; border-width: 3px; }
    .content .event-banner-line { line-height: 1.1; letter-spacing: .02em; }
    .content .event-banner-main { font-size: 2.2rem; }
    .content .event-banner-title { font-size: 1.8rem; }
    .content .event-banner-date { font-size: 1.5rem; }
    .content .hero-grid, .content .video-card-group { grid-template-columns: minmax(0, 1fr); }
    .content .donate-buttons { width: 100%; }
    .content .donate-btn { flex: 1; font-size: 1rem; }
    .content .hero-caption, .content .video-caption { font-size: 1rem; }
    .content .ticket-notice-actions .ticket-notice-close { flex-basis: 100%; }
    .content .image-grid, .content .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; padding: .25rem; }
    .content .image-grid img { height: auto; }
    .content .image-label { font-size: .95rem; line-height: 1.4; }
    .content .enlarge-indicator { opacity: 1; font-size: .8rem; }
    .content .documents-container { margin: 1rem auto; padding: 0; }
    .content .documents-title { margin-bottom: 1rem; }
    .content .documents-list li { margin: .6rem 0; }
    .content .documents-list a { font-size: 1.25rem; padding: .75rem .5rem; }
    .content .documents-image { margin-top: 1rem; }
    .content .form-section .ticket-btn, .content .admin-card button { width: 100%; }
    .content .form-section .headline span { font-size: 1.1rem; animation: none; }
    .content .tribute-author { padding: 1rem; }
    .content .tribute-form .btn { width: 100%; }
    .content .parking-page .kv { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
    .content .parking-page .kv > div { margin-bottom: .75rem; }
    .content .parking-page .badge { white-space: normal; line-height: 1.4; }
    .content .donors-table th:first-child { width: 75%; }
    .content .donors-table th:last-child { width: 25%; }
    .content .costs-table { table-layout: fixed; }
    .content .costs-table th, .content .costs-table td { white-space: normal; padding: .6rem .35rem; }
    .content .split { display: block; }
    .content .messageBox, .content .tickets, .content .center, .content .teamPhoto { width: 100%; height: auto; }
    .content .messageBox, .content .tickets, .content .donations, .content .labelCheckbox, .content .labelError, .content .seqNumber, .content .BigAndBold { font-size: 1.15rem; }
}

/* Preserve the semantic table and all four facts while giving names room to wrap. */
@media (max-width: 479.98px) {
    .content .attendance-table, .content .attendance-table tbody { display: block; width: 100%; }
    .content .attendance-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .content .attendance-table tbody tr { display: block; margin: 0 0 .85rem; padding: .75rem; border: 1px solid #ccd8e8; border-radius: 10px; background: #f7faff; }
    .content .attendance-table tbody td[data-label] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; width: 100%; padding: .45rem 0; text-align: left; font-size: 1rem; border: 0; box-shadow: none; background: transparent; }
    .content .attendance-table td[data-label]::before { content: attr(data-label); font-weight: 700; color: #253d60; }
    .content .attendance-table tbody td.col-name { display: block; font-size: 1.15rem; font-weight: 700; border-bottom: 1px solid #dbe3ef; padding-bottom: .6rem; margin-bottom: .3rem; }
    .content .attendance-table td.col-name::before { content: none; }
    .content .attendance-table td[data-label]:empty::after { content: "—"; }
}

@media (hover: none) {
    .content .enlarge-indicator { opacity: 1; }
    .content .image-item:hover img, .content .documents-list a:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 13000; padding: 1rem 3rem 1rem 1rem; background: #fff3cd; color: #352700; box-shadow: 0 -2px 8px #0003; }
#blazor-error-ui .dismiss { position: absolute; right: .5rem; top: .5rem; padding: .6rem; cursor: pointer; }
