/*
Theme Name: QUAN EL COR
Theme URI: http://www.pifarrevallejo.com
Version: 1.0
Description: Disseny d' <a href="http://www.pifarrevallejo.com">Pifarré–Vallejo Studio</a>
Author: Adrià Pifarré Vallejo.
Author URI: http://www.pifarrevallejo.com
Copyright: (c) 2026 Pifarré–Vallejo Studio
License: GNU/GPL Version 3 or later. http://www.gnu.org/licenses/gpl.html
*/

/* ==========================================================================
   ╭──────────────────────────────────────────────────────────────────────╮
   │                                                                      │
   │   Design & Web Development:                                          │
   │   Adrià Pifarré Vallejo ( Pifarré-Vallejo Studio )                   │
   │   www.pifarrevallejo.com                                             │
   │                                                                      │
   ╰──────────────────────────────────────────────────────────────────────╯
   ========================================================================== */

/* =========================================
   1. IMPORTACIONS I ESTILS GENERALS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400&display=swap');

* {
    outline: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

html {
    background-color: #F3F3F3;
}

body {
    font-family: 'Outfit', sans-serif;
    padding-bottom: 200px; /* Li donem més aire a sota en mòbil perquè el footer és més alt */
    margin: 0;
}

/* Color del text seleccionat (Ratón) */
::selection {
    background-color: #ab1212 !important;
    color: #F3F3F3 !important;
}

::-moz-selection {
    background-color: #ab1212 !important;
    color: #F3F3F3 !important;
}

/* L'scroll suau el deixem NOMÉS per a ordinadors per evitar la congelació als mòbils */
@media (min-width: 769px) {
    html {
        scroll-behavior: smooth; 
    }
}

/* =========================================
   2. ABECEDARI FIX I ANIMAT (Top)
   ========================================= */
:root {
    --mida-lletra-base: 5rem;
    --mida-lletra-scroll: 3rem;
    --mida-comp-base: 1.2rem;
    --mida-comp-scroll: 1rem;
}

@media (max-width: 1024px) {
    :root {
        --mida-lletra-base: 3.5rem;
        --mida-lletra-scroll: 2.2rem;
        --mida-comp-base: 1rem;
        --mida-comp-scroll: 0.9rem;
    }
}

@media (max-width: 768px) {
    :root {
        --mida-lletra-base: 2.2rem;
        --mida-lletra-scroll: 1.5rem;
        --mida-comp-base: 0.9rem;
        --mida-comp-scroll: 0.8rem;
    }
}

/* NOU: Pantalles d'ordinador amb poca alçada (Portàtils petits, menys de 800px) */
@media (max-height: 800px) and (min-width: 769px) {
    :root {
        --mida-lletra-base: 3.5rem; /* Ho fem més petit directament d'inici */
        --mida-comp-base: 1rem;
    }
	 .logo-hero {
        display: none !important;
    }
}

.contenidor-abecedari {
    position: -webkit-sticky; 
    position: sticky;
    top: 0;
    background-color: #F3F3F3; 
    z-index: 90;
    transition: padding 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                gap 0.6s cubic-bezier(0.25, 1, 0.5, 1),
                background-color 0.4s ease,
                backdrop-filter 0.4s ease;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px 60px; 
    max-width: 2000px;
    margin: 20px auto 0 auto;
    padding: 10px 40px;
}

/* NOU: També reduïm l'espaiat inicial a les pantalles d'ordinador baixetes */
@media (max-height: 800px) and (min-width: 769px) {
    .contenidor-abecedari {
        gap: 15px 30px; 
        margin-top: 10px; 
    }
}

.contenidor-abecedari.scroll-actiu {
    /* Fons de vidre i desenfocament */
    background-color: rgba(243, 243, 243, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);    
    border-bottom: none;     
    box-shadow: 0 20px 40px -10px rgba(243, 243, 243, 0.95); /* boira */
    gap: 15px 30px; 
    padding: 10px 40px;
}

@media (max-width: 1024px) {
    .contenidor-abecedari { gap: 20px 30px; padding: 15px 20px; }
    .contenidor-abecedari.scroll-actiu { gap: 10px 20px; padding: 10px 20px; }
}

@media (max-width: 768px) {
    .contenidor-abecedari { gap: 10px 15px; padding: 10px 10px; }
    .contenidor-abecedari.scroll-actiu { gap: 5px 10px; padding: 5px 10px; }
}

.element-lletra {
    display: flex;
    align-items: baseline; 
    color: #000000;
    text-decoration: none;
    cursor: pointer;
}

.element-lletra:hover .lletra {
    color: #ab1212;
}

.element-lletra .lletra {
    font-size: var(--mida-lletra-base); 
    font-weight: 900; 
    line-height: 1;
    text-transform: uppercase;
    transition: font-size 0.6s cubic-bezier(0.25, 1, 0.5, 1), color 0.2s ease;
}

.element-lletra .comptador {
    font-size: var(--mida-comp-base); 
    font-weight: 300; 
    margin-left: 8px; 
    color: #000000;
    transition: font-size 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.contenidor-abecedari.scroll-actiu .element-lletra .lletra { font-size: var(--mida-lletra-scroll); }
.contenidor-abecedari.scroll-actiu .element-lletra .comptador { font-size: var(--mida-comp-scroll); }

/* Color vermell per a la lletra activa mentre s'hi fa scroll */
.element-lletra.en-pantalla .lletra,
.element-lletra.en-pantalla .comptador {
    color: #ab1212 !important;
    opacity: 1 !important; /* També ens assegurem que s'encengui al 100% si estàvem a la pàgina de search.php */
    transition: color 0.3s ease, opacity 0.3s ease;
}

/* =========================================
   3. LA FRASE CENTRAL QUE S'ESVAEIX (Hero)
   ========================================= */
.contenidor-frase-hero {
    position: fixed;
    left: 50%;
    transform: translate(-50%, -50%); 
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1;
    padding: 0 40px;
    pointer-events: none; 
}

.frase-hero {
    color: #ab1212; 
    font-size: 40px; 
    font-weight: 900; 
    line-height: 1.2;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
	pointer-events: none !important; 
}

@media (max-width: 1024px) {
    .frase-hero { font-size: 24px; padding: 0 30px; }
}
@media (max-width: 768px) {
    .frase-hero { font-size: 20px; padding: 0 20px; }
}


/* =========================================
   4. EL CONTINGUT (Llistat ordenat per lletres)
   ========================================= */
.contingut-diccionari {
    margin-top: 100vh; 
    background-color: #F3F3F3; 
    position: relative;
    z-index: 5; 
    padding: 60px 40px 100px 40px;
    max-width: 2000px;
    margin-left: auto;
    margin-right: auto;
}

.fila-categoria {
    scroll-margin-top: 250px; 
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    gap: 30px;
    margin-bottom: 80px;
    align-items: center; 
}

.col-lletra, .col-numero {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
	font-size: 14px;
    letter-spacing: 1px;
}
.col-lletra { text-align: left; margin-top: 10px; }
.col-numero { text-align: right; white-space: nowrap; margin-top: 10px; }

.col-entrades {
    text-align: center;
    line-height: 1.1;
}

.enllac-terme {
    color: #000000;
    font-size: 48px; 
    font-weight: 900; 
    text-decoration: none; 
    transition: color 0.2s ease, text-decoration-color 0.2s ease; 
}

.enllac-terme:hover {
    color: #ab1212; 
    text-decoration: underline;
    text-decoration-color: #ab1212; 
    text-decoration-thickness: 4px; 
    text-underline-offset: 6px; 
    text-decoration-skip-ink: auto; 
}

.puntuacio {
    font-size: 48px;
    font-weight: 900;
    color: #000000;
    margin-right: 15px; 
}

@media (max-width: 1024px) {
    .enllac-terme, .puntuacio { font-size: 36px; }
    .fila-categoria { scroll-margin-top: 180px; grid-template-columns: 50px 1fr 50px; gap: 20px;} 
}
@media (max-width: 768px) {
    .enllac-terme, .puntuacio { font-size: 28px; }
    .enllac-terme:hover { text-decoration-thickness: 3px; } 
    .fila-categoria { scroll-margin-top: 120px; grid-template-columns: 1fr; text-align: center; margin-bottom: 50px; gap: 15px;} 
    .col-lletra { text-align: center; font-size: 24px; font-family: 'Outfit', sans-serif; font-weight: 900; margin-bottom: 10px; color: #ab1212;} 
    .col-numero { text-align: center; }
	.contingut-diccionari { margin-top: 85vh; padding: 40px 20px 80px 20px; }
}


/* =========================================
   5. MENÚ INFERIOR FIX I ANIMACIONS (Footer)
   ========================================= */
.footer-fix {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #F3F3F3; 
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    height: 90px; 
    z-index: 100; 
    font-family: 'DM Mono', monospace;
    font-weight: 400;
	font-size: 14px;
    letter-spacing: normal; 
}

.boto-menu-mobil { display: none; }

.footer-esquerra, .footer-dreta {
    display: flex;
    height: 100%;
    align-items: flex-end; 
}
.footer-esquerra { flex: 1; }

.enllac-nav:first-of-type { margin-left: auto; }

.element-footer {
    border-left: 1px solid #000000;
    padding: 0 50px 0px 15px; 
    height: 55px; 
    display: flex;
    text-decoration: none;
    color: #000000;
    transition: color 0.2s ease;
}

.element-footer.element-dret { padding-right: 0; }
.element-footer a { color: #000000; text-decoration: none; }
.element-footer:hover, .element-footer a:hover { color: #ab1212; }

/* Cercador Gegant */
.element-footer.contenidor-cerca {
    padding: 0 40px 0 15px; 
    height: 100%; 
}

.formulari-cerca { display: flex; flex-direction: column; gap: 2px; }
.cerca-capcalera { display: flex; gap: 10px; }

.etiqueta-cerca {
    font-family: 'DM Mono', monospace;
	font-size: 14px;
    color: #000000;
    cursor: pointer;
}

.input-gegant {
    border: none;
    background: transparent;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 45px; 
    color: #000000;
    width: 450px; 
    letter-spacing: normal;
    text-transform: none; 
    padding: 0;
}

.input-gegant::placeholder { color: #e5e5e5; }
.input-gegant:focus { outline: none !important; }
.formulari-cerca button { background: transparent; border: none; cursor: pointer; padding: 0; display: flex; }

/* Batec del cor */
.btn-parts-cor { margin-right: 15px; }
.cercle-batec {
    width: 16px; height: 16px; background-color: #ff2b2b; 
    border-radius: 50%; display: block; animation: batec 1.5s infinite ease-in-out; 
}
@keyframes batec {
    0% { transform: scale(0.9); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.4; }
}

@media (max-width: 1024px) {
    .footer-fix { padding: 0 20px; }
    .element-footer { padding: 0 20px 0 15px; }
    .input-gegant { width: 300px; font-size: 35px; }
}

@media (max-width: 768px) {
    .footer-fix {
        height: 60px; 
        padding: 0 20px;
        border-top: 1px solid #000000;
        display: flex;
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center;
        background-color: #F3F3F3;
        z-index: 110; 
    }

    .boto-menu-mobil {
        display: flex; 
        flex-direction: column;
        justify-content: space-between;
        width: 24px; height: 16px;
        background: transparent; border: none; cursor: pointer; padding: 0; z-index: 120; 
    }
    .boto-menu-mobil .linia { width: 100%; height: 2px; background-color: #000000; transition: all 0.3s ease; }
    .boto-menu-mobil.actiu .linia:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .boto-menu-mobil.actiu .linia:nth-child(2) { opacity: 0; }
    .boto-menu-mobil.actiu .linia:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .footer-esquerra {
        position: fixed; 
        bottom: 60px; 
        left: 0; width: 100%;
        background-color: #F3F3F3;
        display: flex; flex-direction: column; 
        border-top: 1px solid #000000;
        height: auto; max-height: calc(100vh - 60px); overflow-y: auto; 
        opacity: 0; visibility: hidden;
        transform: translateY(20px); transition: all 0.3s ease; z-index: 100; 
    }
    .footer-esquerra.obert { opacity: 1; visibility: visible; transform: translateY(0); }

    .enllac-nav:first-of-type { margin-left: 0; }

    .element-footer {
        width: 100%; height: auto; border-left: none; 
        border-bottom: 1px solid #eeeeee; padding: 20px; 
        display: flex; align-items: center;
    }
    
    .element-footer.contenidor-cerca {
        border-bottom: none; 
        align-items: flex-start;
        padding-top: 35px; 
        padding-bottom: 30px; 
    }

    .formulari-cerca { gap: 12px; width: 100%; }
    .input-gegant { width: 100%; font-size: 32px; }
    .footer-dreta { display: flex; align-items: center; height: auto; }
    .element-footer.element-dret { border: none; padding: 0; width: auto; }
}

/* =========================================
   6. POP-UP (MODAL) PARTS DEL COR I CARRUSEL
   ========================================= */
.fons-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(243, 243, 243, 0.6) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999; 
    display: flex;
    justify-content: flex-end; 
    align-items: flex-start; 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.fons-modal.obert { opacity: 1; visibility: visible; }

.capsa-modal {
    /* L'exacte mateix efecte de vidre que el menú superior */
    background-color: rgba(243, 243, 243, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: none;
    box-shadow: -20px 0 40px -10px rgba(243, 243, 243, 0.95);
    width: 50%; 
    max-width: none; 
    height: 100vh; 
    max-height: 100vh;
    padding: 50px; 
    margin: 0; 
    position: relative;
    transform: translateX(100%); 
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto; 
}

.fons-modal.obert .capsa-modal { transform: translateX(0); }

.capcalera-modal {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0; font-family: 'DM Mono', monospace; font-size: 14px;
    letter-spacing: 1px; flex-shrink: 0; 
}

.titol-modal { display: flex; align-items: center; }

.punt-vermell-estatic {
    width: 14px; height: 14px; background-color: #ff2b2b;
    border-radius: 50%; margin-left: 10px; display: inline-block;
}

.boto-tancar-modal {
    background: transparent; border: none; font-size: 32px; font-weight: 300; 
    line-height: 1; color: #000000; cursor: pointer; padding: 0; transition: color 0.2s ease;
}
.boto-tancar-modal:hover { color: #ab1212; }

.contenidor-carrusel {
    flex: 1; overflow: hidden; width: 100%; position: relative;
    display: flex; align-items: center; justify-content: center; margin: 20px 0;
}

/* Cursors personalitzats de fletxa segons la posició (Línies més fines al 0.5) */
.contenidor-carrusel.cursor-esquerra {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="%237f1e1e" stroke-width="0.5" stroke-linecap="butt" stroke-linejoin="miter"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>') 24 24, pointer;
}

.contenidor-carrusel.cursor-dreta {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="%237f1e1e" stroke-width="0.5" stroke-linecap="butt" stroke-linejoin="miter"><path d="M5 12h14M12 5l7 7-7 7"/></svg>') 24 24, pointer;
}

.pista-carrusel { display: flex; height: 100%; align-items: center; transition: transform 0.4s ease-in-out; }
.diapositiva { min-width: 100%; display: flex; justify-content: center; align-items: center; }
.diapositiva img { max-width: 100%; max-height: 65vh; object-fit: contain; }

.controls-inferiors-carrusel {
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; padding: 0; 
}

.punts-carrusel { display: flex; justify-content: center; gap: 8px; }
.punt-carrusel {
    width: 8px; height: 8px; border-radius: 50%; background-color: #cccccc; 
    border: none; cursor: pointer; padding: 0; transition: background-color 0.2s ease;
}
.punt-carrusel.actiu, .punt-carrusel:hover { background-color: #000000; }

.fletxa-carrusel {
    background: transparent; color: #000000; border: none; width: 36px; height: 36px; 
    border-radius: 50%; font-size: 16px; cursor: pointer; display: flex; 
    justify-content: center; align-items: center; transition: background 0.2s ease, color 0.2s ease;
}
.fletxa-carrusel:hover { background: #f4f4f4; color: #000000; }

@media (max-width: 768px) {
    .capsa-modal { width: 100%; padding: 30px 20px; transform: translateX(100%); }
    .diapositiva img { max-height: 50vh; }
}

body { padding-right: var(--marge-scroll, 0px) !important; }
.footer-fix, .contenidor-frase-hero { width: calc(100% - var(--marge-scroll, 0px)) !important; }

/* =========================================
   7. CERCADOR AJAX EN VIU (Autocomplete)
   ========================================= */
.formulari-cerca { position: relative; }

.caixa-resultats-ajax {
    position: absolute;
    bottom: calc(100% + 15px); 
    left: 0;
    width: 100%; 
    min-width: 300px;
    
    /* Efecte vidre amb el color F3F3F3 al 85% */
    background-color: rgba(243, 243, 243, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Traiem la línia i afegim flotació cap amunt */
    border: none;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
    
    display: none; 
    flex-direction: column;
    z-index: 200;
    max-height: 50vh; 
    overflow-y: auto; 
}

.caixa-resultats-ajax.actiu { display: flex; }

.caixa-resultats-ajax a {
    padding: 12px 15px;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    color: #000000;
    text-decoration: none;
    /* Línies separadores interiors més subtils i transparents */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-align: left;
}

.caixa-resultats-ajax a:last-child { border-bottom: none; }

.caixa-resultats-ajax a:hover { 
    /* Un hover suau que no trenqui la transparència del vidre */
    background-color: rgba(0, 0, 0, 0.03); 
    color: #ab1212; 
}

.cap-resultat {
    padding: 12px 15px; font-family: 'DM Mono', monospace; font-size: 12px;
    color: #888888; font-style: italic; text-align: left;
}

@media (max-width: 768px) {
    .caixa-resultats-ajax {
        position: static; bottom: auto; width: 100%; margin-top: 15px;
        box-shadow: none; border: 1px solid #eeeeee; background-color: #fafafa; 
    }
}

/* =========================================
   8. PÀGINA INDIVIDUAL (single.php)
   ========================================= */
.contenidor-abecedari-single { margin-bottom: 50px; }

.contenidor-abecedari-single .lletra-inactiva .lletra,
.contenidor-abecedari-single .lletra-inactiva .comptador {
    opacity: 0.08; transition: opacity 0.3s ease, color 0.2s ease;
}

.contenidor-abecedari-single .lletra-inactiva:hover .lletra,
.contenidor-abecedari-single .lletra-inactiva:hover .comptador {
    opacity: 1; color: #ab1212;
}

.contenidor-abecedari-single .lletra-activa .lletra,
.contenidor-abecedari-single .lletra-activa .comptador {
    opacity: 1; color: #ab1212 !important;
}

.contingut-single {
    display: grid; grid-template-columns: 1fr 1fr; gap: 80px; max-width: 100%; margin: 0 50px;
    padding: 0; min-height: calc(100vh - 500px); align-content: center; align-items: center; 
}

/* Columna Esquerra */
.titol-terme {
    font-family: 'Outfit', sans-serif; font-size: 55px; font-weight: 900;
    line-height: 1.1; color: #000000; margin: 0;
}

.bloc-sinonims { margin-top: 45px; }

.etiqueta-sinonims {
    font-family: 'DM Mono', monospace; font-size: 14px; text-transform: uppercase;
    letter-spacing: 1px; color: #000000;
}

.titol-sinonims {
    font-family: 'Outfit', sans-serif; font-size: 55px; font-weight: 900;
    line-height: 1.1; color: #000000; margin: 0;
}

.enllac-sinonim-negre { color: #000000; text-decoration: none; transition: color 0.2s ease; }
.enllac-sinonim-negre:hover {
    color: #ab1212; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px;
}

.coma-sinonim { color: #000000; }

.enllac-sinonim { color: #ab1212; text-decoration: none; transition: opacity 0.2s ease; }
.enllac-sinonim:hover {
    opacity: 0.7; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px;
}

/* Columna Dreta */
.col-dreta-definicio {
    padding-top: 15px; max-width: 500px; margin: 0 auto; width: 100%; 
}

.etiqueta-definicio {
    font-family: 'DM Mono', monospace; font-size: 14px; text-transform: uppercase;
    text-decoration: underline; text-underline-offset: 3px; margin-bottom: 5px; color: #000000;
}

.text-definicio {
    font-family: 'Outfit', sans-serif; font-size: 17px; line-height: 1.3; font-weight: 500; color: #000000;
}
.text-definicio p { margin-top: 0; margin-bottom: 20px; }
.text-definicio a { color: #ab1212; text-decoration: none; font-weight: 800; transition: opacity 0.2s ease; }
.text-definicio a:hover { opacity: 0.7; }

body.single { padding-bottom: 90px; }

@media (max-width: 1024px) {
    .contingut-single { grid-template-columns: 1fr; gap: 50px; }
    .titol-terme { font-size: 45px; }
    .col-dreta-definicio { padding-top: 0; margin: 0; }
}

@media (max-width: 768px) {
    body.single { padding-bottom: 60px; }
    .contenidor-abecedari-single { gap: 5px 12px; margin-bottom: 30px; padding: 5px 10px; }
    .contenidor-abecedari-single .element-lletra .lletra { font-size: 1.4rem !important; }
    .contenidor-abecedari-single .element-lletra .comptador { font-size: 0.75rem !important; }
    .titol-terme, .titol-sinonims { font-size: 36px; }
    .contingut-single { padding: 0 20px 100px 20px; min-height: auto; }
} /* <-- AQUESTA ÉS LA CLAU MÀGICA QUE HAVIA QUEDAT AL FINAL DE TOT. ARA TANCA EL MÒBIL AQUÍ */


/* =========================================
   9. SISTEMA DE VALORACIÓ (Estrelles)
   ========================================= */
.valoracio-terme { margin-top: 20px; }

/* Apliquem DM Mono a tot MENYS a les icones de les estrelles per no trencar-les */
.valoracio-terme *:not(.rmp-icon) { font-family: 'DM Mono', monospace !important; }

.valoracio-terme h3, 
.valoracio-terme p, 
.valoracio-terme span,
.valoracio-terme div {
    font-size: 14px !important;
    font-weight: 400 !important; 
    text-transform: uppercase !important;
    line-height: 1.6 !important;
    margin-block-start: 0;
    margin-block-end: 0;
}

.valoracio-terme .rmp-rating-widget { margin-top: -11px !important; margin-bottom: 10px !important; }

/* 1. Base: Estrelles buides en gris per defecte */
.valoracio-terme .rmp-rating-widget .rmp-icon { 
    font-size: 16px !important; 
    color: #ccc !important; 
    -webkit-text-fill-color: #ccc !important;
}

/* 2. Estrella votada (plena) en negre MÀXIMA PRIORITAT */
.valoracio-terme .rmp-rating-widget .rmp-icon.rmp-icon--full-highlight { 
    color: #000000 !important; 
    -webkit-text-fill-color: #000000 !important;
}

/* 3. Estrella votada (mitja) amb el retall perfecte per evitar el quadrat */
.valoracio-terme .rmp-rating-widget .rmp-icon.rmp-icon--half-highlight { 
    background: linear-gradient(90deg, #000000 50%, #cccccc 50%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* 4. Color negre net en passar el ratolí (hover) */
@media (hover: hover) {
    .valoracio-terme .rmp-rating-widget .rmp-icon.rmp-icon--hovered { 
        color: #000000 !important; 
        background: none !important;
        -webkit-text-fill-color: #000000 !important; 
    }
}

/* 5. Amaguem els textos de resultats (la mitjana en números) */
.rmp-widgets-container.rmp-wp-plugin.rmp-main-container .rmp-rating-widget__results {
	display: none !important;
}


/* =========================================
   10. PÀGINA "EL PROJECTE"
   ========================================= */

/* Fons de pàgina i text per a "El Projecte" */
body.page-template-template-projecte { background-color: #7f1e1e !important; }

/* La màgia CSS per pintar el fons "rebot" de l'HTML sense necessitat de Javascript */
html:has(body.page-template-template-projecte) { background-color: #7f1e1e !important; }

.page-template-template-projecte .contenidor-projecte,
.page-template-template-projecte .presentacio-projecte,
.page-template-template-projecte .text-editorial,
.page-template-template-projecte .etiqueta-sinonims,
.page-template-template-projecte .credit-final-projecte,
.page-template-template-projecte .text-editorial h2, 
.page-template-template-projecte .text-editorial h3 { color: #F3F3F3 !important; }

/* Color dels enllaços dins del contingut d'"El Projecte" */
.page-template-template-projecte .contenidor-projecte a {
    color: #F3F3F3 !important;
    text-decoration: none;
    text-underline-offset: 4px; /* Separa una mica la línia del text perquè quedi més net */
    transition: opacity 0.2s ease;
}

.page-template-template-projecte .contenidor-projecte a:hover {
    opacity: 0.7;
}

/* Ajustos del footer en "El Projecte" */
.page-template-template-projecte .footer-fix { background-color: #7f1e1e !important; }

.page-template-template-projecte .element-footer,
.page-template-template-projecte .element-footer a,
.page-template-template-projecte .etiqueta-cerca,
.page-template-template-projecte .input-gegant { color: #F3F3F3 !important; border-left-color: #F3F3F3 !important; }

.page-template-template-projecte .input-gegant::placeholder { color: rgba(243, 243, 243, 0.4) !important; }
.page-template-template-projecte .formulari-cerca svg { stroke: #F3F3F3 !important; }

/* Cercador AJAX adaptat al fons vermell */
.page-template-template-projecte .caixa-resultats-ajax {
    background-color: #7f1e1e !important;
    border: 1px solid rgba(243, 243, 243, 0.2) !important;
}

.page-template-template-projecte .caixa-resultats-ajax a {
    color: #F3F3F3 !important;
    border-bottom: 1px solid rgba(243, 243, 243, 0.2) !important;
}

.page-template-template-projecte .caixa-resultats-ajax a:hover {
    background-color: rgba(243, 243, 243, 0.1) !important;
    color: #F3F3F3 !important;
}

.page-template-template-projecte .cap-resultat { color: rgba(243, 243, 243, 0.6) !important; }

/* Contingut principal d'"El Projecte" */
.contenidor-projecte { max-width: 1400px; margin: 20px auto 150px auto; padding: 0 50px; }

.text-editorial { font-family: 'DM Mono', monospace; font-size: 13px; line-height: 1.6; color: #000000; }
.text-editorial h2, .text-editorial h3 { font-family: 'Outfit', sans-serif; font-size: 24px; color: #7a2020; margin-top: 0; }

/* Logo de "El Projecte" FIXAT (Sticky) i Animat */
.logo-projecte-wrap {
    position: -webkit-sticky; 
    position: sticky;
    top: 30px; 
    z-index: 50; 
    text-align: center;
    margin-bottom: 40px;
    pointer-events: none; /* Clau: fa que el logo "no existeixi" pel ratolí i puguis seleccionar el text de sota */
}

.logo-projecte-wrap img { 
    max-width: 200px; 
    height: auto; 
    filter: brightness(0) invert(1); 
    /* Afegim una transició suau per a la reducció de mida */
    transition: max-width 0.4s ease;
}

/* Aquesta classe s'afegirà automàticament en fer scroll */
.logo-projecte-wrap.logo-petit img {
    max-width: 100px;
}

/* Vídeo */
.video-projecte-wrap { width: 65%; margin: 40px auto; }
.video-projecte-wrap video { width: 100%; display: block; border-radius: 5px; }

/* Presentació */
.presentacio-projecte {
    column-count: 2; column-gap: 60px; column-fill: balance;
	font-family: 'Outfit', sans-serif !important; font-size: 17px !important;
    line-height: 1.3 !important; font-weight: 500 !important; color: #000000 !important;
	max-width: 80%; margin: 0 auto 100px auto;
}
.presentacio-projecte p { break-inside: auto !important; margin-top: 0; margin-bottom: 20px; }
.presentacio-projecte p + p { text-indent: 50px; }

/* Crèdits */
.credits-projecte { column-count: 4; column-gap: 40px; margin-bottom: 80px; text-align: center; }
.credits-projecte p { margin-top: 0; margin-bottom: 15px; }
.credits-projecte strong { color: #7a2020; } 
.presentacio-projecte p, .credits-projecte p { break-inside: avoid; }
.credit-final-projecte { text-align: center; max-width: 800px; margin: 0 auto 80px auto; }

/* Logos de les institucions */
.logos-institucions-wrap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 50px; }
.logos-institucions-wrap img {
    max-height: 80px; width: auto; object-fit: contain; filter: grayscale(100%); transition: filter 0.3s ease;
}
.logos-institucions-wrap img:hover { filter: grayscale(0%); }


/* Integració perfecta de logos amb fons blanc sobre el vermell */
.page-template-template-projecte .logos-institucions-wrap img {
    filter: grayscale(100%) invert(1); /* Fons negre, logo blanc */
    mix-blend-mode: screen; /* Fa desaparèixer el fons negre i deixa només el logo blanc */
    opacity: 0.9;
}

/* Si en passar el ratolí vols que destaquin al 100% */
.page-template-template-projecte .logos-institucions-wrap img:hover {
    opacity: 1;
}

/* =========================================
   11. MATERIALS DE DIFUSIÓ (DESCARREGUES)
   ========================================= */
.contenidor-descarregues {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 0 auto 100px auto;
    max-width: 900px;
}

.bloc-descarrega {
    width: 260px;
    text-align: center;
}

.bloc-descarrega a {
    text-decoration: none !important;
    display: block;
}

.wrap-imatge-previsualitzacio {
    width: 100%;
    overflow: hidden;
    margin-bottom: 22px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}

.wrap-imatge-previsualitzacio img {
    width: 100%;
    height: auto;
    display: block;
}

/* Efecte de flotació prèmium en passar el ratolí per sobre de la imatge */
.bloc-descarrega a:hover .wrap-imatge-previsualitzacio {
    transform: translateY(-8px);
}

.boto-descarrega {
    display: inline-block;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: #F3F3F3 !important; 
    background-color: transparent;
    padding: 10px;
    letter-spacing: 2px;
	border: 1px solid #F3F3F3;
    transition: background-color 0.2s ease, opacity 0.2s ease;
	width: 260px;
}

.bloc-descarrega a:hover {
    opacity: 1 !important; /* Evitem que hereti l'opacitat del hover general */
}

.bloc-descarrega a:hover .boto-descarrega {
    color: #ff2b2b !important; 
	border: 1px solid #ff2b2b;
}
/* Responsive adaptat per a tauletes i mòbils */
@media (max-width: 768px) {
    .contenidor-descarregues {
        flex-direction: column;
        align-items: center;
        gap: 50px;
        margin-bottom: 60px;
    }
    .bloc-descarrega {
        width: 100%;
        max-width: 180px;
    }
    /* NOU: Forcem el botó a mesurar 180px igual que la imatge i l'ajustem */
    .boto-descarrega {
        width: 100%;
        padding: 10px 0; /* Traiem el padding lateral perquè el text càpiga bé i quedi al centre */
    }
}

/* =========================================
   CORRECCIÓ MENÚ MÒBIL A "EL PROJECTE"
   ========================================= */

/* 1. Fem blanques les línies del botó hamburguesa (i la X) */
.page-template-template-projecte .boto-menu-mobil .linia {
    background-color: #F3F3F3 !important;
}

@media (max-width: 768px) {
    /* 2. Fons del menú desplegable en vermell perquè s'hi llegeixi el text blanc */
    .page-template-template-projecte .footer-esquerra {
        background-color: #7f1e1e !important;
        border-top: 1px solid rgba(243, 243, 243, 0.2) !important;
    }
    
    /* 3. Línies separadores dels elements del menú (Inici, El Projecte...) en blanc transparent */
    .page-template-template-projecte .element-footer {
        border-bottom: 1px solid rgba(243, 243, 243, 0.2) !important;
    }
    
    /* 4. Traiem la línia sobrant de sota del cercador perquè quedi net */
    .page-template-template-projecte .element-footer.contenidor-cerca {
        border-bottom: none !important;
    }
}

/* Responsive per "El Projecte" */
@media (max-width: 1024px) {
    .credits-projecte { column-count: 3; } 
    .presentacio-projecte { column-gap: 40px; }
}

@media (max-width: 768px) {
    .page-template-template-projecte .caixa-resultats-ajax {
        border: 1px solid rgba(243, 243, 243, 0.2) !important;
        background-color: #7f1e1e !important; 
    }
    .contenidor-projecte { padding: 0 20px; margin-top: 50px; }
    .presentacio-projecte { column-count: 1; max-width: 100%; } 
    .credits-projecte { column-count: 2; column-gap: 20px; } 
    .logos-institucions-wrap img { max-height: 60px; }
    .logos-institucions-wrap { gap: 30px; }
	.video-projecte-wrap { width: 100%;}
}

@media (max-width: 480px) {
    .credits-projecte { column-count: 1; } 
}