/* GLOBAL */
html {
    scroll-behavior: smooth;
}

/* THEME TOKENS */
:root,
[data-bs-theme="light"] {
    color-scheme: light;
    --okpc-bg: #f5f6fa;
    --okpc-text: #222;
    --okpc-heading: #111;
    --okpc-card-bg: #ffffff;
    --okpc-card-img-bg: #ffffff;
    --okpc-muted-bg: #f8f9fa;
    --okpc-footer-bg: #0d1117;
    --okpc-footer-text: #ccc;
    --okpc-btn-bg: #1f2937;
    --okpc-btn-text: #ffffff;
    --okpc-accent: #58a6ff;
    --okpc-shadow: rgba(0, 0, 0, 0.1);

    /* Map onto Bootstrap's own variables so all components follow */
    --bs-body-bg: var(--okpc-bg);
    --bs-body-color: var(--okpc-text);
}

[data-bs-theme="dark"] {
    color-scheme: dark;
    --okpc-bg: #0d1117;
    --okpc-text: #e6edf3;
    --okpc-heading: #f0f6fc;
    --okpc-card-bg: #161b22;
    --okpc-card-img-bg: #1c232b;
    --okpc-muted-bg: #161b22;
    --okpc-footer-bg: #010409;
    --okpc-footer-text: #b1bac4;
    --okpc-btn-bg: #30363d;
    --okpc-btn-text: #ffffff;
    --okpc-accent: #58a6ff;
    --okpc-shadow: rgba(0, 0, 0, 0.6);

    --bs-body-bg: var(--okpc-bg);
    --bs-body-color: var(--okpc-text);
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: var(--okpc-bg) !important;
    color: var(--okpc-text);
    line-height: 1.6;
    transition: background-color .2s ease, color .2s ease;
}

/* Theme toggle button */
#themeToggle {
    line-height: 1;
}
#themeToggle .bi { font-size: 1.1rem; }
[data-bs-theme="light"] #themeToggle .bi-sun-fill { display: inline-block; }
[data-bs-theme="light"] #themeToggle .bi-moon-stars-fill { display: none; }
[data-bs-theme="dark"]  #themeToggle .bi-sun-fill { display: none; }
[data-bs-theme="dark"]  #themeToggle .bi-moon-stars-fill { display: inline-block; }

/* ACCESSIBILITY */
:focus,
a:focus,
button:focus {
    outline: 3px solid #58a6ff !important;
    outline-offset: 3px;
}

/* Keyboard-visible focus ring (WCAG 2.4.7) */
:focus-visible {
    outline: 3px solid #58a6ff !important;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.35);
}

/* Honor user motion preferences (WCAG 2.3.3 / 2.2.2) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* HERO */
.hero {
    position: relative;
    padding: 140px 20px 80px;
    text-align: center;
    color: white;
    background-size: cover;
    background-position: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.8rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* TITLES */
h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 35px;
    color: var(--okpc-heading);
}

/* IMAGE HELPERS */
.img-rounded {
    width: 100%;
    border-radius: 10px;
}

/* MAP */
.map-container {
    width: 100%;
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* OPEN MAPS BUTTON */
.open-maps-btn {
    display: inline-block;
    padding: 12px 18px;
    background: var(--okpc-btn-bg);
    color: var(--okpc-btn-text);
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
}

.open-maps-btn:hover {
    background: var(--okpc-accent);
}

/* FOOTER */
footer {
    text-align: center;
    padding: 25px;
    background: var(--okpc-footer-bg);
    color: var(--okpc-footer-text);
    margin-top: 40px;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

footer a:hover { 
    color: #58a6ff !important; 
}

/* COOKIE BANNER */
#cookie-banner {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 999999 !important;
}

#mural video,
#mural img {
    border-radius: 10px;
}

.accordion-item {
    box-shadow: 0 2px 6px var(--okpc-shadow);
}

.accordion-item {
    border-top: 4px solid var(--okpc-accent);
}

.card-img-top {
    background: var(--okpc-card-img-bg);
    padding: 10px;
    border-radius: 10px;
}

.card:hover {
    transform: translateY(-3px);
    transition: 0.2s;
}

.modal-body p {
    margin-bottom: 1rem;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    padding: 12px 18px;
    border-radius: 10px;
}

/* Carousel prev/next arrows — keep them visible on any background (light/dark) */
.carousel-control-prev,
.carousel-control-next {
    width: 52px;
    height: 52px;
    opacity: 1;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    margin: 0 14px;
    transition: background-color .2s ease, transform .2s ease;
}

.carousel-control-prev { left: 0; }
.carousel-control-next { right: 0; }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 1.5rem;
    height: 1.5rem;
    background-size: 100% 100%;
}

.carousel-control-prev:hover,
.carousel-control-next:hover,
.carousel-control-prev:focus-visible,
.carousel-control-next:focus-visible {
    background-color: #000;
    transform: translateY(-50%) scale(1.08);
}

[data-bs-theme="dark"] .carousel-control-prev,
[data-bs-theme="dark"] .carousel-control-next {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

[data-bs-theme="dark"] .carousel-control-prev-icon,
[data-bs-theme="dark"] .carousel-control-next-icon {
    filter: invert(1);
}

[data-bs-theme="dark"] .carousel-control-prev:hover,
[data-bs-theme="dark"] .carousel-control-next:hover,
[data-bs-theme="dark"] .carousel-control-prev:focus-visible,
[data-bs-theme="dark"] .carousel-control-next:focus-visible {
    background-color: #58a6ff;
}

[data-bs-theme="dark"] .carousel-control-prev:hover .carousel-control-prev-icon,
[data-bs-theme="dark"] .carousel-control-next:hover .carousel-control-next-icon,
[data-bs-theme="dark"] .carousel-control-prev:focus-visible .carousel-control-prev-icon,
[data-bs-theme="dark"] .carousel-control-next:focus-visible .carousel-control-next-icon {
    filter: none;
}

/* BACK TO TOP BUTTON */
#backToTop {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    width: 3rem;
    height: 3rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translateY(.5rem);
    transition: opacity .2s ease, transform .2s ease;
}
#backToTop[hidden] {
    display: none !important;
}
#backToTop.is-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    #backToTop { transition: none; }
}
