/* Visualizador de projetos — compartilhado pela home e pela página de cases. */
#case-panel {
  --case-panel-gap: clamp(12px, 3vw, 40px);
  display: grid;
  place-items: center;
  z-index: 10000;
  padding: var(--case-panel-gap);
  background: rgba(4, 4, 5, .91);
  backdrop-filter: blur(20px);
}
#case-panel.active { transition: opacity .3s ease; }
#case-panel .case-panel-shell {
  display: flex;
  flex-direction: column;
  position: relative;
  width: min(1440px, 100%);
  height: min(850px, calc(100dvh - 2 * var(--case-panel-gap)));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff20;
  border-radius: 10px;
  background: #101011;
  box-shadow: 0 40px 120px #000b;
  text-align: left;
}
#case-panel .case-panel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
  height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid #ffffff12;
  background: #141415;
}
#case-panel .case-panel-close {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: auto;
  height: 44px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d7d5d0;
  font: 500 14px / 1 system-ui, sans-serif;
  letter-spacing: .02em;
  text-transform: none;
}
#case-panel .case-panel-logo { position: static; width: 154px; height: auto; opacity: .8; object-fit: contain; }
#case-panel .case-panel-layout { display: grid; grid-template-columns: 57% 43%; flex: 1; min-height: 0; }
#case-panel .case-panel-media { display: flex; flex-direction: column; gap: 0; padding: 24px; min-width: 0; min-height: 0; background: #09090a; }
#case-panel .case-cover {
  display: block;
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #19191b;
  overflow: hidden;
  cursor: zoom-in;
}
#case-panel .case-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#case-panel .case-expand { position: absolute; bottom: 16px; right: 16px; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 4px; background: #111113ce; backdrop-filter: blur(12px); color: #fff; font: 500 13px / 1.2 system-ui, sans-serif; }
#case-panel .case-gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 12px; }
#case-panel .case-gallery-caption { display: flex; flex-wrap: wrap; gap: 12px; color: #bcbcc3; font: 400 13px / 1.5 system-ui, sans-serif; }
#case-panel #case-photo-count { color: #797980; font-variant-numeric: tabular-nums; }
#case-panel .case-gallery-arrows { display: flex; gap: 8px; }
#case-panel .case-gallery-arrows button { width: 40px; height: 36px; border: 1px solid #ffffff26; border-radius: 3px; background: none; color: var(--white); font: 400 20px / 1 system-ui; cursor: pointer; }
#case-panel .case-grid { display: flex; gap: 10px; overflow-x: auto; padding: 0 0 8px; flex-shrink: 0; scrollbar-width: thin; scrollbar-color: #3c3c40 transparent; overscroll-behavior-x: contain; }
#case-panel .case-photo { position: relative; display: block; flex: 0 0 calc((100% - 40px) / 5); min-width: 68px; padding: 0; border: 2px solid transparent; border-radius: 3px; background: #202023; overflow: hidden; cursor: pointer; opacity: .5; transition: opacity .2s, border-color .2s; }
#case-panel .case-photo[aria-pressed="true"] { border-color: var(--brand); opacity: 1; }
#case-panel .case-photo img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 0; border-radius: 0; transform: none; }
#case-panel .case-panel-details { padding: clamp(28px, 3vw, 44px); overflow-y: auto; min-width: 0; scrollbar-width: thin; scrollbar-color: #414146 transparent; border-left: 1px solid #ffffff12; }
#case-panel .case-panel-header { margin: 0; padding: 0; }
#case-panel #case-kicker { display: flex; align-items: baseline; gap: 10px; color: var(--brand); font: 500 11px / 1.65 system-ui, sans-serif; letter-spacing: .13em; text-transform: uppercase; margin: 0 0 22px; }
#case-panel #case-kicker::before { content: ''; width: 20px; height: 1px; background: var(--brand); flex-shrink: 0; align-self: center; }
#case-panel #case-title { max-width: 100%; font-family: var(--font-display); font-size: clamp(28px, 2.65vw, 38px) !important; font-weight: 400; line-height: 1.13; letter-spacing: -.025em; margin: 0 0 20px !important; color: var(--white); }
#case-panel #case-description { margin: 0; color: #99999f; font: 400 15px / 1.7 system-ui, sans-serif; }
#case-panel .case-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 26px 0; margin: 28px 0 0; border-block: 1px solid #ffffff16; }
#case-panel .case-highlights[hidden] { display: none; }
#case-panel .case-highlight { min-width: 0; }
#case-panel .case-highlight strong { display: block; margin-bottom: 8px; color: var(--white); font: 400 clamp(22px, 2.4vw, 32px) / 1.1 var(--font-display); white-space: nowrap; }
#case-panel .case-highlight span { display: block; font: 400 12px / 1.5 system-ui, sans-serif; color: #99999f; }
#case-panel .case-panel-story { padding: 28px 0 0; }
#case-panel .case-section-title { margin: 0 0 14px; color: #e6e4df; font: 600 13px / 1.5 system-ui, sans-serif; }
#case-panel #case-body { margin: 0; color: #a9a9b0; font: 400 15px / 1.8 system-ui, sans-serif; }
#case-panel #case-body p:not(:first-child) { margin-top: 16px; }
#case-panel #case-body > br { display: none; }
#case-panel #case-body ul { margin: 18px 0; padding-left: 20px; }
#case-panel button:focus-visible, #case-panel [tabindex]:focus-visible, #case-carousel-overlay button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#case-carousel-overlay { z-index: 10001; visibility: hidden; }
#case-carousel-overlay.active { visibility: visible; }
#case-carousel-overlay .carousel-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: var(--white); padding: 10px 18px; border: 1px solid #ffffff24; border-radius: 30px; background: #111113e6; font: 500 14px / 1.3 system-ui, sans-serif; }
@media (hover: hover) {
  #case-panel .case-photo:hover { opacity: 1; }
  #case-panel .case-panel-close:hover { color: var(--brand); transform: none; }
  #case-panel .case-gallery-arrows button:hover { border-color: var(--brand); color: var(--brand); }
}
@media (min-width: 761px) and (max-height: 600px) {
  #case-panel { --case-panel-gap: 12px; }
  #case-panel .case-panel-topbar { height: 56px; }
  #case-panel .case-panel-media { padding: 16px; }
  #case-panel .case-grid { max-height: 70px; }
}
@media (max-width: 760px) {
  #case-panel { --case-panel-gap: 0px; padding: 0; display: block; }
  #case-panel .case-panel-shell { min-height: 100dvh; height: auto; border: 0; border-radius: 0; overflow: clip; }
  #case-panel .case-panel-topbar { position: sticky; top: 0; z-index: 3; height: 64px; padding: 0 20px; }
  #case-panel .case-panel-logo { width: 140px; }
  #case-panel .case-panel-layout { display: flex; flex-direction: column; }
  #case-panel .case-panel-media { padding: 16px 16px 8px; }
  #case-panel .case-cover { flex: none; height: auto; aspect-ratio: 4 / 3; }
  #case-panel .case-gallery-toolbar { margin: 12px 0 10px; }
  #case-panel .case-panel-details { padding: 26px 24px 36px; overflow: visible; border: 0; }
  #case-panel #case-kicker { margin-bottom: 16px; }
  #case-panel #case-title { font-size: 32px !important; }
  #case-panel .case-highlights { gap: 12px; padding: 22px 0; margin-top: 24px; }
  #case-panel .case-highlight strong { font-size: clamp(19px, 5.8vw, 28px); }
}
@media (prefers-reduced-motion: reduce) {
  #case-panel, #case-panel *, #case-carousel-overlay { transition: none !important; }
}
