/* COLORS PREDETERMINATS */
:root {
    --primary-color: #735736;
    --secondary-color: #A6A163;
    --accent-color: #F2EC91;
    --dark-color: #0D0D0D;
    --light-color: #D9D9D9;
    --white: #FFFFFF;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ESTILS GENERALS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* BARRA SUPERIOR */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    width: 100%;
    padding: 0;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    margin-right: 1rem;
}

.logo-container h1 {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.logo-container h1 span {
    color: var(--secondary-color);
}

/* MENÚ DE NAVEGACIÓ */
nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-menu a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* BOTÓ DE MENÚ PER A MÒVILS */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* SECCIONS PRINCIPALS */
main {
    min-height: calc(100vh - 70px);
}

.section {
    padding: 2rem 2rem;
}

.section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.section h2::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
}

.content-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.reverse {
    flex-direction: row-reverse;
}

.text-content, .image-content {
    flex: 1;
}

.section-image {
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* SECCIÓ HERO */
.hero-section {
    height: 85vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('media/tendes2.JPG');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
}

.section-hero {
    height: 50vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('media/tendes2.JPG');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
}

/* CALENDARI */
.calendar-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    overflow: hidden;
}

.calendar-container iframe {
    width: 100%;
    max-width: 800px;
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .calendar-container {
        padding: 10px;
    }
    
    .calendar-container iframe {
        height: 400px;
    }
}

/* ESTILS SECCIÓ QUI SOM */
.pilars-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 1rem;
}

.pilar-item {
    flex: 1;
    text-align: center;
    transition: transform 0.3s ease;
}

.pilar-item:hover {
    transform: translateY(-5px);
}

.pilar-image {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--primary-color);
}

.pilar-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pilar-item:hover .pilar-img {
    transform: scale(1.05);
}

.pilar-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.pilar-item p {
    font-size: 0.95rem;
    color: var(--dark-color);
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #5e482e;
}

/* ESTILS SECCIÓ DOCUMENTACIÓ */
.docs-table {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.docs-row {
    display: flex;
    gap: 16px;
}

.docs-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--white);
    border-radius: 6px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
    padding: 18px 0;
}

.docs-cell i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.docs-cell-RRI { background: var(--primary-color);}
.docs-cell-LE     { background: var(--secondary-color);}
.docs-cell-COM   { background: var(--primary-color);}
.docs-cell-PRES     { background: var(--secondary-color);}
.docs-cell-EDC     { background: var(--secondary-color);}
.docs-cell-MEM  { background: var(--primary-color);}
.docs-cell-MANI      { background: var(--secondary-color);}
.docs-cell-VOLA   { background: var(--primary-color);}

.docs-cell:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    text-decoration: none;
}

@media (max-width: 900px) {
    .docs-row {
        flex-direction: column;
        gap: 16px;
    }
}

/* ESTILS SECCIÓ CONTACTE */

.contacte-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
}

.contacte-info {
    flex: 1;
    min-width: 280px;
}

.contacte-info h3 {
    margin-top: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.contacte-info p, .contacte-info a {
    font-size: 1rem;
    color: var(--dark-color);
}

.contacte-mapa {
    flex: 2;
    min-width: 320px;
}

.contacte-mapa iframe {
    width: 100%;
    height: 300px;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@media (max-width: 900px) {
    .contacte-content {
        flex-direction: column;
        gap: 2rem;
    }
    .contacte-mapa iframe {
        height: 220px;
    }
}

/* ESTILS SECCIÓ BLOG */
.blog-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-post {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.blog-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post:hover .post-img {
    transform: scale(1.05);
}

.post-content {
    padding: 2rem;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-meta span {
    margin-right: 1.5rem;
}

.post-meta i {
    margin-right: 0.5rem;
}

.post-title {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.post-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: justify;
}

@media (max-width: 768px) {
    .blog-image {
        height: 250px;
    }
    
    .post-content {
        padding: 1.5rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
}

/* FOOTER */
footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 3rem 2rem 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo, .footer-links, .footer-contact {
    flex: 1;
    min-width: 250px;
}

.small-logo {
    height: 70px;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.footer-links ul {
    margin-top: 0rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-contact p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact a {
    transition: color 0.3s ease;
}

.footer-contact a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* ESTILS SECCIÓ ACTIVITATS */
.activitat-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.activitat-section:nth-child(even) {
    background-color: #f8f8f8;
}

.activitat-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.activitat-section.reverse .activitat-content {
    flex-direction: row-reverse;
}

.activitat-image {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: var(--primary-color);
}

.activitat-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.activitat-image:hover img {
    transform: scale(1.05);
}

.activitat-text {
    flex: 1;
}

.activitat-title {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.activitat-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
}

.activitat-text p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.activitat-text p strong {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .activitat-section {
        padding: 2rem 1rem;
    }
    
    .activitat-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .activitat-section.reverse .activitat-content {
        flex-direction: column;
    }
    
    .activitat-image img {
        height: 300px;
    }
    
    .activitat-title {
        font-size: 1.5rem;
    }
    
    .activitat-text p {
        font-size: 1rem;
    }
}


/* OPCIÓ DE MENÚ ACTIVA */
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a.active::after {
    width: 100%;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .logo-container h1 {
        font-size: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        background-color: var(--white);
        width: 60%;
        height: calc(100vh - 70px);
        padding: 1.5rem 1.5rem 3rem;
        box-shadow: var(--shadow);
        transition: right 0.3s ease;
        gap: 1.2rem;
        overflow-y: auto;
        border-radius: 0 0 0 8px;
    }
    
    .nav-menu li a {
        font-size: 0.95rem;
        padding: 0.5rem 0;
        display: block;
    }

    .nav-menu.active {
        right: 0;
    }

    .content-container {
        flex-direction: column;
    }

    .reverse {
        flex-direction: column;
    }

    .section {
        padding: 3rem 1rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }
    
    .pilars-container {
        flex-direction: column;
    }
    
    .pilar-item {
        margin-bottom: 2rem;
    }
}

/* FLETXA PER TORNAR A DALT */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top-btn:hover {
    background-color: #5e482e;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.carousel-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-button:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.carousel-button.prev {
    left: 20px;
}

.carousel-button.next {
    right: 20px;
}

.carousel-button i {
    transition: transform 0.3s ease;
}

.carousel-button:hover i {
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .carousel-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}