@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

/* --- Reset & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    background-color: #232323;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffffff;
}

/* --- Fixed Background Slideshow --- */
#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    background-color: #000000;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

/* Pattern Overlay (repeating SVG mesh) */
#backgroundoverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Crect width='1' height='1' fill='%23000' fill-opacity='0.3'/%3E%3C/svg%3E");
}

/* --- Main Layout --- */
.fullwrap {
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 2;
}

/* Desktop Sidebar */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 23%;
    min-width: 240px;
    max-width: 320px;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#logo {
    padding: 0 30px;
    margin-bottom: 40px;
}

#logo img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Navigation Menu */
ul.menu {
    list-style: none;
    width: 100%;
}

ul.menu li {
    width: 100%;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

ul.menu li a, 
ul.menu li span.separator {
    display: block;
    padding: 15px 30px;
    color: #dddddd;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

ul.menu li a:hover, 
ul.menu li span.separator:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.02);
}

/* Active & Opened Menu states */
ul.menu li.active > a, ul.menu li.active > span.separator {
    background-color: #0d0d0d;
    color: #ffffff;
    border-left: 4px solid #ffffff;
}

/* Submenu (Equipa) */
ul.menu li ul {
    list-style: none;
    background-color: rgba(0, 0, 0, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

ul.menu li.parent.expanded ul {
    max-height: 300px; /* Adjust to accommodate sublinks */
}

ul.menu li ul li {
    border-bottom: none;
}

ul.menu li ul li a {
    padding: 10px 10px 10px 45px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

ul.menu li ul li a::before {
    content: "•";
    color: #ffffff;
    font-size: 16px;
    margin-right: 8px;
    line-height: 1;
}

ul.menu li ul li.active a {
    background-color: rgba(204, 170, 51, 0.1);
    color: #ffffff;
}

/* Content Container */
#maincontainer {
    margin-left: 23%; /* Matches desktop sidebar width */
    width: 77%;
    position: relative;
    z-index: 5;
}

@media (min-width: 1400px) {
    #sidebar {
        width: 300px;
    }
    #maincontainer {
        margin-left: 300px;
        width: calc(100% - 300px);
    }
}

#maincontentwrap {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#maincontentwrapinner {
    padding: 60px 6%;
    flex-grow: 1;
}

/* --- Mobile Header --- */
#mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #0d0d0d;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mobile-logo-container img {
    height: 35px;
    width: auto;
    display: block;
}

#mobile-menu-trigger {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

/* Mobile Dropdown Overlay */
#mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background-color: rgba(13, 13, 13, 0.98);
    z-index: 999;
    overflow-y: auto;
    padding: 20px 0;
}

/* --- Article Styling --- */
#jbArticle {
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

h2.contentheading, h1.componentheading {
    font-size: 26px;
    color: #ffffff;
    border-bottom: 1px solid rgba(204, 170, 51, 0.2);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.jbIntroText p {
    margin-bottom: 20px;
    text-align: justify;
    font-size: 14px;
    color: #eaeaea;
}

.jbIntroText img {
    max-width: 100%;
    height: auto;
}

/* Float image in articles */
.jbIntroText img.float-right {
    float: right;
    margin-left: 25px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.2);
    padding: 5px;
}

.jbIntroText img.float-left {
    float: left;
    margin-right: 25px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.2);
    padding: 5px;
}

/* --- Team Member Styles --- */
.team-profile-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.team-image-box {
    flex: 0 0 200px;
}

.team-image-box img {
    width: 100%;
    height: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(0, 0, 0, 0.3);
    padding: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.team-details-box {
    flex: 1;
    min-width: 250px;
}

.team-email-line {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 25px;
    font-size: 13px;
}

.team-email-line img {
    margin-left: 8px;
    opacity: 0.9;
}

.team-email-line a {
    color: #ffffff;
    font-weight: 600;
}

.team-email-line a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.profile-section-title {
    font-size: 18px;
    color: #ffffff;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
    font-weight: 500;
}

.team-details-box ul {
    list-style: none;
    margin-bottom: 20px;
}

.team-details-box ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: #eaeaea;
}

.team-details-box ul li::before {
    content: "•";
    color: #ffffff;
    position: absolute;
    left: 5px;
    top: 0;
    font-size: 14px;
}

/* --- Contactos Page Layout --- */
.contact-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.contact-info-panel {
    flex: 1 1 300px;
}

.contact-info-panel h2 {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 20px;
}

.contact-street-address {
    margin-bottom: 25px;
    font-style: normal;
    color: #eaeaea;
}

.contact-street-address address {
    font-style: normal;
}

.contact-street-address span {
    display: block;
    margin-bottom: 5px;
}

.contact-details-list {
    margin-top: 20px;
}

.contact-details-list p {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: #eaeaea;
}

.contact-details-list p img {
    margin-right: 15px;
    opacity: 0.8;
}

/* Map Styling */
#map-section {
    width: 100%;
    margin-top: 30px;
}

#map-section h3 {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#map {
    width: 100%;
    height: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    background-color: #111;
    /* Custom premium dark styling filter for OpenStreetMap tiles */
    filter: grayscale(1) invert(0.9) hue-rotate(180deg) brightness(0.95) contrast(1.1);
    -webkit-filter: grayscale(1) invert(0.9) hue-rotate(180deg) brightness(0.95) contrast(1.1);
}

/* Custom styles to restore popups inside Leaflet */
.leaflet-popup-content-wrapper {
    background: #111111 !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    border-radius: 4px !important;
    font-family: 'Open Sans', sans-serif !important;
}

.leaflet-popup-tip {
    background: #ffffff !important;
}

.leaflet-popup-content {
    margin: 10px 15px !important;
    font-size: 13px !important;
}

/* --- Footer Wrap --- */
#footerwrap {
    background-color: #00000000;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 5px 6%;
    font-size: 9px;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#footerRight {
    text-align: right;
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
    #sidebar {
        display: none;
    }
    
    #maincontainer {
        margin-left: 0;
        width: 100%;
        padding-top: 60px; /* Offset for fixed mobile header */
    }
    
    #mobile-header {
        display: flex;
    }
    
    #maincontentwrapinner {
        padding: 30px 4%;
    }
    
    #jbArticle {
        padding: 25px;
    }
    
    h2.contentheading, h1.componentheading {
        font-size: 22px;
    }
    
    .jbIntroText img.float-right,
    .jbIntroText img.float-left {
        float: none;
        display: block;
        margin: 0 auto 20px auto;
    }
    
    .team-profile-container {
        flex-direction: column;
        align-items: center;
    }
    
    .team-image-box {
        flex: 0 0 auto;
        width: 180px;
    }
    
    .team-email-line {
        justify-content: center;
    }
    
    #footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    #footerRight {
        text-align: center;
    }
}
