:root {
    --verde: #008183;
    --naranja: #f39200;
    --verde-oscuro: #004d4f;
    --fondo: #f4f7f6;
    --blanco: #ffffff;
}

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

body { 
    font-family: 'Montserrat', sans-serif; 
    background: var(--fondo); 
    display: flex; 
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px; 
    height: 100vh; 
    background: var(--verde);
    color: white; 
    position: fixed; 
    top: 0;
    left: 0;
    display: flex; 
    flex-direction: column;
    justify-content: space-between; 
    padding: 3rem 1.8rem;
    z-index: 1000;
}

.sidebar-brand { 
    margin-bottom: 3rem; 
}

.logo-circle {
    display: inline-block;
    padding: 10px 15px; 
    font-size: 0.85rem; 
    background: var(--naranja);
    border-radius: 10px; 
    margin-bottom: 1.2rem; 
    font-weight: bold;
    color: white;
}

.sidebar h2 { 
    font-size: 1.5rem; 
}

.sidebar h2 span { 
    color: var(--naranja); 
    font-weight: bold; 
}

.sidebar nav ul { 
    list-style: none; 
}

.sidebar nav ul li { 
    margin-bottom: 1.8rem; 
}

.sidebar nav ul li a { 
    color: white; 
    text-decoration: none; 
    font-weight: 300; 
    transition: 0.3s; 
    opacity: 0.9; 
    display: inline-block;
}

.sidebar nav ul li a:hover { 
    color: var(--naranja); 
    opacity: 1; 
    transform: translateX(5px);
}

.sidebar-logos { 
    border-top: 1px solid rgba(255,255,255,0.2); 
    padding-top: 1.5rem; 
}

.sidebar-logos p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.logo-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 8px; 
    margin-top: 0.8rem; 
}

.logo-box { 
    background: white; 
    padding: 6px; 
    border-radius: 4px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 40px;
}

.logo-box img {
    max-width: 100%; 
    max-height: 35px;
    height: auto; 
    object-fit: contain;
    display: block;
}

.logo-wide {
    grid-column: span 2;
}

/* --- MAIN CONTENT --- */
.main-content { 
    margin-left: 280px; 
    padding: 3rem 4rem; 
    width: calc(100% - 280px); 
    min-height: 100vh;
}

/* HERO SECTION */
.hero-section {
    background: white; 
    padding: 2.5rem 3rem; 
    border-radius: 20px;
    margin-bottom: 3rem; 
    border-left: 10px solid var(--naranja);
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

.hero-section h1 { 
    font-size: 2.2rem; 
    color: var(--verde-oscuro); 
    margin-bottom: 1rem; 
}

.hero-section h1 span { 
    color: var(--verde); 
}

.hero-text {
    line-height: 1.7; 
    color: #333; 
}

.hero-text p {
    margin-bottom: 12px;
}

.hero-text .highlight-p {
    font-size: 1.1rem;
}

.hero-text .highlight-p strong {
    color: var(--verde);
}

.hero-text .highlight-p span {
    color: var(--naranja); 
    font-weight: bold;
}

.hero-text .quote {
    margin: 15px 0; 
    font-style: italic; 
    border-left: 4px solid var(--naranja); 
    padding-left: 15px;
    color: #555;
}

.hero-text h3 {
    color: var(--verde); 
    margin-top: 20px;
    margin-bottom: 15px;
}

.hero-footer {
    margin-top: 20px; 
    padding-top: 15px; 
    border-top: 1px solid #eee; 
    font-size: 0.85rem;
}

.hero-footer .coord-title {
    font-weight: bold; 
    color: var(--verde-oscuro); 
    margin-bottom: 2px;
}

/* --- CARDS & GALERÍA --- */
.referentes-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 2.5rem; 
}

.card { 
    background: white; 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.04); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.card-img-container {
    width: 100%;
    height: 250px;
    background-color: #f0f0f0;
    border-bottom: 4px solid var(--verde);
    overflow: hidden;
}

.card-img { 
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-content { 
    padding: 1.5rem; 
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}



.rotada-90 {
    transform: rotate(90deg);
}

.tag { 
    font-size: 0.7rem; 
    color: var(--verde); 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.card-content h2 { 
    margin-top: 0.5rem; 
    margin-bottom: 0.2rem; 
    font-size: 1.3rem; 
    color: var(--verde-oscuro); 
}

.card-content .author {
    font-weight: bold; 
    color: var(--naranja); 
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.card-content p { 
    font-size: 0.9rem; 
    color: #666; 
    line-height: 1.5; 
    margin-bottom: 1.5rem; 
    flex-grow: 1;
}



.btn-more {
    background: var(--naranja); 
    color: white; 
    border: none; 
    padding: 12px;
    width: 100%; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: bold; 
    transition: background 0.2s ease;
}

.btn-more:hover { 
    background: var(--verde-oscuro); 
}

/* --- SECCIÓN SOBRE EL PROYECTO --- */
.project-section {
    padding: 40px 0; 
    margin-top: 40px; 
    border-top: 2px solid var(--verde);
}

.project-section h2 {
    color: var(--verde); 
    font-size: 1.8rem; 
    margin-bottom: 20px;
}

.project-card {
    background: white; 
    padding: 25px; 
    border-radius: 16px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.03); 
    line-height: 1.7;
}

.project-card p {
    font-size: 1rem; 
    color: #444; 
    margin-bottom: 12px;
}

.project-card p:last-child {
    margin-bottom: 0;
}

/* --- MODAL --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: #333;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.modal-img-container {
    width: 100%;
    margin: 15px 0;
    text-align: center;
    overflow: hidden;
}

.modal-img {
    max-width: 100%;
    max-height: 450px;
    width: auto;
    height: auto;
    /* Obliga al navegador a usar los metadatos de orientación originales de la imagen */
    image-orientation: from-image;
    object-fit: contain;
    border-radius: 8px;
}

.close:hover { 
    color: var(--naranja); 
}

.subtitle { 
    color: var(--verde); 
    font-weight: bold; 
    margin-bottom: 15px; 
    text-transform: uppercase; 
    font-size: 0.8rem; 
}

.modal-content p {
    line-height: 1.6;
    color: #444;
}

/* --- DISEÑO RESPONSIVO (MÓVILES Y TABLETS) --- */
@media (max-width: 992px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
    }

    .sidebar-brand {
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .sidebar nav ul {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .sidebar nav ul li {
        margin-bottom: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }

    .hero-section {
        padding: 1.5rem;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }

    .referentes-grid {
        gap: 1.5rem;
        grid-template-columns: 1fr;
    }
}