/* El rincón de la fama: pared de cuadros con marco (dorado, madera o plata), cartela de latón y ficha.
   Los marcos son CSS y SVG propios: no se carga nada de fuera. Se usa también en la vista previa del panel. */

/* ---------- Pared ---------- */
/* Portada: la pared real del Patio (fotos firmadas y dedicatorias), oscurecida para que se lea el texto */
.fama-portada { position: relative; isolation: isolate; overflow: hidden; min-height: min(78vh, 680px); display: grid; align-content: center;
  padding: 9rem 0 5.5rem; background: var(--pi-oscuro); }
.fama-portada__foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; z-index: -2;
  filter: sepia(.3) saturate(.85) contrast(1.05); animation: fama-lento 30s ease-out both; }
.fama-portada::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 55%, rgba(36,27,20,.55), rgba(36,27,20,.82) 75%),
              linear-gradient(rgba(36,27,20,.75), transparent 30%, transparent 70%, var(--pi-oscuro)); }
.fama-portada .fama-cab { margin-bottom: 0; }
.fama-portada h1, .fama-portada p { text-shadow: 0 2px 14px rgba(0,0,0,.75); }
.fama-portada .antetitulo { color: #e6cf9f; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 18px rgba(0,0,0,.8); }
.fama-portada__pie { position: absolute; right: 1.2rem; bottom: 1rem; margin: 0; font-family: var(--pi-font-titulos); font-style: italic; font-size: .85rem; color: rgba(214,191,159,.75); }
@keyframes fama-lento { from { transform: scale(1.08); } to { transform: scale(1); } }
.fama-pared { position: relative; padding: 4rem 0 5rem; }
.fama-cab { text-align: center; max-width: 720px; margin: 0 auto 3.5rem; }
.fama-cab h1 { color: var(--pi-crema); margin: .3rem 0 .8rem; }
.fama-cab p:not(.antetitulo) { color: var(--pi-arena); font-size: 1.1rem; margin-inline: auto; }
.fama-cab__filete { display: block; width: 120px; height: 2px; margin: 1.4rem auto 0; background: linear-gradient(90deg, transparent, var(--pi-dorado), transparent); }
.fama-vacio { text-align: center; color: var(--pi-arena); font-family: var(--pi-font-titulos); font-style: italic; font-size: 1.3rem; }
.fama-galeria { display: grid; gap: 3.4rem 2.6rem; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 380px)); justify-content: center; align-items: start; }

/* ---------- Cuadro ---------- */
.cuadro { position: relative; padding-top: 26px; max-width: 420px; margin-inline: auto; width: 100%; }
.cuadro::before { content: ""; position: absolute; left: 50%; top: 0; width: 64px; height: 10px; transform: translateX(-50%);
  border-radius: 0 0 8px 8px; background: linear-gradient(#3a3a3a, #111); box-shadow: 0 2px 3px rgba(0,0,0,.5); z-index: 2; }
.cuadro::after { content: ""; position: absolute; left: 10%; right: 10%; top: 8px; height: 170px; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at 50% 0, rgba(255,236,190,.26), transparent 70%); }
.marco { position: relative; padding: 22px 22px 0; border-radius: 3px; color: #2b1d0c;
  box-shadow: 0 18px 30px rgba(0,0,0,.55), 0 4px 8px rgba(0,0,0,.4); transition: transform .3s; }
.cuadro:hover .marco { transform: translateY(-3px) rotate(-.3deg); }
.marco::before { content: ""; position: absolute; inset: 0; border-radius: 3px; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25), inset 0 0 0 5px rgba(0,0,0,.25), inset 0 0 0 9px rgba(255,255,255,.12), inset 0 0 18px rgba(0,0,0,.45); }
.paspartu { position: relative; padding: 12px; background: #efe6d4; box-shadow: inset 0 2px 6px rgba(0,0,0,.45); }
.lienzo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #111; }
.lienzo img, .lienzo video, .lienzo iframe { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
.lienzo video { object-fit: contain; background: #000; }
.lienzo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, rgba(255,255,255,.10), transparent 35%); }
.lienzo.is-reproduciendo::after { display: none; }
.lienzo__vacio { position: absolute; inset: 0; display: grid; place-content: center; gap: .4rem; justify-items: center; color: #b9a98f; font-family: var(--pi-font-etiquetas); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.lienzo__vacio .ico { width: 2rem; height: 2rem; }
.lienzo__play { position: absolute; inset: 0; margin: auto; width: 74px; height: 74px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85);
  background: rgba(42,33,25,.55); color: #fff; cursor: pointer; display: grid; place-items: center; z-index: 2; backdrop-filter: blur(2px); transition: transform .2s, background .2s; }
.lienzo__play:hover { transform: scale(1.08); background: rgba(171,145,104,.8); }
.lienzo__play .ico { width: 30px; height: 30px; margin-left: 4px; }
.sello { position: absolute; left: 10px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: .35rem; font-family: var(--pi-font-etiquetas); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; background: rgba(42,33,25,.78); color: #f5f0e8; padding: .3rem .55rem; border-radius: 2px; text-decoration: none; }
.sello .ico { width: 1em; height: 1em; }
.sello--enlace:hover { background: var(--pi-dorado); color: var(--pi-oscuro); }

/* Esquinas ornamentales (dorado y madera) */
.esq { position: absolute; width: 46px; height: 46px; z-index: 2; pointer-events: none; background: no-repeat center / contain; }
.esq.a { top: -6px; left: -6px; } .esq.b { top: -6px; right: -6px; transform: scaleX(-1); }
.esq.c { bottom: -6px; left: -6px; transform: scaleY(-1); } .esq.d { bottom: -6px; right: -6px; transform: scale(-1); }

/* Pie del marco con la cartela de latón */
.pie { padding: 16px 6px 18px; text-align: center; }
.cartela { position: relative; display: block; margin: 0 auto; max-width: 92%; padding: .7rem 1.2rem .75rem; border-radius: 3px; color: #2b1d0c;
  text-shadow: 0 1px 0 rgba(255,255,255,.35); background: linear-gradient(160deg, #8a6a2a, #e9d18a 22%, #c7a24f 48%, #f3e0a2 66%, #a8822f 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.25); }
.cartela::before, .cartela::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d0, #6b5120); box-shadow: 0 1px 1px rgba(0,0,0,.4); }
.cartela::before { left: 7px; } .cartela::after { right: 7px; }
.cartela b { display: block; font-family: var(--pi-font-titulos); font-size: 1.25rem; line-height: 1.2; }
.cartela i { display: block; font-family: var(--pi-font-etiquetas); font-style: normal; text-transform: uppercase; letter-spacing: .09em; font-size: .72rem; margin-top: .3rem; }
.cartela span { display: block; font-family: var(--pi-font-titulos); font-style: italic; font-size: .95rem; margin-top: .35rem; line-height: 1.35; }
.leer { margin-top: .9rem; display: inline-block; font-family: var(--pi-font-etiquetas); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem;
  color: var(--pi-arena); border: 1px solid rgba(214,191,159,.5); padding: .5rem 1rem; border-radius: 2px; text-decoration: none; transition: background .2s, color .2s; }
.leer:hover { background: rgba(214,191,159,.14); color: #fff; }

/* Marco 1 · Dorado barroco */
.cuadro--dorado .marco { padding: 26px 26px 0; background:
  repeating-linear-gradient(45deg, rgba(0,0,0,.06) 0 2px, transparent 2px 5px),
  linear-gradient(135deg, #6e5018, #e6c96f 18%, #9c7628 36%, #f4dc92 52%, #8a6420 70%, #d8b252 86%, #6e5018); }
.cuadro--dorado .paspartu { box-shadow: inset 0 2px 6px rgba(0,0,0,.45), 0 0 0 3px #5e4313, 0 0 0 6px #e8cd7c, 0 0 0 8px #6e5018; }
.cuadro--dorado .esq { width: 64px; height: 64px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff1b8'/%3E%3Cstop offset='.5' stop-color='%23c9a14a'/%3E%3Cstop offset='1' stop-color='%236b4c14'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' stroke='%235a3f10' stroke-width='1' d='M4 4h22c-3 4-9 5-12 4 3 4 2 9-2 12 0-6-4-9-8-8 2-3 1-6 0-8zM4 4c10 2 16 8 18 18-5-1-8-4-9-9-1 5-4 7-9 7 4-4 4-10 0-16z'/%3E%3Ccircle cx='9' cy='9' r='3.2' fill='%23fff1b8' stroke='%235a3f10'/%3E%3C/svg%3E"); }
.cuadro--dorado .esq.a { top: -10px; left: -10px; } .cuadro--dorado .esq.b { top: -10px; right: -10px; }
.cuadro--dorado .esq.c { bottom: -10px; left: -10px; } .cuadro--dorado .esq.d { bottom: -10px; right: -10px; }
.cuadro--dorado .leer { color: #3a2608; border-color: rgba(58,38,8,.55); background: rgba(255,245,210,.25); }
.cuadro--dorado .leer:hover { background: rgba(58,38,8,.85); color: #f5e6b8; }

/* Marco 2 · Madera noble con filete dorado */
.cuadro--madera .marco { background:
  repeating-linear-gradient(92deg, rgba(255,255,255,.035) 0 3px, transparent 3px 9px, rgba(0,0,0,.08) 9px 11px, transparent 11px 17px),
  linear-gradient(135deg, #3b2414, #6a4126 30%, #4a2c18 55%, #7a4c2c 75%, #3b2414); }
.cuadro--madera .paspartu { outline: 4px solid #c9a457; box-shadow: inset 0 2px 6px rgba(0,0,0,.45), 0 0 0 5px #5a3a1e; }
.cuadro--madera .esq { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath fill='%23c9a457' stroke='%23704f1c' d='M8 8l14 0-4 4h-6v6l-4 4z'/%3E%3C/svg%3E"); }
.cuadro--madera .cartela { background: linear-gradient(160deg, #7a5d26, #d7bd78 30%, #b8954a 60%, #e5cf90 80%, #8f6e30); }

/* Marco 3 · Ébano y plata */
.cuadro--plata .marco { padding: 20px 20px 0; background: linear-gradient(135deg, #0d0b0a, #2a2522 40%, #141110 60%, #2e2926); }
.cuadro--plata .marco::before { box-shadow: inset 0 0 0 3px #b9bcc0, inset 0 0 0 5px #4b4d50, inset 0 0 0 7px #d9dcdf, inset 0 0 18px rgba(0,0,0,.6); }
.cuadro--plata .paspartu { background: #f3f1ec; }
.cuadro--plata .cartela { color: #1b1d20; background: linear-gradient(160deg, #7d8186, #eef0f2 25%, #aeb2b7 50%, #f6f7f8 70%, #8c9095); }
.cuadro--plata .cartela::before, .cuadro--plata .cartela::after { background: radial-gradient(circle at 35% 35%, #fff, #555); }

/* Aparición al bajar: más suave que el resto de bloques */
.cuadro.revelar { transition-duration: .8s; }

/* ---------- Fichas: sin JavaScript se leen debajo; con JavaScript se abren encima ---------- */
.fama-ficha { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 2.5rem; padding-block: 2.5rem; border-bottom: 1px solid var(--pi-borde); scroll-margin-top: 6rem; }
.fama-ficha__foto img { width: 100%; height: auto; border-radius: var(--pi-radio); display: block; box-shadow: var(--pi-sombra); }
.fama-ficha h2 { margin: .1rem 0 .3rem; }
.fama-ficha__quien { font-family: var(--pi-font-titulos); font-style: italic; color: var(--pi-texto-suave); margin-bottom: 1.2rem; }
.fama-ficha .texto-largo { font-size: 1.05rem; margin-bottom: 1.5rem; }
.fama-ficha__video { width: 100%; margin: 0 0 1.5rem; border-radius: var(--pi-radio); background: #000; }
video.fama-ficha__video { display: block; max-height: 60vh; }
.fama-ficha__galeria { columns: 4 90px; column-gap: .5rem; margin-bottom: 1.5rem; }
.fama-ficha__galeria a { margin-bottom: .5rem; }
.fama-ficha__enlaces { display: flex; flex-wrap: wrap; gap: .6rem; }

.js .fama-fichas { display: none; }
.fama-capa { position: fixed; inset: 0; z-index: 150; background: rgba(20,15,11,.85); display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.fama-capa[hidden] { display: none; }
.fama-capa__caja { position: relative; width: min(960px, 100%); max-height: calc(100dvh - 2rem); overflow-y: auto; background: var(--pi-crema); color: var(--pi-texto);
  border-radius: var(--pi-radio); box-shadow: 0 24px 70px rgba(0,0,0,.6); animation: fama-entra .25s ease-out; }
.fama-capa .fama-ficha { padding: 0; border: 0; gap: 0; }
.fama-capa .fama-ficha__foto { background: var(--pi-oscuro) url("../img/patron-azulejo.svg") center / 120px; border-radius: var(--pi-radio) 0 0 var(--pi-radio); padding: 1.5rem; display: flex; align-items: flex-start; justify-content: center; }
.fama-capa .fama-ficha__foto picture { width: 100%; }
.fama-capa .fama-ficha__foto img { position: sticky; top: 1.5rem; width: 100%; height: auto; max-height: calc(100dvh - 5rem); object-fit: contain; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.fama-capa .fama-ficha__texto { padding: 2rem 2rem 1.8rem; }
.fama-capa__cerrar { position: sticky; float: right; top: .6rem; margin: .6rem .6rem -3rem 0; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--pi-oscuro); color: var(--pi-crema); cursor: pointer; display: grid; place-items: center; }
.fama-capa__cerrar .ico { width: 18px; height: 18px; }
@keyframes fama-entra { from { opacity: 0; transform: translateY(12px) scale(.98); } }

@media (max-width: 760px) {
  .fama-portada { padding: 7.5rem 0 4.5rem; min-height: 0; }
  .fama-portada__pie { left: 1rem; text-align: center; }
  .fama-ficha { grid-template-columns: 1fr; gap: 1.5rem; }
  .fama-capa { padding: .5rem; }
  .fama-capa .fama-ficha__foto { border-radius: var(--pi-radio) var(--pi-radio) 0 0; padding: 1rem; }
  .fama-capa .fama-ficha__foto img { max-height: 55vh; width: auto; max-width: 100%; }
  .fama-capa .fama-ficha__texto { padding: 1.4rem 1.3rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .fama-portada__foto { animation: none; } .cuadro:hover .marco { transform: none; } .fama-capa__caja { animation: none; } }
.cuadro--plata .esq { display: none; }
