:root {
    --color-background: rgba(255, 255, 255, 0.6);
    --color-surface: rgba(255, 255, 255, 0.4);
    --color-primary: #f4b400;
    --color-primary-dark: #d79500;
    --color-text: #1f2933;
    --color-muted: rgba(31, 41, 51, 0.65);
    --content-width: min(1100px, 92vw);
    --shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
    --radius: 22px;
    --transition: 0.25s ease;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--color-text);
    min-height: 100vh;
    background: radial-gradient(circle at center, rgba(250, 250, 252, 0.65), rgba(220, 224, 232, 0.9));
    display: flex;
    flex-direction: column;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url('../../background.png') center/cover no-repeat;
    transform: scale(1.04);
    z-index: -2;
    filter: saturate(1.05) brightness(1.08);
    opacity: 0.55;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(245, 247, 250, 0.35);
    backdrop-filter: blur(1.3px);
    z-index: -1;
}

.app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 100vh;
    position: relative;
}

.sidebar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    border-right: 1px solid rgba(207, 214, 226, 0.8);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.sidebar-inner {
    padding: 2.4rem 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 2.8rem;
    height: 100%;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.brand-logo {
    display: block;
    width: 94px;
    min-width: 70px;
}

.brand-logo img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 25px rgba(15, 23, 42, 0.2));
}

.site-header {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2.4rem 3.2rem 0;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.site-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.6rem;
    flex-wrap: wrap;
}

.brand-main {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    flex-wrap: wrap;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    color: rgba(17, 24, 39, 0.8);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid transparent;
    transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
}

.site-nav a:hover,
.site-nav a.active {
    color: #0f172a;
    background: rgba(244, 180, 0, 0.18);
    border-color: rgba(244, 180, 0, 0.35);
    transform: translateY(-2px);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
}

.site-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-tagline {
    color: var(--color-muted);
    font-size: 0.9rem;
    letter-spacing: 0.14em;
}

.site-nav {
    flex: 1 0 auto;
}

.site-nav .nav-root {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.site-nav .nav-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.site-nav .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 14px;
    color: rgba(15, 23, 42, 0.76);
    text-decoration: none;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active,
.site-nav .nav-item.is-active > .nav-link {
    color: #0f172a;
    background: rgba(244, 180, 0, 0.22);
    transform: translateX(4px);
}

.site-nav .sub-menu {
    list-style: none;
    margin: 0.2rem 0 0 0.9rem;
    padding: 0.4rem 0 0.2rem 0.6rem;
    border-left: 2px solid rgba(148, 163, 184, 0.22);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.site-nav .sub-menu a {
    display: block;
    padding: 0.35rem 0.7rem;
    border-radius: 10px;
    color: rgba(30, 41, 59, 0.7);
    text-decoration: none;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.site-nav .sub-menu a:hover,
.site-nav .sub-menu a.active {
    color: #0f172a;
    background: rgba(244, 180, 0, 0.18);
    transform: translateX(4px);
}

.site-footer {
    width: 100%;
    margin-top: 3rem;
    padding: 1.8rem 1rem 2.4rem;
    text-align: center;
    color: var(--color-muted);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.site-footer a {
    color: var(--color-primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover,
.site-footer a:focus {
    text-decoration: underline;
}

.language-switch {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: var(--color-muted);
    align-items: flex-end;
    text-align: right;
}

.language-switch label {
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.language-switch select {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(203, 213, 224, 0.9);
    background: rgba(255, 255, 255, 0.48);
    color: var(--color-text);
    backdrop-filter: blur(6px);
    min-width: 140px;
}

.sidebar-backdrop {
    display: none;
}

.content-area {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 2.8rem 3.2rem 3.6rem;
    gap: 2rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 224, 0.8);
    background: rgba(255, 255, 255, 0.85);
    color: rgba(17, 24, 39, 0.85);
    font-weight: 600;
    letter-spacing: 0.08em;
}

.sidebar-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.toggle-bars {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-bars .bar {
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.content-brand {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.site-main {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1 0 auto;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.4rem;
    border: 1px solid rgba(210, 217, 227, 0.75);
}

.latest-event-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, rgba(244, 180, 0, 0.06), rgba(255, 255, 255, 0.46));
    border: 1px solid rgba(244, 180, 0, 0.28);
    box-shadow: 0 18px 44px rgba(244, 180, 0, 0.18);
    transition: transform var(--transition), box-shadow var(--transition);
}

.latest-event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.22);
}

.latest-event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.latest-event-meta h3 {
    margin: 0;
    font-size: 1.5rem;
}

.latest-event-card .event-date,
.latest-event-card .event-location {
    color: rgba(31, 41, 55, 0.78);
}

.page-content {
    background: rgba(255, 255, 255, 0.46);
    border-radius: var(--radius);
    padding: 2.6rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(210, 217, 227, 0.7);
}

.page-content h1 {
    margin-top: 0;
    font-size: 2.4rem;
    letter-spacing: 0.06em;
}

.rich-text {
    line-height: 1.72;
    color: rgba(45, 55, 72, 0.9);
}

.rich-text a {
    color: var(--color-primary-dark);
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.6rem;
}

.section-header h1,
.section-header h2 {
    margin: 0;
    font-size: 1.75rem;
}

.section-header p {
    margin: 0;
    color: var(--color-muted);
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.6rem;
}

.event-grid.full {
    grid-template-columns: 1fr;
}

.event-card {
    background: rgba(255, 255, 255, 0.42);
    border-radius: var(--radius);
    padding: 1.6rem;
    border: 1px solid rgba(210, 217, 227, 0.65);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.event-card.highlight {
    background: linear-gradient(135deg, rgba(244, 180, 0, 0.08), rgba(255, 255, 255, 0.46));
}

.event-card h2,
.event-card h3 {
    margin: 0;
}

.event-date,
.event-location {
    font-size: 0.95rem;
    color: rgba(45, 55, 72, 0.78);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f4b400, #ffd05a);
    color: #1f2937;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(244, 180, 0, 0.32);
}

.document-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.document-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.39);
    border: 1px solid rgba(210, 217, 227, 0.6);
}

.document-list a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
}

.document-meta {
    color: rgba(45, 55, 72, 0.7);
    font-size: 0.85rem;
}

.document-modal[hidden],
.document-modal-backdrop[hidden] {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

.document-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 80;
}

.document-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.4rem;
    z-index: 90;
}

.document-modal-inner {
    background: rgba(255, 255, 255, 0.49);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(210, 217, 227, 0.8);
    width: clamp(320px, 80vw, 1600px);
    height: 90vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.document-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid rgba(210, 217, 227, 0.6);
}

.document-modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.document-modal-close {
    border: none;
    background: rgba(244, 180, 0, 0.22);
    color: #1f2937;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.document-modal-close:hover,
.document-modal-close:focus-visible {
    background: rgba(244, 180, 0, 0.35);
    transform: translateY(-1px);
    outline: none;
}

.document-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.2rem 1.6rem 1.6rem;
}

.document-modal iframe {
    width: 100%;
    flex: 1;
    border: none;
    border-radius: calc(var(--radius) - 6px);
    box-shadow: inset 0 0 0 1px rgba(210, 217, 227, 0.5);
    background: rgba(248, 250, 252, 0.8);
}

.document-modal-empty {
    margin: 0;
    text-align: center;
    color: rgba(45, 55, 72, 0.75);
    padding: 3rem 0;
}

.gallery-page {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

.gallery-section {
    padding-bottom: 4rem;
}

.gallery-collection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-collection h2 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
}

.gallery-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gallery-card {
    background: rgba(255, 255, 255, 0.39);
    border-radius: 1.25rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.28);
}

.gallery-card-image {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.16));
    overflow: hidden;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.gallery-card-meta {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: rgba(15, 23, 42, 0.65);
}

.gallery-modal-backdrop,
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
}

.gallery-modal-backdrop[hidden],
.gallery-modal[hidden] {
    display: none;
}

.gallery-modal-backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.gallery-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gallery-modal-inner {
    background: rgba(255, 255, 255, 0.48);
    border-radius: 1.5rem;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    height: clamp(320px, 85vh, 90vh);
    width: clamp(320px, 85vw, 90vw);
    pointer-events: all;
    position: relative;
    overflow: hidden;
}

.gallery-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.08);
    border: none;
    border-radius: 999px;
    color: #111827;
    cursor: pointer;
    font-size: 1.5rem;
    height: 2.5rem;
    width: 2.5rem;
    line-height: 1;
}

.gallery-modal-header {
    padding: 1.5rem 3.5rem 1rem;
    text-align: center;
}

.gallery-modal-image-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3.5rem;
    width: 100%;
    height: 100%;
}

.gallery-modal-image-wrapper img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 1rem;
}

.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.65);
    color: #fff;
    border: none;
    border-radius: 999px;
    width: 3rem;
    height: 3rem;
    font-size: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-prev {
    left: 1.5rem;
}

.gallery-modal-next {
    right: 1.5rem;
}

.gallery-modal-caption {
    padding: 1rem 2rem 1.75rem;
    text-align: center;
    color: rgba(17, 24, 39, 0.78);
    min-height: 2.5rem;
}

.event-detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.event-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.1rem;
}

.event-gallery-item {
    position: relative;
    border-radius: calc(var(--radius) - 6px);
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    transition: transform var(--transition), box-shadow var(--transition);
}

.event-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.event-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}

.event-gallery-item:hover img {
    transform: scale(1.05);
}

.event-gallery-item figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 0.6rem 0.9rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.65) 100%);
    color: #f8fafc;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .sidebar-inner {
        padding: 2.2rem 1.8rem;
    }
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(82vw, 320px);
        transform: translateX(-100%);
        box-shadow: 24px 0 60px rgba(15, 23, 42, 0.25);
        transition: transform var(--transition);
        z-index: 40;
    }

    .sidebar-inner {
        padding: 2.4rem 1.8rem;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(6px);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition);
        z-index: 30;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: all;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .content-area {
        padding: 2rem 1.6rem 3rem;
    }

    .content-header {
        align-items: flex-start;
    }

    .content-brand {
        align-items: flex-start;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .site-main {
        gap: 1.6rem;
    }

    .site-header {
        padding: 2rem 1.8rem 0;
        gap: 1.5rem;
        margin-bottom: 2.4rem;
    }

    .site-brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand-main {
        width: 100%;
    }

    .language-switch {
        align-items: flex-start;
        text-align: left;
    }

    .document-modal {
        padding: 1.8rem;
    }

    .document-modal-inner {
        width: clamp(280px, 90vw, 720px);
        height: 92vh;
    }

    .gallery-modal-inner {
        width: clamp(280px, 90vw, 720px);
        height: clamp(260px, 85vh, 90vh);
        border-radius: 1.25rem;
    }

    .gallery-modal-image-wrapper {
        padding: 0 2.25rem;
    }

    .gallery-modal-nav {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }
}

@media (max-width: 700px) {
    body::before {
        background: linear-gradient(160deg, rgba(255, 255, 255, 0.7), rgba(220, 224, 232, 0.9)), url('../images/logo-bocb.jpg') center/58% no-repeat;
        opacity: 0.6;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .site-tagline {
        font-size: 0.75rem;
    }

    .page-content, .card {
        padding: 1.8rem;
    }

    .site-header {
        padding: 1.6rem 1.4rem 0;
        margin-bottom: 2rem;
    }

    .site-nav ul {
        gap: 0.5rem;
        justify-content: flex-start;
    }

    .site-nav a {
        padding: 0.45rem 0.85rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .document-modal {
        padding: 1.2rem;
    }

    .document-modal-body {
        padding: 1rem 1.2rem 1.4rem;
    }

    .gallery-modal-inner {
        height: clamp(240px, 85vh, 90vh);
        width: clamp(240px, 85vw, 90vw);
    }
}

@media (max-width: 520px) {
    .content-area {
        padding: 1.6rem 1.1rem 2.6rem;
    }

    .page-content h1 {
        font-size: 2rem;
    }

    .section-header h1,
    .section-header h2 {
        font-size: 1.45rem;
    }

    .language-switch select {
        font-size: 0.9rem;
    }

    .sidebar-toggle {
        padding: 0.45rem 0.75rem;
    }

    .document-modal-inner {
        width: 100%;
        height: 94vh;
        max-height: 95vh;
        border-radius: 18px;
    }
}
