/* Tipografia personalitzada per H1 */
@font-face {
    font-family: 'CustomFont';
    src: url('./qrada/Qrada.otf') format('opentype');
}

html, body {
    background-color: #F6F6EE !important;
    color: black;
    font-family: Helvetica, sans-serif;
    margin: 0;
    height: 100%;
}

/* Ajustar el padding de les seccions per la barra de navegació fixa */
section {
    padding-top: 60px;
    scroll-margin-top: 60px;
    margin-bottom: 2rem;
    padding: 1rem 0.5rem;
}
@media (min-width: 576px) {
    section {
        padding: 2rem 1rem;
    }
}

/* Evitar marge extra a l'última secció */
section:last-of-type {
    margin-bottom: 2rem;
}

/* Ajust específic per la secció de galeria */
section#galeria {
    padding-top: 80px; 
    position: relative;
    margin-top: 40px; 
}

@media (max-width: 991.98px) {
    section#galeria {
        padding-top: 30px;   
        margin-top: 10px;   
    }
    section#galeria h2 {
        margin-bottom: 1rem; 
        padding-top: 0.5rem;
    }
}

/* Estil específic pel títol de la galeria */
section#galeria h2 {
    position: relative;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

/* Sobreescriure estils de Bootstrap per elements principals */
header, nav, section, .container, .container-fluid, .row {
    background-color: transparent !important;
}

/* Forçar fons per classes de Bootstrap */
.bg-white, .bg-light, .navbar-light {
    background-color: #F6F6EE !important;
}

/* Header: alinear logotip i títol */
header#inici {
    background-color: #F6F6EE !important;
    padding: 1rem 0; 
    padding-left: 0 !important;
    margin-left: 0 !important;
}

header#inici .container {
    display: flex;
    align-items: center; 
    justify-content: space-between; 
    flex-wrap: wrap; 
    padding-left: 0 !important; 
    
}

header#inici h1 {
    font-family: 'CustomFont', sans-serif;
    color: #7A363C;
    margin: 0 auto;
    flex: 1; 
    text-align: center;
}

/* LOGO i HEADER responsive */
.logo {
    width: 40px;
    margin-right: 0.5rem;
}
@media (min-width: 576px) {
    .logo {
        width: 50px;
        margin-right: 1rem;
    }
}

.logo {
    width: 40px;
    height: auto;
    margin-left: 0 !important;   
    margin-right: 0.5rem; 
    display: block;
}
@media (min-width: 576px) {
    .logo {
        width: 50px;
        margin-right: 1rem;
    }
}

/* Barra de navegació */
nav.navbar.sticky-top {
    background-color: #F6F6EE !important;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1020;
}

@media (max-width: 991.98px) {
    .navbar {
        margin-top: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    nav.navbar.sticky-top {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
    }
}

/* Caixes d'entrada del formulari */
.form-control {
    background-color: #F6F6EE !important;
    border: 1px solid #D1DBA1;
}

/* Estils per l'animació GSAP */
.bresca-container {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    padding-left: 1rem;
    padding-bottom: 1.2rem;
    display: flex;
    align-items: flex-end;
}
@media (min-width: 576px) {
    .bresca-container {
        padding-left: 2rem;
        padding-bottom: 2rem;
    }
}
@media (min-width: 992px) {
    .bresca-container {
        padding-left: 2.3rem;
        padding-bottom: 4rem;
    }
}

/* .bresca-container responsive */
.bresca-container {
    padding-left: 1rem;
    padding-bottom: 1.2rem;
}
@media (min-width: 576px) {
    .bresca-container {
        padding-left: 2rem;
        padding-bottom: 2rem;
    }
}
@media (min-width: 992px) {
    .bresca-container {
        padding-left: 2.3rem;
        padding-bottom: 4rem;
    }
}

.letter {
    display: inline-block;
    font-size: 4rem; 
    font-family: 'CustomFont', sans-serif;
    font-weight: bold;
    color: #7A363C;
    opacity: 0;
    transform: translateY(50px);
    margin: 0 0.7rem 0 0; 
    line-height: 1;
}

/* LLETRES BRESCA responsive */
.letter {
    font-size: 4rem;
    margin: 0 0.7rem 0 0;
}
@media (min-width: 576px) {
    .letter {
        font-size: 6rem;
        margin: 0 1.2rem 0 0;
    }
}
@media (min-width: 992px) {
    .letter {
        font-size: 8rem;
        margin: 0 2rem 0 0;
    }
}

.figure img {
    transition: transform 0.45s cubic-bezier(.2,.95,.2,1),
                box-shadow 0.35s ease,
                border-radius 0.35s ease;
    transform-origin: center center;
    will-change: transform, box-shadow;
}

.figure img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 0 3px #D1DBA1;
}

/* Botó d'enviar */
.btn-primary {
    background-color: #7A363C;
    border-color: #7A363C;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #D1DBA1;
    border-color: #D1DBA1;
}

/* Secció Blog: estils per les caixes (cards) */
.card {
    background-color: #F6F6EE;
    border: 1px solid #D1DBA1;
}

/* Estils del carrusel del blog */
#blogCarousel {
    padding-bottom: 1.5rem;
}

#blogCarousel .carousel-indicators {
    position: static;
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

#blogCarousel .carousel-indicators button {
    width: 1.4rem;
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: rgba(0,0,0,0.35);
    border: none;
    opacity: 1;
}

#blogCarousel .carousel-indicators .active {
    background-color: rgba(0,0,0,0.75);
}

/* Footer: estils generals i enllaços */
footer {
    background-color: #7A363C !important;
    color: #F6F6EE !important;
    padding: 1rem 0;
}

footer a {
    color: #F6F6EE;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #D1DBA1;
}

footer .text-muted {
    color: #F6F6EE !important;
}

/* Estils per les icones del footer */
footer img[src*="Logo"] {
    transition: filter 0.3s ease;
}

footer img[src*="Logo"]:hover {
    filter: brightness(0) saturate(100%) invert(89%) sepia(19%) saturate(346%) hue-rotate(38deg) brightness(93%) contrast(89%);
}

/* Altres ajustos generals */
a {
    transition: color 0.3s ease;
}

/* Assegurar que el text justificat funcioni bé */
.text-justify {
    text-align: justify !important;
}

@media (min-width: 992px) { 
    #nosaltres .row.gx-5 {
        --bs-gutter-x: 3rem; 
    }
}
/* Estils per l'efecte parallax */
.image-grid {
    position: relative;
    width: 100%;
    height: 600px; 
}

.image_cont {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; 
    z-index: 1; 
}

.parallax-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 0.25rem; 
}

/* Estils del Fòrum */
#forumForm {
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
}

.form-control {
    border: 2px solid #D1DBA1;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #7A363C;
    box-shadow: 0 0 0 0.2rem rgba(122, 54, 60, 0.25);
    transform: translateY(-2px);
}

#forumForm .btn-primary {
    background-color: #7A363C;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

#forumForm .btn-primary:hover {
    background-color: #D1DBA1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

#forumForm .col-12:focus-within .form-label {
    color: #7A363C;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#forumForm .col-12 {
    margin-bottom: 1.5rem;
}

.text-justify {
    text-align: justify !important;
}

/* Mantenir l'espai horitzontal entre columnes */
@media (min-width: 992px) {
    #nosaltres .row.gx-5 {
        --bs-gutter-x: 3rem;
    }
}

/* Ajustos responsius per pantalles petites */
@media (max-width: 767px) {
    .image-grid {
        height: 400px; 
    }
    .spacer {
        height: 100vh;
    }
}

/* Estils específics per al Fòrum */
#forum .card {
    border-left: 4px solid #7A363C;
    transition: all 0.3s ease;
}

#forum .card:hover {
    border-left-color: #D1DBA1;
    transform: translateY(-3px);
}

#forum .card-subtitle {
    font-family: 'CustomFont', sans-serif;
    letter-spacing: 1.2px;
    font-size: 0.85rem;
}

#forum small {
    font-style: italic;
    color: #7A363C;
}

/* Carrusel rotatiu amb eix central fix */
.forum-wheel-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    perspective: 1000px;
}

.forum-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
}

.forum-card {
    position: relative;
    width: 300px;
    height: 260px;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    will-change: transform, opacity;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.forum-card.active {
    opacity: 1;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 10;
}

.forum-card.left {
    opacity: 0.6;
    z-index: 5;
}

.forum-card.right {
    opacity: 0.6;
    z-index: 5;
}

.forum-card:not(.active):not(.left):not(.right) {
    opacity: 0;
    pointer-events: none;
}

.forum-card h5 {
    color: #7A363C;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.forum-card p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.forum-card small {
    display: block;
    color: #7A363C;
    font-style: italic;
    margin-top: 1rem;
    opacity: 0.8;
}

.forum-card h5 { transform: none; }

/* Responsivitat */
@media (max-width: 992px) {
    .forum-wheel-container {
        height: 350px;
    }
    .forum-card {
        width: 220px; 
        height: 240px;
    }
    .forum-card.left {
        transform: translateX(-260px) scale(0.85);
    }
    .forum-card.right {
        transform: translateX(260px) scale(0.85);
    }
}

@media (max-width: 768px) {
    .forum-wheel-container {
        height: 300px;
    }
    .forum-card {
        width: 200px;
        height: 220px;
        padding: 1.25rem;
    }
    .forum-card.left {
        transform: translateX(-240px) scale(0.85);
    }
    .forum-card.right {
        transform: translateX(240px) scale(0.85);
    }
    .forum-card.active {
        transform: scale(1.05);
    }
}

/* Millora l'altura de les targetes del fòrum en pantalles petites/mitjanes */
@media (max-width: 991px) {
    #forum .forum-wheel {
        min-height: 320px;
        align-items: center;
        justify-content: center;
    }

    #forum .forum-card {
        min-height: 220px;
        padding: 1.25rem;
        box-sizing: border-box;
        max-width: 92%;
        margin-left: auto;
        margin-right: auto;
    }

    #forum {
        padding-top: 0.75rem;
    }
}

/* pantalles molt petites: augment lleu per evitar salts de línia inesperats */
@media (max-width: 575px) {
    #forum .forum-wheel {
        min-height: 360px;
    }
    #forum .forum-card {
        min-height: 260px;
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Imatge capçalera responsive */
.capçalera img {
    width: 100%;
    height: auto;
    display: block;
}

/* Amaga la capçalera (imatge + lletres animades) en pantalles petites i mitjanes */
@media (max-width: 991.98px) {
    .capçalera {
        display: none !important;
    }
}

/* Galeria i seccions: ja uses Bootstrap grid, però pots afegir ajustos si cal */
section {
    margin-bottom: 2rem;
    padding: 1rem 0.5rem;
}
@media (min-width: 576px) {
    section {
        padding: 2rem 1rem;
    }
}

/* Text responsive */
h1, h2, h3 {
    font-size: 2rem;
}
@media (min-width: 576px) {
    h1, h2, h3 {
        font-size: 2.5rem;
    }
}
@media (min-width: 992px) {
    h1, h2, h3 {
        font-size: 3rem;
    }
}

/* Footer responsive */
footer .nom {
    font-size: 0.9rem;
}
@media (min-width: 576px) {
    footer .nom {
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .navbar-toggler {
        margin-left: auto;
        margin-right: auto;
        display: block;
        background-color: #7A363C !important; 
        border: none;
        box-shadow: none;
        transition: background-color 0.3s;
    }
    .navbar-toggler[aria-expanded="true"] {
        background-color: #D1DBA1 !important;
    }
    .navbar-toggler:focus {
        box-shadow: none !important;
        outline: none !important;
    }
    .navbar-toggler-icon {
        background-image: none !important;
        width: 2rem;
        height: 2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        padding: 0;
    }
    .navbar-toggler-icon span {
        display: block;
        height: 3px;
        width: 24px;
        background: #F6F6EE; 
        margin: 4px 0;
        border-radius: 2px;
        transition: 0.3s;
    }
}

#nosaltres {
  position: relative;
  min-height: 300px;
}

#nosaltres .parallax-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Només per mòbil i tablet */
@media (max-width: 991.98px) {
  #nosaltres {
    position: relative;
    min-height: 300px; 
    background: none;
  }
  #nosaltres .parallax-image {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
    position: static !important;
    opacity: 1 !important;
    z-index: 1 !important;
    margin: 0 auto;
  }
}

/* Ajustos específics per mòbil/tablet per evitar que el formulari quedi tallat */
@media (max-width: 991.98px) {
  #forum {
    padding-top: 1rem;
    padding-bottom: 4.5rem;
    position: relative;
  }

  .forum-wheel-container {
    margin-bottom: 4rem;    
    min-height: 320px;     
    position: relative;
    z-index: 0;
  }

  #forumForm {
    margin-top: 2rem;      
    position: relative;
    z-index: 1;
  }

  #forum .forum-wheel {
    padding-bottom: 1rem;
  }
}

@media (max-width: 991.98px) {
  
  .forum-wheel-container {
    height: 480px;     
    margin-bottom: 2.5rem;
    z-index: 1;         
    position: relative;
  }
  
  .forum-card {
    width: 92%;
    max-width: 340px;
    min-height: 340px; 
    height: auto;
    padding: 1.5rem 1.75rem;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  #forum {
    padding-top: 1rem;
    padding-bottom: 5rem;
    position: relative;
  }
  #forumForm {
    margin-top: 2.5rem;
    position: relative;
    z-index: 0;
  }
}

@media (max-width: 575px) {
  .forum-wheel-container {
    height: 520px;      
    margin-bottom: 2rem;
  }

  .forum-card {
    min-height: 360px; 
    padding: 1.25rem 1.25rem;
    width: 92%;
    max-width: 300px;
  }

  #forumForm {
    margin-top: 3rem;
  }
}

@media (max-width: 991.98px) {
  .forum-wheel-container {
    height: 420px !important;      
    margin-bottom: 1.5rem !important;
  }

  .forum-wheel {
    padding-bottom: 0.5rem !important;
  }

  .forum-card {
    width: 90% !important;
    max-width: 320px !important;   
    min-height: 300px !important;  
    padding: 1.25rem 1.5rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  #forum {
    padding-bottom: 3.5rem !important; 
  }
  #forumForm {
    margin-top: 1.8rem !important;
  }
}

@media (max-width: 575px) {
  .forum-wheel-container {
    height: 440px !important;      
    margin-bottom: 1.25rem !important;
  }

  .forum-card {
    max-width: 280px !important;   
    min-height: 320px !important; 
    padding: 1rem 1.1rem !important;
    width: 92% !important;
  }

  #forumForm {
    margin-top: 2rem !important;
  }
}


@media (max-width: 991.98px) {
  footer .social-icons,
  footer .footer-social,
  footer .social {
    display: flex;
    gap: 0.9rem;           
    margin-bottom: 1.25rem;
    align-items: center;
    justify-content: flex-start;
  }

  footer .social-icons a img,
  footer .footer-social a img {
    display: inline-block;
    vertical-align: middle;
    margin: 0;
  }

  footer .footer-terms,
  footer .terms,
  footer .legal {
    padding-top: 1rem;    
    border-top: none;   
    margin-top: 0.5rem;
  }
}

/* Ajust lleu per pantalles molt petites */
@media (max-width: 575.98px) {
  footer .social-icons,
  footer .footer-social,
  footer .social {
    gap: 0.7rem;
    margin-bottom: 1rem;
  }
  footer .footer-terms,
  footer .terms,
  footer .legal {
    padding-top: 0.9rem;
  }
}
/* Fi overrides */

/* Reduir espai entre el botó de publicar i el footer en mòbil/tablet */
@media (max-width: 991.98px) {
  #forum {
    padding-bottom: 1.25rem !important;
  }
  #forumForm {
    margin-bottom: 0 !important;
  }
  #forumForm .col-12:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  #forumForm .btn-primary {
    margin-bottom: 0 !important;
  }
}

/* Mateix ajust per pantalles molt petites */
@media (max-width: 575.98px) {
  #forum {
    padding-bottom: 1rem !important;
  }
  #forumForm {
    margin-bottom: 0 !important;
  }
  #forumForm .col-12:last-child {
    margin-bottom: 0 !important;
  }
}

/* Reduir espais entre capçalera, hamburguesa i títol galeria (mòbil/tablet) */
@media (max-width: 991.98px) {
  header#inici {
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
  }

  /* menys separació del navbar respecte al header */
  nav.navbar.sticky-top,
  .navbar {
    margin-top: 0.25rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  .navbar-toggler {
    margin-top: 0.15rem !important;
    margin-bottom: 0.15rem !important;
    padding: 0.35rem 0.6rem !important;
  }
  section#galeria {
    padding-top: 0.5rem !important;
    margin-top: 4px !important;
  }
  section#galeria h2 {
    margin-top: 0.25rem !important;
    padding-top: 0 !important;
  }
}

/* Ajust més compacte per pantalles molt petites */
@media (max-width: 575.98px) {
  header#inici {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
  }
  nav.navbar.sticky-top,
  .navbar {
    margin-top: 0.15rem !important;
  }
  .navbar-toggler {
    margin-top: 0.1rem !important;
    margin-bottom: 0.1rem !important;
    padding: 0.3rem 0.5rem !important;
  }
  section#galeria {
    padding-top: 0.35rem !important;
    margin-top: 2px !important;
  }
  section#galeria h2 {
    margin-top: 0.15rem !important;
  }
}

/* Ajust per mòbil i tablet: desplaçar logo i títol cap avall */
@media (max-width: 991.98px) {
    header#inici .container {
        padding-top: 1.5rem !important; 
        padding-bottom: 0.5rem !important; 
    }
}

/* Per pantalles molt petites (ex: mòbils estrets), pots fer un ajust més fi */
@media (max-width: 575.98px) {
    header#inici .container {
        padding-top: 1rem !important; 
    }
}

:focus {
    outline: 3px solid #D1DBA1; 
    outline-offset: 2px;
}

nav .logo {
    margin-left: 10px !important;
}