/* Painel lateral de detalhe do projeto */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 20;
  width: var(--panel-w);
  max-width: 100vw;
  background: var(--paper);
  border-left: 2px dotted var(--rule);
  box-shadow: -1.1vmin 0 0 var(--edge-cream), -1.7vmin 0 0 var(--edge-red), var(--shadow);
  transform: translateX(calc(100% + 3vmin));
  transition: transform .55s var(--ease);
  display: flex; flex-direction: column;
}
.panel.is-open { transform: none; }
.panel-close {
  align-self: flex-end;
  min-height: var(--touch); padding: 0 1.2em;
  font-size: var(--s-1);
}
.panel-close:hover { color: var(--accent); }
.panel-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 clamp(20px, 2.2vw, 80px) clamp(40px, 5vh, 140px);
  -webkit-overflow-scrolling: touch;
}

.panel-id { margin: 0 0 .6em; font-size: var(--s-2); color: var(--muted); }
.panel-alias { opacity: .8; }
/* ligação única do projeto (?prj=…) */
.panel-share {
  margin-left: .8em; padding: .15em .7em;
  font-family: var(--mono); font-size: inherit; text-transform: lowercase; color: var(--muted);
  border: 1px dotted var(--rule); border-radius: 999px;
}
.panel-share:hover, .panel-share:focus-visible { color: var(--accent); border-color: var(--accent); }
/* «ver entrada completa» (site do MDGPE ou do autor) */
.panel-link { margin: 1.1em 0 0; font-family: var(--mono); font-size: var(--s-1); text-transform: lowercase; }
.panel-link a {
  display: inline-flex; align-items: center; gap: .45em; min-height: calc(var(--touch) * .8); padding: 0 1em;
  border: 1px solid var(--ink); color: var(--ink); text-decoration: none;
  box-shadow: .25em .25em 0 var(--edge-cream);
}
.panel-link a:hover, .panel-link a:focus-visible { border-color: var(--accent); color: var(--accent); }
.panel-link--kiosk { color: var(--muted); }
.panel-link--kiosk span { color: var(--ink); text-transform: none; }
/* QR code da ligação única (no fundo do painel); sempre preto sobre branco para ler bem */
.panel-qr { margin-top: 2.2em; }
.qr-card { display: flex; align-items: center; gap: 1.1em; margin: 0; }
.qr-card img {
  flex: none; width: clamp(110px, 8vw, 240px); height: auto;
  background: #fff; image-rendering: pixelated;
  outline: 1px solid var(--rule); box-shadow: .3em .3em 0 var(--edge-cream);
}
.qr-card figcaption { font-family: var(--mono); font-size: var(--s-2); color: var(--muted); text-transform: lowercase; }
.qr-url { display: block; margin-top: .5em; color: var(--ink); text-transform: none; overflow-wrap: anywhere; }
.panel-title {
  margin: 0;
  font-family: var(--serif); font-weight: 500;
  font-size: var(--s2); line-height: 1.12;
  text-transform: uppercase; letter-spacing: .06em;
  hyphens: manual; overflow-wrap: break-word;
}
.panel-subtitle { margin: .4em 0 0; font-family: var(--serif); font-style: italic; font-size: var(--s1); line-height: 1.3; }
.panel-authors { margin: .7em 0 0; font-size: var(--s-1); text-transform: lowercase; }

.panel-media { margin: 1.4em 0 1.6em; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(90px, 8vw, 300px), 1fr)); gap: .5em; }
.thumb {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--paper-deep);
  outline: 1px solid var(--rule);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover, .thumb:focus-visible { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--accent); }
.thumb--video .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: var(--s2); color: var(--paper); text-shadow: 0 0 8px rgba(0,0,0,.6);
}
.no-media {
  aspect-ratio: 3 / 1; display: grid; place-items: center;
  border: 2px dotted var(--rule); color: var(--muted); font-size: var(--s-1);
}

.section-label, .meta-label {
  margin: 0 0 .7em;
  font-size: var(--s-2); font-weight: 500; color: var(--muted);
  display: flex; align-items: center; gap: .6em;
}
.section-label::after { content: ""; flex: 1; border-top: 1px dotted var(--rule); }

.panel-synopsis { margin-bottom: 1.8em; }
.panel-synopsis .prose { font-size: 1.2em; line-height: 1.65em; }

.panel-meta { display: grid; gap: 1.05em; margin-bottom: 2em; }
.meta-group { display: grid; gap: .1em; }
.pills { display: flex; flex-wrap: wrap; gap: .45em; }
.pill {
  display: inline-flex; align-items: center; gap: .55em;
  min-height: calc(var(--touch) * .82);
  padding: .25em .85em;
  font-size: var(--s-1);
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  transition: background-color .2s, color .2s, border-color .2s;
}
.pill-n { font-size: .78em; color: var(--muted); }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.is-active { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.pill.is-active .pill-n { color: inherit; opacity: .8; }
.pill--tag { border-style: dotted; }
.pill--teacher { border-style: dashed; }
/* arquivo material */
.pill--paper, .pill--weight { border-style: dashed; }
.pill--producer { border-style: double; border-width: 3px; }
.pill--reference, .pill--work { border-style: dotted; }
.pill--typeface, .pill--reference { text-transform: none; }
.pill--work { text-transform: none; font-family: var(--serif); font-style: italic; font-size: calc(var(--s-1) * 1.15); }
.pill-role { color: var(--muted); font-size: .85em; }
.pill-role::before { content: "· "; }
.pill-q { color: var(--accent); font-weight: 600; margin-left: -.25em; }
.pill.is-active .pill-role, .pill.is-active .pill-q { color: inherit; }
.meta-note { margin: .35em 0 0; font-size: var(--s-2); color: var(--muted); }
.panel-meta--material .section-label { margin-top: -.6em; }

.panel-tech dl { margin: 0; display: grid; gap: .9em; }
.tech-row { display: grid; grid-template-columns: minmax(7em, 30%) 1fr; gap: 1em; }
.tech-row dt { font-size: var(--s-2); color: var(--muted); text-transform: lowercase; padding-top: .3em; }
.tech-row dd { margin: 0; font-family: var(--serif); font-size: var(--s0); line-height: 1.45; }
.tech-row dd p { margin: 0 0 .35em; }
.tech-note { display: block; color: var(--muted); font-size: .9em; }

@media (max-width: 720px) {
  .panel { width: 100vw; box-shadow: none; }
  .tech-row { grid-template-columns: 1fr; gap: .2em; }
}
