:root {
  --bg:        #FEFAFA;
  --ink:       #111111;
  --ink-mute:  #6b6b6b;
  --accent:    #DAC012;
  --white:     #ffffff;

  --display: "Oswald", "Arial Narrow", sans-serif;
  --body:    "Graphik", "Montserrat", sans-serif;
  --label:   "Montserrat", sans-serif;
  --mono:    "American Typewriter", "Courier New", monospace;

  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.1;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }

p { margin: 0; line-height: 1.6; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--white);
  padding: .6rem 1rem; z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid rgba(17,17,17,.08);
  padding: 1.1rem 0;
  background: var(--bg);
  position: relative;
  z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: none;
  padding-left: clamp(1.5rem, 5vw, 4.5rem);
  padding-right: clamp(1.5rem, 5vw, 4.5rem);
}
.logo-link { display: inline-flex; min-width: 0; order: 2; margin: 0 auto; }
.logo-link img { height: 30px; width: auto; max-width: 100%; }
@media (max-width: 480px) {
  .logo-link img { height: 18px; }
  .container { padding: 0 1rem; }
}
.burger {
  order: 3;
  background: rgba(17,17,17,.06);
  border: none; border-radius: 4px;
  width: 38px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.burger svg { width: 18px; height: 14px; }

.nav-panel {
  order: 1;
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid rgba(17,17,17,.08);
  padding: .5rem 0 1.2rem;
  display: none;
}
.nav-panel.is-open { display: block; }
.nav-panel a {
  display: block;
  font-family: var(--display);
  font-size: 1.1rem;
  text-transform: uppercase;
  padding: .55rem 0;
}
.nav-panel .container { display: flex; flex-direction: column; }

.lang-switch {
  order: 4; display: flex; justify-content: center; margin-top: .6rem;
  font-family: var(--display); text-transform: uppercase; font-size: .9rem;
  gap: .9rem;
}
.lang-switch button {
  background: none; border: none; cursor: pointer; padding: 0;
  font: inherit; color: var(--ink-mute);
}
.lang-switch button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }

/* Mobile header: logo + burger on row 1, language switch centred on row 2 */
@media (max-width: 859px) {
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .6rem; }
  .logo-link { grid-column: 1; grid-row: 1; justify-self: center; margin: 0; }
  .burger { grid-column: 2; grid-row: 1; }
  .lang-switch { grid-column: 1 / -1; grid-row: 2; }
}

@media (min-width: 860px) {
  .header-inner {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  }
  .burger { display: none; }
  .logo-link { justify-self: center; grid-column: 2; margin: 0; }
  .nav-panel {
    position: static; display: flex !important; background: none; border: none; padding: 0;
    justify-self: start;
  }
  .nav-panel .container { flex-direction: row; gap: 2.4rem; padding: 0; max-width: none; }
  .nav-panel a { padding: 0; font-size: 1.05rem; }
  .lang-switch { justify-content: flex-start; margin-top: 0; justify-self: end; grid-column: 3; grid-row: auto; }
}

/* ---------- Section label (Montserrat Light — used for sub-section headings like Videobooks/Fotos/Contacto) ---------- */
.section-label {
  font-family: var(--label); font-weight: 300; text-transform: none;
  letter-spacing: normal; text-align: center; color: var(--ink);
}
h4.section-label { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
h2.section-label { font-size: clamp(1.1rem, 1.6vw, 1.25rem); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(17,17,17,.08);
  padding: 1.4rem 0;
  margin-top: 4rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: .8rem 1.6rem;
  align-items: center; justify-content: space-between;
  font-size: .85rem; color: var(--ink-mute);
  max-width: none;
  padding-left: clamp(1.5rem, 5vw, 4.5rem);
  padding-right: clamp(1.5rem, 5vw, 4.5rem);
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 0 1.4rem; }
.footer-legal a:hover { color: var(--ink); }

/* ---------- Yellow icon buttons (contact, chooser) ---------- */
.icon-btn {
  width: 92px; height: 92px; border-radius: 999px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.icon-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 22px -10px rgba(0,0,0,.35); }
.icon-btn svg { width: 34px; height: 34px; fill: var(--ink); }

/* ---------- Section heading ---------- */
.section-title {
  text-align: center;
  padding: 3rem 0 2rem;
}

/* ---------- Video embed (Vimeo/YouTube 16:9 responsive wrapper) ---------- */
.video-embed {
  position: relative; aspect-ratio: 16 / 9; margin: 0 auto 2.4rem;
  max-width: 900px; background: #000; overflow: hidden;
}
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); text-transform: uppercase;
  border: 2px solid var(--ink); border-radius: 999px;
  padding: .7rem 1.8rem; font-size: .95rem;
  background: transparent; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.btn:hover { background: var(--ink); color: var(--white); }
.btn-solid {
  background: var(--accent); border-color: var(--accent); color: var(--ink);
}
.btn-solid:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* ---------- Portfolio index pages ---------- */
.page-hero { padding: 3rem 0 1rem; text-align: center; }
.cat-title {
  text-align: center; font-size: 1.4rem; letter-spacing: .02em;
  padding: 3rem 0 1.6rem;
}
.cat-title:first-of-type { padding-top: 2.4rem; }

.portfolio-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.6rem;
  padding: 0 0 1rem;
}
@media (min-width: 640px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .portfolio-grid--filtered { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Portfolio index (sidebar + filter tabs) ---------- */
.portfolio-page {
  max-width: 1500px; margin: 0 auto;
  padding: 3rem clamp(1.5rem, 4vw, 3rem) 4rem;
}
.page-title-left { text-align: left; padding: 0 0 2.4rem; }

.portfolio-layout { display: flex; flex-direction: column; gap: 2.4rem; }
@media (min-width: 860px) {
  .portfolio-layout { flex-direction: row; align-items: flex-start; gap: 3.5rem; }
}

.portfolio-sidebar { flex: 0 0 230px; }
.sidebar-label {
  font-size: 1.3rem; letter-spacing: .02em; margin-bottom: 1.3rem;
}
.sidebar-list { display: flex; flex-direction: column; gap: .75rem; }
.sidebar-list a {
  display: block; font-family: var(--body); font-style: italic; font-weight: 300;
  font-size: 1.05rem; color: var(--ink);
}
.sidebar-list a:hover { color: var(--ink-mute); text-decoration: underline; }

.portfolio-main { flex: 1; min-width: 0; }
.portfolio-filters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 3.2rem;
  font-family: var(--display); font-weight: 600;
  font-size: 1.3rem; letter-spacing: .02em;
  padding-bottom: 1.6rem; margin-bottom: 2rem;
  border-bottom: 1px solid rgba(17,17,17,.08);
}
.portfolio-filters button {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; text-transform: uppercase; color: var(--ink);
}
.portfolio-filters button.is-active { color: var(--accent); }

.portfolio-card {
  position: relative; display: block; aspect-ratio: 16/9; overflow: hidden;
  background: #111;
}
.portfolio-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.portfolio-card:hover img { transform: scale(1.045); }
.card-hover-label {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: rgba(218, 192, 18, .85);
  color: #fff; font-family: var(--body); font-weight: 400; font-size: 1.05rem;
  text-align: center; padding: 1rem;
  opacity: 0; transition: opacity .25s ease;
  pointer-events: none;
}
.portfolio-card:hover .card-hover-label,
.portfolio-card:focus-visible .card-hover-label { opacity: 1; }

/* Mobile portfolio index: no sidebar / filter tabs; projects listed by category, caption under each thumbnail */
.portfolio-cat-heading { display: none; }
@media (max-width: 859px) {
  .portfolio-sidebar, .portfolio-filters { display: none; }
  .portfolio-page > .page-title-left { text-align: center; font-size: 2.25rem; line-height: 1.1; }
  .portfolio-layout { gap: 0; }
  .portfolio-grid--filtered { display: flex; flex-direction: column; gap: 1.6rem; }
  .portfolio-grid--filtered > .portfolio-card { order: var(--mo, 0); aspect-ratio: auto; background: none; }
  .portfolio-grid--filtered > .portfolio-cat-heading {
    display: block; order: var(--mo, 0);
    text-align: center; font-size: 1.4rem; letter-spacing: .02em; text-transform: uppercase;
    margin: 1.2rem 0 0;
  }
  .portfolio-grid--filtered > .portfolio-cat-heading:first-child { margin-top: 0; }
  .portfolio-grid--filtered .portfolio-card:hover img { transform: none; }
  .portfolio-grid--filtered .portfolio-card > img { height: auto; aspect-ratio: 16/9; display: block; }
  .portfolio-grid--filtered .card-hover-label {
    position: static; opacity: 1; display: block; background: none; padding: 0;
    color: var(--ink-mute); font-style: italic; font-weight: 300; font-size: .95rem;
    margin-top: .6rem;
  }
}

/* Logo cards (Servicios Audiovisuales): thumbnails already include their own framed-card design */
.portfolio-card--logo {
  aspect-ratio: auto; background: none;
  display: flex; flex-direction: column; gap: .6rem;
}
.portfolio-card--logo .logo-box {
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.portfolio-card--logo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Portfolio detail pages ---------- */
.detail-page { padding: 3rem clamp(1.5rem, 4vw, 3rem) 4rem; }
.detail-video { max-width: none; margin: 2rem 0 3rem; }
.detail-banner { width: 100%; display: block; margin: 2rem 0 3rem; border-radius: 2px; }
.detail-section { margin-bottom: 2.6rem; }
.detail-heading { font-size: 1.4rem; margin-bottom: 1rem; }
.detail-section p { font-weight: 300; font-size: 1.05rem; line-height: 1.7; }
.detail-credits { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.detail-credits li { font-weight: 300; font-size: 1.02rem; }
.detail-credits li b { font-weight: 600; }

.detail-divider {
  height: 1px; background: rgba(17, 17, 17, .2);
  width: 34%; min-width: 220px; max-width: 400px;
  margin: 2.4rem auto;
}

.detail-media-row {
  display: flex; flex-direction: column; gap: 2.6rem;
}
@media (min-width: 860px) {
  .detail-media-row { flex-direction: row; align-items: start; gap: 2.5rem; }
  .detail-media-row > * { flex: 1; min-width: 0; }
  .detail-media-row .detail-section { margin-bottom: 1.4rem; }
  .detail-media-row .detail-section:last-child { margin-bottom: 0; }
}
.detail-gallery {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.detail-gallery img { width: 100%; border-radius: 2px; display: block; cursor: zoom-in; }

.detail-gallery--full { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .detail-gallery--full { grid-template-columns: repeat(4, 1fr); }
}
.detail-gallery--triple {
  display: flex; flex-wrap: wrap; justify-content: center;
}
.detail-gallery--triple img { width: calc((100% - 1rem) / 2); }
@media (min-width: 640px) {
  .detail-gallery--triple img { width: calc((100% - 2rem) / 3); }
}

.detail-media-row--centered .detail-heading,
.detail-media-row--centered .detail-credits { text-align: center; }

.detail-single-column { max-width: 640px; margin: 0 auto; }
.detail-single-column .detail-heading,
.detail-single-column .detail-section p,
.detail-single-column .detail-credits { text-align: center; }

.detail-credits--stacked { gap: 1.1rem; }
.detail-credits--stacked li { display: flex; flex-direction: column; gap: .2rem; }
.detail-credits--stacked li b { text-transform: none; }

.detail-gallery--masonry {
  display: block; column-count: 1; column-gap: 10px;
}
.detail-gallery--masonry img { margin-bottom: 10px; break-inside: avoid; }
@media (min-width: 640px) { .detail-gallery--masonry { column-count: 2; } }
@media (min-width: 960px) { .detail-gallery--masonry { column-count: 3; } }

.detail-back-top { text-align: center; }
.detail-back-top .btn { border-radius: 8px; }

.detail-section > .video-embed { margin-bottom: 1rem; }

/* ---------- Legal pages (Aviso legal, Privacidad, Cookies) ---------- */
.legal-page .detail-back-top { margin-top: 2.4rem; }
.legal-body p { margin-bottom: 1rem; }
.legal-body p:last-child { margin-bottom: 0; }
.legal-body ul, .legal-body ol { margin: 0 0 1rem 1.3rem; padding: 0; }
.legal-body li { margin-bottom: .4rem; }
.legal-body h3, .legal-body h4 {
  font-family: var(--body); font-weight: 700; text-transform: none;
  font-size: 1.05rem; margin: 1.6rem 0 .7rem;
}

.legal-accordion-item { border-bottom: 1px solid rgba(17, 17, 17, .08); }
.legal-accordion-item summary {
  list-style: none; cursor: pointer;
  padding: .9rem 0; margin: 0;
  font-family: var(--body); font-style: italic; font-size: 1.1rem;
  color: var(--ink);
  display: flex; align-items: center; gap: .7rem;
}
.legal-accordion-item summary::-webkit-details-marker { display: none; }
.legal-accordion-item summary::before {
  content: "▶"; font-size: .65rem; flex-shrink: 0;
  transition: transform .2s ease;
}
.legal-accordion-item[open] summary::before { transform: rotate(90deg); }
.legal-accordion-item .legal-body { padding: 0 0 1.6rem 1.7rem; }

/* ---------- Lightbox (portfolio gallery) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0, 0, 0, .88);
  display: none; align-items: center; justify-content: center;
  padding: 4.5rem 1.5rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute; background: none; border: none; cursor: pointer;
  color: #fff; line-height: 1; padding: .5rem;
}
.lightbox-close { top: 1rem; right: 1.5rem; font-size: 1.8rem; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); font-size: 2.6rem; }
.lightbox-prev { left: .5rem; }
.lightbox-next { right: .5rem; }
.lightbox-counter {
  position: absolute; top: 1.2rem; left: 1.5rem; color: #fff;
  font-family: var(--body); font-weight: 300; font-size: .9rem;
}

.detail-subheading {
  font-family: var(--body); font-weight: 300; font-size: 1.15rem;
  text-align: center; margin-bottom: 1.4rem;
}
.detail-awards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; text-align: center; }
.detail-awards li { font-weight: 300; font-size: .98rem; line-height: 1.5; }
.detail-awards li b { font-weight: 600; }

/* ---------- Reveal-on-scroll (matches site's subtle fade/slide) ---------- */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-revealed { opacity: 1; transform: none; }
