h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------- Global site look & feel ---------- */
body {
    font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f7f8fa;
    color: #1f2937;
    margin: 0;
}

a {
    color: #123a63;
}

/* ---------- Gallery folder grid ---------- */
.gallery-page h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

@media (max-width: 640px) {
    .gallery-page h1 {
        font-size: 1.5rem;
    }
}

.gallery-intro {
    color: #6b7280;
    margin-bottom: 1.75rem;
}

.whole-route-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.whole-route-card {
    margin: 0;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-top: 4px solid #111827;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.whole-route-image {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin: 0 auto;
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}

.whole-route-image:hover,
.whole-route-image:focus-visible {
    opacity: 0.85;
}

.whole-route-card figcaption {
    margin-top: 0.6rem;
    font-weight: 600;
    color: #6b7280;
}

@media (max-width: 720px) {
    .whole-route-row {
        grid-template-columns: 1fr;
    }

    .whole-route-image {
        height: 240px;
    }
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .folder-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.folder-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.folder-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #e5e7eb;
}

.folder-card-body {
    padding: 0.9rem 1rem;
}

.folder-card-title {
    font-weight: 700;
    font-size: 1.02rem;
    margin: 0 0 0.2rem;
}

.folder-card-count {
    color: #6b7280;
    font-size: 0.85rem;
}

/* ---------- Folder detail page ---------- */
.folder-detail-header {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}

.folder-preamble {
    background: #fff;
    border-left: 4px solid #ffcc00;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0 1.75rem;
    line-height: 1.65;
    font-size: 1rem;
    color: #1f2937;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

@media (max-width: 640px) {
    .folder-preamble {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .stage-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

.folder-preamble p {
    margin: 0 0 0.85rem;
}

.folder-preamble p:last-child {
    margin-bottom: 0;
}

.stage-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1.25rem;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.stage-table th,
.stage-table td {
    padding: 0.6rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.stage-table th {
    background: #111827;
    color: #ffcc00;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.stage-table tr:nth-child(even) td {
    background: #f9fafb;
}

.stage-table tr:last-child td {
    border-bottom: none;
}

.stage-subheading {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: 0.01em;
    border-left: 4px solid #ffcc00;
    padding-left: 0.6rem;
}

/* ---------- Stage elevation profile ---------- */
.elevation-float {
    float: right;
    margin: 0 0 1rem 1.5rem;
    max-width: 340px;
    width: 45%;
    background: #fff;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-top: 4px solid #111827;
}

.folder-preamble::after {
    content: "";
    display: table;
    clear: both;
}

.elevation-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #111827;
}

.elevation-distance {
    margin: 0.5rem 0 0;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9rem;
    text-align: center;
}

.elevation-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.elevation-zoomable {
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}

.elevation-zoomable:hover,
.elevation-zoomable:focus-visible {
    opacity: 0.85;
    outline: none;
}

.elevation-source-link {
    display: block;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #111827;
    text-decoration: none;
    text-align: center;
}

.elevation-source-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .elevation-float {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 1.25rem;
    }
}

@media (max-width: 900px) and (min-width: 641px) {
    .elevation-float {
        max-width: 45%;
    }
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

@media (max-width: 480px) {
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
}

.media-thumb-button {
    border: none;
    padding: 0;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    position: relative;
}

.media-thumb-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.media-thumb-button:hover img {
    transform: scale(1.05);
}

.media-video-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ---------- Lightbox ---------- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.lightbox-overlay img,
.lightbox-overlay video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-prev {
    left: 1.25rem;
}

.lightbox-next {
    right: 1.25rem;
}

.lightbox-slideshow-toggle {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    cursor: pointer;
}

.lightbox-slideshow-toggle:hover {
    background: rgba(255,255,255,0.3);
}

@media (max-width: 640px) {
    .lightbox-overlay {
        padding: 1rem;
    }

    .lightbox-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.1rem;
        height: 2.1rem;
        font-size: 1.25rem;
    }

    .lightbox-nav {
        width: 2.4rem;
        height: 2.4rem;
        font-size: 1.8rem;
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }

    .lightbox-slideshow-toggle {
        bottom: 0.85rem;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* ---------- Admin page ---------- */
.admin-page h1 {
    margin-bottom: 0.2rem;
}

.admin-subtitle {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.admin-tab-button:hover {
    color: #111827;
}

.admin-tab-button.active {
    color: #0f766e;
    border-bottom-color: #0f766e;
}

@media (max-width: 640px) {
    .admin-tab-button {
        padding: 0.6rem 0.85rem;
        font-size: 0.9rem;
    }
}

.admin-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    max-width: 640px;
    margin-bottom: 1.5rem;
}

.admin-card:has(.stats-table),
.admin-card:has(.stats-summary) {
    max-width: 860px;
}

@media (max-width: 640px) {
    .admin-card {
        padding: 1rem;
        max-width: 100%;
    }
}

.btn-primary {
    background: #123a63;
    color: #fff;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary:hover:not(:disabled) {
    background: #0b1f3a;
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: default;
}

.admin-result {
    margin-top: 1.25rem;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.admin-login-card {
    max-width: 380px;
}

.admin-login-input {
    display: block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.admin-login-error {
    color: #b91c1c;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.admin-progress {
    margin-top: 0.75rem;
    color: #6b7280;
    font-size: 0.85rem;
}

.spinner {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 0.4rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-secondary {
    background: #fff;
    color: #123a63;
    border: 1px solid #123a63;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1.25rem;
}

.btn-secondary:hover {
    background: #f3f4f6;
}

.btn-copy {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.btn-copy:hover {
    background: #f3f4f6;
}

.stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.stats-summary-item {
    flex: 1 1 160px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    text-align: center;
}

.stats-summary-value {
    display: block;
    font-size: 1.9rem;
    font-weight: 700;
    color: #123a63;
}

.stats-summary-label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stats-subheading {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.05rem;
    color: #111827;
}

.admin-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #374151;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1rem;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.stats-table th,
.stats-table td {
    padding: 0.55rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.stats-table th {
    background: #111827;
    color: #ffcc00;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.stats-table tr:nth-child(even) td {
    background: #f9fafb;
}

@media (max-width: 640px) {
    .stats-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .stats-summary {
        flex-direction: column;
    }
}
