/*-- 1. Root Variables & Global Styles --*/
:root {
    /* colores */
    --clr-negro: black;
    --clr-blanco: white;
    --clr-dorado: #f4d229;
    --clr-amarillo-claro: #e6d690;
    --clr-azul: #7892c2;
    --clr-verde-whsp: #5FFC7B;
    /* fuentes */
    --ff-title: 'Roboto', sans-serif;
    --ff-title-weight: 500;
    --ff-paragraph: 'Poppins', sans-serif;
    --ff-paragraph-weight: 300;

    /* Fluid Sizes using clamp() */
    /* Format: clamp(MIN-SIZE, SCALABLE-VALUE, MAX-SIZE) */
    --h1-font-size: clamp(2.5rem, 1.19vw + 2.07rem, 3.5rem);
    --p-font-size: clamp(1.25rem, 1.67vw + 0.92rem, 2rem); /* NEW: Fluid paragraph size */
    --span-font-size: clamp(1.3rem, 1.42vw + 1rem, 2.5rem);
    --icon-size: clamp(160px, 6.27vw + 121.12px, 200px); /* Doubled size for mobile/tablet */
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden; /* Prevents scrollbars from appearing */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

/*-- 2. Main Container --*/
.image-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-image: url('iconos_mapa/insumos/potencial.jpg');
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, .5);
}

/*-- 3. Text Styling (Mobile-First) --*/
.texto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes h1 to top, p to bottom */
    align-items: center;
    text-align: center;
    padding: 2rem 0;
    box-sizing: border-box;
    z-index: 5; /* Ensure text is above icons */
    pointer-events: none; /* FIX: Make the container ignore mouse events */
}

.texto h1 {
    width: 95%;
    color: var(--clr-dorado);
    font-family: var(--ff-title);
    font-weight: bold;
    text-shadow: -0.5px -0.5px 0 black, 0.5px -0.5px 0 black, -0.5px 0.5px 0 black, 0.5px 0.5px 0 black;
    font-size: var(--h1-font-size); /* Use fluid size */
    pointer-events: auto; /* FIX: Re-enable mouse events for the text itself */
}

.texto p {
    width: 95%;
    color: white;
    font-weight: 300;
    white-space: normal;
    text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
    font-size: var(--p-font-size); /* MODIFIED: Use fluid size */
    line-height: 1.4;
    pointer-events: auto; /* FIX: Re-enable mouse events for the text itself */
}

/*-- 4. Icon Styling (Mobile-First) --*/
.custom-icon {
    position: absolute;
    cursor: pointer;
    width: var(--icon-size); /* Use fluid size */
    height: auto;
    z-index: 2;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.custom-icon img {
    width: 100%;
    height: auto;
    display: block;
}

.custom-icon:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.custom-icon span {
    position: absolute;
    bottom: -4rem;
    left: 50%;
    transform: translateX(-50%) rotateZ(10deg);
    display: inline-block;
    text-align: center;
    font-size: var(--span-font-size); /* Use fluid size */
    font-weight: bold;
    white-space: nowrap;
    color: white;
    opacity: 0;
    transition: all 400ms ease;
    text-shadow: -2px -2px 0 black, 2px -2px 0 black, -2px 2px 0 black, 2px 2px 0 black;
    pointer-events: none;
}

.custom-icon:hover span {
    transform: translateX(-50%) rotateZ(0deg);
    opacity: 1;
}

/* Mobile Icon Positions (Randomized Distribution) */
.modeling-icon      { left: 10%; top: 25%; }
.bbdd-icon          { left: 70%; top: 20%; }
.development-icon   { left: 15%; top: 55%; }
.geoportal-icon     { left: 65%; top: 45%; }
.geohumanities-icon { left: 40%; top: 15%; }
.app-icon           { left: 75%; top: 65%; }


/*-- 5. Responsive Adjustments for Tablets & Up --*/
@media (min-width: 768px) {
    .texto {
        justify-content: flex-start; /* Keeps H1 at the top */
        padding-top: 3rem;
    }
    
    .texto p {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        white-space: normal; /* Allow text to wrap */
        max-width: 80%; /* Prevent line from getting too long */
    }
    
    .custom-icon span {
        bottom: -5rem;
    }

    /* Intermediate Icon Positions for Tablets */
    .modeling-icon      { left: 15%; top: 15%; }
    .bbdd-icon          { left: 75%; top: 25%; }
    .development-icon   { left: 8%; top: 60%; }
    .geoportal-icon     { left: 80%; top: 70%; }
    .geohumanities-icon { left: 45%; top: 10%; }
    .app-icon           { left: 48%; top: 80%; }
}


/*-- 6. Responsive Adjustments for Desktops & Up --*/
@media (min-width: 1024px) {
    .texto h1 {
        font-size: 2.5rem; /* Override clamp for desktop design */
    }

    .texto p {
        font-size: 1rem; /* Override for desktop design */
    }
    
    .custom-icon {
        width: 120px; /* Revert to original desktop size */
    }
    
    /* Final Desktop Icon Positions (Scattered) */
    .modeling-icon      { left: 13%; top: 12%; }
    .bbdd-icon          { left: 30%; top: 35%; }
    .development-icon   { left: 10%; top: 65%; }
    .geoportal-icon     { left: 70%; top: 15%; }
    .geohumanities-icon { left: 80%; top: 60%; }
    .app-icon           { left: 45%; top: 75%; }
}
