/* =============================================
   Bulgarian Chopper Society – Main Stylesheet
   ============================================= */

:root {
    --bcs-black: #0d0d0d;
    --bcs-dark: #1a1a1a;
    --bcs-gray: #2a2a2a;
    --bcs-orange: #e85d04;
    --bcs-orange-dark: #c44d00;
    --bcs-orange-darker: #a63d02;
    --bcs-orange-darkest: #8a3000;
    --bcs-orange-light: #f48c06;
    --bcs-gold: #d4a017;
    --bcs-text: #f2f2f2;
    --bcs-text-muted: #b0b0b0;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --nav-height: 72px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bcs-black);
    color: var(--bcs-text);
    line-height: 1.7;
    padding-top: var(--nav-height);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.text-muted {
    color: var(--bcs-text-muted) !important;
}

main {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* ---- Fixed background logo ---- */
.site-bg-logo {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background: url('/assets/img/bcs-720.jpg') center center / contain no-repeat;
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 575.98px) {
    .site-bg-logo {
        background-image: url('/assets/img/bcs-360.jpg');
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Navigation ---- */
#mainNav {
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--bcs-orange);
    padding: 0.5rem 0;
    transition: box-shadow 0.3s ease;
}

#mainNav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.nav-logo {
    height: 44px;
    width: auto;
    border-radius: 4px;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bcs-orange);
    letter-spacing: 0.1em;
}

.navbar-nav .nav-link {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bcs-text) !important;
    padding: 0.5rem 1rem !important;
    position: relative;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--bcs-orange);
    transition: width 0.3s ease, left 0.3s ease;
}

.navbar-nav .nav-link.active {
    color: var(--bcs-orange) !important;
    cursor: default;
}

.navbar-nav .nav-link:hover {
    color: var(--bcs-orange) !important;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
    left: 10%;
}

/* ---- Language switch ---- */
.nav-item-lang {
    margin-left: 0.35rem;
}

.navbar-nav .nav-link.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(232, 93, 4, 0.55);
    border-radius: 999px;
    padding: 0.3rem 0.85rem !important;
    line-height: 1;
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-nav .nav-link.lang-switch:hover,
.navbar-nav .nav-link.lang-switch:focus-visible {
    background-color: var(--bcs-orange);
    border-color: var(--bcs-orange);
    color: #fff !important;
}

.navbar-nav .nav-link.lang-switch::after {
    display: none;
}

.lang-switch .bi {
    font-size: 1rem;
}

.lang-switch-text {
    font-weight: 600;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler:focus-visible,
.navbar-nav .nav-link:focus-visible,
.btn-bcs:focus-visible,
.gallery-thumb:focus-visible,
.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:focus-visible,
.install-btn:focus-visible {
    outline: 2px solid var(--bcs-orange-light);
    outline-offset: 3px;
}

/* Focus ring for browsers without :focus-visible (Safari < 15.4) */
.navbar-toggler:focus,
.navbar-nav .nav-link:focus,
.btn-bcs:focus,
.gallery-thumb:focus,
.gallery-lightbox-close:focus,
.gallery-lightbox-nav:focus,
.install-btn:focus {
    outline: 2px solid var(--bcs-orange-light);
    outline-offset: 3px;
}

.navbar-toggler:focus:not(:focus-visible),
.navbar-nav .nav-link:focus:not(:focus-visible),
.btn-bcs:focus:not(:focus-visible),
.gallery-thumb:focus:not(:focus-visible),
.gallery-lightbox-close:focus:not(:focus-visible),
.gallery-lightbox-nav:focus:not(:focus-visible),
.install-btn:focus:not(:focus-visible) {
    outline: none;
}

/* ---- Hero Section ---- */
.hero {
    position: relative;
    min-height: calc(100vh - var(--nav-height));
    min-height: calc(100dvh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: transparent;
}

.hero-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, var(--bcs-black) 80%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.hero-logo {
    max-width: 320px;
    width: 80%;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 30px rgba(232, 93, 4, 0.3));
}

@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
    .hero-logo {
        animation: fadeInUp 1s ease;
    }

    .hero h1 {
        animation: fadeInUp 1s ease 0.2s both;
    }

    .hero-subtitle {
        animation: fadeInUp 1s ease 0.4s both;
    }

    .hero-tagline {
        animation: fadeInUp 1s ease 0.6s both;
    }

    .btn-bcs {
        animation: fadeInUp 1s ease 0.8s both;
    }
}

.hero h1 {
    font-size: 2rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--bcs-orange);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.hero-tagline {
    font-size: 1.1rem;
    color: var(--bcs-text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.btn-bcs {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    border: 2px solid transparent;
    text-decoration: none;
    display: inline-block;
}

.btn-bcs:not(.btn-bcs-outline) {
    background-color: var(--bcs-orange-dark);
    color: #fff;
    border-color: var(--bcs-orange-dark);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-bcs:not(.btn-bcs-outline):hover {
    background-color: var(--bcs-orange-darkest);
    color: #fff;
    border-color: var(--bcs-orange-light);
    box-shadow: 0 0 0 1px var(--bcs-orange-light), 0 6px 24px rgba(232, 93, 4, 0.55);
}

.btn-bcs.btn-bcs-outline {
    background-color: transparent;
    color: var(--bcs-orange);
    border-color: var(--bcs-orange);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-bcs.btn-bcs-outline:hover {
    background-color: var(--bcs-orange-dark);
    color: #fff;
    border-color: var(--bcs-orange-dark);
    box-shadow: 0 4px 20px rgba(232, 93, 4, 0.35);
}

/* ---- Page Header ---- */
.page-header {
    background: transparent;
    padding: 4rem 0 3rem;
    text-align: center;
    border-bottom: 1px solid var(--bcs-gray);
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--bcs-orange);
}

.page-header h1 {
    font-size: 2rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #fff;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--bcs-text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Content Sections ---- */
.content-section {
    padding: 4rem 0;
    background: transparent;
}

.content-section:nth-child(even) {
    border-top: 1px solid rgba(232, 93, 4, 0.08);
    border-bottom: 1px solid rgba(232, 93, 4, 0.08);
}

.section-title {
    font-size: 1.8rem;
    color: var(--bcs-orange);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--bcs-orange);
}

/* ---- Feature Cards ---- */
.feature-card {
    background: var(--bcs-gray);
    border: 1px solid rgba(232, 93, 4, 0.15);
    border-radius: 8px;
    padding: 2rem;
    height: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--bcs-orange);
    box-shadow: 0 10px 30px rgba(232, 93, 4, 0.15);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--bcs-orange);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--bcs-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
}

a.feature-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.feature-card-link:hover {
    color: inherit;
}

/* ---- Timeline (History) ---- */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--bcs-orange), var(--bcs-gray));
}

.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.4rem;
    width: 14px;
    height: 14px;
    background: var(--bcs-orange);
    border-radius: 50%;
    border: 3px solid var(--bcs-black);
    transform: translateX(calc(-50% + 1.5px));
}

.timeline-year {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--bcs-orange);
    font-weight: 600;
}

.timeline-item h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0.25rem 0 0.5rem;
}

.timeline-item p {
    color: var(--bcs-text-muted);
    margin-bottom: 0;
}

/* ---- Charter / Ustav ---- */
.charter-page {
    padding-top: 2rem;
}

.charter-document {
    background: rgba(26, 26, 26, 0.45);
    border: 1px solid rgba(232, 93, 4, 0.12);
    border-radius: 8px;
    padding: 2.5rem;
    opacity: 1;
}

.charter-document a {
    color: var(--bcs-orange-light);
    text-decoration: none;
}

.charter-document a:hover {
    text-decoration: underline;
}

.charter-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0;
}

.charter-meta-header {
    margin-top: 1.25rem;
}

.charter-meta-item {
    font-size: 0.82rem;
    color: var(--bcs-text-muted);
    background: var(--bcs-gray);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
}

.charter-translation-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(232, 93, 4, 0.1);
    border: 1px solid rgba(232, 93, 4, 0.35);
    border-left: 4px solid var(--bcs-orange);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.charter-translation-notice .bi {
    color: var(--bcs-orange-light);
    font-size: 1.35rem;
    line-height: 1.5;
    flex-shrink: 0;
}

.charter-translation-notice p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--bcs-text);
}

.charter-part {
    margin-bottom: 2.5rem;
    scroll-margin-top: calc(var(--nav-height) + 1rem);
}

.charter-part-title {
    font-size: 1.15rem;
    color: var(--bcs-orange);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(232, 93, 4, 0.25);
}

.charter-subsection {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.75rem 0 0.75rem;
}

.charter-article {
    margin-bottom: 1.25rem;
}

.charter-article-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: #fff;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 0.5rem;
}

.charter-paragraph {
    color: var(--bcs-text);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    text-align: justify;
}

.charter-alinea {
    color: var(--bcs-orange);
    font-weight: 500;
    margin-right: 0.35rem;
    white-space: nowrap;
}

.charter-list {
    color: var(--bcs-text);
    font-size: 0.95rem;
    padding-left: 1.5rem;
    margin: 0.5rem 0 0.75rem;
}

.charter-list li {
    margin-bottom: 0.4rem;
    text-align: justify;
}

.charter-list-alpha {
    list-style-type: lower-alpha;
}

.charter-amendment {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--bcs-orange-light);
    background: rgba(232, 93, 4, 0.1);
    border: 1px solid rgba(232, 93, 4, 0.25);
    border-radius: 3px;
    padding: 0.1rem 0.45rem;
    margin-right: 0.35rem;
    vertical-align: middle;
    font-style: normal;
    text-transform: none;
    letter-spacing: normal;
    font-family: var(--font-body);
}

.charter-signature {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(232, 93, 4, 0.2);
}

.charter-signature p {
    color: var(--bcs-text-muted);
    font-size: 0.92rem;
    margin-bottom: 0.75rem;
    text-align: justify;
}

@media (max-width: 991.98px) {
    .charter-document {
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .charter-document {
        padding: 1.25rem 1rem;
    }

    .charter-paragraph,
    .charter-list li {
        text-align: left;
    }
}

/* ---- Divisions ---- */
.division-card {
    background: var(--bcs-gray);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(232, 93, 4, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.division-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.division-header {
    background: linear-gradient(135deg, var(--bcs-orange-dark) 0%, #a63d02 100%);
    padding: 1.5rem;
    text-align: center;
}

.division-header h3 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0;
}

.division-body {
    padding: 1.5rem;
}

.division-body p {
    color: var(--bcs-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.division-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bcs-orange);
    font-size: 0.9rem;
}

.division-location i {
    font-size: 1rem;
}

/* ---- Events ---- */
.event-card {
    background: var(--bcs-gray);
    border-left: 4px solid var(--bcs-orange);
    border-radius: 0 8px 8px 0;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: background 0.3s ease;
}

.event-card:hover {
    background: #333;
}

.event-date {
    display: inline-block;
    background: var(--bcs-orange-dark);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.event-card h3 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.event-card p {
    color: var(--bcs-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--bcs-text-muted);
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.event-meta i {
    color: var(--bcs-orange);
}

.event-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
}

.event-badge-upcoming {
    background: rgba(232, 93, 4, 0.2);
    color: var(--bcs-orange-light);
}

.event-badge-past {
    background: rgba(153, 153, 153, 0.2);
    color: var(--bcs-text-muted);
}

/* ---- Footer ---- */
.site-footer {
    position: relative;
    z-index: 1;
    background: rgba(13, 13, 13, 0.75);
    border-top: 2px solid var(--bcs-orange);
    padding: 2.5rem 0;
    margin-top: auto;
}

.footer-logo {
    height: 50px;
    width: auto;
    border-radius: 4px;
}

.footer-name {
    font-family: var(--font-heading);
    color: var(--bcs-orange);
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.footer-tagline {
    font-family: var(--font-heading);
    color: var(--bcs-text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.footer-copy {
    color: var(--bcs-text-muted);
    font-size: 0.85rem;
}

/* ---- PWA Install Button ---- */
.install-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1050;
    background: var(--bcs-orange-dark);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(232, 93, 4, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(232, 93, 4, 0.5);
}

.ios-install-guide[hidden] {
    display: none !important;
}

.ios-install-guide {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
}

.ios-install-guide-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.ios-install-guide-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bcs-gray-dark, #1a1a1a);
    border: 1px solid rgba(232, 93, 4, 0.35);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem 1.25rem 1.75rem;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

.ios-install-guide-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--bcs-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.ios-install-guide-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bcs-orange);
    margin: 0 2rem 1rem 0;
}

.ios-install-guide-steps {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--bcs-text);
    line-height: 1.6;
}

.ios-install-guide-steps li + li {
    margin-top: 0.5rem;
}

.ios-install-guide-note,
.ios-install-guide-body p {
    margin: 0;
    color: var(--bcs-text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.ios-install-guide-body p + p {
    margin-top: 0.75rem;
}

/* ---- Gallery ---- */
.gallery-code {
    color: var(--bcs-orange);
    background: var(--bcs-gray);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.gallery-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bcs-gray);
    cursor: pointer;
    aspect-ratio: 4 / 3;
    min-height: 150px;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-thumb:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(13, 13, 13, 0.55);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-thumb:hover .gallery-overlay,
.gallery-thumb:focus .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    font-size: 2rem;
    color: var(--bcs-orange);
}

.gallery-lightbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox.open {
    display: flex;
}

.gallery-lightbox-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: 92vw;
    width: min(92vw, 1100px);
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 3.5rem;
}

.gallery-lightbox-figure {
    margin: 0;
    text-align: center;
    max-height: 80vh;
    max-height: 80dvh;
}

.gallery-lightbox-img {
    max-width: 100%;
    max-height: calc(80vh - 3rem);
    max-height: calc(80dvh - 3rem);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox-caption {
    display: none;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    position: absolute;
    background: rgba(232, 93, 4, 0.15);
    color: #fff;
    border: 1px solid rgba(232, 93, 4, 0.4);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 2;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
    background: var(--bcs-orange-dark);
    transform: scale(1.05);
}

.gallery-lightbox-close {
    top: 1rem;
    right: 1rem;
}

.gallery-lightbox-prev {
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-lightbox-next {
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    transform: translateY(-50%) scale(1.05);
}

body.lightbox-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Visible by default; hidden only after JS marks in-viewport items */
.fade-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    html.fade-ready .fade-in:not(.visible) {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

    html.fade-ready .fade-in.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- 404 Error Page ---- */
.error-page {
    position: relative;
    min-height: calc(100vh - var(--nav-height) - 120px);
    min-height: calc(100dvh - var(--nav-height) - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    overflow: hidden;
}

.error-page-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(232, 93, 4, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(212, 160, 23, 0.06) 0%, transparent 40%);
    z-index: 0;
}

.error-road {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    display: flex;
    justify-content: center;
    gap: 3rem;
    opacity: 0.15;
    z-index: 0;
}

.error-road-line {
    width: 4px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        var(--bcs-orange) 0,
        var(--bcs-orange) 24px,
        transparent 24px,
        transparent 48px
    );
    animation: roadScroll 1.2s linear infinite;
}

.error-road-line:nth-child(2) {
    animation-delay: 0.4s;
}

.error-road-line:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes roadScroll {
    from { transform: translateY(-48px); }
    to   { transform: translateY(0); }
}

.error-page-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 640px;
}

.error-icon {
    font-size: 3rem;
    color: var(--bcs-orange);
    margin-bottom: 1rem;
    opacity: 0.9;
}

.error-code {
    font-family: var(--font-heading);
    font-size: 6rem;
    font-size: clamp(6rem, 18vw, 9rem);
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.5rem;
    color: var(--bcs-orange);
    background: linear-gradient(180deg, var(--bcs-orange-light) 0%, var(--bcs-orange) 50%, #a63d02 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: 0.05em;
}

.error-title {
    font-size: 1.5rem;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    color: #fff;
    margin-bottom: 1rem;
}

.error-lead {
    color: var(--bcs-text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.error-path {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--bcs-text-muted);
    background: var(--bcs-gray);
    border: 1px solid rgba(232, 93, 4, 0.2);
    border-radius: 6px;
    padding: 0.4rem 1rem;
    margin-bottom: 2rem;
    word-break: break-all;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.error-actions .btn {
    animation: none;
}

.error-links-label {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    color: var(--bcs-text-muted);
    margin-bottom: 1rem;
}

.error-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.error-links-grid a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: var(--bcs-gray);
    border: 1px solid rgba(232, 93, 4, 0.15);
    border-radius: 8px;
    color: var(--bcs-text);
    text-decoration: none;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.error-links-grid a:hover {
    color: var(--bcs-orange);
    border-color: var(--bcs-orange);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 93, 4, 0.15);
}

.error-links-grid a i {
    font-size: 1.1rem;
    color: var(--bcs-orange);
}

/* ---- Cross-browser fallbacks ---- */
@supports not (display: grid) {
    .gallery-grid {
        display: flex;
        flex-wrap: wrap;
        margin: -0.625rem;
    }

    .gallery-item {
        flex: 1 1 260px;
        padding: 0.625rem;
    }

    .error-links-grid {
        display: flex;
        flex-wrap: wrap;
        margin: -0.375rem;
    }

    .error-links-grid a {
        flex: 1 1 calc(50% - 0.75rem);
        margin: 0.375rem;
    }
}

/* ---- Legacy browser notice ---- */
.legacy-browser-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #8a3000;
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
    border-bottom: 2px solid var(--bcs-orange-light);
}

.legacy-browser-notice p {
    margin: 0;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

html.legacy-browser body {
    padding-top: calc(var(--nav-height) + 3.5rem);
}

html.legacy-browser #mainNav {
    top: 3.5rem;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    #mainNav {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .site-bg-logo {
        display: none;
    }

    .navbar-collapse {
        background: var(--bcs-dark);
        padding: 1rem;
        border-radius: 8px;
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    .hero {
        min-height: calc(80vh - var(--nav-height));
        min-height: calc(80dvh - var(--nav-height));
    }

    .hero-logo {
        max-width: 240px;
    }
}

@media (max-width: 575.98px) {
    :root {
        --nav-height: 64px;
    }

    .content-section {
        padding: 3rem 0;
    }

    .page-header {
        padding: 3rem 0 2rem;
    }

    .install-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .gallery-lightbox-dialog {
        padding: 3rem 1rem;
    }

    .gallery-lightbox-prev {
        left: 0.25rem;
    }

    .gallery-lightbox-next {
        right: 0.25rem;
    }

    .error-page {
        padding: 3rem 0;
    }

    .error-links-grid {
        grid-template-columns: 1fr;
    }

    .error-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
