/*
 * Main stylesheet for AulaSputnik
 */


/* --- 1. CSS VARIABLES --- */
/* We define all our core colors and fonts here in the :root selector.
 * This makes them globally available and easy to update later.
 * The palette is inspired by aulasputnik.com.
*/
:root {
    /* Color Palette */
    --color-primary: #a15df6;      /* The main brand blue for buttons, links, etc. */
    --color-background: #e2e8ee;  /* A very light gray for the page background. */
    --color-text: #19325a;        /* A dark, soft black for body text for better readability. */
    --color-text-alt: #e2e8ee;        /* A dark, soft black for body text for better readability. */
    --color-text-accent: #e3fe53; /* A dark, soft black for body text for better readability. */
    --color-heading: #19325a;     /* A slightly darker black for headings to give them emphasis. */
    --color-heading-alt: #e2e8ee;        /* A dark, soft black for body text for better readability. */
    --color-heading-accent: #e3fe53; /* A dark, soft black for body text for better readability. */
    --color-secondary-text: #19325a; /* A muted gray for less important text. */
    --color-border: #9fb3c8;      /* A light gray for borders and dividers. */
    --color-white: #FFFFFF;       /* Pure white, for card backgrounds, etc. */
    --color-btn: #a15df6; /* A very light gray for button backgrounds, providing a subtle contrast. */
    --color-btn-hover: #9053dd; /* A slightly darker gray for button hover states, enhancing interactivity. */
    --color-btn-hover-clear: #bd8df8; /* A slightly darker gray for button hover states, enhancing interactivity. */
    --color-btn-sec: #e3fe53; /* A very light gray for button backgrounds, providing a subtle contrast. */
    --color-btn-hover-sec: #cce44a; /* A slightly darker gray for button hover states, enhancing interactivity. */

    /* Typography */
    --font-body: 'Inter', sans-serif;         /* The font for all paragraphs and general text. */
    --font-heading: 'Urbanist', sans-serif;   /* A distinct, bold font for all headings (h1, h2, etc). */
}
/* --- FINAL FOOTER OVERFLOW FIXES (2025-07-13) --- */
@media (max-width: 600px) {
  body {
    overflow-x: hidden;
  }
  .footer-main-grid,
  .footer-column-left,
  .footer-column-right {
    min-width: 0 !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  .footer-column-left p,
  .footer-column-right p,
  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form select,
  .contact-form textarea {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }
}
/* --- EXTRA FOOTER RESPONSIVE FIXES (2025-07-13) --- */
@media (max-width: 600px) {
  .footer-container,
  .footer-main-grid,
  .footer-column-right,
  .footer-column-left {
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
  }
  .footer-container {
    padding-left: 8px;
    padding-right: 8px;
  }
  .footer-main-grid {
    gap: 18px;
  }
  .footer-column-right {
    padding-left: 2px;
    padding-right: 2px;
  }
  .footer-column-left p {
    word-break: break-word;
  }
  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form select,
  .contact-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 6px;
    padding-right: 6px;
  }
}


/* --- 2. CSS RESET AND GLOBAL STYLES --- */
/* These rules create a consistent starting point across all browsers. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* This makes layout math more intuitive. */
}

html {
    /* Enables smooth scrolling when a user clicks an anchor link. */
    scroll-behavior: smooth;
}

body {
    /* APLIQUEM LA IMATGE DE FONS A TOTA LA PÀGINA */
    background-image: url('../images/background.png');
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;

    /* El color de fons original ara actua com a 'fallback' si la imatge no es carrega. */
    background-color: var(--color-background);

    /* La resta d'estils es mantenen igual. */
    font-family: var(--font-body);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* Apply the heading font to all heading levels. */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-heading);
}


/* --- 3. LANGUAGE SWITCHER --- */
/* The minimal style needed for the language switcher functionality. */
.lang-switcher-btn.active {
    font-weight: bold;
    text-decoration: underline;
    text-decoration-color: var(--color-primary); /* Use our brand color for the underline. */
    text-underline-offset: 4px; /* Give the underline a bit of space. */
}
.lang-switcher-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-secondary-text);
}


/* --- HEADER & NAVIGATION STYLES --- */

/* The main header container. It's positioned at the top of the page. */
.site-header {
    /* Positioned absolutely so that content below it can appear underneath (for the transparent effect). */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* A high z-index ensures it stays on top of other content. */
    z-index: 1000;
}

/* The navigation bar itself. */
.site-nav {
    /* We will use padding to control the height of the nav bar. */
    padding: 30px 0;
    /* This transition makes the padding and background-color changes smooth when we scroll. */
    transition: padding 0.3s ease, background-color 0.3s ease;
}

/* This class will be ADDED BY JAVASCRIPT when the user scrolls down. */
.site-nav.scrolled {
    /* Changes the position to fixed, so it sticks to the top of the viewport. */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Sets the background color using one of your variables. */
    background-color: var(--color-background);
    /* Reduces the padding to make the nav bar smaller. */
    padding: 15px 0;
    /* Adds a subtle shadow to lift it off the page content. */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* The container that centers the nav content. */
.nav-container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 40px;
    /* Use flexbox to lay out the logo and menu. */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* The logo container */
.nav-logo img {
    /* Sets the height of the logo. The width will adjust automatically. */
    height: 50px;
    /* A transition for a smooth size change if we ever need it. */
    transition: height 0.3s ease;
}
/* When the nav is scrolled, we can also make the logo slightly smaller. */
.site-nav.scrolled .nav-logo img {
    height: 35px;
}

/* --- Navigation Menu & Links --- */
/*.nav-menu {
    /* By default, the menu items are aligned to the right. 
}*/
.nav-list {
    /* Remove default list bullets. */
    list-style: none;
    margin: 0;
    padding: 0;
    /* Use flexbox to align all list items horizontally. */
    display: flex;
    align-items: center;
    /* Sets the space between menu items. */
    gap: 30px;
}
.nav-list a {
    /* Set the text color to white. */
    color: var(--color-text);
    text-decoration: none;
    font-weight: 400;
    position: relative;
    padding: 5px 0;
    transition: color 0.2s ease;
}
/* A simple underline effect for standard nav links on hover */
.nav-list a:not(.nav-button)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}
.nav-list a:not(.nav-button):hover::after {
    width: 100%;
}

/* --- Navigation Buttons & Language Switcher --- */
.nav-button {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.2s ease;
}
.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
/* This removes the underline hover effect from the buttons. */
.nav-button::after {
    display: none !important;
}

/* Primary button style (e.g., "Tallers") */
a.nav-button {
    background-color: var(--color-btn);
    color: var(--color-white) !important;
    padding: 8px 12px;
}
a.nav-button:hover {
    background-color: var(--color-btn-hover);
}

/* Secondary button style (e.g., "Contacte") */
a.nav-button-secondary {
    background-color: var(--color-btn-sec);
    color: var(--color-text) !important; /* Dark text on light button */
    padding: 8px 12px;
}
a.nav-button-secondary:hover {
    background-color: var(--color-btn-hover-sec);
}

/* --- Subtle Color Pulse Animation for "Tallers" Button --- */

/* We apply the animation directly to the primary navigation button. */
a.nav-button:not(.nav-button-secondary) {
    /* The 'animation' property calls our keyframes (defined below).
       - 'pulse-color' is the animation name.
       - '4s' is the duration (a slow, 4-second loop).
       - 'ease-in-out' makes the transition smooth.
       - 'infinite' makes it repeat forever.
    */
    animation: pulse-color 4s ease-in-out infinite;
}

/* Estil per a l'enllaç de la pàgina activa al menú de navegació. */
.nav-list a.active-page {
    color: var(--color-primary); /* El ressaltem amb el color principal. */
}

/* LinkedIn button under team member quotes */
.linkedin-btn {
    margin-top: 10px;
    color: #0A66C2;
    font-size: 1.7em;
    transition: color 0.2s;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    gap: 0.05em;
    margin-top: 8px;
    background: #0A66C2;
    color: #fff;
    font-size: 0.75em;
    font-weight: 300;
    border-radius: 20px;
    padding: 0.25em 1em 0.25em 0.8em;
    border: none;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(10,102,194,0.08);
    transition: background 0.2s, box-shadow 0.2s;
    min-height: 2em;
    min-width: 0;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.linkedin-btn:hover {
    text-decoration: none;
    background: #5393d4;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(10,102,194,0.15);
}

/* LinkedIn button icon style */
.linkedin-btn i.fa-linkedin {
    font-size: 1em;
    margin-right: 0.3em;
    vertical-align: middle;
}

/* LinkedIn button text style */
.linkedin-btn-text {
    font-size: 0.9em;
    font-weight: 300;
    letter-spacing: 0.01em;
    vertical-align: middle;
    margin-left: 0.1em;
}


/* We define the animation steps for the background color change. */
@keyframes pulse-color {
    /* The animation starts and ends at the button's default background color. */
    0%, 100% {
        background-color: var(--color-btn);
    }
    /* At the middle of the animation (50%), we change to the button's hover color. 
       This creates the subtle "brighter" effect. */
    50% {
        background-color: var(--color-btn-hover-clear);
    }
}

/* Language switcher styling */
.lang-switcher-btn {
    border: 0.4px solid var(--color-white);
    background: transparent;
    color: var(--color-text);
    padding: 2px 4px;
    border-radius: 8px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}
.lang-switcher-btn:hover {
    background-color: var(--color-white);
    border-color: var(--color-white);
}
/* This is the key to only showing one language option at a time. */
.lang-switcher-btn.active {
    display: none;
}

/* --- Hamburger Menu & Responsive Styles --- */
.hamburger-menu {
    /* Hide the hamburger on desktop screens. */
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001; /* Ensure it's on top of other nav content */
}
.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-white);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* This media query applies to screens 900px wide or smaller. */
@media (max-width: 900px) {
    .nav-menu {
        /* Hide the regular menu on mobile. */
        display: none;
        /* Position it absolutely for the slide-down effect. */
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding-top: 100px; /* Space for the header */
        padding-bottom: 30px;
        background-color: var(--color-background);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    .nav-menu.is-active {
        /* Show the menu when it has the 'is-active' class (from JS). */
        display: block;
    }
    .nav-list {
        /* Change the layout to a vertical column. */
        flex-direction: column;
        /* Increase the gap for better spacing. */
        gap: 25px;
    }
    .hamburger-menu {
        /* Show the hamburger menu on mobile. */
        display: block;
    }

    /* Animate the hamburger icon into an "X" when the menu is open. */
    .hamburger-menu.is-active .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-menu.is-active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.is-active .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* --- 8. HERO SECTION STYLES --- */

/* The main container for the hero section. */
/* El contenidor principal de la secció hero, ara transparent. */
.hero-section {
    height: 100vh;
    color: var(--color-white);
    position: relative;
    display: grid;
    grid-template-columns: 3fr 2fr;
    align-items: start; 
    padding: 18vh 80px 0 80px;
    gap: 40px;
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
}

/* The container for the text and button. */
.hero-content {
    z-index: 2;
    max-width: 1250px;
    /* Aligns the text to the left within this container. */
    text-align: left;
}

/* The main title (H1). */
.hero-title {
    font-size: clamp(32px, 4.5vw, 50px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 40px;
    max-width: 800px; /* Prevents the line from getting too long on wide screens. */
    text-shadow: 1px 1px 2px rgba(226, 232, 238, 0.6);
}

/* This styles the "AulaSPUTNIK" text inside the title. */
.hero-title .highlight {
    /* It uses your primary brand color to stand out. */
    color: var(--color-primary);
    font-weight: 900; /* Make it even bolder. */
}

/* The main "Veure Tallers" button. */
.hero-button {
    /* Reusing your button styles for consistency. */
    background-color: var(--color-btn);
    color: var(--color-white);
    padding: 10px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 300;
    font-size: 16px;
    transition: all 0.2s ease;
}
.hero-button:hover {
    background-color: var(--color-btn-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Contenidor per als botons del hero. */
.hero-buttons-container {
    display: flex; /* Alinea els botons horitzontalment. */
    align-items: center; /* Els centra verticalment. */
    gap: 20px; /* Afegeix un espai de 20px entre els botons. */
}

/* Estil per al nou botó secundari. */
.hero-button--secondary {
    /* Utilitzem el teu color de botó secundari. */
    background-color: var(--color-btn-sec);
    /* Utilitzem el teu color de text fosc per a un bon contrast. */
    color: var(--color-text);
}
.hero-button--secondary:hover {
    /* Utilitzem el teu color de hover per al botó secundari. */
    background-color: var(--color-btn-hover-sec);
}

/* The "Saber Més" link at the bottom. */
.scroll-down-link {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Space between the text and the arrow. */
    color: var(--color-white);
    text-decoration: none;
    font-weight: 600;
    opacity: 0.8;
    
    /* This is where we apply our limited animation! */
    /* 'bounce' is the animation name.
       '2.5s' is the duration.
       '2' means it will only run twice.
       '1s' is a delay before it starts.
    */
    animation: bounce 2s infinite ease-in-out;
}
.scroll-down-link:hover {
    opacity: 1;
}

/* We define the keyframes for our limited bounce animation. */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
        color: var(--color-text-alt);
    }
    40% {
        transform: translateY(-2px);
        color: var(--color-text-accent);
    }
    60% {
        transform: translateY(-1px);
        color: var(--color-text-accent);
    }
}

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
    .hero-content {
        /* Reduce padding on mobile to keep content from being pushed too far down/in. */
        padding: 150px 40px;
    }
    .hero-title {
        /* Reduce font size on smaller screens to prevent it from looking too big. */
        font-size: 40px;
    }
  .hero-buttons-container {
    flex-direction: column;
    gap: 1rem;
    align-items: center; /* Center the buttons horizontally */
  }
  .hero-button,
  .hero-button--secondary {
    width: auto;         /* Let buttons keep their natural width */
    min-width: 0;        /* Prevent unwanted stretching */
    text-align: center;
  }
}

/* Per a pantalles horitzontals de mòbil i altres pantalles baixes */
@media (max-height: 600px) and (min-width: 768px) {
    .hero-title {
        font-size: 32px; /* Reduïm la mida del títol. */
        margin-bottom: 20px; /* Reduïm el marge inferior. */
    }
    .hero-content {
        /* Reduïm l'espaiat superior per donar més lloc al text. */
        padding-top: 120px;
    }
}

.hero-floating-image {
    /* Ja no necessita ser absolut. Simplement li diem que s'alineï a la dreta de la seva columna. */
    justify-self: end;
    width: 100%;
    /* Definim una amplada màxima per controlar-ne la mida. */
    max-width: 350px;
}
.hero-floating-image img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 5px #e2e8ee);
}

/* --- BANNER INFERIOR PER A MÒBILS --- */

/* Per defecte, el banner està amagat. */
.mobile-scroll-banner {
    display: none; /* Amagat en pantalles grans. */
    position: fixed; /* El fixem a la finestra del navegador. */
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 500; /* Assegura que estigui per sobre d'altres elements. */

    /* Estils visuals del banner. */
    background-color: var(--color-text); /* Un fons fosc per a bon contrast. */
    padding: 15px 0;
    text-align: center;
}

/* Estil per a l'enllaç dins del banner. */
.mobile-scroll-banner .scroll-down-link {
    /* Eliminem l'animació en aquesta versió. */
    animation: none;
    /* Assegurem que la posició no sigui absoluta. */
    position: static;
    transform: none;
    color: var(--color-white);
    opacity: 1;
}

/* AQUESTA ÉS LA PART CLAU: La Media Query per a mòbils. */
/* Aquestes regles només s'apliquen a pantalles de 768px d'ample o menys. */
@media (max-width: 768px) {
    /* 1. Amaguem l'enllaç "Saber Més" original que surava al mig. */
    .hero-section .scroll-down-link {
        display: none;
    }

    /* 2. Mostrem el nou banner inferior. */
    .mobile-scroll-banner {
        display: block; /* O 'flex' si necessites alinear-lo. */
    }
}

/* --- Ajustos responsius per al Hero Grid --- */

/* Quan la pantalla és més estreta de 900px, passem a una sola columna. */
@media (max-width: 900px) {
    .hero-section {
        /* Canviem a una sola columna. */
        grid-template-columns: 1fr;
        /* Reduïm l'espaiat lateral. */
        padding: 120px 40px 0 40px;
        /* Centrem el text quan només hi ha una columna. */
        justify-items: center;
        text-align: center;
    }

    .hero-content {
        /* Ens assegurem que el text estigui centrat. */
        text-align: center;
    }

    /* Amaguem la imatge en dispositius mòbils per deixar espai al text. */
    .hero-floating-image {
        display: none;
    }
}

/* Per a tauletes */
@media (max-width: 900px) {
    .hero-floating-image {
        /* La fem una mica transparent perquè no competeixi tant amb el text. */
        opacity: 0.6;
        max-width: 300px;
        bottom: 2%;
    }
}

/* Per a pantalles de mòbil, el millor és amagar-la per no sobrecarregar la pantalla. */
@media (max-width: 768px) {
    .hero-floating-image {
        display: none;
    }
}

/* --- 11. SECCIÓ DE CONTEXT I ACORDIÓ --- */

.context-section {
    padding: 60px 40px;
    background-color: var(--color-white); /* Un fons blanc per a aquesta secció. */
    scroll-margin-top: 70px;
}

/* Estil per al text ressaltat NOMÉS dins de la secció de context. */
.context-section strong {
    /* El text tindrà el teu color principal per destacar. */
    color: var(--color-primary);
    /* Ens assegurem que el pes de la lletra sigui marcadament negreta. */
    font-weight: 800;
}

/* La graella per a les dues columnes. */
.context-grid {
    display: grid;
    /* Dues columnes d'igual amplada. */
    grid-template-columns: 1fr 1fr;
    /* Un espai generós entre les columnes. */
    gap: 80px;
    /* Alineem els elements a la part superior. */
    align-items: start;
}

/* El contenidor del text de l'esquerra. */
.context-text-content .section-title {
    /* El títol de la secció l'alineem a l'esquerra. */
    text-align: left;
    margin-bottom: 10px;
}

.context-text-content p {
    /* Espaiat entre paràgrafs. */
    margin-bottom: 10px;
    line-height: 1.5; /* Una mica més d'interlineat per a millor llegibilitat. */
    text-align: justify;
}

/* --- Estils per a l'acordió --- */
.accordion-item {
    /* Una vora inferior per separar cada ítem de l'acordió. */
    border-bottom: 1px solid var(--color-border);
}

/* L'estil del botó que fa de capçalera de cada ítem. */
.accordion-header {
    /* Eliminem tots els estils per defecte dels botons. */
    background: none;
    border: none;
    width: 100%;
    /* Utilitzem flexbox per alinear el títol i la icona. */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
    text-align: left;
    /* Estils de la font. */
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 900;
    color: var(--color-heading);
}
.accordion-header i {
    /* La icona de més/creu. */
    font-size: 18px;
    color: var(--color-primary);
    transition: transform 0.3s ease; /* Transició per a la rotació. */
}

/* El contingut de l'acordió, que estarà amagat per defecte. */
.accordion-content {
    /* L'amaguem posant una alçada màxima de 0. */
    max-height: 0;
    overflow: hidden; /* El contingut que sobrepassi queda ocult. */
    transition: max-height 0.4s ease-out, padding 0.4s ease-out; /* Transició suau per a l'efecte de desplegament. */
    text-align: justify;
}
.accordion-content p {
    padding-bottom: 25px; /* Espaiat intern del text. */
}

/* --- Estats actius de l'acordió (quan es clica) --- */

/* Quan un ítem està actiu, canviem la icona de "+" a "x". */
.accordion-item.is-active .accordion-header i {
    transform: rotate(45deg);
}

/* Quan un ítem està actiu, mostrem el seu contingut. */
.accordion-item.is-active .accordion-content {
    /* L'alçada màxima es calcula amb JavaScript per mostrar tot el contingut. */
    /* Aquest valor és només un fallback gran. */
    max-height: 500px; 
}


/* --- Ajustos responsius per a la secció --- */

@media (max-width: 900px) {
    /* En pantalles més petites, passem a una sola columna. */
    .context-grid {
        grid-template-columns: 1fr;
        gap: 50px; /* Reduïm l'espai. */
    }

    .context-text-content .section-title {
        /* Tornem a centrar el títol en format mòbil. */
        text-align: center;
    }
}

/* --- 9. SECCIÓ DE VALORS --- */

/* Contenidor principal de la secció. */
.valors-section {
    /* Un espaiat generós per sobre i per sota. */
    padding: 60px 40px;
    /* Utilitzem el color de fons principal de la pàgina. */
    background-color: var(--color-background);
}

/* Un contenidor genèric per centrar el contingut de les seccions. */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Estil per al títol principal de la secció. */
.section-title {
    font-size: 42px;
    font-weight: 900;
    text-align: center;
    /* Un marge inferior per separar-lo del contingut. */
    margin-bottom: 40px;
    color: var(--color-heading);
}

/* La graella que contindrà les targetes. */
.valors-grid {
    /* Utilitzem CSS Grid per a la disposició. */
    display: grid;
    /* Aquesta és la línia clau per a la responsivitat:
       - Crea tantes columnes com pugui.
       - Cada columna tindrà una mida mínima de 300px i una màxima d'1 fracció d'espai (1fr).
       - Això fa que passi de 3 a 2 i a 1 columna automàticament. */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* L'espai entre les targetes. */
    gap: 30px;
}

/* L'estil per a cada targeta individual. */
.valor-card {
    /* Fons blanc per a cada targeta. */
    background-color: var(--color-white);
    /* Cantonades arrodonides. */
    border-radius: 8px;
    /* Espaiat interior. */
    padding: 30px 20px;
    /* Tot el contingut estarà centrat. */
    text-align: center;
    /* Una ombra suau per donar-li profunditat. */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.005);
    /* Una transició suau per a l'efecte de sobreposició (hover). */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efecte en passar el ratolí per sobre d'una targeta. */
.valor-card:hover {
    /* La targeta s'aixeca una mica. */
    transform: translateY(-0px);
    /* L'ombra es fa una mica més pronunciada. */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.01);
}

/* L'estil per a la icona. */
.valor-icon {
    /* Color de la icona (el teu color primari). */
    color: var(--color-primary);
    /* Mida de la icona. */
    font-size: 40px;
    /* Marge inferior per separar-la del títol. */
    margin-bottom: 2px;
}

/* L'estil per al títol de la targeta. */
.valor-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--color-heading);
}

/* L'estil per al subtítol (la frase). */
.valor-subtitle {
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
}

/* --- FOOTER STYLES --- */
/* These rules style the footer section of the site. */

/* Main footer container styling */
.site-footer {
    /* Sets the background color to the dark blue from your variables. */
    background-color: rgba(26, 50, 90, 0.9);
    /* Sets the text color to white for high contrast on the dark background. */
    color: var(--color-text-alt);
    /* Sets padding for: 50px top, 0 right, 20px bottom, 0 left */
    padding: 50px 0 20px 0;
}

/* This container constrains the footer content's width and centers it. */
.footer-container {
    /* Sets a maximum width to prevent the content from becoming too wide on large screens. */
    max-width: 1200px;
    /* Centers the container horizontally. */
    margin: 0 auto;
    /* Adds side padding that shrinks on smaller screens. */
    padding: 0 40px;
}

/* The main grid for the two columns. */
.footer-main-grid {
    /* Use CSS Grid for the layout. */
    display: grid;
    /* Defines two columns. The right column (form) is 1.5 times wider than the left. */
    grid-template-columns: 2fr 3fr;
    /* Sets a gap between the two columns. */
    gap: 50px;
    /* Adds space below the grid, before the bottom bar. */
    margin-bottom: 40px;
}

/* Left column (text content) styling */
.footer-column-left p {
    /* Adds space below the paragraphs. */
    margin-bottom: 20px;
    /* Sets the opacity to make the text slightly less bright and easier to read. */
    opacity: 0.9;
}

.footer-column-right {
    /* Això evita que els inputs toquin les vores en pantalles molt estretes. */
    padding: 0 10px;
}

/* Footer main title styling ("PARLEM?") */
.footer-title {
    /* Use the heading font family. */
    font-family: var(--font-heading);
    /* Sets a large font size. */
    font-size: 36px;
    /* Adds space below the title. */
    margin-bottom: 20px;
    /* Sets the color to white for contrast against the dark footer background. */
    color: var(--color-text-accent);
}

/* Social media icons container */
.footer-social-icons {
    /* Use Flexbox to lay out the icons. */
    display: flex;
    /* Sets a gap between the icons. */
    gap: 22px;
    /* Adds some space above the icons. */
    margin-top: 20px;
    /* This new line centers the icons horizontally within their container. */
    justify-content: center;
}

/* Individual social icon link styling */
.footer-social-icons a {
    /* Sets the color of the icons to white. */
    color: var(--color-btn-sec);
    /* Sets the size of the icons. */
    font-size: 26px;
    /* Smooth transition for the hover effect. */
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Hover effect for social icons: slightly lighter color and moves up a bit. */
.footer-social-icons a:hover {
    color: var(--color-btn-hover-sec); /* Use your secondary button color on hover. */
    /* transform: translateY(-3px); */
}

/* --- Contact Form Styles --- */

/* A container for each label-input pair in the form. */
.form-group {
    /* Adds space below each form group. */
    margin-bottom: 20px;
}

/* Styling for placeholder text within form fields */
.contact-form ::placeholder {
    /* Sets the color of the placeholder text. */
    color: var(--color-white);
    /* Makes the placeholder text slightly transparent so it looks like a hint. */
    opacity: 0.6;
}

/* Styling for all text inputs, select dropdowns, and textareas */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
    /* Makes the input field take up the full width of its container. */
    width: 100%;
    /* Sets padding inside the input field. */
    padding: 10px;
    /* Removes the default border. */
    border: 1px solid rgba(227, 254, 83, 0.2); /* Match multiselect border color */
    /* Adds rounded corners. */
    border-radius: 8px;
    /* Sets the background color to be slightly darker than the footer itself. */
    background-color: var(--color-text); /* replaced rgba(0,0,0,0.2) with --color-text for dark bg */
    /* Sets the text color inside the input field to white. */
    color: var(--color-white);
    /* Sets the font size for text typed into the field. */
    font-size: 14px;
    /* Use the standard body font. */
    font-family: var(--font-body);
    box-sizing: border-box; 

}
.contact-form select {
    /* Allows custom arrow styling if needed later. */
    -webkit-appearance: none;
    appearance: none;
    /* Add a background arrow image to indicate it's a dropdown. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23e2e8ee' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

/* Submit button styling */
.submit-btn {
    /* Makes the button take up the full width. */
    width: 100%;
    max-width: 100px;
    /* Sets padding inside the button. */
    padding: 10px;
    /* Sets the background color using your button color variable. */
    background-color: var(--color-btn-sec);
    /* Sets the text color. */
    color: var(--color-text);
    /* Removes the border. */
    border: none;
    /* Adds rounded corners. */
    border-radius: 8px;
    /* Sets the font size. */
    font-size: 14px;
    /* Makes the font bold. */
    font-weight: 700;
    /* Changes the cursor to a pointer on hover. */
    cursor: pointer;
    /* Smooth transition for the hover effect. */
    transition: background-color 0.2s ease;
    display: block;
    margin: 0 auto; /* Center the button */
}

/* Hover effect for the submit button */
.submit-btn:hover {
    /* Use your button hover color variable. */
    background-color: var(--color-btn-hover-sec);
}

/* --- Checkbox Styles --- */

/* A container for the entire privacy section to give it some space. */
.privacy-section {
    /* Adds space between the textarea above and the submit button below. */
    margin: 10px 0 30px 0;
}

/* Styling for the introductory text ("En relació amb...") */
.privacy-header {
    font-size: 12px;
    margin-bottom: 10px;
    color: var(--color-text-alt);
}

/* Styling for the link within the privacy consent header text. */
.privacy-header a {
    /* This makes the link's color exactly the same as the surrounding paragraph text. */
    color: inherit;
    /* This removes the underline completely. */
    text-decoration: none;
    /* This adds a smooth transition for the color change on hover. */
    transition: color 0.2s ease;
}

/* This rule applies ONLY when the mouse is hovering over the link. */
.privacy-header a:hover {
    /* On hover, the link's color changes to pure white to make it stand out. */
    color: var(--color-white);
}

/* This is the container for each individual checkbox and its label. */
.form-group-checkbox {
    /* Use Flexbox to align the checkbox and text. */
    display: flex;
    /* Vertically aligns items to the center. */
    align-items: center;
    /* Make sure it's positioned so we can hide the default checkbox. */
    position: relative;
    /* Adds space below the first checkbox. */
    margin-bottom: 5px;
}

/* The label is our clickable area. */
.form-group-checkbox label {
    /* Use the body font. */
    font-family: var(--font-body);
    /* Set a comfortable font size. */
    font-size: 12px;
    /* Makes the text slightly dimmer. */
    color: var(--color-text-alt);
    /* Adds space to the left, so it doesn't touch our custom checkbox. */
    padding-left: 25px;
    /* Makes the whole label clickable. */
    cursor: pointer;
}

/* Here we hide the ugly default checkbox. */
.form-group-checkbox input[type="checkbox"] {
    /* Makes it invisible. */
    opacity: 0;
    /* Takes it out of the document flow. */
    position: absolute;
    /* Moves the label on top of it, making the label clickable. */
    z-index: 1;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* This creates our new, custom checkbox box. */
.form-group-checkbox label::before {
    /* This is the empty box. */
    content: '';
    /* Positions it on the left side of the label. */
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    /* Sets the size of the box. */
    width: 12px;
    height: 12px;
    /* The border of the box. */
    border: 2px solid var(--color-border); /* replaced rgba(255,255,255,0.7) */
    /* Adds rounded corners. */
    border-radius: 2px;
    /* A smooth transition for when it gets checked. */
    transition: all 0.2s ease;
}

/* This rule applies ONLY when the hidden checkbox is checked. */
.form-group-checkbox input[type="checkbox"]:checked + label::before {
    /* Fills the box with our primary brand color. */
    background-color: var(--color-btn);
    /* Changes the border color to match. */
    border-color: var(--color-btn);
    /* Adds our SVG checkmark as a background image. */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3e%3cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022z'/%3e%3c/svg%3e");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- Custom Multi-Select Dropdown Styles --- */

/* The main container for the component. */
.multiselect-container {
    /* Required for positioning the dropdown options panel inside it. */
    position: relative;
}

/* The visible, clickable area that looks like an input field. */
.multiselect-display {
    /* Same background as our other inputs. */
    background-color: var(--color-text); /* replaced rgba(0,0,0,0.2) */
    /* Same border. */
    border: 1px solid rgba(227, 254, 83, 0.2); /* replaced rgba(255,255,255,0.2) */
    /* Same rounded corners. */
    border-radius: 8px;
    /* Same padding. */
    padding: 12px;
    /* Make the cursor a pointer to show it's clickable. */
    cursor: pointer;
    /* Use flexbox to position the text and the arrow icon. */
    display: flex;
    /* Puts space between the text and the arrow. */
    justify-content: space-between;
    /* Vertically aligns the text and arrow. */
    align-items: center;
    font-size: 14px; /* Increased font size for multiselect tool */
    color: var(--color-white); /* Use the main text color */
}

/* When the dropdown is open ('active'), we give the display a subtle blue glow. */
.multiselect-display.active {
    border-color: var(--color-btn);
    box-shadow: 0 0 5px rgba(161, 93, 246, 0.5); /* This can stay as it's a brand color shadow */
}

/* The placeholder text inside the display area. */
.multiselect-placeholder {
    /* Prevents long text from wrapping. */
    white-space: nowrap;
    /* Hides text that overflows the container. */
    overflow: hidden;
    /* Adds '...' to overflowing text. */
    text-overflow: ellipsis;
    /* Makes the text slightly dimmer, like a real placeholder. */
    opacity: 0.7;
    /* Add a little space to the right, so it doesn't touch the arrow. */
    padding-right: 10px;
    font-size: 14px; /* Match font size for multiselect tool */
}

/* The dropdown panel itself, containing the options. */
.multiselect-options {
    /* Hide the panel by default. */
    display: none;
    /* Position it absolutely, relative to the main container. */
    position: absolute;
    /* Puts it on top of other elements. */
    z-index: 10;
    /* Make it span the full width of the container. */
    width: 100%;
    /* Set the background to be a solid, slightly darker color. */
    background-color: var(--color-text); /* replaced #2c3e50 with --color-text */
    /* Add a border and rounded corners. */
    border: 1px solid rgba(159, 179, 200, 0.5); /* var(--color-border) with 50% opacity */
    border-radius: 8px;
    /* Limits the height and makes it scrollable if there are many options. */
    max-height: 250px;
    overflow-y: auto;
    /* Add a little space from the top. */
    margin-top: 1px;
}

/* When the component is active, we show the options panel. */
.multiselect-container.active .multiselect-options {
    display: block;
}

/* Styling for each individual option (the checkbox and its label). */
.multiselect-option {
    /* Use flexbox for alignment. */
    display: flex;
    align-items: center;
    /* Add padding inside each option. */
    padding: 4px 10px;
    /* Make it clickable. */
    cursor: pointer;
    /* A smooth transition for the background color on hover. */
    transition: background-color 0.2s ease;
    /* Prevent user from accidentally selecting the text. */
    user-select: none;
    font-size: 14px; /* Match font size for multiselect tool */
}
.multiselect-option:hover {
    /* Change the background on hover to give feedback. */
    background-color: var(--color-btn-hover); /* replaced rgba(255,255,255,0.1) with --color-btn-hover */
}

/* We style our own checkbox and hide the default one. */
.multiselect-option input[type="checkbox"] {
    margin-right: 12px;
    /* For custom styling, you can use appearance: none; and then style a ::before element, similar to the other checkboxes. For now, we'll use a simplified version. */
    width: 12px;
    height: 12px;
    accent-color: var(--color-btn); /* This quickly colors the default checkbox. */
}

/* --- Footer Bottom Bar Styles --- */

.footer-bottom-bar {
    /* Use Flexbox to lay out the copyright and legal links. */
    display: flex;
    /* Puts maximum space between the two items, pushing them to opposite ends. */
    justify-content: space-between;
    /* Vertically aligns the items in the center. */
    align-items: center;
    /* Allows items to wrap onto a new line on small screens. */
    flex-wrap: wrap;
    /* Adds space above the bar. */
    padding-top: 0px;
    /* Adds a border on top. */
    border-top: 0px solid var(--color-border); /* replaced rgba(255,255,255,0.1) */
}

/* Styling for the copyright and legal link text */
.copyright-text {
    font-size: 14px;
    color: var(--color-text-alt);
}

.copyright-text a {
    font-size: 14px; /* Increased font size for legal links */
    text-decoration: none;
    transition: color 0.2s ease;
    color: var(--color-text-alt);
}
.copyright-text a:hover {
    color: var(--color-white);
}


.footer-legal-links a {
    font-size: 14px; /* Increased font size for legal links */
    text-decoration: none;
    transition: color 0.2s ease;
    color: var(--color-text-alt);
}
.footer-legal-links a:hover {
    color: var(--color-white);
}
.footer-legal-links a:last-child {
    margin-left: 20px;
}


/* --- RESPONSIVE STYLES FOR FOOTER --- */
/* This media query applies only when the screen width is 900px or less. */
@media (max-width: 900px) {
    .footer-main-grid {
        /* Changes the grid to a single column layout. */
        grid-template-columns: 1fr;
        /* Reduces the gap for a tighter look on mobile. */
        gap: 50px;
    }
}

/* This media query applies only when the screen width is 600px or less. */
@media (max-width: 600px) {
    .footer-bottom-bar {
        /* Changes the layout to a column, stacking the items vertically. */
        flex-direction: column;
        /* Aligns items to the start (left). */
        align-items: flex-start;
        /* Adds a gap between the stacked items. */
        gap: 15px;
    }

    .footer-container {
        /* Reduces side padding on very small screens. */
        padding: 0 20px;
    }
}

/* --- CUSTOM SCROLLBAR STYLES --- */
/* These rules customize the appearance of the browser's scrollbar. */

/* For WebKit-based browsers (Chrome, Edge, Safari) */
/* First, we define the overall scrollbar element. We can set its width here. */
body::-webkit-scrollbar {
    /* Sets the width of the scrollbar. 10px is a good, subtle size. */
    width: 8px;
}

/* This is the "track" - the background area the bar slides along. */
body::-webkit-scrollbar-track {
    /* As requested, we make the background transparent. */
    background: transparent;
}

/* This is the "thumb" - the actual draggable bar itself. */
body::-webkit-scrollbar-thumb {
    /* You can change this variable to any color from your palette! */
    /* Let's use your primary button color for now. */
    background-color: var(--color-btn);
    /* This adds fully rounded corners to the bar. */
    border-radius: 20px;
    /* This creates a small transparent border around the bar, making it look like it's "floating". */
    border: 3px solid transparent;
    background-clip: content-box;
}

/* We can also add a hover effect to the bar. */
body::-webkit-scrollbar-thumb:hover {
    /* It will change to your button hover color when you mouse over it. */
    background-color: var(--color-btn-hover);
}

/* For Firefox browser */
/* Firefox uses a more modern, simpler syntax. */
html {
    /* 'thin' makes the scrollbar narrow. 'auto' is default. */
    scrollbar-width: thin;
    /* Sets the color of the thumb and the track, respectively. */
    /* So, here we are setting the thumb to your button color and the track to transparent. */
    scrollbar-color: var(--color-btn) transparent;
}

/* --- SCROLL TO TOP BUTTON STYLES --- */

#scroll-to-top-btn {
    /* Position fixed keeps it in the same place on the screen when scrolling. */
    position: fixed;
    /* 30px from the bottom of the viewport. */
    bottom: 30px;
    /* 30px from the right of the viewport. */
    right: 30px;
    
    /* Set a high z-index to ensure it stays on top of other content. */
    z-index: 999;
    
    /* Hide the button by default. */
    opacity: 0;
    visibility: hidden;
    /* This moves the button down slightly, so it can "slide in" from the bottom. */
    transform: translateY(20px);
    
    /* This makes all the changes (opacity, transform) smooth. */
    transition: all 0.3s ease-in-out;
    
    /* Visual styles */
    /* Use your primary button color for the background. */
    background-color: var(--color-btn);
    /* Set the icon color to white. */
    color: var(--color-white);
    /* Remove the default button border. */
    border: none;
    /* Make the button a perfect circle. */
    border-radius: 50%;
    /* Set the width and height. */
    width: 30px;
    height: 30px;
    /* Set the icon size. */
    font-size: 14px;
    /* Add a subtle shadow. */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    /* Make the cursor a pointer to show it's clickable. */
    cursor: pointer;
}

/* We will add this class with JavaScript when the button should be visible. */
#scroll-to-top-btn.is-visible {
    /* Make the button fully visible. */
    opacity: 1;
    visibility: visible;
    /* Move the button back to its original position, creating the slide-in effect. */
    transform: translateY(0);
}

/* A simple hover effect for the button. */
#scroll-to-top-btn:hover {
    /* Use your button hover color. */
    background-color: var(--color-btn-hover);
    /* Make the button slightly larger on hover. */
    /* transform: scale(1.1); */
}

/* --- 12. SECCIÓ D'INTRODUCCIÓ DE PÀGINA --- */

/* Contenidor principal per a les seccions d'introducció de les sub-pàgines. */
.page-intro-section {
    background-color: var(--color-background);
    padding: 130px 40px 30px 40px;
}

/* El contenidor del contingut de text. */
.intro-content {
    /* Centrem el contingut horitzontalment. */
    max-width: 1200px;
    /* Centrem tot el text dins d'aquest contenidor. */
    text-align: left;
}

/* El títol principal de la pàgina. */
.page-title {
    font-size: 52px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--color-heading);
    margin-bottom: 10px; /* Espai sota el títol principal. */
}

/* Els paràgrafs introductoris, amb un estil una mica diferent. */
.lead-paragraph {
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 4px;
    text-align: justify;
}

/* El subtítol (per exemple, "Metodologia"). */
.section-subtitle {
    font-size: 36px;
    font-weight: 800;
    color: var(--color-heading);
    /* Un espai més gran per sobre per separar-lo visualment. */
    margin-top: 10px;
    margin-bottom: 2px;
}

/* Els paràgrafs introductoris, amb un estil una mica diferent. */
.regular-paragraph {
    font-size: 16px;
    line-height: 1.4;
    text-align: justify;
    color: var(--color-text);
    margin-bottom: 2px;
    margin-top: 10px;
}

/* El subtítol (per exemple, "Metodologia"). */
.section-middle-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-heading);
    /* Un espai més gran per sobre per separar-lo visualment. */
    margin-top: 8px;
    margin-bottom: 2px;
    text-transform: uppercase;    background-color: var(--color-background);
}

/* --- 13. NOVA SECCIÓ DE TALLERS --- */

.tallers-section {
    padding: 10px 40px 20px 40px;
    background-color: var(--color-background);
}

.tallers-section p {
    text-align: justify;
    line-height: 1.4;
}

/* La graella que conté les targetes. */
.taller-grid {
    display: grid;
    /* Una sola columna per a les targetes. */
    grid-template-columns: 1fr;
    gap: 25px;
    /* Limitem l'amplada per a una millor llegibilitat en pantalles grans. */
    max-width: 1200px; 
    margin: 0 auto; /* Centrem la graella a la pàgina. */
}

/* L'estil per a cada targeta individual. */
.taller-card {
    background-color: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.taller-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* La capçalera de la targeta, que és l'element clicable. */
.taller-card-header {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 25px 30px;
    cursor: pointer;
}

.taller-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    min-width: 48px;
    min-height: 48px;
    max-width: 80px;
    max-height: 80px;
    flex-shrink: 0; /* Evita que la icona s'encongeixi. */
    /* Remove color/font-size, now for images */
}

.taller-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}


.taller-main-info {
    flex-grow: 1; /* Fa que aquesta secció ocupi tot l'espai disponible. */
}

.taller-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--color-heading);
    line-height: 1.2;
}

.taller-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.taller-tags span {
    background-color: var(--color-background);
    color: var(--color-text);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 400;
}

/* La fletxa per expandir, ara a la dreta. */
.taller-expand-icon {
    font-size: 20px;
    color: var(--color-text);
    opacity: 0.6;
    transition: transform 0.4s ease;
    margin-left: 20px; /* Espai a l'esquerra de la fletxa. */
    margin-right: 0;
    /* Fixem la icona a la dreta de la capçalera */
    margin-left: auto;
    /* Ens assegurem que no s'encongeixi */
    flex-shrink: 0;
    /* Opcional: alineem verticalment si cal */
    align-self: center;
}
.taller-card.is-open .taller-expand-icon {
    transform: rotate(180deg);
}

/* La part oculta de la targeta (animada amb el teu JS). */
.taller-card-hidden {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

/* El contenidor del contingut intern que té l'espaiat. */
.taller-hidden-content {
    padding: 20px 30px;
    border-top: 1px solid var(--color-background);
}

/* La disposició de dues columnes per als detalls. */
.taller-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Columna esquerra 2/3, dreta 1/3. */
    gap: 40px;
    align-items: start;
}

/* Estils per al contingut intern. */
.taller-details-grid h4 { 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--color-primary); 
    margin-bottom: 2px; 
    margin-top: 6px; /* Espaiat superior per separar del text anterior */
}
.taller-details-grid ul { 
    list-style: none; 
    padding: 0; 
}
.taller-details-grid li, 
.taller-details-grid .feature-item { 
    display: flex; 
    align-items: flex-start; 
    gap: 2px; 
    margin-bottom: 4px; 
    margin-left: 6px; /* Espaiat a l'esquerra per a les llistes */
}
.taller-details-grid i { 
    color: var(--color-primary); 
    margin-top: 6px;
    font-size: 12px; /* Mida de la icona */ 

}

/* Responsivitat per a les columnes internes. */
@media (max-width: 768px) {
    .taller-details-grid {
        /* En pantalles petites, les columnes es posen una sobre l'altra. */
        grid-template-columns: 1fr;
        gap: 0px;
    }
}

/* Amaguem la icona principal del taller en pantalles estretes per donar més espai al títol. */
@media (max-width: 768px) {
    .taller-card-header .taller-icon {
        display: none;
    }
    .taller-card-header {
        gap: 0; /* Eliminem l'espai que deixava la icona. */
    }
}

/* Estils per a la secció dels ODS. */
.taller-ods-section {
    margin-top: 6px; /* Espai per sobre de la secció. */
}

.ods-images {
    display: flex;
    flex-wrap: wrap; /* Permet que les imatges baixin a la següent línia si no hi caben. */
    gap: 10px; /* Espai entre les imatges. */
}

.ods-images img {
    width: 80px; /* Amplada de la imatge. */
    height: 80px; /* Alçada de la imatge per fer-la quadrada. */
    object-fit: cover; /* Assegura que la imatge ompli l'espai sense deformar-se. */
    border-radius: 0px; /* Cantonades lleugerament arrodonides. */
    transition: transform 0.2s ease;
    margin-top: 4px; /* Espaiat superior per a les imatges */
}
.ods-images img:hover {
    transform: scale(1); /* Un petit efecte de zoom en passar per sobre. */
}

/* Estil per al botó de 'Sol·licita informació' dins dels tallers */
.taller-cta-container {
    text-align: center; /* Centra el botó */
    margin-top: 30px; /* Afegeix un espai per sobre */
}

.taller-cta-button {
    display: inline-block; /* Permet aplicar padding i marges correctament */
    background-color: var(--color-btn);
    color: var(--color-white);
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.taller-cta-button:hover {
    background-color: var(--color-btn-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- 14. CARRUSEL DE FOTOS DELS TALLERS (VERSIÓ AMB CENTRAT D'IMATGE) --- */

.taller-carousel {
    position: relative;
    margin-top: 40px;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

/* El slide ara és un contenidor flexible que centrarà el seu contingut. */
.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    /* AQUESTA ÉS LA PART CLAU: */
    display: flex;
    justify-content: center; /* Centra la imatge horitzontalment. */
    align-items: center;     /* Centra la imatge verticalment. */
    /* Definim una alçada fixa per al contenidor del slide. */
    height: 350px; 
}

/* L'estil per a les imatges dins dels slides. */
.carousel-slide img {
    /* La imatge mai serà més ampla que el seu contenidor. */
    max-width: 100%;
    /* AQUESTA ÉS L'ALTRA PART CLAU: Limitem l'alçada màxima de la imatge. */
    max-height: 100%; /* Mai serà més alta que el seu contenidor (450px). */
    
    width: auto;  /* L'amplada s'ajusta per mantenir la proporció. */
    height: auto; /* L'alçada s'ajusta per mantenir la proporció. */
    
    display: block;
    border-radius: 6px;
}

/* L'estil dels botons de navegació (es manté igual). */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(161, 93, 246, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
}
.carousel-button:hover {
    background-color: rgba(161, 93, 246, 0.6);
}
.carousel-button--left {
    /* L'espai a l'esquerra és del 25% (100% - 50% de la imatge) / 2. El botó es posiciona just fora de la imatge central. */
    left: calc(25% - 40px);
}
.carousel-button--right {
    /* El mateix càlcul per a la dreta. */
    right: calc(25% - 40px);
}
.carousel-button.is-hidden {
    display: none;
}

/* --- Responsivitat del carrusel avançat --- */
@media (max-width: 900px) {
    .carousel-slide {
        flex-basis: 70%;
        width: 70%;
    }
    .carousel-button--left {
        /* L'espai a l'esquerra és del 15% (100% - 70%) / 2. */
        left: calc(15% - 50px);
    }
    .carousel-button--right {
        right: calc(15% - 50px);
    }
}

@media (max-width: 768px) {
    .carousel-slide {
        flex-basis: 80%;
        width: 80%;
    }
    /* En pantalles petites, tornem a posicionar els botons a les vores per a més espai. */
    .carousel-button--left {
        left: 15px;
    }
    .carousel-button--right {
        right: 15px;
    }
}

/* --- 15. BANNER REPTE SPUTNIK (VERSIÓ AMB MARC) --- */

/* 1. El contenidor exterior: té el color de fons i l'espaiat. */
.repte-banner-section {
    /* AQUEST ÉS EL COLOR DEL "MARC". Pots canviar-lo per qualsevol de la teva paleta. */
    background-color: var(--color-background);
    /* El padding crea l'espai entre la vora de la secció i la imatge. */
    padding: 20px 40px;
}

/* 2. El contenidor interior: té la imatge de fons. */
.repte-banner-inner {
    background-image: 
        linear-gradient(rgba(25, 50, 90, 0.75), rgba(25, 50, 90, 0.75)),
        url('../images/repte-banner.png');
    background-size: cover;
    background-position: center;
    padding: 80px 40px;
    text-align: center;
    color: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 10px 10px rgba(0,0,0,0.01);
    max-width: 1250px;
    margin-left: auto;
    margin-right: auto;
}

/* Estils per al contingut (títol, subtítol, botó) - Aquests no canvien. */
.repte-banner-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 15px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.repte-banner-subtitle {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 30px auto;
    opacity: 0.9;
    line-height: 1.6;
}

.repte-banner-button {
    background-color: var(--color-btn-sec);
    color: var(--color-text);
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.2s ease;
    display: inline-block;
}
.repte-banner-button:hover {
    background-color: var(--color-btn-hover-sec);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Ajust responsiu per a mòbils. */
@media (max-width: 768px) {
    .repte-banner-section {
        padding: 40px 20px;
    }
    .repte-banner-inner {
        padding: 60px 20px;
    }
    .repte-banner-title {
        font-size: 32px;
    }
    .repte-banner-subtitle {
        font-size: 16px;
    }
}

.repte-content-section {
    padding: 0 40px 80px 40px; /* Espaiat inferior per separar-lo del footer. */
    background-color: var(--color-background);
    text-align: justify; 
}

/* --- 16. SECCIÓ DE L'EQUIP (DISSENY CLÀSSIC) --- */

.team-section-classic {
    padding: 20px 40px 40px 40px;
    background-color: var(--color-background);
}

/* Cada fila d'un membre de l'equip. */
.team-member-row {
    display: grid;
    grid-template-columns: 1fr 3fr; /* Columna de foto 1/3, text 2/3. */
    gap: 5px;
    align-items: center;
    margin-bottom: 40px; /* Espai entre membres. */
}

/* La classe 'reverse' inverteix l'ordre de les columnes. */
.team-member-row.reverse {
    grid-template-columns: 3fr 1fr;
}
.team-member-row.reverse .team-member-photo {
    grid-column: 2;
    grid-row: 1;
}
.team-member-row.reverse .team-member-info {
    grid-column: 1;
    grid-row: 1;
}

/* El contenidor de la foto. */
.team-member-photo {
    width: 75%;
    max-width: 200px; /* Limitem la mida de la foto. */
    justify-self: center; /* Centrem la foto dins la seva columna. */
}

.team-member-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Assegura que la imatge sigui quadrada abans de fer-la rodona. */
    object-fit: cover; /* Evita que la imatge es deformi. */
    border-radius: 150px; /* La clau per a la foto circular. */
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.1);
}

/* El contenidor de la informació. */
.team-member-info h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-heading);
    margin-bottom: 0px;
}

.team-member-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.team-member-bio {
    font-size: 16px;
    line-height: 1.4;
    color: var(--color-text);
}

.team-member-quote {
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text);
    font-family: 'Domine', serif;
    font-style: italic;
    padding: 6px 20px;
}

/* --- Ajustos responsius per a la secció de l'equip --- */
@media (max-width: 768px) {
    .team-member-row,
    .team-member-row.reverse {
        /* En pantalles petites, passem a una sola columna. */
        grid-template-columns: 1fr;
        text-align: center; /* Centrem el text. */
        gap: 20px;
    }

    .team-member-row.reverse .team-member-photo,
    .team-member-row.reverse .team-member-info {
        /* Resetejem l'ordre de les columnes. */
        grid-column: 1;
        grid-row: auto;
    }
}

/* --- 16. SECCIÓ DE L'EQUIP (DISSENY CLÀSSIC) --- */

.projectes-section-classic {
    padding: 20px 40px 20px 40px;
    background-color: var(--color-background);
}

/* Cada fila d'un membre de l'equip. */
.projectes-member-row {
    display: grid;
    grid-template-columns: 1fr 3fr; /* Columna de foto 1/3, text 2/3. */
    gap: 5px;
    align-items: center;
    margin-bottom: 40px; /* Espai entre membres. */
}

/* La classe 'reverse' inverteix l'ordre de les columnes. */
.projectes-member-row.reverse {
    grid-template-columns: 3fr 1fr;
}
.projectes-member-row.reverse .projectes-member-photo {
    grid-column: 2;
    grid-row: 1;
}
.projectes-member-row.reverse .projectes-member-info {
    grid-column: 1;
    grid-row: 1;
}

/* El contenidor de la foto. */
.projectes-member-photo {
    width: 100%;
    max-width: 220px; /* Limitem la mida de la foto. */
    justify-self: center; /* Centrem la foto dins la seva columna. */
}

.projectes-member-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Assegura que la imatge sigui quadrada abans de fer-la rodona. */
    object-fit: cover; /* Evita que la imatge es deformi. */
    border-radius: 12px; /* La clau per a la foto circular. */
    /* box-shadow removed to blend with section background */
}

/* El contenidor de la informació. */
.projectes-member-info h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 2px;
}

.projectes-member-bio {
    font-size: 16px;
    line-height: 1.4;
    color: var(--color-text);
    text-align: justify;
    margin-bottom: 0.4em;
}

/* --- Ajustos responsius per a la secció de l'equip --- */
@media (max-width: 768px) {
    .projectes-member-row,
    .projectes-member-row.reverse {
        /* En pantalles petites, passem a una sola columna. */
        grid-template-columns: 1fr;
        text-align: center; /* Centrem el text. */
        gap: 20px;
    }

    .projectes-member-row.reverse .projectes-member-photo,
    .projectes-member-row.reverse .projectes-member-info {
        /* Resetejem l'ordre de les columnes. */
        grid-column: 1;
        grid-row: auto;
    }
}

/* --- EXTRA FOOTER RESPONSIVE FIXES (2025-07-13) --- */
@media (max-width: 600px) {
  .footer-main-grid {
    grid-template-columns: 1fr !important;
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
  }
  .footer-container {
    overflow-x: hidden;
  }
  .footer-column-left,
  .footer-column-right {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .footer-column-left p,
  .footer-column-right p {
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form select,
  .contact-form textarea {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    box-sizing: border-box;
    padding-left: 6px;
    padding-right: 6px;
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

/* --- 18. SECCIÓ DE TESTIMONIS --- */

.testimonials-section {
    padding: 40px 40px;
    background-color: var(--color-background);
}

.testimonial-carousel {
    position: relative;
    width: 100%;
    overflow: hidden; /* La clau per a l'efecte de carrusel */
}

.testimonial-track {
    display: flex;
    /* La transició per al moviment suau */
    transition: transform 0.5s ease-in-out;
}

.testimonial-card {
    background-color: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 30px;
    text-align: center;
    /* Definim l'amplada de cada targeta */
    flex: 0 0 calc(100% / 3 - 20px); /* 3 targetes menys el gap */
    margin: 0 10px; /* Espai entre targetes */
    display: flex;
    flex-direction: column;
}

.testimonial-taller-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto 15px auto;
}

.testimonial-card .taller-title {
    font-size: 18px;
    min-height: 44px; /* Assegura una alçada consistent per als títols */
}

.testimonial-body {
    border-top: 1px solid var(--color-background);
    padding-top: 20px;
    margin-top: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.testimonial-quote {
    font-family: 'Domine', serif;
    font-style: italic;
    font-size: 15px;
    flex-grow: 1;
    color: var(--color-text);
    margin-bottom: 5px; /* Reduced space below quote */
}

.testimonial-author {
    font-size: 14px;
    font-weight: 600;
    margin-top: auto; /* Empeny l'autor cap avall */
    color: var(--color-primary);
}

/* Botons de navegació del carrusel */
.testimonial-carousel .carousel-nav-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.testimonial-carousel:hover .carousel-nav-btn {
    opacity: 1;
    pointer-events: auto;
}
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    z-index: 10;
}
.carousel-nav-btn:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}
.carousel-nav-btn.prev {
    left: 0px; /* Prevent button from being cut off */
}
.carousel-nav-btn.next {
    right: 0px; /* Prevent button from being cut off */
}

/* --- Responsivitat del carrusel de testimonis --- */
@media (max-width: 1024px) {
    .testimonial-card {
        flex-basis: calc(100% / 2 - 20px); /* 2 targetes */
    }
}
@media (max-width: 768px) {
    .testimonial-card {
        flex-basis: calc(100% - 20px); /* 1 targeta */
    }
    .carousel-nav-btn.prev {
        left: 5px;
    }
    .carousel-nav-btn.next {
        right: 5px;
    }
}

/* =================== COL·LABORADORS SECTION =================== */
.collaboradors-section {
    padding: 20px 0 40px 0;
    background: var(--color-background);
    text-align: center;
}
.collaboradors-title {
    letter-spacing: 1px;
    font-size: 42px;
    font-weight: 900;
    text-align: center;
    /* Un marge inferior per separar-lo del contingut. */
    margin-bottom: 40px;
    color: var(--color-heading);
}
.collaboradors-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 36px;
    flex-wrap: wrap;
    justify-content: center;
    /* Limit to 4 items per row using max-width and flex-basis */
    /* Each logo item is 120px wide, so 4 * 120px + 3 * 36px gap = 564px */
    max-width: calc(4 * 120px + 3 * 36px);
    margin-left: auto;
    margin-right: auto;
}
.collaboradors-logo-item {
    flex: 0 1 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.collaboradors-logo-item:hover {
    transform: scale(1.07);
}
.collaboradors-logo {
    width: 110px;
    height: auto;
    filter: grayscale(100%) contrast(0.8);
    transition: transform 0.2s, filter 0.2s, opacity 0.2s;
    opacity: 0.7;
    cursor: pointer;
}
.collaboradors-logo:hover {
    transform: scale(1.13);
    filter: grayscale(0%) contrast(1);
    /* Keep grayscale and opacity, just scale up */
}
@media (max-width: 600px) {
    .collaboradors-logos {
        gap: 18px;
    }
    .collaboradors-logo {
        width: 80px;
    }
}

.dossier-download-btn::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: "\f019"; /* fa-download */
    display: inline-block;
    margin-right: 0.5em;
    font-size: 1em;
    vertical-align: middle;
}
.dossier-download-btn {
    /* Copied from .hero-button for individual editing */
    display: inline-block;
    background: var(--color-btn);
    color: #fff;
    font-family: inherit;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 1.2rem;
    padding: 0.5em 2em;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px 0 rgba(161, 93, 246, 0.10);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    text-align: center;
    text-decoration: none;
    margin: 0.5em 0;
    position: relative;
    z-index: 1;
}

.dossier-download-btn:hover,
.dossier-download-btn:focus {
    background: var(--color-btn-hover);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px 0 rgba(161, 93, 246, 0.15);
}
