/* Base */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --map-btn-color: #6b4c9a;
    --secondary-color: #10b981;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f9fafb;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Map section */
.map-cutout-section {
    position: relative;
    width: 100%;
    padding: 1.5rem 0 0;
    margin: 0;
    background-image: url('/static/img/banner_Cataliza_1.png');
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
}

.logo-corner {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    padding: 1rem 1.5rem 1rem 2.25rem;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-corner-img {
    height: 40px;
    width: auto;
    display: block;
}

.map-cutout-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 720px;
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: transparent;
}

.map-cutout-left {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 720px;
}

.map-clip-wrapper {
    width: 100%;
    height: 100%;
    min-height: 720px;
    position: relative;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.map-clip-wrapper #map {
    width: 100%;
    height: 100%;
    min-height: 720px;
    border: none;
    will-change: transform;
    transform: translateZ(0);
}

.leaflet-container {
    font-family: inherit;
    background: transparent !important;
}

.map-cutout-right {
    min-height: 720px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 3.5rem 2rem 2rem;
}

.map-hero-title {
    font-size: clamp(2.85rem, 5.5vw, 4.25rem);
    font-weight: 600;
    color: var(--white);
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.2);
}

.map-panel-content {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-height: 0;
}

.map-operating-list {
    padding: 0;
    list-style: none;
    color: var(--white);
    font-size: 0.95rem;
    text-align: left;
    max-height: 50vh;
    overflow-y: auto;
    flex: 1 1 auto;
}

.map-operating-list .map-hierarchy-list,
.map-hierarchy-list {
    padding-left: 0;
    margin: 0 0 0 0;
}

.map-operating-list ul.map-hierarchy-list {
    margin-bottom: 0.5rem;
}

.map-operating-list .list-title {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.map-operating-list .list-breadcrumb {
    font-size: 0.8rem;
    opacity: 0.95;
    margin-bottom: 0.65rem;
    font-weight: 500;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.map-operating-list .map-subregion-select {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    background: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.map-operating-list .map-department-municipios {
    margin-top: 0.25rem;
}

.map-operating-list .map-department-municipios ul {
    margin-bottom: 0;
}

.map-operating-list .negocio-count {
    font-size: 0.85em;
    opacity: 0.85;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.map-operating-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 1rem 0;
}

.map-operating-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.map-operating-list li:last-child {
    border-bottom: none;
}

.map-operating-list .municipio-row {
    cursor: pointer;
    position: relative;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 0.2em;
    transition: text-decoration-color 0.2s ease;
}

.map-operating-list .municipio-row:hover {
    text-decoration-style: solid;
}

.map-operating-list .municipio-row.selected {
    font-weight: 600;
    text-decoration-style: solid;
}

.municipio-detail {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: none;
}

.municipio-detail.visible {
    display: block;
}

.municipio-detail-name {
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--white);
}

.municipio-detail-line {
    color: rgba(255, 255, 255, 0.95);
    white-space: normal;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.municipio-detail-proyectos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.proyecto-chip {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.proyecto-chip:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.proyecto-chip.selected {
    background: rgba(255, 255, 255, 0.3);
    border-color: var(--map-btn-color);
}

.municipio-detail-descripcion {
    margin-top: 0.6rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    display: none;
}

.municipio-detail-descripcion.visible {
    display: block;
}

/* Map panel buttons: low opacity white bg, purple text and border */
.btn-consulta-directorio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--white);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-consulta-directorio:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-consulta-directorio:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.map-controls {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.map-control-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--white);
    border-radius: var(--radius-md);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.2s ease, background 0.15s ease;
}

.map-control-btn.visible {
    opacity: 1;
    pointer-events: auto;
    max-height: 2rem;
}

.map-control-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}


/* Projects */

.projects-section {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.projects-section h2 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.project-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    min-width: 280px;
    max-width: 350px;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.project-card.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--white) 0%, #eff6ff 100%);
}

.card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.card-summary {
    font-size: 0.85rem;
    color: var(--text-light);
}

.project-description {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    min-height: 120px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
}

.project-description.active {
    background: linear-gradient(135deg, var(--white) 0%, #f0fdf4 100%);
    border-top-color: var(--secondary-color);
}

.project-description .default-text {
    color: var(--text-light);
    text-align: center;
    font-style: italic;
}

.project-banner-container {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.project-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-banner-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
}

.project-banner-container .banner-title,
h2.banner-title {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff !important;
    font-size: 2rem;
    font-weight: 700;
    /* Black border with gray outer glow */
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        -2px -2px 0 #888,
        2px -2px 0 #888,
        -2px 2px 0 #888,
        2px 2px 0 #888,
        0 0 12px rgba(200,200,200,0.6);
    z-index: 1;
    text-align: center;
    width: 90%;
    -webkit-text-fill-color: #fff !important;
    margin: 0;
    padding: 0;
}

.project-description p {
    color: var(--text-color);
    line-height: 1.7;
    max-width: 900px;
    margin: 0 auto 2rem;
    text-align: justify;
}

.project-indicators {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin: 2rem auto;
    max-width: 1000px;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.indicator-card {
    text-align: center;
    min-width: 120px;
}

.indicator-value {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.indicator-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-view-map {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    margin: 1.5rem auto;
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-view-map:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-view-map:active {
    transform: translateY(0);
}

.btn-view-map svg {
    width: 18px;
    height: 18px;
}

.sponsors-section {
    margin-top: 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.sponsors-section.active {
    opacity: 1;
    transform: translateY(0);
}

.sponsors-section h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sponsors-ribbon {
    overflow: hidden;
    background: var(--white);
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.sponsors-track {
    display: flex;
    align-items: center;
    gap: 4rem;
    animation: scroll-sponsors 20s linear infinite;
    width: max-content;
}

.sponsors-track img {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.sponsors-track img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes scroll-sponsors {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.sponsors-ribbon:hover .sponsors-track {
    animation-play-state: paused;
}

.footer {
    background: var(--text-color);
    color: var(--white);
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 900px) {
    .map-cutout-split {
        grid-template-columns: 1fr;
    }
    .map-controls {
        bottom: 0.75rem;
        left: 0.75rem;
    }
    .map-hero-title {
        font-size: clamp(2.25rem, 6vw, 3.25rem);
    }
    .project-description {
        width: 95%;
        padding: 1.5rem;
    }
    .project-banner-container {
        height: 150px;
    }
    .banner-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .cards-container {
        flex-direction: column;
        align-items: center;
    }
    
    .project-card {
        min-width: 100%;
    }
}
