/* 
   Ruta Boabdil V10 - Standard Refactor
   Refined Typography, Full-Width Map, Ivory Theme
*/

:root {
    --clr-rojo: #A01027;
    --clr-verde: #B2C765;
    --clr-azul-alp: #1A3B4B;
    --clr-dorado: #CBAA56;
    --clr-azul-mar: #5D97A4;
    --clr-white: #F7F5F0;
    --clr-bg-white: #F7F5F0;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow-sm: 0 4px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
}

@font-face {
    font-family: 'Gotham';
    src: url('web/home/assets/fonts/Gotham-Book.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Gotham';
    src: url('web/home/assets/fonts/Gotham-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Gotham';
    src: url('web/home/assets/fonts/Gotham-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 130px; /* Offset for fixed header */
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Gotham', sans-serif;
    background-color: var(--clr-bg-white);
    color: #1a1a1a;
    line-height: 1.6;
}

body.town-page {
    background-color: #0b2530;
    color: #F7F5F0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, .logo-link {
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0;
    margin: 0;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 0; /* Adjusted for two rows */
    z-index: 9999; /* ABOVE EVERYTHING */
    transition: var(--transition);
    background: var(--clr-azul-alp);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px; /* Standard container width */
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-bottom {
    width: 100%;
    display: flex;
    justify-content: center;
    border-top: 2px solid var(--clr-dorado);
    border-bottom: 2px solid var(--clr-dorado); /* Double line as requested */
    padding: 8px 0; /* Balanced padding for the subheader */
    margin-top: 5px;
}

.header-subheader {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem); /* Scaled slightly for header but matching style */
    color: var(--clr-dorado);
    font-weight: 500;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-transform: uppercase;
    text-align: center;
}

.header-subheader a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    z-index: 10; /* Ensure it stays above subheader background */
    pointer-events: auto; /* Force clickability */
}

.header-subheader a:hover {
    color: #A01027; /* Rojo de la web */
    transform: translateY(-2px);
    cursor: pointer;
}

.header-star {
    height: 10px !important; /* Fixed size to prevent browser scaling issues */
    width: 10px !important;
    display: inline-block;
}

@media (max-width: 768px) {
    .header-subheader {
        font-size: 0.7rem; /* Increased from 0.55rem for better touch target */
        gap: 10px;
        letter-spacing: 1px;
    }
    .header-star {
        height: 8px;
        width: 8px;
    }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10001;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link {
    margin-right: 15px; /* Separation from sponsor logos */
}

.logo-main {
    height: 55px; /* Slightly adjusted for balance */
    transition: var(--transition);
}

.logo-sponsor-img {
    height: 38px; /* Slightly smaller than main logo */
    width: auto;
    transition: var(--transition);
}

.logo-sponsor-img:hover {
    filter: brightness(1.2) drop-shadow(0 0 5px rgba(255,255,255,0.3));
}

@media (max-width: 768px) {
    .logo-group {
        gap: 8px;
    }
    .logo-main {
        height: 40px;
    }
    .logo-sponsor-img {
        height: 28px;
    }
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #ffffff; /* White for contrast on blue */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.2px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--clr-dorado);
}

/* Hero Section - V4 Flat */
.hero {
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background-color: var(--clr-azul-alp);
    padding: 200px 20px 80px; /* Increased for breathing room */
    border-bottom: 8px solid var(--clr-dorado);
    overflow: hidden; /* Ensure slider doesn't spill */
}

/* Hero Slideshow Styles - Horizontal Slider V1.10 */
.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 600%; /* Total for 6 slides */
    height: 100%;
    z-index: 1;
    display: flex;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.slide {
    flex: 0 0 16.6666%; /* Each slide is 1/6 of the width */
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Slider Controls */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3000;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.slider-prev { left: 0; }
.slider-next { right: 0; }

.half-star {
    width: 50px;
    height: 100px;
    background-image: url('Media/assets/estrella-8-blanca.svg');
    background-size: 100px 100px; /* Full star size */
    background-repeat: no-repeat;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.half-star.left {
    background-position: left center; /* Shows only left half because width is 50px */
}

.half-star.right {
    background-position: right center; /* Shows only right half because width is 50px */
}

.slider-nav:hover .half-star {
    opacity: 1;
    transform: scale(1.1);
}

.hero-content {
    max-width: 900px;
    position: relative; 
    z-index: 2500;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.6); /* Robust legibility */
}

.hero-regions {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--clr-dorado);
    margin-bottom: 40px;
    letter-spacing: 3px;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Star CTA Button - V7.3 (+20%) */
.btn-star {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 264px; /* Increased 20% from 220px */
    height: 264px; /* Increased 20% from 220px */
    background: url('Media/assets/estrella-8-dorada.svg') no-repeat center center;
    background-size: contain;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    margin-top: 450px;
    position: relative;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}

.star-content {
    color: #fff; /* White as requested */
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
    font-family: 'Gotham', sans-serif;
    /* transform: translateY(-2px); */ /* Removed for perfect V1.13 alignment */
    font-size: 1.1rem; /* Adjusted for 3-line layout */
    letter-spacing: 1.5px;
}

.btn-star:hover {
    transform: scale(1.1); /* Removed rotation as requested */
    filter: none;
}

.btn-star:hover .star-content {
    color: #fff; /* Keep white on hover as requested */
    transition: none;
}

.hero-title {
    font-family: 'Gotham', sans-serif;
    font-weight: 900;
    font-size: clamp(3.5rem, 12vw, 7.5rem);
    color: white; /* Contrast vs dark blue */
    margin-bottom: 5px;
    letter-spacing: -2px;
}

.hero-subtitle {
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 30px;
    color: var(--clr-dorado); /* Premium touch on dark blue */
}

.btn-highlight {
    display: inline-block;
    padding: 18px 40px;
    background: var(--clr-rojo);
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(160, 16, 39, 0.2);
}

.btn-highlight:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(160, 16, 39, 0.3);
}

/* Interactive Map Section - FULL WIDTH */
.map-full-width-section {
    width: 100%;
    position: relative;
    background: #0b2530; /* Dark background for map area */
    margin: 0; /* REMOVED GAP AS REQUESTED */
    padding: 80px 0 60px;
}

.map-header {
    text-align: center;
    padding-bottom: 50px;
    color: white;
}

.map-header h2 {
    font-family: 'Gotham', sans-serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 8vw, 4rem); /* Large like H1 */
    color: var(--clr-dorado);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.map-header p {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

.map-viewport {
    width: 100%;
    height: 70vh; /* Responsive height */
    min-height: 600px;
    background: #0b2530;
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
}


.map-overlay-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000; /* ABOVE NAVBAR AND OVERLAYS */
    display: flex;
    gap: 15px;
}

.map-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    background: var(--clr-azul-alp);
    color: white;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.map-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* --- Premium Town Template Styles --- */
.town-hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.town-title-large {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0.2em 0;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.hero-tagline {
    font-size: 1rem;
    letter-spacing: 0.5em;
    font-weight: 300;
    opacity: 0.9;
}

.hero-separator {
    width: 60px;
    height: 3px;
    background: #deb887;
    margin: 1.5rem auto;
}

.hero-subtitle-premium {
    font-size: 1.4rem;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
    font-style: italic;
    opacity: 0.95;
}

.hero-cta-group {
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn-premium {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-premium.btn-solid {
    background: #deb887;
    color: #1a1a1a;
}

.btn-premium.btn-outline {
    border: 2px solid white;
    color: white;
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.practical-info-section {
    padding: 5rem 0;
    background: #fdfdfd;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.info-card {
    background: white;
    padding: 2.5rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card i {
    font-size: 2rem;
    color: #deb887;
    margin-bottom: 1rem;
}

.info-card h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.info-card p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.animate-fade-in {
    animation: fadeIn 1.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Tooltip Custom */
#map-tooltip {
    position: absolute;
    width: 280px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    z-index: 3100;
    pointer-events: none;
    opacity: 0;
    visibility: hidden; /* CRITICAL FOR FLICKER FIX */
    transition: opacity 0.3s ease, transform 0.3s ease; /* NO TRANSITION FOR TOP/LEFT */
    transform: translateY(10px);
}

#map-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* REVEAL ANIMATIONS */
.reveal {
    opacity: 1; /* Changed to 1 by default for stability */
    transform: none;
    transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.phase-section {
    padding: 80px 0; /* Reduced general padding */
    position: relative;
    width: 100%;
    opacity: 1; /* Ensure visible */
}

/* Remove gap specifically for the first phase after the map */
#pueblos .phase-section:first-child {
    padding-top: 0;
}

/* FOOTER EXTRA POSING */
.site-footer {
    padding: 80px 0;
    background: #fff;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer-logos {
    max-width: 600px;
    margin-bottom: 40px;
    opacity: 0.8;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #999;
    letter-spacing: 2px;
}

.phase-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.phase-number {
    font-size: 120px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.2);
    display: block;
    line-height: 1;
    margin-bottom: -40px;
}

.phase-title {
    font-size: 2.5rem;
    font-weight: 500; /* Medium weight as requested */
    text-transform: uppercase;
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: 3px; /* Increased distance */
    font-style: italic; /* Dynamic italic feel */
}

.phase-title small {
    display: block;
    font-size: 4rem;
    font-weight: 900;
    color: var(--clr-dorado);
    margin-top: 0;
    letter-spacing: 2px;
    font-style: normal; /* Stay upright as requested */
}

.phase-title small a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.phase-title small a:hover {
    color: #A01027 !important;
    cursor: pointer;
}



/* --- Phase Identity & Color Sequence V1.12 --- */
.phase-section.phase-granada { background-color: #A01027; color: white; }
.phase-section.phase-granada .phase-title small { color: #0b2530 !important; }

.phase-section.phase-valle { background-color: #B2C765; color: #0b2530; }
.phase-section.phase-valle .phase-title { color: white !important; }
.phase-section.phase-valle .phase-title small { color: #A01027 !important; } /* Red from Granada */

.phase-section.phase-alpujarra { background-color: #1A3B4B; color: white; }
.phase-section.phase-alpujarra .phase-title small { color: #B2C765 !important; } /* Green from Valle */

.phase-section.phase-contraviesa { background-color: #CBAA56; color: white; }
.phase-section.phase-contraviesa .phase-title small { color: #1A3B4B !important; } /* Blue from Alpujarra */

.phase-section.phase-adra { background-color: #5D97A4; color: white; }
.phase-section.phase-adra .phase-title small { color: #CBAA56 !important; } /* Gold from Contraviesa */

.town-links {
    margin-top: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 100%;
}

.town-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 168px;
    height: 168px;
    flex-shrink: 0;
    color: white;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-align: center;
    padding: 30px;
    transition: color 0.3s ease, background-image 0.3s ease; /* No zoom/bounce */
    cursor: pointer;
    text-decoration: none;
    margin: 0;
    position: relative;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
}

.town-link:hover {
    color: var(--phase-color, #CBAA56); /* Dynamic color swap */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22white%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22white%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E") !important;
    z-index: 20;
}

/* Linear Connective Diamonds (Horizontal + Vertical) */
.town-link::after, .town-link::before {
    content: "";
    position: absolute;
    width: 45px;
    height: 45px;
    background-color: white;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 5;
}

/* Horizontal Connector */
.town-link::after {
    right: -42.5px; /* (45px / 2) + (40px / 2) */
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

/* Vertical Connector (New Bottom Diamond) */
.town-link::before {
    bottom: -42.5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

/* Hide trailing connectors dynamically based on fixed grid columns */
.town-link:last-child::after, .town-link:last-child::before {
    display: none !important;
}

@media (min-width: 851px) {
    /* 4 columns */
    .town-link:nth-child(4n)::after { display: none; }
}
@media (max-width: 850px) and (min-width: 651px) {
    /* 3 columns */
    .town-link:nth-child(3n)::after { display: none; }
}
@media (max-width: 650px) and (min-width: 451px) {
    /* 2 columns */
    .town-link:nth-child(2n)::after { display: none; }
}
@media (max-width: 450px) {
    /* 1 column */
    .town-link::after { display: none !important; }
}

/* Hide vertical diamonds if there is no item below it.
   Since we don't have :has(), we hide for the last n items in the grid.
*/
@media (min-width: 851px) { .town-link:nth-last-child(-n+4)::before { display: none; } }
@media (max-width: 850px) and (min-width: 651px) { .town-link:nth-last-child(-n+3)::before { display: none; } }
@media (max-width: 650px) and (min-width: 451px) { .town-link:nth-last-child(-n+2)::before { display: none; } }
@media (max-width: 450px) { .town-link:last-child::before { display: none; } }

.town-links {
    margin: 50px auto 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, 168px);
    justify-content: center;
    gap: 40px 40px;
    width: fit-content;
    max-width: 792px; /* 4 columns maximum */
    padding: 20px 0;
}

@media (max-width: 850px) {
    .town-links { max-width: 584px; } /* 3 columns maximum */
}
@media (max-width: 650px) {
    .town-links { max-width: 376px; } /* 2 columns maximum */
}
@media (max-width: 450px) {
    .town-links { max-width: 168px; } /* 1 column maximum */
}

/* Phase Identities */
.phase-valle { --phase-color: #A01027; }
.phase-valle .town-link { 
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23A01027%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23A01027%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E");
}
.phase-granada { --phase-color: #0b2530; }
.phase-granada .town-link { 
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%230b2530%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%230b2530%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E");
}
.phase-alpujarra { --phase-color: #B2C765; }
.phase-alpujarra .town-link { 
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23B2C765%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23B2C765%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E");
}
.phase-contraviesa { --phase-color: #1A3B4B; }
.phase-contraviesa .town-link { 
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%231A3B4B%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%231A3B4B%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E");
}
.phase-adra { --phase-color: #CBAA56; }
.phase-adra .town-link { 
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23CBAA56%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23CBAA56%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E");
}




/* Unified Town Navigation */
.town-navigation {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background: #0b2530; /* Darker blue */
    border: 1px solid var(--clr-dorado);
    border-radius: 12px;
    overflow: hidden;
    margin: 60px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    color: white;
    position: relative;
}

.nav-item.prev { text-align: left; border-right: 1px solid rgba(203, 170, 86, 0.2); }
.nav-item.next { text-align: right; }
.nav-item.home { 
    flex: 0 0 100px; 
    justify-content: center; 
    align-items: center; 
    font-size: 1.8rem;
    background: rgba(203, 170, 86, 0.05);
    border-left: 1px solid rgba(203, 170, 86, 0.2);
    border-right: 1px solid rgba(203, 170, 86, 0.2);
    color: var(--clr-dorado);
}

.nav-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--clr-dorado);
    margin-bottom: 8px;
    opacity: 0.8;
}

.nav-name {
    display: block;
    font-size: 1.5rem; /* Larger font */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
}

.nav-item:hover {
    background: rgba(203, 170, 86, 0.2);
    border-color: #fff;
}

.nav-item:hover .nav-name {
    color: #fff;
    transform: scale(1.02);
}

.nav-item .fas {
    opacity: 0.6;
    transition: all 0.3s ease;
}

.nav-item:hover .fas {
    opacity: 1;
    color: var(--clr-dorado);
}

/* Tablet & Mobile Nav Adjustment */
@media (max-width: 768px) {
    .town-navigation {
        flex-direction: column;
        border-radius: 0;
        margin: 40px -24px; /* Full bleed on mobile */
    }
    
    .nav-item.prev, .nav-item.next {
        text-align: center;
        border: none;
        border-bottom: 1px solid rgba(203, 170, 86, 0.1);
    }
    
    .nav-item.home {
        flex: none;
        padding: 20px;
        border: none;
        order: -1; /* Home at the top or bottom? Maybe center is better? */
    }
}

/* Redundant Phase Specifics Removed for V1.12 consolidation */

/* Ticker */
.territory-ticker {
    background: #1a1a1a;
    color: white;
    padding: 20px 0;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-content {
    display: inline-block;
    animation: scroll 30s linear infinite;
}

.ticker-content span {
    font-size: 14px;
    font-weight: 700;
    margin-right: 50px;
    text-transform: uppercase;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Footer */
.site-footer {
    background: var(--clr-bg-white);
    padding: 80px 0 40px;
    text-align: center;
    border-top: 2px solid var(--clr-rojo);
}

.footer-logos {
    max-width: 600px;
    margin: 0 auto 40px;
    display: block;
}

.footer-copyright {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Instagram Section */
.instagram-section {
    background-color: var(--clr-azul-alp);
    padding-bottom: 0;
}

.instagram-header {
    padding: 100px 20px 80px;
    text-align: center;
    background-color: var(--clr-azul-alp);
    color: white;
    border-bottom: 2px solid var(--clr-dorado);
}

.instagram-title {
    margin: 0;
}

.instagram-title {
    text-align: center;
    margin-bottom: 30px;
}

.instagram-cta {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 400 !important;
    color: var(--clr-dorado) !important;
    text-transform: none !important;
    letter-spacing: 1px !important;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.instagram-cta:hover {
    opacity: 1;
    text-decoration: underline;
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    line-height: 0;
}

.gallery-item {
    width: 100%;
    height: 350px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(0.9);
}

.gallery-item:hover {
    transform: scale(1.02);
    z-index: 10;
    filter: brightness(1.1);
}

/* Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    box-shadow: 0 0 20px rgba(216, 167, 71, 0.3);
    border: 2px solid var(--clr-dorado);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: #fff;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--clr-dorado);
}

/* --- RESPONSIVE DESIGN --- */

/* Tablet & Large Mobile (1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }
    
    .navbar .container {
        padding: 0 20px;
    }

    .logo-main {
        max-width: 140px;
    }
    
    .instagram-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-content h1 {
        font-size: 4rem;
    }
}

/* Mobile Devices (768px) */
@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0;
    }

    .navbar .container {
        flex-direction: row !important;
        padding: 15px 24px; /* Restore side padding */
    }

    .logo-main {
        height: 45px; /* Smaller logo for mobile */
    }

    .menu-toggle {
        display: block; /* Show toggle on mobile */
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Hidden by default */
        width: 70%;
        height: 100vh;
        background: rgba(11, 37, 48, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: 0.5s ease;
        z-index: 1001;
        backdrop-filter: blur(10px);
        margin-top: 0;
        border-left: 2px solid var(--clr-dorado);
    }

    .nav-links.active {
        right: 0; /* Show menu */
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .phase-title {
        font-size: 1.8rem;
    }
    .phase-title small {
        font-size: 2.2rem;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    .instagram-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-item {
        height: 250px;
    }

    /* Town Page Specifics */
    .town-hero {
        height: 50vh;
    }

    .quote-box {
        padding: 40px;
    }

    .quote-box p {
        font-size: 1.2rem !important;
    }

    .fact-sheet {
        padding: 30px;
    }

    #mini-map {
        height: 350px;
    }

    /* Home Map Tooltip Adjustment for Mobile */
    #map-tooltip {
        width: 90% !important;
        left: 5% !important;
        bottom: 20px !important;
        top: auto !important;
        transform: none !important;
        max-width: none;
    }
}

/* Small Mobile (480px) */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .town-title {
        font-size: 3rem !important;
    }

    .instagram-grid {
        grid-template-columns: 1fr;
    }

    .site-footer .container {
        text-align: center;
    }

    .footer-logos {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin-bottom: 20px;
    }

    .map-overlay-controls {
        bottom: auto;
        top: 20px;
        right: 20px;
        flex-direction: row;
        gap: 5px;
    }

    .map-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* ==========================================================================
   Hitos del Recorrido - Star Trail Component (v1.42)
   ========================================================================== */
.hitos-trail {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    max-width: 900px;
    margin: 60px auto;
}

.hito-item {
    display: flex;
    align-items: flex-start;
    gap: 50px;
    position: relative;
    padding-bottom: 80px;
}

/* Vertical Connecting Line with Diamonds */
.hito-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 40px; /* Center of the 80px star */
    top: 80px;
    bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.15);
    z-index: 1;
}

/* Diamond connectors on the line */
.hito-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 36px; /* 40 - 4 */
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--clr-dorado);
    transform: rotate(45deg);
    z-index: 2;
    opacity: 0.4;
}

.hito-star-container {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    position: relative;
    z-index: 5;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.3));
}

/* The 8-point star container (Empty inside per user request) */
.hito-star-container::before {
    display: none;
}

.hito-text {
    padding-top: 10px;
}

.hito-text h3 {
    color: var(--clr-dorado);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: 800;
}

.hito-text p {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #F7F5F0;
    opacity: 0.9;
    max-width: 650px;
}

/* Semantic Star Colors */
.star-granada .hito-star-container { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%236B1C2A%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%236B1C2A%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E"); }
.star-valle .hito-star-container { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%232D5A3D%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%232D5A3D%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E"); }
.star-alpujarra .hito-star-container { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%231A3B4B%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%231A3B4B%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E"); }
.star-almeria .hito-star-container { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%237A4E2D%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%237A4E2D%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E"); }
.star-adra .hito-star-container { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%231E5B6E%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%231E5B6E%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E"); }

/* Legacy Fallbacks */
.star-rojo .hito-star-container { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23A01027%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23A01027%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E"); }
.star-verde .hito-star-container { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23B2C765%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23B2C765%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E"); }
.star-dorado .hito-star-container { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23CBAA56%22%20%2F%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%2260%22%20height%3D%2260%22%20fill%3D%22%23CBAA56%22%20transform%3D%22rotate(45%2050%2050)%22%20%2F%3E%3C%2Fsvg%3E"); }

/* ==========================================================================
   Town Specific Styles - Global Template (v1.3)
   ========================================================================== */

.town-hero {
    height: 65vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    padding-top: 180px;
    border-bottom: 6px solid var(--clr-dorado);
}

.town-hero-content {
    position: relative;
    z-index: 2;
}

.town-title {
    font-size: clamp(3.5rem, 12vw, 6.5rem);
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
    line-height: 0.9;
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.section-padding {
    padding: 120px 0;
}

.fact-sheet {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(203, 170, 86, 0.2);
    color: white;
    padding: 50px;
    border-radius: 4px;
}

.fact-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 15px 0;
    font-size: 1.1rem;
}

.fact-item span:first-child {
    color: var(--clr-dorado);
    font-weight: 600;
}

.quote-box {
    background: rgba(203, 170, 86, 0.05);
    padding: 80px;
    border-left: 8px solid var(--clr-dorado);
    position: relative;
}

.quote-box::after {
    content: "“";
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 10rem;
    opacity: 0.1;
    color: var(--clr-dorado);
    line-height: 1;
}

.gastronomy-section {
    background: linear-gradient(135deg, #0b2530 0%, #162e3a 100%);
}

.btn-cta {
    display: inline-block;
    padding: 18px 35px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 10px;
    border: 2px solid transparent;
}

.btn-outline {
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: #0b2530;
}

.btn-solid {
    background: var(--clr-dorado);
    color: #0b2530;
}

.btn-solid:hover {
    background: transparent;
    color: var(--clr-dorado);
    border-color: var(--clr-dorado);
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
    border-left: 4px solid #5D97A4;
}

.faq-question {
    font-weight: 700;
    color: var(--clr-dorado);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.faq-answer {
    color: #ddd;
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .section-padding { padding: 60px 0; }
    .town-hero { height: 50vh; }
    .quote-box { padding: 40px; }
    .fact-sheet { padding: 30px; }
}
