/* Estils moderns per a la plantilla single d'excursions */

/* Container principal */
.excursion-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0; /* Reduït de 40px a 20px */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Botó de tornar enrere integrat al header */
.header-top {
    margin-bottom: 10px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    transform: translateX(-2px);
}

.back-btn i {
    font-size: 0.9rem;
}

/* Header integrat més subtil */
.excursion-header {
    background: transparent;
    color: #2c3e50;
    padding: 20px 0;
    margin-bottom: 20px;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 3px solid #e8ecef;
}

.header-content {
    text-align: left;
}

.excursion-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0 0;
    color: #2c3e50;
    line-height: 1.2;
}

/* Grid principal de contingut amb menys separació */
.excursion-content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 25px; /* Reduït de 40px a 25px */
    margin-bottom: 40px;
    grid-template-areas:
        "main-content sidebar-content";
}

/* Assignar àrees específiques per desktop */
.main-content {
    grid-area: main-content;
}

.sidebar-content {
    grid-area: sidebar-content;
}

/* Imatge destacada optimitzada per ocupar més espai horitzontal */
.featured-image {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%; /* Ocupa tot l'espai disponible de la columna principal */
    max-width: none; /* Eliminem la limitació anterior */
}

.excursion-image {
    width: 100%;
    height: auto;
    max-height: 400px; /* Reduïm l'alçada màxima per evitar imatges massa altes */
    object-fit: cover; /* Mantenim les proporcions i fem crop si cal */
    display: block;
    transition: transform 0.8s ease; /* Transició lenta per l'efecte zoom */
    transform: scale(1.02); /* Zoom inicial lleuger */
}

.featured-image:hover .excursion-image {
    transform: scale(1.05); /* Zoom al hover */
}

/* Animació subtil d'entrada */
.excursion-image {
    animation: subtleZoomIn 2s ease-out;
}

@keyframes subtleZoomIn {
    0% {
        transform: scale(1.08);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.02);
        opacity: 1;
    }
}

.excursion-image:hover {
    transform: scale(1.02);
}

/* Seccions generals */
.description-section,
.equipment-section,
.tips-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e8ecef;
}

.description-section h2,
.equipment-section h2,
.wikiloc-map-section h2 {
    color: #2c3e50;
    font-size: 1.4rem; /* Reduït de 1.6rem a 1.4rem */
    font-weight: 600; /* Reduït de 700 a 600 */
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.description-section h2 i,
.equipment-section h2 i,
.tips-section h2 i {
    color: #667eea;
    font-size: 1.3rem; /* Reduït també les icones */
}

/* Contingut de les seccions */
.description-content,
.equipment-content {
    line-height: 1.7;
    color: #4a5568;
    font-size: 1.1rem;
}

.description-content p {
    margin-bottom: 16px;
}

/* Llista de consells simplificada */
.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    color: #4a5568;
    line-height: 1.5;
}

.tips-list li i {
    color: #48bb78;
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* === SIDEBAR === */
.sidebar-content {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* Icona de dificultat a la sidebar */
.difficulty-icon-small {
    font-size: 1.1rem;
    width: 20px;
    flex-shrink: 0;
}

/* Icona més gran de Wikiloc per l'enllaç */
.wikiloc-icon-small {
    height: 32px; /* Augmentat de 20px a 32px */
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

/* Estils de l'enllaç de Wikiloc */
.wikiloc-link-text {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 0.95rem;
}

.wikiloc-link-text a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.wikiloc-link-text a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Widgets de la sidebar (actualitzats) */
.quick-info-widget,
.wikiloc-widget {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e8ecef;
}

.quick-info-widget h3,
.wikiloc-widget h3 {
    color: #2c3e50;
    font-size: 1.2rem; /* Reduït de 1.3rem a 1.2rem */
    font-weight: 600; /* Reduït de 700 a 600 */
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-info-widget h3 i {
    color: #667eea;
}

/* Informació ràpida */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-item i {
    color: #667eea;
    font-size: 1.2rem;
    width: 20px;
    flex-shrink: 0;
}

.info-item div {
    flex: 1;
}

.info-item .label {
    display: block;
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 2px;
}

.info-item .value {
    display: block;
    font-size: 1rem;
    color: #2d3748;
    font-weight: 600;
}

/* Widget Wikiloc simplificat */
.wikiloc-embed {
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
}

.wikiloc-embed iframe {
    border-radius: 8px;
}

.wikiloc-actions {
    text-align: center;
}

/* Enllaç de Wikiloc dins del mapa */
.wikiloc-actions-inline {
    text-align: center;
    margin-top: 15px;
    padding: 0; /* Eliminar padding */
    /* background eliminat per treure el fons */
    /* border-radius eliminat */
}

/* Consells útils a la sidebar */
.sidebar-tips {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e8ecef;
}

.sidebar-tips h3 {
    color: #2c3e50;
    font-size: 1.2rem; /* Reduït de 1.3rem a 1.2rem */
    font-weight: 600; /* Reduït de 700 a 600 */
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-tips h3 i {
    color: #667eea;
}

.sidebar-tips .tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-tips .tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    color: #4a5568;
    line-height: 1.4;
    font-size: 0.9rem;
}

.sidebar-tips .tips-list li i {
    color: #48bb78;
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 0.8rem;
}

/* Enllaç extern dins la descripció */
.external-link-inline {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8ecef;
}

.external-link-text {
    color: #4a5568;
    font-size: 1rem;
    margin: 0;
}

.external-link-text i {
    color: #667eea;
    margin-right: 8px;
}

.external-link-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.external-link-text a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Secció del mapa de Wikiloc */
.wikiloc-map-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e8ecef;
}

.wikiloc-map-section h2 {
    color: #2c3e50;
    font-size: 1.4rem; /* Igualat als altres títols */
    font-weight: 600; /* Igualat als altres títols */
    margin: 0 0 18px 0; /* Igualat als altres títols */
    display: flex;
    align-items: center;
    gap: 10px; /* Igualat als altres títols */
}

.wikiloc-map-section h2 i {
    color: #667eea; /* Igualat als altres títols (era #e74c3c) */
    font-size: 1.3rem; /* Igualat als altres títols */
}

.wikiloc-map-container {
    border-radius: 8px;
    overflow: hidden;
    /* box-shadow eliminada per evitar doble fons */
}

.wikiloc-map-container iframe {
    width: 100%;
    height: 450px; /* Augmentat de 400px a 450px */
    border: none;
    border-radius: 8px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .excursion-single-container {
        padding: 15px 15px 0;
    }

    .excursion-content-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 25px;
        grid-template-areas:
            "featured-image"
            "description"
            "quick-info"
            "wikiloc-map"
            "equipment"
            "sidebar-tips";
    }

    /* Assignar àrees del grid en mòbil */
    .featured-image {
        grid-area: featured-image;
    }

    .description-section {
        grid-area: description;
    }

    .quick-info-widget {
        grid-area: quick-info;
    }

    .wikiloc-map-section {
        grid-area: wikiloc-map;
    }

    .equipment-section {
        grid-area: equipment;
    }

    .sidebar-tips {
        grid-area: sidebar-tips;
    }

    .sidebar-content {
        position: static;
        display: contents; /* Permet que els fills es posicionin directament al grid pare */
    }

    .main-content {
        display: contents; /* Permet que els fills es posicionin directament al grid pare */
    }

    .excursion-title {
        font-size: 2rem; /* Augmentat de 1.8rem a 2rem */
        line-height: 1.3;
    }

    .excursion-header {
        padding: 15px 0; /* Ajustat per al nou estil de header */
        margin-bottom: 15px;
    }

    .featured-image {
        max-width: none;
    }

    .description-section,
    .equipment-section,
    .wikiloc-map-section,
    .quick-info-widget,
    .sidebar-tips {
        padding: 18px; /* Reduït de 20px a 18px */
    }

    .wikiloc-map-container iframe {
        height: 400px; /* Augmentat de 320px a 400px per mòbil */
    }

    .excursion-image {
        max-height: 280px; /* Alçada més petita per a mòbils */
    }

    /* Títols més petits en mòbil */
    .description-section h2,
    .equipment-section h2,
    .wikiloc-map-section h2 {
        font-size: 1.2rem; /* Reduït encara més */
    }

    .quick-info-widget h3,
    .sidebar-tips h3 {
        font-size: 1.1rem; /* Reduït per mòbil */
    }
}

@media (max-width: 480px) {
    .excursion-header {
        padding: 12px 0; /* Ajustat per al nou estil */
    }

    .excursion-title {
        font-size: 1.7rem; /* Lleugerament reduït per pantalles molt petites */
    }

    .description-section h2,
    .equipment-section h2,
    .wikiloc-map-section h2 {
        font-size: 1.1rem; /* Encara més petit en pantalles petites */
    }

    .quick-info-widget h3,
    .sidebar-tips h3 {
        font-size: 1rem; /* Més petit per pantalles petites */
    }

    .back-btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .description-section,
    .equipment-section,
    .wikiloc-map-section,
    .quick-info-widget,
    .sidebar-tips {
        padding: 15px; /* Menys padding en pantalles molt petites */
    }
}

/* Control responsive del grid */