/* ============================================
   Bethany Baptist Church - Events Page Styles
   Self-contained stylesheet
   ============================================ */

/* Accessibility: Skip to content link */
.visually-hidden-focusable {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.visually-hidden-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    left: auto;
    overflow: visible;
    background: #fff;
    z-index: 1000;
    border: 3px solid #000;
    padding: 5px;
}

/* ============================================
   FULL-WIDTH HEADER BACKGROUND
   ============================================ */

.header-bg {
    width: 100%;
    background-color: var(--nav-bg);
    background-image: linear-gradient(to bottom, #2c2c2c, #1a1a1a);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* ============================================
   Header / Navbar Styling
   ============================================ */

.navbar.small-menu {
    padding-top: 0.2rem !important;
    padding-bottom: 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.header-logo {
    width: 200px !important;
    max-width: 200px !important;
    height: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.header-logo:hover,
.header-logo:focus {
    transform: scale(1.10);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.header-logo {
    filter: invert(1) brightness(1.1);
}

[data-theme="dark"] .header-logo {
    filter: none;
}

.navbar.small-menu .nav-link {
    font-size: 0.85rem !important;
    letter-spacing: 0.3px;
}

.navbar.small-menu .navbar-nav {
    margin-top: 0 !important;
}

.navbar.small-menu .nav-link {
    position: relative;
}

.navbar.small-menu .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0.15rem;
    width: 0%;
    height: 2px;
    background: #fff;
    transition: width 0.25s ease;
}

.navbar.small-menu .nav-link:hover::after,
.navbar.small-menu .nav-link:focus::after {
    width: 100%;
}

.nav-link {
    transition: all 0.3s ease;
    margin: 0 5px;
    font-weight: 500;
    color: #fff !important;
}

.nav-link:hover,
.nav-link:focus {
    transform: scale(1.08);
    outline: none;
}

.navbar.small-menu .nav-link.active {
    border-bottom: 3px solid #fff;
    font-weight: 700;
    background-color: rgba(0,0,0,0.12);
    border-radius: 4px 4px 0 0;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.7);
}

.navbar-toggler-icon {
    filter: brightness(1.2);
}

.dropdown-menu {
    border-radius: 6px;
    border: 1px solid #555;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    background-color: #fff;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.dropdown-item {
    padding: 0.6rem 1.1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    color: #000;
    font-size: 0.95rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f0f0f0;
    border-left: 3px solid #333;
    font-weight: 600;
    outline: none;
}

/* ============================================
   Mobile Header
   ============================================ */

@media (max-width: 991px) {
    .navbar.small-menu .navbar-nav {
        margin-top: 0.5rem !important;
    }

    .navbar.small-menu .nav-link {
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
        text-align: center;
    }

    .dropdown-menu {
        box-shadow: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .dropdown-item {
        text-align: center;
    }
}

/* ============================================
   Main Content
   ============================================ */

main {
    min-height: 400px;
    padding: 0 0 40px;
}

.events-page #main {
    padding: 0;
}

/* ============================================
   Footer Styling
   ============================================ */

footer,
.footer-content {
    background-color: var(--footer-bg);
    background-image: linear-gradient(to bottom, #2c2c2c, #1a1a1a);
    color: var(--footer-text);
    padding-top: 2rem;
    padding-bottom: 0.5rem;
}

.footer-heading {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #666;
    padding-bottom: 10px;
}

.footer-address,
.footer-contact,
.footer-text {
    color: #fff;
    line-height: 1.8;
    font-size: 0.95rem;
}

.footer-contact a,
.footer-links a,
.footer-social a {
    color: #fff !important;
    transition: all 0.3s ease;
}

.footer-links a:hover,
.footer-contact a:hover,
.footer-social a:hover {
    transform: scale(1.08);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.footer-content .row > [class^="col-"],
.footer-content .row > [class*=" col-"] {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .footer-content .row > [class^="col-"],
    .footer-content .row > [class*=" col-"] {
        margin-bottom: 0.5rem;
    }
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    background-color: #333;
    border: 2px solid #fff;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #555;
    border: 3px solid #fff;
    transform: scale(1.10);
    outline: 2px solid #999;
    outline-offset: 2px;
}

/* ============================================
   Theme Variables
   ============================================ */

:root {
    --bg: #ffffff;
    --text: #222222;
    --nav-bg: #2c2c2c;
    --footer-bg: #2c2c2c;
    --footer-text: #ffffff;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --dropdown-bg: #ffffff;
    --dropdown-text: #000000;
    --dropdown-hover-bg: #f0f0f0;
}

[data-theme="dark"] {
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --nav-bg: #0d63e0;
    --footer-bg: #0d63e0;
    --footer-text: #ffffff;
    --card-bg: #2c2c2c;
    --border-color: #444444;
    --dropdown-bg: #2c2c2c;
    --dropdown-text: #e0e0e0;
    --dropdown-hover-bg: #3c3c3c;
}

body {
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .header-bg {
    background-color: var(--nav-bg);
    background-image: linear-gradient(to bottom, #0d63e0, #0b5ed7);
}

[data-theme="dark"] footer,
[data-theme="dark"] .footer-content {
    background-color: var(--footer-bg);
    background-image: linear-gradient(to bottom, #0d63e0, #0b5ed7);
    color: var(--footer-text);
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--dropdown-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--dropdown-text);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--dropdown-hover-bg);
    color: var(--dropdown-text);
}

[data-theme="dark"] .footer-heading {
    border-bottom-color: #555;
    color: var(--text);
}

/* Theme toggle button */
.theme-toggle {
    background: transparent !important;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    margin-left: 10px;
    color: #fff !important;
    min-width: 50px;
}

.theme-toggle:hover {
    transform: scale(1.15);
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* ============================================
   Events Hero Section
   ============================================ */

.events-hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 3px solid #dee2e6;
}

[data-theme="dark"] .events-hero {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-bottom-color: #444;
}

[data-theme="dark"] .events-hero h1,
[data-theme="dark"] .events-hero .lead {
    color: var(--text);
}

/* ============================================
   Event Cards
   ============================================ */

.events-card {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.events-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14) !important;
    transform: translateY(-3px);
}

.events-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.events-card-date {
    font-size: 0.88rem;
    letter-spacing: 0.2px;
}

.events-card .card-body {
    padding: 1.25rem;
}

/* ============================================
   Photo Grid (within cards)
   ============================================ */

.events-photo-grid {
    margin-top: 0.5rem;
}

.events-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, outline 0.15s ease;
    display: block;
}

.events-thumb:hover,
.events-thumb:focus {
    opacity: 0.82;
    transform: scale(1.05);
    outline: 2px solid #333;
    outline-offset: 2px;
}

[data-theme="dark"] .events-thumb:hover,
[data-theme="dark"] .events-thumb:focus {
    outline-color: #fff;
}

.events-view-all {
    font-size: 0.8rem;
    border-color: #999;
    color: #555;
}

.events-view-all:hover {
    border-color: #333;
    color: #333;
}

[data-theme="dark"] .events-view-all {
    color: #bbb;
    border-color: #666;
}

[data-theme="dark"] .events-view-all:hover {
    color: #fff;
    border-color: #fff;
}

/* ============================================
   Lightbox
   ============================================ */

.events-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.93);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.events-lightbox[hidden] {
    display: none;
}

.lb-image {
    max-height: 82vh;
    max-width: 88vw;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 6px 40px rgba(0, 0, 0, 0.7);
    user-select: none;
}

.lb-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.8rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 10000;
}

.lb-close:hover,
.lb-close:focus {
    transform: scale(1.2) rotate(90deg);
    color: #ddd;
    outline: none;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.2rem;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.35);
    border: none;
    padding: 0.2rem 0.7rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
    z-index: 10000;
    user-select: none;
}

.lb-nav:hover,
.lb-nav:focus {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    outline: none;
}

.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

.lb-counter {
    position: absolute;
    top: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.lb-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* ============================================
   Dark mode card overrides
   ============================================ */

[data-theme="dark"] .events-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .events-hero {
    background: linear-gradient(135deg, #252525 0%, #1a1a1a 100%);
}

/* ============================================
   Loading / Empty states
   ============================================ */

#events-loading .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    color: #555;
}

[data-theme="dark"] #events-loading .spinner-border {
    color: #aaa;
}

/* ============================================
   HEIC Fallback elements
   (shown when browser cannot render HEIC natively)
   ============================================ */

/* Grid thumbnail placeholder */
.events-heic-dl {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    border: 1px dashed #bbb;
    border-radius: 5px;
    text-align: center;
    font-size: 1.5rem;
    text-decoration: none;
    color: #555;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1.3;
}

.events-heic-dl small {
    font-size: 0.65rem;
    margin-top: 3px;
}

.events-heic-dl:hover,
.events-heic-dl:focus {
    background: #e2e2e2;
    color: #222;
    outline: 2px solid #555;
    outline-offset: 2px;
}

[data-theme="dark"] .events-heic-dl {
    background: #2c2c2c;
    border-color: #555;
    color: #bbb;
}

[data-theme="dark"] .events-heic-dl:hover,
[data-theme="dark"] .events-heic-dl:focus {
    background: #3a3a3a;
    color: #fff;
}

/* Lightbox download button for HEIC */
.lb-heic-download {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    text-align: center;
    font-size: 3rem;
    gap: 0.5rem;
    padding: 2.5rem 3rem;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.lb-heic-download span {
    font-size: 1.1rem;
    font-weight: 600;
}

.lb-heic-download small {
    font-size: 0.85rem;
    opacity: 0.7;
}

.lb-heic-download:hover,
.lb-heic-download:focus {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    outline: none;
}

/* ============================================
   Responsive adjustments
   ============================================ */

@media (max-width: 575px) {
    .lb-nav {
        font-size: 2.4rem;
        padding: 0.15rem 0.5rem;
    }

    .lb-prev { left: 0.3rem; }
    .lb-next { right: 0.3rem; }

    .lb-image {
        max-height: 78vh;
        max-width: 94vw;
    }
}

/* ============================================
   Split layout — list (left) + viewer (right)
   ============================================ */

.events-split-wrap {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    height: calc(100dvh - 185px);
    min-height: 350px;
}

.events-list-col {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem 1rem 1.5rem;
    scrollbar-width: none;
}

.events-list-col::-webkit-scrollbar {
    display: none;
}

.events-viewer-col {
    flex: 0 0 28%;
    width: 28%;
    min-height: 0;
    position: relative;
    border-left: 1px solid var(--border-color);
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================
   Side viewer
   ============================================ */

.events-side-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ev-ph {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: #aaa;
}

.ev-ph-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.ev-ph p {
    font-size: 0.95rem;
    margin: 0;
}

.ev-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.ev-img-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    overflow: hidden;
    position: relative;
    padding: 8px;
}

.ev-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
}

.ev-heic-dl {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.78rem;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.55);
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.ev-heic-dl:hover,
.ev-heic-dl:focus {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    outline: none;
}

.ev-bar {
    flex: 0 0 auto;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.ev-caption {
    font-size: 0.8rem;
    color: var(--text);
    text-align: center;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ev-navrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.ev-navbtn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text);
    font-size: 1.4rem;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.ev-navbtn:hover,
.ev-navbtn:focus {
    background: var(--border-color);
    outline: none;
}

.ev-navbtn:disabled {
    opacity: 0.3;
    cursor: default;
}

.ev-counter {
    font-size: 0.78rem;
    color: #888;
    min-width: 4rem;
    text-align: center;
}

@media (max-width: 991px) {
    .events-page #main {
        padding: 0;
    }

    .events-split-wrap {
        height: auto;
        min-height: 0;
        flex-direction: column;
        overflow: visible;
    }

    .events-list-col {
        overflow-y: visible;
        min-height: 0;
        padding: 1rem 0.75rem 2rem;
        width: 100%;
    }

    .events-viewer-col {
        display: none;
    }
}

/* ============================================
   Navbar Social Icons
   ============================================ */
.navbar-social {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.navbar-social a {
    color: #fff !important;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.25s ease;
    text-decoration: none;
}

.navbar-social a:hover,
.navbar-social a:focus {
    transform: scale(1.2);
    outline: none;
}

/* ============================================
   Give Button - Navbar
   ============================================ */
.btn-give {
    background-color: #996633;
    border: 2px solid #fff;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.3rem 0.85rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.btn-give:hover,
.btn-give:focus {
    background-color: #7a4d26;
    border-color: #fff;
    transform: scale(1.08);
    /* Enhanced focus indicator for 508c compliance */
    outline: 3px solid rgba(255,255,255,0.8);
    outline-offset: 2px;
}

/* Dark mode adjustments for give button - maintain brand consistency and 508c compliance */
[data-theme="dark"] .btn-give {
    background-color: #996633;
    color: #fff !important;
    border: 2px solid #fff;
}

[data-theme="dark"] .btn-give:hover,
[data-theme="dark"] .btn-give:focus {
    background-color: #b8773d;
    color: #fff !important;
    border-color: #fff;
    /* Enhanced focus indicator for 508c compliance */
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ============================================
   Footer Social Icon Size
   ============================================ */
.footer-social a {
    font-size: 1.4rem;
    margin-right: 0.75rem;
}
