/* Embotits Casolans Vall Cardós
   Fosc de fumador, os, i el verd del logo.
   Cormorant Garamond per als títols, Alegreya Sans per al text. */

:root {
  --fum: #1E1B18;
  --fum-2: #2B2723;
  --os: #EFEAE1;
  --paper: #FAF8F4;
  --verd: #2E6B3C;
  --verd-clar: #8DB394;
  --gris: #6B645C;
  --vermell: #8E2B1F;

  --titol: "Cormorant Garamond", Georgia, serif;
  --text: "Alegreya Sans", system-ui, sans-serif;

  --ample: 74rem;
  --mesura: 36rem;
  --marge: clamp(1rem, 4vw, 2.5rem);
  --seccio: clamp(4.5rem, 10vw, 8rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--paper); color: var(--fum);
  font-family: var(--text); font-size: 1.125rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3 { font-family: var(--titol); font-weight: 600; line-height: 1.05; margin: 0; }
h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -0.01em; }
h3 { font-size: 1.75rem; }
p { margin: 0 0 1em; }
a { color: var(--verd); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--verd-clar); outline-offset: 3px; }

.salta { position: absolute; left: -9999px; top: 0; background: var(--fum); color: var(--os); padding: .6rem 1rem; z-index: 100; }
.salta:focus { left: 1rem; top: 1rem; }

/* ---------- Capçalera ---------- */
.capcalera {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  color: var(--os); transition: background-color .3s ease, box-shadow .3s ease;
}
.capcalera.solida { background: var(--fum); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.capcalera__dins {
  max-width: var(--ample); margin: 0 auto; padding: .75rem var(--marge);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.marca { display: block; }
.marca__escut { display: inline-block; background: var(--os); border-radius: 6px; padding: .3rem .55rem; }
.marca__escut img { height: 2.6rem; width: auto; }
.menu { display: flex; gap: 2rem; font-weight: 500; font-size: 1rem; }
.menu a { color: inherit; text-decoration: none; padding: .3rem 0; border-bottom: 1px solid transparent; }
.menu a:hover { border-bottom-color: currentColor; }
.menu-boto { display: none; }

@media (max-width: 760px) {
  .menu-boto {
    display: block; font: 500 1rem var(--text); color: var(--os); background: none;
    border: 1px solid rgba(239,234,225,.6); border-radius: 2px; padding: .4rem 1rem;
  }
  .menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--fum); padding: .5rem var(--marge) 1.25rem;
  }
  .menu.obert { display: flex; }
  .menu a { padding: .8rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
}

/* ---------- Botons ---------- */
.botons { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.botons--centre { justify-content: center; }
.boto {
  display: inline-block; font-family: var(--text); font-weight: 500; font-size: 1rem; letter-spacing: .02em;
  text-decoration: none; padding: .85rem 1.6rem; border: 1px solid; border-radius: 2px;
  transition: background-color .2s ease, color .2s ease;
}
.boto--clar { color: var(--os); border-color: rgba(239,234,225,.7); }
.boto--clar:hover { background: var(--os); color: var(--fum); }
.boto--fosc { color: var(--fum); border-color: var(--fum); }
.boto--fosc:hover { background: var(--fum); color: var(--os); }

/* ---------- Portada ---------- */
.portada {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  text-align: center; color: var(--os); background: var(--fum); overflow: hidden;
}
.portada__foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portada::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(20,17,14,.45) 0%, rgba(20,17,14,.7) 70%, rgba(20,17,14,.85) 100%);
}
.portada__text { position: relative; z-index: 1; padding: 7rem var(--marge) 4rem; max-width: 60rem; }
.portada__lloc { font-size: 1.05rem; letter-spacing: .06em; opacity: .85; margin-bottom: 1.5rem; }
.portada h1 { font-size: clamp(3.2rem, 9vw, 7.5rem); font-weight: 500; line-height: .95; letter-spacing: -0.015em; }
.portada__entrada { font-family: var(--titol); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 2rem); margin: 1.5rem 0 0; }

/* Una sola entrada orquestrada a la portada */
@media (prefers-reduced-motion: no-preference) {
  .portada__foto { animation: apropa 2.4s ease-out both; }
  .portada__text > * { animation: apareix 1s ease-out both; }
  .portada__text > :nth-child(2) { animation-delay: .25s; }
  .portada__text > :nth-child(3) { animation-delay: .5s; }
  .portada__text > :nth-child(4) { animation-delay: .75s; }
  @keyframes apropa { from { transform: scale(1.08); } to { transform: scale(1); } }
  @keyframes apareix { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ---------- Benvinguda ---------- */
.benvinguda { text-align: center; padding: var(--seccio) var(--marge); max-width: 46rem; margin: 0 auto; }
.benvinguda__logo { height: 4.5rem; width: auto; margin: 0 auto 2rem; }
.benvinguda h2 { margin-bottom: 1.5rem; }
.benvinguda p { font-size: 1.25rem; color: var(--gris); }

/* ---------- La casa ---------- */
.casa { background: var(--fum); color: var(--os); display: grid; grid-template-columns: 1fr 1fr; }
.casa__foto img { width: 100%; height: 100%; object-fit: cover; min-height: 30rem; }
.casa__text { padding: var(--seccio) var(--marge); max-width: 34rem; align-self: center; }
.casa__text h2 { margin-bottom: 1.5rem; }
.casa__text p { color: rgba(239,234,225,.82); }
@media (max-width: 860px) { .casa { grid-template-columns: 1fr; } .casa__foto img { min-height: 18rem; aspect-ratio: 4 / 3; } }

.panoramica {
  height: clamp(9rem, 18vw, 16rem);
  background: var(--fum) url("../img/assecador-panoramica.jpg") center / cover no-repeat;
}

/* ---------- El producte ---------- */
.experiencia { padding: var(--seccio) var(--marge); max-width: var(--ample); margin: 0 auto; }
.experiencia__cap { text-align: center; max-width: 40rem; margin: 0 auto clamp(3rem, 6vw, 4.5rem); }
.experiencia__cap h2 { margin-bottom: 1rem; }
.experiencia__cap p { color: var(--gris); font-size: 1.2rem; }
.experiencia__graella { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.experiencia__bloc figure { aspect-ratio: 4 / 3; overflow: hidden; margin-bottom: 1.75rem; }
.experiencia__bloc img { width: 100%; height: 100%; object-fit: cover; }
.experiencia__bloc h3 { font-size: 2.1rem; margin-bottom: .75rem; }
.experiencia__bloc p { color: var(--gris); max-width: 32rem; margin-bottom: 1.5rem; }
@media (max-width: 760px) { .experiencia__graella { grid-template-columns: 1fr; gap: 3.5rem; } }

/* ---------- Galeria ---------- */
.galeria { padding-bottom: var(--seccio); }
.galeria__tira {
  list-style: none; margin: 0; padding: 0 var(--marge);
  display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.galeria__tira li { flex: 0 0 auto; scroll-snap-align: start; }
.galeria__tira img { height: clamp(16rem, 32vw, 24rem); width: auto; object-fit: cover; }

/* ---------- La vall ---------- */
.vall { position: relative; min-height: 80vh; display: grid; align-items: end; color: var(--os); background: var(--fum); overflow: hidden; }
.vall__foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vall::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,17,14,0) 40%, rgba(20,17,14,.8) 100%); }
.vall__text { position: relative; z-index: 1; max-width: var(--ample); width: 100%; margin: 0 auto; padding: 6rem var(--marge) clamp(3rem, 7vw, 5rem); }
.vall__text h2 { margin-bottom: 1rem; }
.vall__text p { max-width: var(--mesura); font-size: 1.2rem; }

/* ---------- Botiga ---------- */
.botiga { background: var(--os); padding: var(--seccio) var(--marge); }
.botiga__dins { max-width: var(--ample); margin: 0 auto; display: grid; grid-template-columns: 3fr 2fr; align-items: center; }
.botiga__foto img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.botiga__fitxa { background: var(--paper); padding: clamp(2rem, 4vw, 3rem); margin-left: -4rem; position: relative; }
.botiga__fitxa h2 { margin-bottom: 1.5rem; }
.botiga__fitxa h3 { font-family: var(--text); font-size: 1rem; font-weight: 700; letter-spacing: .04em; color: var(--verd); margin-bottom: .5rem; }
.botiga__horari { color: var(--gris); margin-bottom: 1.75rem; }
@media (max-width: 860px) {
  .botiga__dins { grid-template-columns: 1fr; }
  .botiga__fitxa { margin: -3rem 1rem 0; }
}

/* ---------- Professionals ---------- */
.professionals { background: var(--verd); color: var(--os); text-align: center; }
.professionals__dins { max-width: 44rem; margin: 0 auto; padding: clamp(4rem, 8vw, 6rem) var(--marge); }
.professionals h2 { margin-bottom: 1rem; }
.professionals p { opacity: .9; margin-bottom: 2rem; }

/* ---------- Contacte ---------- */
.contacte { max-width: var(--ample); margin: 0 auto; padding: var(--seccio) var(--marge); text-align: center; }
.contacte h2 { margin-bottom: 3rem; }
.contacte__graella { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.contacte h3 { font-family: var(--text); font-size: 1rem; font-weight: 700; letter-spacing: .04em; color: var(--gris); margin-bottom: .5rem; }
.contacte p { font-family: var(--titol); font-size: 1.5rem; line-height: 1.3; }
.contacte a { color: var(--fum); }
@media (max-width: 760px) { .contacte__graella { grid-template-columns: 1fr; } }

/* ---------- Peu ---------- */
.peu { background: var(--fum); color: rgba(239,234,225,.8); font-size: 1rem; }
.peu__dins {
  max-width: var(--ample); margin: 0 auto; padding: 4rem var(--marge) 2.5rem;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem;
}
.peu p { margin: 0 0 .4rem; }
.peu__titol { color: var(--os); font-weight: 700; }
.peu a { color: inherit; }
.peu__legal { max-width: var(--ample); margin: 0 auto; padding: 1.25rem var(--marge) 2rem; font-size: .9rem; opacity: .6; border-top: 1px solid rgba(255,255,255,.1); }
@media (max-width: 860px) { .peu__dins { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .peu__dins { grid-template-columns: 1fr; } }

/* ---------- Avís legal ---------- */
.legal { max-width: var(--mesura); margin: 0 auto; padding: 9rem var(--marge) var(--seccio); }
.legal h1 { font-size: 3rem; margin-bottom: 2rem; }
.legal h2 { font-size: 1.8rem; margin: 2.5rem 0 .5rem; }
.botiga__fitxa p { margin-bottom: 1.75rem; }

/* ---------- Segell 1971 ---------- */
.segell {
  position: relative; z-index: 3;
  width: clamp(8.5rem, 14vw, 11rem); aspect-ratio: 1;
  margin: calc(clamp(8.5rem, 14vw, 11rem) / -2) auto 0;
  border-radius: 50%; background: var(--paper);
  box-shadow: 0 6px 24px rgba(20,17,14,.25);
  color: var(--fum); display: block;
}
.segell svg { width: 100%; height: 100%; display: block; }
.segell__vora { fill: none; stroke: var(--vermell); stroke-width: 2; }
.segell__dins { fill: none; stroke: var(--vermell); stroke-width: 1; }
.segell__anell text { font-family: var(--text); font-size: 13px; font-weight: 700; letter-spacing: .5px; fill: var(--vermell); }
.segell__des { font-family: var(--titol); font-style: italic; font-size: 18px; fill: var(--fum); }
.segell__any { font-family: var(--titol); font-weight: 600; font-size: 40px; fill: var(--vermell); }
.segell:hover .segell__vora { stroke-width: 4; }
@media (prefers-reduced-motion: no-preference) {
  .segell__anell { transform-origin: 100px 100px; animation: gira 60s linear infinite; }
  @keyframes gira { to { transform: rotate(360deg); } }
}
.benvinguda { padding-top: clamp(2.5rem, 5vw, 4rem); }
.boto--vermell { background: var(--vermell); border-color: var(--vermell); color: var(--os); }
.boto--vermell:hover { background: #A63526; border-color: #A63526; color: #fff; }
.menu__idioma { border: 1px solid currentColor !important; border-radius: 2px; padding: .2rem .55rem !important; font-size: .9rem; letter-spacing: .05em; opacity: .9; }
.menu__idioma:hover { background: var(--os); color: var(--fum); }
@media (max-width: 760px) { .menu__idioma { align-self: flex-start; margin-top: .75rem; } }
