:root {
  --brand-surface: rgba(10, 10, 12, 0.72);
  --brand-surface-strong: rgba(8, 8, 10, 0.9);
  --brand-text: #ffffff;
  --progress-height: 5px;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--brand-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.exhibition-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
}

.media-stage,
.media-item,
.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
}

.media-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 700ms ease;
}

.media-item.active { opacity: 1; }

.media-item img,
.media-item video {
  object-fit: cover;
  display: block;
}

.media-overlay-qr {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  width: min(45vw, 45dvh);
  padding: 12px;
  background: #fff;
  border: 4px solid #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  transform: translate(-50%, -50%);
}

.media-overlay-qr img,
.media-overlay-qr canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
}

.media-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.45) 0%, rgba(0,0,0,.05) 35%, rgba(0,0,0,.1) 65%, rgba(0,0,0,.65) 100%);
  pointer-events: none;
}

.media-caption {
  position: absolute;
  left: clamp(1.5rem, 4vw, 4rem);
  bottom: calc(var(--footer-height, 7rem) + clamp(1rem, 3vh, 2rem));
  z-index: 3;
  max-width: min(760px, 75vw);
  max-height: calc(100dvh - var(--footer-height, 7rem) - clamp(7rem, 18vh, 10rem));
  text-shadow: 0 2px 14px rgba(0,0,0,.65);
}

.media-caption h2 {
  font-size: clamp(2rem, min(5vw, 7vh), 3.5rem);
  line-height: 1.08;
}

.media-caption p {
  font-size: clamp(1rem, min(2.2vw, 3.5vh), 1.5rem) !important;
  line-height: 1.35;
}

.text-fade {
  opacity: 1;
  visibility: visible;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.text-fade.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.top-overlay { z-index: 4; pointer-events: none; }

.sound-toggle {
  position: fixed;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  z-index: 7;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(8, 8, 10, .68);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: opacity 250ms ease, visibility 250ms ease, background-color 250ms ease;
}

.sound-toggle.is-visible,
.sound-toggle:focus-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  background: rgba(8, 8, 10, .9);
  outline: 2px solid rgba(255, 255, 255, .8);
  outline-offset: 3px;
}

.sound-icon {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-icon-on,
.sound-toggle.sound-enabled .sound-icon-muted { display: none; }

.sound-toggle.sound-enabled .sound-icon-on { display: block; }

.bottom-bar {
  z-index: 5;
  background: var(--brand-surface-strong);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.12);
  transition: background-color 300ms ease, border-color 300ms ease;
}

.footer-info-hidden .bottom-bar {
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
  border-top-color: transparent;
}

.footer-info-hidden .bottom-bar .container-fluid {
  padding-top: 0 !important;
  padding-bottom: calc(.75rem + env(safe-area-inset-bottom)) !important;
}

.footer-info-hidden .bottom-bar .row {
  display: flex;
  justify-content: flex-end;
}

.footer-info-hidden .qr-column {
  width: auto;
  pointer-events: auto;
}

.footer-info-hidden .media-caption {
  right: clamp(7.5rem, 12vw, 9rem);
  bottom: clamp(1.5rem, 4vh, 3rem);
  max-width: min(760px, calc(100vw - 11rem));
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  /* padding: 6px;
  background: rgba(255,255,255,.95); */
  border-radius: 12px;
}

.footer-contacts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}

.footer-contact:hover {
  color: var(--brand-text);
  text-decoration: underline;
}

.footer-contact-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  object-fit: contain;
}

.qr-code {
  display: inline-block;
  padding: 6px;
  background: #fff;
  border-radius: 8px;
  line-height: 0;
}

.qr-code img,
.qr-code canvas {
  display: block;
  width: 144px;
  height: 144px;
}

.slide-progress {
  z-index: 6;
  bottom: 0;
  height: var(--progress-height);
  background: rgba(255,255,255,.12);
}

.slide-progress .progress-bar {
  transition: none;
  background: rgba(255,255,255,.9);
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 3rem;
  text-align: center;
  background: radial-gradient(circle at center, #282828 0%, #050505 75%);
}

.t-branco {
  color: var(--brand-text);
  text-decoration: none;  
}

@media (max-width: 767.98px) {
  .top-overlay { padding: 1.25rem !important; }
  .top-overlay h1 { font-size: 2rem; }
  .media-caption {
    right: 1.25rem;
    bottom: calc(var(--footer-height, 7rem) + 1rem);
    left: 1.25rem;
    max-width: none;
    overflow-wrap: anywhere;
  }

  .media-caption h2 { font-size: clamp(1.75rem, 8vw, 2.25rem); }
  .media-caption p { font-size: clamp(1rem, 4.5vw, 1.25rem) !important; }
  .bottom-bar { font-size: .92rem; }

  .footer-info-hidden .media-caption {
    right: 6.75rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    max-width: none;
  }

  .bottom-bar .container-fluid {
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)) !important;
  }

  .bottom-bar .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    margin: 0;
  }

  .bottom-bar .row > div:first-child {
    display: none;
  }

  .bottom-bar .col-12 {
    width: auto;
    padding: 0;
  }

  .bottom-bar .col-12:nth-child(2) {
    min-width: 0;
    text-align: left;
  }

  .footer-contacts {
    align-items: flex-start;
    flex-direction: column;
    gap: .35rem;
  }

  .footer-info-hidden .bottom-bar .row {
    display: flex;
  }

  .qr-code img,
  .qr-code canvas {
    width: 120px;
    height: 120px;
  }
}

@media (max-height: 500px) {
  .top-overlay {
    padding: .75rem 1rem !important;
  }

  .top-overlay h1 {
    font-size: 1.5rem;
  }

  .top-overlay p {
    font-size: .9rem;
  }

  .media-caption {
    top: auto;
    right: 7.5rem;
    bottom: calc(var(--footer-height, 7rem) + .75rem);
    left: 1rem;
    max-width: min(760px, calc(100vw - 9.5rem));
    max-height: calc(100dvh - var(--footer-height, 7rem) - 5rem);
  }

  .footer-info-hidden .media-caption {
    top: auto;
    right: 7.5rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    left: 1rem;
    max-width: min(760px, calc(100vw - 9.5rem));
    max-height: calc(100dvh - 6rem);
  }

  .media-caption h2 {
    font-size: clamp(1.35rem, 5.5vh, 2rem);
    margin-bottom: .35rem !important;
  }

  .media-caption p {
    font-size: clamp(.85rem, 3.8vh, 1.1rem) !important;
    line-height: 1.25;
  }
}

@media (max-width: 359.98px) {
  .bottom-bar .container-fluid { padding-inline: .75rem !important; }
  .qr-code { padding: 5px; }

  .qr-code img,
  .qr-code canvas {
    width: 104px;
    height: 104px;
  }
}
