/* Galería: fotografía protagonista, con la paleta de Show Ibarra. */
.gallery-page {
  --gallery-surface: #151212;
  --gallery-line: #44392d;
  --gallery-text: #d8d0c7;
  background: var(--black);
}
.gallery-page main { color: var(--paper); }
.gallery-page main .eyebrow { color: var(--gold); }
.gallery-page main :focus-visible { outline-color: var(--gold); }
.gallery-hero { padding-block: 24px 64px; background: var(--hero); }
.gallery-banner { border: 1px solid var(--gallery-line); border-radius: 18px; overflow: hidden; }
.gallery-banner .hero-photo { aspect-ratio: 885 / 300; }
.gallery-banner .hero-photo img { top: calc(-100% * 67 / 300); }
.gallery-banner .has-original-media img, .gallery-banner .has-remote-media img { top: 0; }
.gallery-hero-copy { padding-top: 28px; }
.gallery-hero h1 { max-width: 900px; font-size: clamp(42px, 5.2vw, 70px); line-height: 1.08; letter-spacing: -1.4px; text-wrap: balance; }
.gallery-hero-copy > p:not(.eyebrow) { max-width: 540px; margin-top: 24px; font-size: 18px; color: var(--gallery-text); }
.gallery-jump-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 24px; }
.gallery-jump-links a { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--paper); font-size: 15px; text-decoration: underline; text-underline-offset: 5px; }
.gallery-jump-links .icon { color: var(--gold); }
.gallery-section { padding-block: 64px; }
.gallery-section h2 { max-width: 790px; font-size: clamp(32px, 3.6vw, 46px); text-wrap: balance; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.gallery-filter { min-height: 44px; padding: 9px 16px; border: 1px solid var(--gallery-line); border-radius: 24px; color: var(--gallery-text); background: transparent; font-size: 14px; line-height: 1.4; transition: border-color .2s, color .2s, background-color .2s; }
.gallery-filter:hover { border-color: var(--gold); color: var(--paper); }
.gallery-filter[aria-pressed="true"] { border-color: var(--red); background: var(--red); color: white; }
.gallery-results { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: baseline; margin-block: 28px 18px; }
.gallery-results p { color: var(--gold); font-size: 14px; }
.gallery-note { color: var(--gallery-text); font-size: 15px; }
.gallery-grid, .gallery-video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.gallery-grid:empty { display: none; }
.gallery-card { min-width: 0; }
.gallery-photo-button, .gallery-video-button { display: block; position: relative; width: 100%; padding: 0; border: 1px solid var(--gallery-line); border-radius: 16px; background: var(--gallery-surface); color: var(--paper); text-align: left; overflow: hidden; }
.gallery-visual { display: block; position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--gallery-surface); }
.gallery-visual > img { width: 100%; height: 100%; object-fit: cover; transition: scale .3s; }
.gallery-visual .photo-frame { position: absolute; top: 0; left: 50%; height: 100%; width: auto; translate: -50% 0; }
.gallery-visual .occasion-photo { max-width: none; }
.gallery-card-caption { display: block; padding: 20px; }
.gallery-card-category { display: block; margin-bottom: 7px; color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .7px; }
.gallery-card-title { display: block; font: 500 24px/1.25 var(--serif); }
.gallery-expand { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--gallery-line); border-radius: 50%; color: var(--paper); background: var(--black); transition: background-color .2s; }
.gallery-photo-button:hover .gallery-expand, .gallery-photo-button:focus-visible .gallery-expand { background: var(--red); }
.gallery-photo-button:hover, .gallery-video-button:hover { border-color: var(--gold); }
.gallery-unavailable { display: none; position: absolute; inset: 0; place-items: center; padding: 24px; text-align: center; color: var(--gallery-text); }
.is-unavailable .gallery-unavailable { display: grid; }
.is-unavailable img { visibility: hidden; }
.gallery-empty { display: grid; justify-items: center; gap: 16px; padding: 48px 28px; border: 1px solid var(--gallery-line); border-radius: 16px; background: var(--gallery-surface); text-align: center; }
.gallery-empty > .icon { width: 36px; height: 36px; color: var(--gold); stroke-width: 1.4; }
.gallery-empty h3 { max-width: 500px; font-size: 26px; }
.gallery-empty p { max-width: 550px; color: var(--gallery-text); font-size: 16px; }
.gallery-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--gold); border-radius: 24px; background: transparent; color: var(--paper); font-size: 14px; font-weight: 500; }
.gallery-secondary:hover { background: var(--gallery-surface); }
.gallery-actions { display: flex; justify-content: center; margin-top: 28px; }
.gallery-actions:has(button[hidden]) { display: none; }
.gallery-secondary:disabled { opacity: .65; cursor: progress; }
.gallery-error { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 20px; padding: 18px; border: 1px solid var(--gallery-line); border-radius: 12px; background: var(--gallery-surface); }
.gallery-error p { flex: 1 1 280px; color: var(--gallery-text); }
.gallery-videos { background: var(--gallery-surface); }
.gallery-section-intro { max-width: 640px; margin-block: 18px 30px; color: var(--gallery-text); font-size: 17px; }
.gallery-video-visual { display: grid; place-items: center; position: relative; aspect-ratio: 4 / 3; background: var(--hero); }
.gallery-video-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-play { z-index: 1; display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--gold); border-radius: 50%; background: var(--burgundy); color: var(--paper); }
.gallery-play .icon { width: 23px; height: 23px; }
.gallery-video-button:hover .gallery-play { background: var(--red); }
.gallery-recorded { border-top: 1px solid var(--gallery-line); }
.gallery-reviews .testimonials-grid { margin-top: 28px; }
.gallery-reviews .testimonial-card { border-color: var(--gallery-line); background: var(--gallery-surface); }
.gallery-reviews .testimonial-card blockquote { color: var(--paper); }
.gallery-reviews .testimonial-card figcaption { color: var(--gold); }
.gallery-closing { padding-block: 64px; background: var(--burgundy); }
.gallery-closing-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; }
.gallery-closing h2 { max-width: 780px; font-size: clamp(34px, 3.6vw, 48px); text-wrap: balance; }
.gallery-closing p:not(.eyebrow) { max-width: 620px; margin-top: 20px; color: var(--paper); }
.gallery-closing-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.gallery-closing .button { background: var(--paper); color: var(--burgundy); white-space: nowrap; }
.gallery-closing .button:hover { background: var(--sand); }

/* El visor usa dialog nativo: teclado, Escape y retorno del foco al cerrar. */
html { scrollbar-gutter: stable; }
html.media-viewer-open { overflow: hidden; }
.media-viewer { position: fixed; width: min(1100px, calc(100% - 32px)); max-height: calc(100svh - 32px); padding: 24px; border: 1px solid var(--gallery-line); border-radius: 18px; color: var(--paper); background: var(--black); overflow: auto; }
.media-viewer::backdrop { background: rgb(0 0 0 / 88%); }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.viewer-counter { color: var(--gallery-text); font-size: 14px; }
.viewer-controls { display: flex; gap: 10px; }
.viewer-controls button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--gallery-line); border-radius: 50%; background: var(--gallery-surface); color: var(--paper); }
.viewer-controls button:hover { border-color: var(--gold); }
.viewer-previous .icon { rotate: 180deg; }
.viewer-media { display: grid; place-items: center; min-height: 120px; }
.viewer-media > .photo-frame { display: block; }
.viewer-media > img, .viewer-media video { max-width: 100%; max-height: calc(100svh - 250px); object-fit: contain; }
.viewer-media > .hero-photo { width: min(100%, calc((100svh - 250px) * 885 / 367)); }
.viewer-media > .occasion-photo { width: min(100%, calc((100svh - 250px) * 299 / 341)); max-width: none; }
.viewer-caption { margin-top: 20px; }
.viewer-caption h2 { font-size: 27px; letter-spacing: -.4px; }
.viewer-caption p { max-width: 750px; margin-top: 8px; color: var(--gallery-text); font-size: 15px; }
.gallery-page [hidden] { display: none !important; }

@media (hover: hover) and (pointer: fine) {
  .gallery-photo-button:hover .gallery-visual > img { scale: 1.035; }
}
@media (max-width: 900px) {
  .gallery-closing-layout { grid-template-columns: 1fr; gap: 28px; }
  .gallery-closing-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
}
@media (max-width: 600px) {
  .gallery-hero { padding-block: 20px 40px; }
  .gallery-banner { border-radius: 12px; }
  .gallery-banner .hero-photo { aspect-ratio: 885 / 367; }
  .gallery-banner .hero-photo img { top: calc(-100% * 67 / 367); }
  .gallery-banner .has-original-media img, .gallery-banner .has-remote-media img { top: 0; }
  .gallery-hero h1 { font-size: clamp(39px, 10vw, 54px); letter-spacing: -.8px; }
  .gallery-hero-copy > p:not(.eyebrow) { font-size: 16px; margin-top: 20px; }
  .gallery-section { padding-block: 44px; }
  .gallery-section h2 { font-size: 32px; }
  .gallery-filters { gap: 8px; margin-top: 24px; }
  .gallery-filter { padding-inline: 13px; font-size: 13px; }
  .gallery-grid, .gallery-video-grid { gap: 18px; }
  .gallery-card-caption { padding: 18px; }
  .gallery-card-title { font-size: 24px; }
  .gallery-section-intro { font-size: 16px; }
  .gallery-empty { padding: 32px 20px; }
  .gallery-closing { padding-block: 44px; }
  .media-viewer { padding: 16px; }
  .viewer-media > img, .viewer-media video { max-height: calc(100svh - 270px); }
  .viewer-media > .hero-photo { width: min(100%, calc((100svh - 270px) * 885 / 367)); }
  .viewer-media > .occasion-photo { width: min(100%, calc((100svh - 270px) * 299 / 341)); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-photo-button:hover .gallery-visual > img { scale: none; }
}
