:root {
    --paper: #f4f0e6;
    --paper-suau: #faf7f0;
    --paper-verd: #eef1e6;
    --tinta: #243024;
    --tinta-suau: #4a5548;
    --tinta-mut: #6a7366;
    --verd: #305030;
    --verd-fosc: #243824;
    --or: #b07a32;
    --kraft: #a89080;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--tinta);
    background: var(--paper);
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--verd);
    text-decoration: none;
}

a:hover {
    color: var(--or);
}

.saltar {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--verd);
    color: var(--paper-suau);
    padding: 0.75rem 1rem;
    z-index: 100;
}

.saltar:focus {
    left: 0.75rem;
    top: 0.75rem;
}

/* Capçalera */

.capcalera {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.85rem 6vw;
    background: rgba(250, 247, 240, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(48, 80, 48, 0.18);
}

.capcalera-logo {
    display: flex;
    align-items: center;
}

.capcalera-logo img {
    width: 8.5rem;
    height: auto;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 1.35rem;
}

.nav a {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tinta-suau);
}

.nav a:hover,
.nav a.cta-nav {
    color: var(--or);
}

.nav a.cta-nav {
    border: 1px solid var(--or);
    padding: 0.35rem 0.8rem;
}

.nav a.cta-nav-secundari {
    border-color: rgba(176, 122, 50, 0.45);
}

.nav a[aria-current="page"] {
    color: var(--or);
}

/* Botons */

.boto {
    display: inline-block;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper-suau);
    border: 1px solid var(--or);
    padding: 0.85rem 1.6rem;
    background: var(--or);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.boto:hover {
    background: var(--verd);
    border-color: var(--verd);
    color: var(--paper-suau);
}

/* Hero */

.hero {
    min-height: calc(100vh - 4.2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 6vw 5rem;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(48, 80, 48, 0.08), transparent 55%),
        var(--paper-suau);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(250, 247, 240, 0.28) 0%, rgba(250, 247, 240, 0.45) 100%),
        url("../img/habitats/boscos.jpg") center / cover no-repeat;
    opacity: 0.72;
    pointer-events: none;
    z-index: 0;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: min(34rem, 88vw);
    margin-bottom: 0.4rem;
}

.hero-etiqueta {
    font-family: "Caveat", cursive;
    font-weight: 700;
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    line-height: 0.95;
    color: var(--or);
    margin: 0 0 1.75rem;
    -webkit-text-stroke: 1px rgba(36, 48, 36, 0.45);
    paint-order: stroke fill;
    text-shadow:
        -1px -1px 0 rgba(36, 48, 36, 0.35),
        1px -1px 0 rgba(36, 48, 36, 0.35),
        -1px 1px 0 rgba(36, 48, 36, 0.35),
        1px 1px 0 rgba(36, 48, 36, 0.35);
}

.hero p {
    max-width: 36rem;
    color: var(--verd);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 auto 2rem;
}

/* Seccions comunes */

.seccio {
    padding: 5.5rem 6vw;
}

.seccio-estreta {
    max-width: 42rem;
    margin: 0 auto;
}

.seccio-ampla {
    max-width: 68rem;
    margin: 0 auto;
}

.kicker {
    font-family: "Caveat", cursive;
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    color: var(--or);
    display: block;
    margin-bottom: 0.2rem;
}

h2 {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    font-size: clamp(3.2rem, 9vw, 6rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 1.5rem;
    color: var(--verd-fosc);
}

h2::after {
    content: "";
    display: block;
    width: 4.5rem;
    height: 4px;
    margin-top: 0.85rem;
    background: var(--or);
}

.seccio p + p {
    margin-top: 1rem;
}

.xifres p,
.xifres p + p {
    margin-top: 0;
}

/* Hàbitats */

.habitats {
    background: var(--paper-verd);
}

.habitats-ajuda {
    font-family: "Caveat", cursive;
    font-size: 1.55rem;
    color: var(--or);
    margin: -0.4rem 0 1.4rem;
}

.graella-habitats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.habitat-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.habitat-item > .habitat-text {
    display: none !important;
}

.habitat {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    line-height: 0;
    cursor: pointer;
    text-align: left;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.habitat:focus-visible,
.habitat-item.seleccionat .habitat {
    outline: 3px solid var(--or);
    outline-offset: 3px;
}

.habitat img {
    width: 100%;
    height: 18rem;
    object-fit: cover;
    filter: saturate(0.9);
    display: block;
    vertical-align: top;
}

.habitat-nom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2.5rem 3.2rem 1.1rem 1.25rem;
    background: linear-gradient(to top, rgba(36, 56, 36, 0.92), transparent);
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--paper-suau);
}

.habitat-mes {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(250, 247, 240, 0.7);
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--paper-suau);
    z-index: 1;
    transition: transform 0.2s ease, background 0.2s ease;
}

.habitat[aria-expanded="true"] .habitat-mes {
    transform: rotate(45deg);
    background: rgba(176, 122, 50, 0.85);
    border-color: var(--or);
}

.habitat-panell {
    grid-column: 1 / -1;
    background: var(--paper-suau);
    border: 1px solid rgba(48, 80, 48, 0.18);
    padding: 1.25rem 1.35rem 1.4rem;
    margin-top: 0.25rem;
}

.habitat-panell[hidden] {
    display: none !important;
}

.habitat-panell-titol {
    display: block;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--or);
    margin-bottom: 0.65rem;
}

.habitat-panell-cos p,
.habitat-text p {
    margin: 0;
    color: var(--tinta-suau);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 48rem;
    text-align: justify;
    text-wrap: pretty;
}

/* Cartes especials */

.especials-grup {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    font-size: clamp(1.35rem, 3vw, 1.7rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--verd);
    margin: 2.4rem 0 1rem;
}

.especials-grup:first-of-type {
    margin-top: 0.5rem;
}

.graella-especials {
    grid-template-columns: repeat(3, minmax(0, 20rem));
    gap: 1.5rem;
    align-items: start;
    justify-content: start;
}

.habitat-carta {
    background: var(--paper-suau);
    width: 100%;
    max-width: 20rem;
}

.habitat-carta img {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 7;
    object-fit: contain;
    object-position: center top;
    filter: none;
}

/* Com es juga */

.com-juga-bloc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 3rem;
    align-items: start;
    margin-top: 2.5rem;
}

.passos {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pas h3 {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    color: var(--or);
    margin-bottom: 0.45rem;
}

.pas p {
    color: var(--tinta-suau);
    font-size: 1.05rem;
}

.partida-fotos {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.partida-fotos figure {
    margin: 0;
}

.partida-fotos img {
    width: 100%;
    height: auto;
    display: block;
    border: 0;
}

.nota-pdf {
    margin-top: 2.25rem;
    color: var(--tinta-suau);
}

/* Material */

.material {
    background: var(--paper-verd);
    border-top: 1px solid rgba(48, 80, 48, 0.12);
    border-bottom: 1px solid rgba(48, 80, 48, 0.12);
}

.xifres {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.25rem;
    text-align: center;
}

.xifra {
    display: grid;
    grid-template-rows: 4.5rem auto;
    justify-items: center;
    margin: 0;
}

.xifra strong {
    grid-row: 1;
    align-self: end;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    font-size: clamp(2.4rem, 4.5vw, 3.5rem);
    letter-spacing: 0.04em;
    color: var(--or);
    line-height: 1;
    white-space: nowrap;
}

.xifra span {
    grid-row: 2;
    align-self: start;
    margin-top: 0.45rem;
    font-family: "Barlow Condensed", sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: var(--tinta-mut);
    line-height: 1.3;
    max-width: 9.5rem;
}

/* Carrusel d’il·lustracions */

.carrusel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.carrusel-vista {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    container-type: inline-size;
}

.carrusel-vista::-webkit-scrollbar {
    display: none;
}

.carrusel-pista {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 1rem;
    padding: 0;
    width: max-content;
}

.carrusel-pista figure {
    flex: 0 0 calc((100cqi - 2rem) / 3);
    width: calc((100cqi - 2rem) / 3);
    max-width: calc((100cqi - 2rem) / 3);
    scroll-snap-align: start;
    background: transparent;
    border: none;
    margin: 0;
}

.carrusel-pista img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid rgba(48, 80, 48, 0.28);
    box-sizing: border-box;
}

.carrusel-pista figcaption {
    font-family: "Caveat", cursive;
    font-size: 1.45rem;
    text-align: center;
    color: var(--paper);
    padding: 0.6rem 0 0.2rem;
    background: #111;
}

.carrusel-boto {
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--or);
    background: transparent;
    color: var(--or);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}

.carrusel-boto:hover {
    background: var(--or);
    color: var(--paper-suau);
}

/* Crèdits + CTA final */

.credits-bloc {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

.credits-llista {
    list-style: none;
}

.credits-llista li {
    margin-bottom: 0.7rem;
    color: var(--tinta-suau);
}

.credits-llista a {
    color: var(--or);
    text-decoration: none;
}

.credits-llista a:hover {
    color: var(--verd);
}

.kicker a {
    color: inherit;
    text-decoration: none;
}

.kicker a:hover {
    text-decoration: underline;
}

.credits-llista strong {
    display: block;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--or);
    font-size: 0.9rem;
}

.credit-logo a {
    display: inline-block;
}

.credit-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 200px;
    margin-top: 0.45rem;
    object-fit: contain;
    object-position: left center;
}

.coberta {
    width: 100%;
    max-width: 30rem;
    margin-left: auto;
    border: 0;
}

.cta-final {
    text-align: center;
    padding-bottom: 4rem;
    background: var(--paper-verd);
}

.cta-final p {
    color: var(--tinta-suau);
    margin-bottom: 1.4rem;
}

/* Peu */

.peu {
    padding: 1.6rem 6vw 2.2rem;
    border-top: 1px solid rgba(48, 80, 48, 0.18);
    font-size: 0.95rem;
    color: var(--tinta-mut);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--paper-suau);
}

.peu-marca {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.peu span {
    font-family: "Barlow Condensed", sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--or);
}

.peu a {
    color: var(--verd);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.peu a:hover {
    color: var(--or);
}

.peu-instagram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--or);
    text-decoration: none;
    line-height: 0;
    padding-left: 0.5rem;
}

.peu-instagram:hover {
    color: var(--verd);
}

/* Punts de venda */

.punts-intro {
    padding-bottom: 1.5rem;
}

.punts-intro h1 {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.15;
    margin: 0.35rem 0 0.85rem;
}

.punts-filtre-wrap {
    padding-top: 0;
    padding-bottom: 0.75rem;
}

.punts-filtre {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
}

.punts-filtre-lbl {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--tinta-mut);
    margin-right: 0.25rem;
}

.punts-filtre-btn {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tinta-suau);
    background: var(--paper-suau);
    border: 1px solid rgba(48, 80, 48, 0.22);
    padding: 0.45rem 0.85rem;
    min-height: 44px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.punts-filtre-btn:hover {
    border-color: var(--or);
    color: var(--or);
}

.punts-filtre-btn.is-on {
    background: var(--verd);
    border-color: var(--verd);
    color: var(--paper-suau);
}

.punts-mapa-wrap {
    padding: 0 6vw 0.5rem;
}

.punts-mapa {
    width: 100%;
    height: min(58vh, 420px);
    min-height: 280px;
    border: 1px solid rgba(48, 80, 48, 0.18);
    background: var(--paper-suau);
    z-index: 1;
}

.punts-mapa-avis {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1.5rem;
    text-align: center;
    color: var(--tinta-suau);
    font-size: 1rem;
}

.punts-mapa-avis code {
    font-size: 0.9em;
}

.punts-llista-wrap {
    padding-top: 2rem;
}

.punts-llista-ttl {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 1.15rem;
    color: var(--or);
    margin-bottom: 1.25rem;
}

.punts-llista {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.punt-card {
    background: var(--paper-suau);
    border: 1px solid rgba(48, 80, 48, 0.16);
    padding: 1.15rem 1.2rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.punt-card:hover,
.punt-card:focus-visible,
.punt-card.is-active {
    border-color: var(--or);
    box-shadow: 0 0 0 1px var(--or);
    outline: none;
}

.punt-tipus {
    display: inline-block;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--or);
    margin-bottom: 0.35rem;
}

.punt-nom {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 0.25rem;
}

.punt-lloc,
.punt-adreca {
    color: var(--tinta-suau);
    font-size: 1rem;
    line-height: 1.45;
    margin: 0;
}

.punt-adreca {
    margin-top: 0.65rem;
}

.punt-contacte {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    margin-top: 0.9rem;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
}

.punt-contacte a {
    color: var(--verd);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.punt-contacte a:hover {
    color: var(--or);
}

.punts-buit {
    color: var(--tinta-mut);
}

@media (max-width: 900px) {
    .nav a:not(.cta-nav) {
        display: none;
    }

    .punts-llista {
        grid-template-columns: 1fr;
    }

    .punts-mapa-wrap {
        padding-left: 7vw;
        padding-right: 7vw;
    }

    .graella-habitats,
    .com-juga-bloc,
    .credits-bloc {
        grid-template-columns: 1fr;
    }

    .graella-especials {
        grid-template-columns: 1fr;
    }

    .habitat-carta {
        max-width: none;
        width: 100%;
    }

    .xifres {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .coberta {
        margin: 1.5rem auto 0;
    }

    .carrusel-pista figure {
        flex-basis: calc((100cqi - 1rem) / 2);
        width: calc((100cqi - 1rem) / 2);
        max-width: calc((100cqi - 1rem) / 2);
    }
}

@media (max-width: 560px) {
    .xifres {
        grid-template-columns: 1fr 1fr;
        gap: 1.6rem 1rem;
    }

    .carrusel-pista figure {
        flex-basis: 100cqi;
        width: 100cqi;
        max-width: 100cqi;
    }

    .seccio {
        padding: 3.5rem 7vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .carrusel-vista {
        scroll-behavior: auto;
    }
}
