/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 300;
  color: #1a1a1a;
  background: #fafaf7;
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: opacity 0.3s ease; }
a:hover { opacity: 0.55; }
ul { list-style: none; }

/* ── Tipografia ── */
.display {
  font-family: 'Changa One', 'Times New Roman', serif;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
}

/* ── Header ── */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 28px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(250,250,247,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.logo {
  font-family: 'Changa One', serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#main-nav ul {
  display: flex;
  gap: 42px;
  align-items: center;
}
#main-nav .label { font-size: 12px; letter-spacing: 0.2em; }
#main-nav .current > a, #main-nav .current > button { color: #8a3a2a; }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown-toggle {
  background: none; border: none;
  font-family: 'Inter', sans-serif;
  font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; font-weight: 400;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  color: #1a1a1a;
}
.arrow-icon {
  display: inline-block;
  width: 5px; height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.3s ease;
}
.has-dropdown.open .arrow-icon { transform: rotate(-135deg) translateY(2px); }
.dropdown {
  position: absolute;
  top: calc(100% + 22px); left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #fafaf7;
  border: 1px solid rgba(0,0,0,0.08);
  padding: 22px 32px;
  min-width: 220px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.has-dropdown.open .dropdown {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
#main-nav .dropdown { align-items: stretch; }
.dropdown li { padding: 8px 0; }
.dropdown li + li { border-top: 1px solid rgba(0,0,0,0.06); }
.dropdown a {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  color: #1a1a1a;
}

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0; }
.menu-toggle span {
  display: block; width: 26px; height: 1px;
  background: currentColor; margin: 6px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Pàgina base ── */
main { padding-top: 88px; min-height: 100vh; }

/* ── HOME HERO ── */
.home-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 88px);
  align-items: stretch;
}
.home-hero__text {
  padding: 8vh 6vw;
  display: flex; flex-direction: column; justify-content: center;
}
.home-hero__text .label { color: #8a3a2a; margin-bottom: 28px; }
.home-hero__text h1 { font-size: clamp(48px,7vw,96px); margin-bottom: 32px; }
.home-hero__text h1 em { font-style: italic; color: #8a3a2a; }
.home-hero__text p { font-size: 15px; max-width: 380px; color: #4a4a4a; margin-bottom: 40px; }
.home-hero__image { position: relative; overflow: hidden; background: #2a1f1c; }
.home-hero__image img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }

/* ── PROJECTES PREVIEW (home) ── */
.home-projectes {
  padding: 14vh 6vw 8vh;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.section-head {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 80px; flex-wrap: wrap; gap: 20px;
}
.section-head h2 { font-size: clamp(36px,5vw,64px); }
.section-head .label { color: #8a8a82; }

.projectes-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 8vh 4vw;
}
.projecte-card { transition: transform 0.5s cubic-bezier(0.2,0.8,0.2,1); }
.projecte-card:hover { transform: translateY(-4px); }
.projecte-card__link { display: block; }
.projecte-card__img {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg,#d4c5b3 0%,#8a6e52 100%);
  overflow: hidden; margin-bottom: 28px; position: relative;
}
.projecte-card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2,0.8,0.2,1);
}
.projecte-card:hover .projecte-card__img img { transform: scale(1.05); }
.projecte-card .label { color: #8a8a82; margin-bottom: 10px; display: block; }
.projecte-card h3 {
  font-family: 'Changa One', serif;
  font-size: 32px; font-weight: 400; margin-bottom: 10px; line-height: 1.2;
}
.projecte-card p { color: #5a5a5a; font-size: 15px; max-width: 480px; }
.projecte-card .arrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
}
.projecte-card:hover .arrow svg { transform: translateX(6px); }
.projecte-card .arrow svg { transition: transform 0.4s ease; }

/* ── HOME ABOUT ── */
.home-about {
  padding: 14vh 6vw;
  background: #f3efe8; text-align: center;
}
.home-about .label { color: #8a3a2a; margin-bottom: 24px; display: block; }
.home-about h2 {
  font-size: clamp(28px,4vw,52px);
  max-width: 800px; margin: 0 auto 36px; line-height: 1.25;
}
.btn-link {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  border-bottom: 1px solid currentColor; padding-bottom: 4px;
}
.btn-link svg, .btn-link:hover svg { transition: transform 0.4s ease; }
.btn-link:hover svg { transform: translateX(6px); }
.btn-link:hover { opacity: 1; }

/* ── HOME CONTACTE CTA ── */
.home-contacte { padding: 14vh 6vw; text-align: center; }
.home-contacte .label { color: #8a8a82; margin-bottom: 20px; display: block; }
.home-contacte h2 { font-size: clamp(40px,6vw,80px); font-style: italic; margin-bottom: 36px; }

/* ── PROJECTES INDEX ── */
.projectes-page { padding: 14vh 6vw 8vh; }
.page-header { margin-bottom: 100px; max-width: 700px; }
.page-header .label { color: #8a3a2a; margin-bottom: 20px; display: block; }
.page-header h1 { font-size: clamp(48px,7vw,96px); margin-bottom: 28px; }
.page-header h1 em { font-style: italic; color: #8a3a2a; }
.page-header p { font-size: 18px; color: #4a4a4a; }

.projectes-list { display: flex; flex-direction: column; }
.projecte-row {
  display: grid;
  grid-template-columns: 80px 1fr 1.2fr;
  gap: 4vw; padding: 6vh 0;
  border-top: 1px solid rgba(0,0,0,0.1);
  transition: padding 0.4s ease;
  color: inherit;
}
.projecte-row:last-child { border-bottom: 1px solid rgba(0,0,0,0.1); }
.projecte-row:hover { padding-left: 16px; opacity: 1; }
.projecte-row:hover .projecte-row__title { color: #8a3a2a; }
.projecte-row__num {
  font-family: 'Changa One', serif;
  font-style: italic; font-size: 22px; color: #8a8a82; padding-top: 8px;
}
.projecte-row__title {
  font-family: 'Changa One', serif;
  font-size: clamp(32px,4vw,52px); font-weight: 300;
  line-height: 1.05; transition: color 0.3s ease;
}
.projecte-row__meta { color: #5a5a5a; font-size: 15px; }
.projecte-row__meta .label { display: block; margin-bottom: 12px; color: #8a8a82; }

/* ── PROJECTE DETAIL ── */
.projecte-detail__hero {
  aspect-ratio: 21/9; position: relative;
  overflow: hidden; margin-bottom: 8vh;
  background: linear-gradient(135deg,#2a4d6e 0%,#4a8ac4 50%,#d4a548 100%);
}
.projecte-detail__hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.projecte-detail__hero::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.3); z-index: 1; pointer-events: none;
}
.projecte-detail__body {
  max-width: 1200px; margin: 0 auto;
  padding: 0 6vw 8vh;
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 6vw;
}
.back-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: #8a8a82; margin-bottom: 40px;
}
.back-link svg { transition: transform 0.4s ease; }
.back-link:hover svg { transform: translateX(-6px); }
.back-link:hover { opacity: 1; }
.projecte-detail__title-col .label { color: #8a3a2a; margin-bottom: 18px; display: block; }
.projecte-detail__title-col h1 {
  font-family: 'Changa One', serif;
  font-size: clamp(40px,5.5vw,76px); font-weight: 300; line-height: 1.05;
}
.projecte-detail__content p { font-size: 15px; color: #2a2a2a; margin-bottom: 22px; max-width: 620px; }
.projecte-detail__content p:first-child {
  font-family: 'Changa One', serif;
  font-size: clamp(22px,2.4vw,28px); font-weight: 300; line-height: 1.4;
  color: #1a1a1a; margin-bottom: 32px;
}

.formacio { margin-top: 60px; padding-top: 40px; border-top: 1px solid rgba(0,0,0,0.1); }
.formacio .label { color: #8a8a82; margin-bottom: 24px; display: block; }
.formacio li {
  display: flex; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
  font-family: 'Changa One', serif; font-size: 19px;
}
.formacio li span:last-child { color: #8a8a82; font-style: italic; font-size: 16px; }

.escolta { margin-top: 60px; padding-top: 40px; border-top: 1px solid rgba(0,0,0,0.1); }
.escolta .label { color: #8a8a82; margin-bottom: 24px; display: block; }
.escolta-links { display: flex; flex-wrap: wrap; gap: 14px; }
.escolta-link {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border: 1px solid rgba(0,0,0,0.18);
  border-radius: 100px; font-size: 13px; letter-spacing: 0.08em;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.escolta-link:hover {
  background: #1a1a1a; color: #fafaf7;
  border-color: #1a1a1a; opacity: 1;
}

/* ── GALERIA ── */
.projecte-gallery { padding: 0 6vw 8vh; }
.projecte-gallery > .label { color: #8a8a82; display: block; margin-bottom: 28px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.gallery-item {
  aspect-ratio: 4/3; overflow: hidden;
  background: #e8e4dc; cursor: pointer; position: relative;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2,0.8,0.2,1), filter 0.3s ease;
  filter: brightness(0.94);
}
.gallery-item:hover img, .gallery-item:focus img { transform: scale(1.05); filter: brightness(1); }
.gallery-item:focus { outline: 2px solid #8a3a2a; outline-offset: 2px; }

/* ── LIGHTBOX ── */
#glb {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.93); z-index: 9999;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
#glb.open { display: flex; }
#glb img { max-width: 90vw; max-height: 85vh; object-fit: contain; }
#glb-credit { color: rgba(255,255,255,0.45); font-size: 12px; letter-spacing: 0.15em; font-style: italic; }
#glb-close {
  position: absolute; top: 24px; right: 32px;
  background: none; border: none; color: #888; font-size: 2rem; cursor: pointer; line-height: 1;
}
#glb-close:hover { color: #fff; }

/* ── JO ── */
.jo-page { padding: 14vh 0 8vh; }
.jo-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6vw; align-items: start;
  max-width: 1400px; margin: 0 auto; padding: 0 6vw;
}
.jo-image { position: sticky; top: 120px; aspect-ratio: 3/4; overflow: hidden; background: #2a1f1c; }
.jo-image img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.jo-text .label { color: #8a3a2a; margin-bottom: 20px; display: block; }
.jo-text h1 { font-size: clamp(48px,6vw,84px); line-height: 1; margin-bottom: 40px; }
.jo-text .lead {
  font-family: 'Changa One', serif;
  font-size: clamp(22px,2.4vw,30px); font-weight: 300;
  line-height: 1.4; margin-bottom: 36px; color: #1a1a1a;
}
.jo-text p { font-size: 15px; color: #2a2a2a; margin-bottom: 22px; max-width: 520px; }
.master-classes { margin-top: 50px; padding-top: 40px; border-top: 1px solid rgba(0,0,0,0.1); }
.master-classes .label { color: #8a8a82; margin-bottom: 24px; display: block; }
.master-list { display: flex; flex-wrap: wrap; gap: 10px; }
.master-list span {
  padding: 8px 16px; background: #f3efe8;
  border-radius: 100px; font-size: 14px;
  font-family: 'Changa One', serif; font-style: italic;
}

/* ── CONTACTE ── */
.contacte-page {
  padding: 14vh 6vw 8vh; text-align: center;
  min-height: calc(100vh - 88px);
  display: flex; flex-direction: column; justify-content: center;
}
.contacte-page .label { color: #8a3a2a; margin-bottom: 24px; display: block; }
.contacte-page h1 {
  font-family: 'Changa One', serif;
  font-size: clamp(56px,9vw,140px); font-weight: 300;
  line-height: 1; margin-bottom: 60px; font-style: italic;
}
.contacte-email {
  font-family: 'Changa One', serif;
  font-size: clamp(22px,3vw,36px);
  border-bottom: 1px solid currentColor;
  padding-bottom: 6px; display: inline-block; margin-bottom: 80px;
}
.contacte-socials { display: flex; justify-content: center; gap: 50px; flex-wrap: wrap; }
.contacte-social { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.contacte-social .label { color: #8a8a82; }
.contacte-social .handle { font-family: 'Changa One', serif; font-size: 22px; font-style: italic; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid rgba(0,0,0,0.1);
  padding: 60px 48px 40px; margin-top: 8vh;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 60px;
}
.footer-grid h4 {
  font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: #8a8a82;
  margin-bottom: 18px; font-weight: 400;
}
.footer-grid li { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 300; letter-spacing: 0.04em; margin-bottom: 10px; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 30px; border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 12px; color: #8a8a82; letter-spacing: 0.06em;
}
.logo-small { font-family: 'Inter', sans-serif; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 400; color: #1a1a1a; }

/* ── Responsive ── */
@media (max-width: 900px) {
  #site-header { padding: 20px 24px; }
  .menu-toggle { display: block; }
  #main-nav ul {
    position: fixed; top: 70px; left: 0; right: 0;
    background: #fafaf7; flex-direction: column; gap: 0;
    padding: 24px; border-bottom: 1px solid rgba(0,0,0,0.08);
    transform: translateY(-110%); transition: transform 0.4s ease;
  }
  #main-nav ul.open { transform: translateY(0); }
  #main-nav li { width: 100%; padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
  .dropdown { position: static; transform: none; opacity: 1; pointer-events: auto;
    border: none; padding: 12px 0 0 16px; min-width: 0;
    background: transparent; display: none; }
  .has-dropdown.open .dropdown { display: block; }
  .home-hero { grid-template-columns: 1fr; }
  .home-hero__image { aspect-ratio: 4/5; min-height: 60vh; }
  .projectes-grid { grid-template-columns: 1fr; }
  .projecte-row { grid-template-columns: 60px 1fr; }
  .projecte-row__meta { grid-column: 2; }
  .projecte-detail__body { grid-template-columns: 1fr; }
  .jo-grid { grid-template-columns: 1fr; }
  .jo-image { position: static; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); }
}


/* ── Accent burdeus en contingut ric (em = cursiva = burdeus) ── */
.hero-lead em,
.home-hero__text p em,
.projecte-text em,
.projecte-detail__content em,
.jo-text .lead em,
.jo-text .jo-body em,
.jo-text p em {
  color: #8a3a2a;
  font-style: normal;
}

/* ── Photo credits ─────────────────────────────── */
.photo-credit {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  line-height: 1;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.03em;
  pointer-events: none;
  z-index: 3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Position:relative needed on containers */
.home-hero__image,
.projecte-detail__hero,
.gallery-item {
  position: relative;
}

/* In galleries: credit hidden by default, visible on hover */
.gallery-item .photo-credit {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.gallery-item:hover .photo-credit,
.gallery-item:focus .photo-credit {
  opacity: 1;
}

/* Projectes archive — frase 3/4 ample */
.projectes-page .page-header .display {
  max-width: 80%;
}


/* Pàgina Jo — lead text */
.lead p {
  font-size: 25px;
}


/* Projectes page-header override */
.projectes-page .page-header {
  max-width: 1150px !important;
}

/* ── Vídeo YouTube al detall del projecte ── */
.projecte-video,
.projecte-escolta {
  max-width: 1150px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.projecte-video .label,
.projecte-escolta .label {
  display: block;
  margin-bottom: 1.2rem;
}
.videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.videos-grid .video-wrapper {
  overflow: hidden;
  border-radius: 4px;
}
.videos-grid .video-wrapper iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}
/* Vídeo sol: centra i ocupa 1/2 */
.videos-grid .video-wrapper:only-child,
.videos-grid .video-wrapper:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 50%;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 640px) {
  .videos-grid {
    grid-template-columns: 1fr;
  }
  .videos-grid .video-wrapper:only-child,
  .videos-grid .video-wrapper:last-child:nth-child(odd) {
    grid-column: auto;
    max-width: 100%;
  }
}
