/* ==========================================================================
   Tema «maqueta» — maqueta de les fitxes impreses de l'audioguia
   (FICHAS_AUDIOGUIA/Audioguia_Sant_Cugat_sense_01.pdf) amb tots els mitjans
   de l'app: fotos, vídeos, àudios, carrusels i ampliacions.
   Es carrega DESPRÉS d'app.css; els altres temes no es toquen.

   Paleta extreta del PDF:
     crema #F6F3ED · tinta #1A1A1A · coure #B98459 · granat #4A1220
     gris topo #8C8475 / #5A544B
   Tipografia: Lora (títols i números) + Lato (etiquetes i interfície).
   ========================================================================== */

.theme-maqueta {
  --cream: #f6f3ed;
  --paper: #fbf9f5;
  --paper-2: #eee8de;
  --ink: #1a1a1a;
  --copper: #b98459;
  --copper-text: #9a6536;          /* coure fosc: AA per a text petit sobre crema */
  --copper-pale: #ede3d8;          /* el «0» pàl·lid dels números */
  --burgundy: #4a1220;
  --burgundy-900: #2e0a14;
  --taupe: #8c8475;
  --taupe-text: #6b6457;           /* topo amb contrast suficient */
  --taupe-dark: #5a544b;
  --line: rgba(74, 18, 32, .16);

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* tokens del tema base redirigits a la nova paleta */
  --brand-900: var(--burgundy-900);
  --brand-700: var(--burgundy);
  --brand-600: var(--burgundy);
  --brand-300: var(--copper-pale);
  --sand-200: var(--copper-pale);
  --cream-100: var(--paper-2);
  --cream-50: var(--cream);
  --ink-soft: var(--taupe-dark);
  --font: var(--sans);
  --radius-s: 3px;
  --radius-m: 4px;
  --shadow-1: 0 1px 2px rgba(26, 26, 26, .06);
  --shadow-2: 0 10px 30px rgba(46, 10, 20, .22);

  background: var(--cream);
  color: var(--ink);
}

.theme-maqueta a { color: var(--burgundy); }

/* ---------- Tipus base ------------------------------------------------ */
.fx-eyebrow {
  display: block; margin: 0;
  font: 700 11px/1.5 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--ink);
}
.fx-eyebrow--accent { color: var(--burgundy); letter-spacing: .22em; }
.fx-label {
  margin: 0 0 14px; font: 700 12px/1.4 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--burgundy);
}
.fx-rule { display: block; width: 64px; height: 2px; margin: 18px 0; background: var(--burgundy); }
.fx-lead { margin: 6px 0 0; font: 400 16px/1.55 var(--sans); color: var(--taupe-dark); }
.fx-num { font-family: var(--serif); font-weight: 400; color: var(--copper); line-height: .8; letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.fx-num__pad { color: var(--copper-pale); }

/* Marc de les il·lustracions: filet granat, aire i filet interior */
.fx-frame { margin: 0; padding: 7px; background: #fff; border: 1px solid var(--burgundy); }
.fx-frame img { display: block; width: 100%; height: auto; outline: 1.5px solid var(--burgundy); outline-offset: -1.5px; }

/* ---------- Capçalera i menú ------------------------------------------ */
.theme-maqueta .site-header { background: rgba(246, 243, 237, .95); border-bottom: 1px solid var(--line); }
.theme-maqueta .site-header__back { font: 700 12px/1.2 var(--sans); letter-spacing: .2em; color: var(--burgundy); }
.theme-maqueta .icon-btn { color: var(--burgundy); }
.theme-maqueta .icon-btn:hover { background: rgba(74, 18, 32, .06); }

.theme-maqueta .drawer { background: var(--cream); color: var(--ink); }
.theme-maqueta .drawer::backdrop { background: rgba(26, 26, 26, .4); }
.theme-maqueta .drawer__close { color: var(--burgundy); }
.theme-maqueta .drawer nav a {
  color: var(--ink); font: 400 22px/1.2 var(--serif); border-bottom-color: var(--line);
}
.theme-maqueta .drawer nav a .icon { color: var(--copper); }
.theme-maqueta .drawer__logo { opacity: 1; width: 150px; }

.theme-maqueta .lang-switch a {
  min-height: 34px; border-width: 1px; border-radius: 2px;
  font: 700 11px/1 var(--sans); letter-spacing: .22em; color: var(--burgundy);
}
.theme-maqueta .lang-switch a[aria-current="true"],
.theme-maqueta .lang-switch--light a[aria-current="true"] { background: var(--burgundy); border-color: var(--burgundy); color: var(--cream); }
.theme-maqueta .lang-switch--light a { color: var(--burgundy); }

/* ---------- Portada --------------------------------------------------- */
.fx-home { min-height: 100vh; min-height: 100dvh; padding: 28px 0 calc(28px + var(--safe-b)); display: flex; flex-direction: column; justify-content: center; }
.fx-home__grid { display: grid; gap: 28px; align-items: center; }
.fx-home__text { display: flex; flex-direction: column; align-items: flex-start; }
.fx-home__logo { width: 120px; height: auto; margin: 22px 0 6px; }
.fx-display { margin: 10px 0 0; font: 400 clamp(40px, 11vw, 76px)/1.02 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.fx-home__langs { display: grid; gap: 10px; margin: 4px 0 24px; }
.fx-home__langs .fx-label { margin: 0; }
.fx-home__langs .lang-switch a { min-width: 92px; min-height: 42px; letter-spacing: .08em; font-size: 13px; }
.fx-btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 28px;
  background: var(--burgundy); color: var(--cream) !important; border-radius: 2px; text-decoration: none;
  font: 700 13px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  transition: background-color .15s ease;
}
.fx-btn:hover { background: var(--burgundy-900); }
.fx-listen { display: flex; align-items: center; gap: 10px; margin: 22px 0 0; font: 400 18px/1.3 var(--serif); color: var(--ink); }
.fx-listen .icon { color: var(--copper); }
.fx-home__art { width: min(100%, 440px); justify-self: center; }
/* Mòbil: la imatge d'inici és el primer que es veu (a l'ordinador va a la dreta) */
@media (max-width: 899px) {
  .fx-home { justify-content: flex-start; padding-top: 16px; }
  .fx-home__art { order: -1; width: 100%; }
  .fx-home__art img { height: min(38vh, 38svh, 340px); object-fit: cover; object-position: center 40%; }
}
.fx-home__note { margin-top: 28px; font: 400 13px/1.5 var(--sans); color: var(--taupe-text); }

/* ---------- Índex ----------------------------------------------------- */
.fx-page-eyebrow { margin-top: 24px; }
.fx-page-title { margin: 8px 0 0; font: 400 clamp(40px, 11vw, 60px)/1 var(--serif); color: var(--ink); }

.fx-toc { list-style: none; margin: 8px 0 40px; padding: 0; border-bottom: 1px solid var(--line); }
.fx-card { border-top: 1px solid var(--line); padding: 22px 0; }
.fx-card__main {
  display: grid; grid-template-columns: auto 1fr 92px; grid-template-areas: "num aud art" "body body body";
  align-items: end; column-gap: 12px; row-gap: 12px;
  color: var(--ink) !important; text-decoration: none;
}
.fx-card__num { grid-area: num; font-size: 72px; }
.fx-card__main > .toc-audio { grid-area: aud; justify-self: start; width: 20px; height: 20px; margin-bottom: 4px; color: var(--copper-text); }
.fx-card__art { grid-area: art; align-self: start; padding: 4px; }
.fx-card__art img { aspect-ratio: 1; object-fit: cover; }
.fx-card__body { grid-area: body; display: grid; gap: 6px; }
.fx-card__title { font: 400 26px/1.12 var(--serif); }
.fx-card__main:hover .fx-card__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.fx-sub { list-style: none; margin: 16px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--copper-pale); display: grid; }
.fx-sub a {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: baseline; gap: 10px;
  padding: 12px 4px; min-height: 48px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line);
}
.fx-sub li:last-child a { border-bottom: 0; }
.fx-sub__num { font: 400 22px/1 var(--serif); color: var(--copper-text); }
.fx-sub__body { display: grid; gap: 2px; }
.fx-sub__title { font: 700 15px/1.3 var(--sans); }
.fx-sub a:hover .fx-sub__title { text-decoration: underline; text-underline-offset: 3px; }
.fx-sub .toc-audio { width: 18px; height: 18px; color: var(--copper-text); align-self: center; }

/* ---------- Fitxa d'obra ---------------------------------------------- */
.fx-hero { display: grid; gap: 24px; padding: 20px 0 8px; }
.fx-hero__num { font-size: clamp(120px, 40vw, 280px); margin: 0 0 -4px -6px; }
.fx-hero__text .fx-eyebrow { margin-top: 10px; }
.fx-title { margin: 6px 0 0; font: 400 clamp(34px, 9.5vw, 54px)/1.05 var(--serif); color: var(--ink); letter-spacing: -.005em; }
.fx-credit { margin: 10px 0 0; font: 700 11px/1.6 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--taupe-text); }
.fx-summary { margin: 0 0 12px; font: italic 400 18px/1.5 var(--serif); color: var(--ink); }
.fx-facts { margin: 0; display: grid; gap: 7px; font: 400 14px/1.5 var(--sans); }
.fx-facts div { display: block; }
.fx-facts dt { display: inline; font-weight: 700; color: var(--burgundy); }
.fx-facts dt::after { content: ": "; }
.fx-facts dd { display: inline; margin: 0; color: var(--ink); }
.fx-note { margin: 10px 0 0; font: 400 14px/1.5 var(--sans); color: var(--taupe-dark); }
/* Carrusel de l'app emmarcat com les imatges de les fitxes */
.fx-hero__gallery { min-width: 0; padding: 7px; background: #fff; border: 1px solid var(--burgundy); }
.fx-hero__gallery .gallery { margin: 0; border-radius: 0; outline: 1.5px solid var(--burgundy); outline-offset: -1.5px; }
.fx-hero__gallery .gallery__slide { aspect-ratio: 1 / 1; max-height: min(66vh, 66svh); }

.fx-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 20px 0 22px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.theme-maqueta .text-size button { color: var(--burgundy); font-family: var(--serif); font-weight: 500; }

.theme-maqueta .obra-text { font-family: var(--serif); line-height: 1.7; color: var(--ink); }
.theme-maqueta .obra-text strong { font-weight: 600; color: var(--burgundy); }
.theme-maqueta .notice { background: var(--paper-2); color: var(--taupe-dark); border-radius: 2px; font-family: var(--sans); }
.theme-maqueta .notice .icon { color: var(--copper-text); }

.fx-section { margin: 36px 0 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.fx-kids { list-style: none; margin: 0; padding: 0; display: grid; }
.fx-kids a {
  display: grid; grid-template-columns: 72px auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line);
}
.fx-kids li:last-child a { border-bottom: 0; }
.fx-kids a:not(:has(.fx-sub__art)) { grid-template-columns: auto 1fr auto; }
.fx-sub__art { padding: 3px; }
.fx-sub__art img { aspect-ratio: 1; object-fit: cover; }
.fx-kids .fx-sub__num { font-size: 28px; }
.fx-kids .toc-audio { width: 18px; height: 18px; color: var(--copper-text); }

/* Galeria de fotos: escenari clar, com un full de fitxa */
.theme-maqueta .gallery { background: var(--paper-2); }
.theme-maqueta .gallery__nav { background: rgba(251, 249, 245, .94); color: var(--burgundy); border-radius: 2px; }
.theme-maqueta .gallery__dots span { background: rgba(74, 18, 32, .25); }
.theme-maqueta .gallery__dots span[aria-current="true"] { background: var(--burgundy); }
.theme-maqueta .gallery__zoom { background: rgba(74, 18, 32, .72); border-radius: 2px; }
.fx-section .gallery { margin-top: 0; }

.theme-maqueta .pager a { background: var(--paper); border: 1px solid var(--line); box-shadow: none; border-radius: 2px; color: var(--ink); }
.theme-maqueta .pager small { font: 700 10.5px/1.4 var(--sans); letter-spacing: .22em; color: var(--burgundy); }
.theme-maqueta .pager span { font: 400 17px/1.25 var(--serif); }

/* ---------- Cercador -------------------------------------------------- */
.theme-maqueta .num-search__form {
  background: var(--paper); color: var(--burgundy); border: 1px solid var(--burgundy); border-radius: 2px; box-shadow: none;
  padding: 5px 5px 5px 16px;
}
.theme-maqueta .num-search input { color: var(--ink); border-bottom: 0; font: 400 22px/1 var(--serif); letter-spacing: .02em; }
.theme-maqueta .num-search input::placeholder { color: var(--taupe); font-weight: 400; }
.theme-maqueta .num-search input:focus { border-bottom: 0; }
.theme-maqueta .num-search button {
  background: var(--burgundy); color: var(--cream); border-radius: 2px;
  font: 700 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; padding: 0 18px;
}
.theme-maqueta .num-search__msg { color: #8a1c1c; }

/* ---------- Reproductor ----------------------------------------------- */
.theme-maqueta .player { background: var(--burgundy); border-radius: 4px; }
.theme-maqueta .player__btn:not(.player__btn--ghost) { background: var(--cream); color: var(--burgundy); }
.theme-maqueta .player__speed { border-radius: 2px; border-width: 1px; font: 700 12px/1 var(--sans); letter-spacing: .06em; }
.theme-maqueta .player__time { font-family: var(--sans); }
.theme-maqueta .ear-dialog { border-radius: 4px; background: var(--cream); border: 1px solid var(--burgundy); }
.theme-maqueta .ear-dialog h2 { font: 400 24px/1.15 var(--serif); color: var(--ink); }
.theme-maqueta .ear-dialog p { font-family: var(--sans); color: var(--taupe-dark); }
.theme-maqueta .ear-dialog__btns button { border-radius: 2px; border-width: 1px; font: 700 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }

/* ---------- Mapa, pàgines simples, peu -------------------------------- */
.theme-maqueta .page-title { font: 400 clamp(36px, 10vw, 52px)/1.05 var(--serif); color: var(--ink); }
.theme-maqueta .page-intro { font-family: var(--sans); color: var(--taupe-dark); }
.theme-maqueta .map { padding: 7px; background: #fff; border: 1px solid var(--burgundy); }
.theme-maqueta .map__pin {
  width: 38px; height: 38px; border-radius: 50%; background: var(--copper); color: #fff;
  font: 500 17px/1 var(--serif); box-shadow: 0 0 0 4px rgba(185, 132, 89, .22), 0 1px 3px rgba(0, 0, 0, .2);
}
.theme-maqueta .map__pin:hover, .theme-maqueta .map__pin:focus-visible { background: var(--burgundy); }
.theme-maqueta .children h2, .theme-maqueta .map-extra h2 { font: 700 12px/1.4 var(--sans); letter-spacing: .26em; color: var(--burgundy); }
.theme-maqueta .toc-sub a { background: var(--paper); border: 1px solid var(--line); box-shadow: none; border-radius: 2px; color: var(--ink); }
.theme-maqueta .toc-sub .toc-num { background: none; color: var(--copper-text); font: 400 20px/1 var(--serif); }
.theme-maqueta .btn--light { background: var(--burgundy); color: var(--cream); box-shadow: none; border-radius: 2px; font-size: 13px; letter-spacing: .22em; }
.theme-maqueta .site-footer { font-family: var(--sans); color: var(--taupe-text); border-top: 1px solid var(--line); margin-top: 16px; }

/* ---------- Pantalles grans ------------------------------------------- */
@media (min-width: 600px) {
  .fx-card__main { grid-template-columns: 112px 1fr auto 132px; grid-template-areas: "num body aud art"; align-items: center; column-gap: 20px; }
  .fx-card__num { font-size: 88px; }
  .fx-card__main > .toc-audio { align-self: center; margin: 0; }
  .fx-sub { margin-left: 132px; }
}

@media (min-width: 900px) {
  :root .theme-maqueta, .theme-maqueta { --maxw: 1080px; }
  .fx-home__grid { grid-template-columns: 1.1fr .9fr; gap: 64px; }
  .fx-hero { grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: start; padding-top: 32px; }
  .fx-hero { grid-template-columns: 1fr 1fr; }
  .fx-hero--noart { grid-template-columns: 1fr; }
  .fx-hero__art { margin-top: 24px; }
  .fx-hero__gallery .gallery__slide { aspect-ratio: 4 / 5; max-height: 72vh; }
  .theme-maqueta .obra-text, .fx-tools, .fx-section, .theme-maqueta .pager, .theme-maqueta .num-search, .theme-maqueta > main > .notice { max-width: 720px; }
}

/* Pantalla completa / app instal·lada: espai per a la zona del rellotge */
.fx-home { padding-top: calc(28px + env(safe-area-inset-top, 0px)); }
@media (max-width: 899px) {
  .fx-home { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
}
.theme-maqueta .ios-hint { margin: 24px auto 0; width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--maxw) - 2 * var(--gutter)); border: 1px solid var(--burgundy); border-radius: 2px; background: var(--paper); font-family: var(--sans); }

/* NFC i «Toca per escoltar» amb l'estil de les fitxes */
.theme-maqueta .num-search__nfc { border-radius: 2px; border-width: 1px; border-color: var(--burgundy); color: var(--burgundy);
  font: 700 12px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.theme-maqueta .num-search__nfc.is-on { background: var(--burgundy); color: var(--cream); }
.theme-maqueta .num-search__nfc-status { font-family: var(--sans); color: var(--taupe-dark); }
.theme-maqueta .tap-listen__btn { border-radius: 4px; background: var(--burgundy); color: var(--cream);
  font: 700 13px/1.2 var(--sans); letter-spacing: .22em; text-transform: uppercase; }

/* ---------- Cercador flotant ------------------------------------------- */
.theme-maqueta .num-search__form { box-shadow: 0 6px 22px rgba(46, 10, 20, .12); }
.theme-maqueta .num-search__form:focus-within { border-color: var(--burgundy); box-shadow: 0 0 0 3px rgba(74, 18, 32, .2), 0 10px 28px rgba(46, 10, 20, .16); }
.theme-maqueta .num-search .icon { color: var(--burgundy); }
/* el botó «Ir» s'apaga fins que hi ha un número que existeix */

/* semitransparent i molt llegible quan és enganxat a dalt */
.theme-maqueta .num-search.is-docked .num-search__form {
  background: rgba(251, 249, 245, .8);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-color: rgba(74, 18, 32, .45); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(46, 10, 20, .22), 0 1px 0 rgba(255, 255, 255, .7) inset;
  padding: 4px 4px 4px 14px;
}
.theme-maqueta .num-search.is-docked input { font-size: 20px; height: 42px; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.theme-maqueta .num-search.is-docked button[type=submit] { height: 42px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .theme-maqueta .num-search.is-docked .num-search__form { background: rgba(251, 249, 245, .96); }
}
.theme-maqueta .num-search.is-docked .num-search__msg:not(:empty) { color: #8a1c1c; font: 700 13px/1.3 var(--sans); }
/* estats del botó «Ir» (després de les regles d'enganxat perquè manin) */
.theme-maqueta .num-search .num-search__form button[type=submit] { background: rgba(74, 18, 32, .1); color: var(--burgundy); }
.theme-maqueta .num-search .num-search__form.is-valid button[type=submit] { background: var(--burgundy); color: var(--cream); box-shadow: 0 0 0 3px rgba(185, 132, 89, .5); }
.theme-maqueta .num-search .num-search__form.is-going button[type=submit] { background: var(--copper); color: #fff; }
.theme-maqueta .num-search .num-search__form.is-error { border-color: #8a1c1c; box-shadow: 0 0 0 3px rgba(138, 28, 28, .2), 0 10px 30px rgba(46, 10, 20, .18); }

/* ---------- Ampliació de fotos: la X de tancar ben visible ------------ */
.theme-maqueta .lightbox__close {
  z-index: 2; width: 48px; height: 48px; border-radius: 50%;
  color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}
.theme-maqueta .lightbox__close .icon { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.theme-maqueta .lightbox__close:hover, .theme-maqueta .lightbox__close:focus-visible { background: rgba(255, 255, 255, .3); }
.theme-maqueta .lightbox__close:active { transform: scale(.94); }
.theme-maqueta .lightbox__count { color: #fff; }

/* ---------- Carrusel (maqueta) ---------------------------------------- */
.theme-maqueta .gallery__nav { border-radius: 50%; background: rgba(251, 249, 245, .82); color: var(--burgundy); }
.theme-maqueta .gallery__nav:hover { background: rgba(251, 249, 245, .97); }
.theme-maqueta .gallery__progress i { background: var(--copper); }
.theme-maqueta .gallery__thumb { border-radius: 2px; }
.theme-maqueta .gallery__thumb.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--burgundy), 0 6px 14px rgba(46, 10, 20, .25); }

/* ---------- Carrusel amb cantonades arrodonides (aspecte més professional) */
.fx-hero__gallery {
  padding: 8px; border: 1px solid rgba(74, 18, 32, .18); border-radius: 18px; background: #fff;
  box-shadow: 0 1px 2px rgba(46, 10, 20, .06), 0 12px 32px rgba(46, 10, 20, .12);
}
.fx-hero__gallery .gallery { border-radius: 12px; outline: 0; overflow: hidden; overflow: clip; isolation: isolate; }
.theme-maqueta .gallery__zoom { border-radius: 50%; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.theme-maqueta .gallery__count { top: 12px; left: 12px; }
.theme-maqueta .gallery__zoom { top: 12px; right: 12px; }
.theme-maqueta .gallery__thumbs { gap: clamp(4px, 1.6vw, 10px); padding: 6px 4px 4px; }
/* quadrades i de mida flexible: la graella d'app.css fa que sempre càpiguen (sense scroll) */
.theme-maqueta .gallery__thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 10px; }
.theme-maqueta .gallery__thumb.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--burgundy), 0 6px 14px rgba(46, 10, 20, .22); }
.theme-maqueta .gallery__thumbs:has(+ *) { margin-bottom: 0; }
.theme-maqueta .lightbox__count, .theme-maqueta .lightbox__caption { border-radius: 999px; }

/* ---------- Reproductor inferior: vidre clar molt transparent --------
   Translúcid i llegible sobre qualsevol fons: desenfocament fort, controls granat. */
.theme-maqueta .player {
  background: linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(246, 243, 237, .30));
  -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px);
  border: 1px solid rgba(255, 255, 255, .7); border-radius: 22px; color: var(--burgundy);
  box-shadow: 0 12px 36px rgba(46, 10, 20, .18), 0 1px 3px rgba(46, 10, 20, .08), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.theme-maqueta .player__btn:not(.player__btn--ghost) {
  background: var(--burgundy); color: var(--cream); box-shadow: 0 6px 16px rgba(74, 18, 32, .3);
  transition: transform .15s ease, box-shadow .2s ease;
}
.theme-maqueta .player__btn:not(.player__btn--ghost):active { transform: scale(.92); box-shadow: 0 3px 8px rgba(74, 18, 32, .3); }
.theme-maqueta .player__btn--ghost { color: var(--burgundy); border-radius: 50%; transition: background-color .2s ease, transform .15s ease; }
.theme-maqueta .player__btn--ghost:active { transform: scale(.9); background: rgba(74, 18, 32, .1); }
.theme-maqueta .player__time { color: var(--burgundy-900); opacity: 1; font-weight: 700; }
.theme-maqueta .player__range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--burgundy) var(--p), rgba(74, 18, 32, .18) var(--p)); }
.theme-maqueta .player__range::-moz-range-track { background: rgba(74, 18, 32, .18); }
.theme-maqueta .player__range::-moz-range-progress { background: var(--burgundy); }
.theme-maqueta .player__range::-webkit-slider-thumb { background: var(--burgundy); box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 2px 6px rgba(46, 10, 20, .35); }
.theme-maqueta .player__range::-moz-range-thumb { background: var(--burgundy); box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 2px 6px rgba(46, 10, 20, .35); }
.theme-maqueta .player__speed {
  border: 1.5px solid rgba(74, 18, 32, .45); border-radius: 10px; color: var(--burgundy); background: rgba(255, 255, 255, .35);
  transition: background-color .2s ease, transform .15s ease;
}
.theme-maqueta .player__speed:active { transform: scale(.94); background: rgba(74, 18, 32, .1); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .theme-maqueta .player { background: rgba(251, 249, 245, .96); }
}

/* ---------- Botons i caixes amb cantonades arrodonides (igual que el carrusel) */
.theme-maqueta .lang-switch a { border-radius: 10px; transition: background-color .15s ease, color .15s ease, transform .12s ease; }
.theme-maqueta .lang-switch a:active { transform: scale(.95); }
.theme-maqueta .text-size button { border-radius: 10px; transition: background-color .15s ease, transform .12s ease; }
.theme-maqueta .text-size button:hover { background: rgba(74, 18, 32, .07); }
.theme-maqueta .text-size button:active { transform: scale(.92); }
.fx-btn { border-radius: 14px; box-shadow: 0 6px 18px rgba(46, 10, 20, .18); }
.fx-btn:active { transform: scale(.97); }
.theme-maqueta .btn--light { border-radius: 14px; }
.theme-maqueta .pager a { border-radius: 14px; transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease; }
.theme-maqueta .pager a:hover { border-color: rgba(74, 18, 32, .35); box-shadow: 0 4px 14px rgba(46, 10, 20, .08); }
.theme-maqueta .pager a:active { transform: scale(.98); }
.theme-maqueta .toc-sub a { border-radius: 12px; }
.theme-maqueta .notice { border-radius: 12px; }
.theme-maqueta .num-search__form { border-radius: 14px; }
.theme-maqueta .num-search .num-search__form button[type=submit] { border-radius: 10px; }
.theme-maqueta .num-search.is-docked .num-search__form { border-radius: 14px; }
.theme-maqueta .num-search__nfc { border-radius: 12px; }
.theme-maqueta .ear-dialog { border-radius: 18px; }
.theme-maqueta .ear-dialog__btns button { border-radius: 12px; }
.theme-maqueta .ios-hint { border-radius: 14px; }
.theme-maqueta .tap-listen__btn { border-radius: 16px; }
/* marcs de foto (portada, índex) i mapa amb el mateix estil que el carrusel */
.fx-frame {
  padding: 6px; border: 1px solid rgba(74, 18, 32, .18); border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(46, 10, 20, .06), 0 10px 26px rgba(46, 10, 20, .12);
}
.fx-frame img { outline: 0; border-radius: 11px; }
.theme-maqueta .map { padding: 8px; border: 1px solid rgba(74, 18, 32, .18); border-radius: 18px; box-shadow: 0 1px 2px rgba(46, 10, 20, .06), 0 12px 32px rgba(46, 10, 20, .12); }
.theme-maqueta .map img { border-radius: 12px; }

/* ---------- Portada al mòbil: façana de fons a tota la pantalla ------------
   Patró professional per a text sobre foto: la foto s'enfosqueix amb un degradat,
   la targeta és de vidre fosc i la tipografia és clara (sense halos ni contorns). */
.fx-home__bgm { display: none; }
@media (max-width: 759px) {
  .fx-home--bgm {
    position: relative; isolation: isolate; justify-content: center; gap: 14px;
    padding: calc(58px + env(safe-area-inset-top, 0px)) 0 calc(58px + var(--safe-b));
    color: #fff;
  }
  /* 100% de l'alçada, amplada proporcional; el rosetó (--fx-x) al centre i els costats es retallen */
  .fx-home--bgm .fx-home__bgm {
    display: block; position: fixed; inset: 0; z-index: -2; overflow: hidden; background: #2a1d17;
    animation: fxh-bg 1.8s cubic-bezier(.2, .7, .2, 1) both;
  }
  .fx-home--bgm .fx-home__bgm img {
    position: absolute; top: 0; left: 50%; height: 100%; width: auto; max-width: none;
    transform: translateX(calc(-1 * var(--fx-x, 50%)));
  }
  /* degradat fosc + vinyeta: dona contrast sense amagar la façana */
  .fx-home--bgm::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(120% 70% at 50% 35%, rgba(14, 6, 9, 0) 0%, rgba(14, 6, 9, .35) 100%),
      linear-gradient(180deg, rgba(14, 6, 9, .30) 0%, rgba(14, 6, 9, .42) 45%, rgba(14, 6, 9, .78) 100%);
  }
  .fx-home--bgm .fx-home__art { display: none; }
  .fx-home--bgm .fx-home__grid { gap: 0; }

  /* targeta de vidre */
  .fx-home--bgm .fx-home__text {
    padding: 24px 22px 22px; border-radius: 24px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
    -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, .24);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .28);
    animation: fxh-card .8s cubic-bezier(.2, .7, .2, 1) .15s both;
  }
  .fx-home--bgm .fx-eyebrow { color: rgba(255, 255, 255, .78); }
  .fx-home--bgm .fx-home__logo { filter: brightness(0) invert(1); opacity: .95; }
  .fx-home--bgm .fx-display { color: #fff; }
  .fx-home--bgm .fx-lead { color: rgba(255, 255, 255, .86); }
  .fx-home--bgm .fx-rule { background: var(--copper); }
  .fx-home--bgm .fx-label { color: rgba(255, 255, 255, .72); }
  .fx-home--bgm .fx-listen { color: #fff; }
  .fx-home--bgm .fx-listen .icon { color: #e0b48a; }
  .fx-home--bgm .fx-home__note {
    position: absolute; left: 0; right: 0; bottom: calc(10px + var(--safe-b)); max-width: none; margin: 0 auto;
    padding: 0 24px; text-align: center; color: rgba(255, 255, 255, .78);
  }

  /* idiomes: contorn clar; el triat, ple */
  .fx-home--bgm .lang-switch a {
    color: #fff; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .45);
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
  }
  .fx-home--bgm .lang-switch a:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .8); }
  .fx-home--bgm .lang-switch a:active { transform: scale(.94); }
  .fx-home--bgm .lang-switch a[aria-current="true"] { background: #f6f3ed; border-color: #f6f3ed; color: var(--burgundy); }

  /* botó principal: crema sobre fosc, amb reflex que hi passa un cop en entrar */
  .fx-home--bgm .fx-btn {
    position: relative; overflow: hidden; background: #f6f3ed; color: var(--burgundy) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35); transition: transform .15s ease, box-shadow .2s ease;
  }
  .fx-home--bgm .fx-btn::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; pointer-events: none;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .75), rgba(255, 255, 255, 0));
    transform: skewX(-20deg); animation: fxh-sheen 1.1s ease 1.4s both;
  }
  .fx-home--bgm .fx-btn .icon { transition: transform .2s ease; }
  .fx-home--bgm .fx-btn:hover .icon { transform: translateX(4px); }
  .fx-home--bgm .fx-btn:active { transform: scale(.97); box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
  .fx-home--bgm .fx-btn:focus-visible, .fx-home--bgm .lang-switch a:focus-visible { outline: 3px solid #e0b48a; outline-offset: 3px; }

  /* entrada escalonada del contingut */
  .fx-home--bgm .fx-home__text > * { animation: fxh-up .6s cubic-bezier(.2, .7, .2, 1) both; }
  .fx-home--bgm .fx-home__text > :nth-child(1) { animation-delay: .30s; }
  .fx-home--bgm .fx-home__text > :nth-child(2) { animation-delay: .38s; }
  .fx-home--bgm .fx-home__text > :nth-child(3) { animation-delay: .46s; }
  .fx-home--bgm .fx-home__text > :nth-child(4) { animation-delay: .54s; }
  .fx-home--bgm .fx-home__text > :nth-child(5) { animation-delay: .60s; }
  .fx-home--bgm .fx-home__text > :nth-child(6) { animation-delay: .68s; }
  .fx-home--bgm .fx-home__text > :nth-child(7) { animation-delay: .78s; }
  .fx-home--bgm .fx-home__text > :nth-child(8) { animation-delay: .88s; }
  .fx-home--bgm .fx-home__note { animation: fxh-fade .8s ease 1s both; }
}
@keyframes fxh-bg { from { transform: scale(1.08); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fxh-card { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fxh-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fxh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fxh-sheen { from { left: -60%; } to { left: 130%; } }
/* mòbils baixos: targeta més compacta perquè hi càpiga sencera */
@media (max-width: 759px) and (max-height: 720px) {
  .fx-home--bgm { padding-top: calc(44px + env(safe-area-inset-top, 0px)); padding-bottom: calc(44px + var(--safe-b)); }
  .fx-home--bgm .fx-home__text { padding: 16px 18px; }
  .fx-home--bgm .fx-home__logo { width: 96px; margin: 12px 0 2px; }
  .fx-home--bgm .fx-display { font-size: clamp(32px, 9vw, 40px); }
  .fx-home--bgm .fx-home__langs { margin: 2px 0 16px; }
  .fx-home--bgm .fx-btn { min-height: 48px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (max-width: 759px) { .fx-home--bgm .fx-home__text { background: rgba(20, 10, 12, .62); } }
}
@media (prefers-reduced-motion: reduce) {
  .fx-home--bgm .fx-home__bgm, .fx-home--bgm .fx-home__text, .fx-home--bgm .fx-home__text > *,
  .fx-home--bgm .fx-home__note, .fx-home--bgm .fx-btn::after { animation: none; }
}

/* ---------- «Pròximament»: obres que encara no tenen contingut en aquest idioma */
.fx-soon {
  flex: none; align-self: center; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 9px; border-radius: 999px;
  background: rgba(185, 132, 89, .12); border: 1px solid rgba(185, 132, 89, .55);
  color: var(--copper-text); font: 700 10px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
}
.fx-soon::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--copper);
  box-shadow: 0 0 0 0 rgba(185, 132, 89, .6); animation: fx-soon-dot 2s ease-out infinite;
}
@keyframes fx-soon-dot { 0% { box-shadow: 0 0 0 0 rgba(185, 132, 89, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(185, 132, 89, 0); } }
.fx-card__main:has(.fx-soon) .fx-card__title, .fx-sub a:has(.fx-soon) .fx-sub__title { color: var(--taupe-dark); }
.fx-card__main:has(.fx-soon) .fx-frame { opacity: .7; }

.fx-soon-panel {
  display: grid; justify-items: center; gap: 6px; margin: 8px 0 28px; padding: 30px 22px 28px; text-align: center;
  border-radius: 20px; background: linear-gradient(160deg, #fff, var(--paper-2));
  border: 1px solid rgba(74, 18, 32, .12); box-shadow: 0 1px 2px rgba(46, 10, 20, .05), 0 14px 34px rgba(46, 10, 20, .08);
  animation: fx-soon-in .6s cubic-bezier(.2, .7, .2, 1) both;
}
.fx-soon-panel__icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 50%;
  background: var(--burgundy); color: var(--cream); box-shadow: 0 10px 24px rgba(74, 18, 32, .28);
}
.fx-soon-panel__icon .icon { width: 30px; height: 30px; animation: fx-soon-tick 4s ease-in-out infinite; }
.fx-soon-panel__title { margin: 0; font: 400 28px/1.15 var(--serif); color: var(--burgundy); }
.fx-soon-panel__text { margin: 0; max-width: 34ch; font: 400 15px/1.5 var(--sans); color: var(--taupe-dark); }
@keyframes fx-soon-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fx-soon-tick { 0%, 80%, 100% { transform: rotate(0); } 88% { transform: rotate(-12deg); } 94% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .fx-soon::before, .fx-soon-panel, .fx-soon-panel__icon .icon { animation: none; } }

/* ---------- Accés directe al mapa (capçalera, només al mòbil) --------- */
.site-header__map { display: none; }
@media (max-width: 759px) {
  .theme-maqueta .site-header__map {
    display: grid; place-items: center; width: 42px; height: 42px; margin-right: 4px; border-radius: 50%;
    color: var(--burgundy); background: rgba(74, 18, 32, .07); border: 1px solid rgba(74, 18, 32, .14);
    transition: background-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
  }
  .theme-maqueta .site-header__map .icon { width: 22px; height: 22px; }
  .theme-maqueta .site-header__map:hover { background: rgba(74, 18, 32, .12); }
  .theme-maqueta .site-header__map:active { transform: scale(.9); }
  .theme-maqueta .site-header__map:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }
  .theme-maqueta .site-header__map[aria-current="page"] {
    background: var(--burgundy); border-color: var(--burgundy); color: var(--cream); box-shadow: 0 6px 16px rgba(74, 18, 32, .25);
  }
}
