/* Portrait editorial covers; shared by the public gallery and Studio preview. */
.sbs-hero {
  position: relative;
  --hero-cover-width: min(calc(100vw - 32px), 420px);
  --hero-gap: 18px;
}
.sbs-hero-stage {
  height: calc(var(--hero-cover-width) * 4 / 3 + 48px);
  overflow: hidden;
  /* Clip neighbors without letting focus scroll the centered gallery sideways. */
  overflow: clip;
  isolation: isolate;
  cursor: grab;
  background: var(--page-bg);
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.sbs-hero-stage.is-dragging, .sbs-hero-stage.is-dragging .sbs-hero-destination { cursor: grabbing; }
.sbs-hero-stage:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.sbs-hero-slot {
  position: absolute;
  width: var(--hero-cover-width);
  height: calc(var(--hero-cover-width) * 4 / 3);
  left: 50%; top: 24px;
  translate: -50% 0;
  transform-origin: center;
  pointer-events: none;
  z-index: 1;
}
.sbs-hero-slot.is-active { pointer-events: auto; z-index: 3; }
.sbs-hero-slot.is-neighbor { z-index: 2; }
.sbs-hero-slot .sbs-hero-slide, #hero-studio-preview .sbs-hero-slide {
  width: 100%; height: 100%; min-width: 0; min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding: clamp(16px, 2.4vw, 26px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px var(--glass-shadow);
}
.sbs-hero-slot .sbs-hero-copy, #hero-studio-preview .sbs-hero-copy {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 0;
  max-width: 100%; max-height: 100%; overflow-x: hidden; overflow-y: auto;
  overflow-wrap: anywhere; padding: 12px; touch-action: pan-y pinch-zoom;
}
.sbs-hero-copy:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.sbs-hero-copy .sbs-hero-link { max-width: 100%; white-space: normal; }
.sbs-hero-slot .sbs-hero-image + .sbs-hero-copy, #hero-studio-preview .sbs-hero-image + .sbs-hero-copy {
  max-height: 55%; padding: 14px 16px;
  background: #171714ad; color: #f2efe8;
}
.sbs-hero-copy[hidden], .sbs-hero-caption-toggle[hidden] { display: none; }
.sbs-hero-caption-toggle {
  position: absolute; z-index: 4; top: 12px; right: 12px;
  min-width: 92px; min-height: 44px; padding: 8px 12px;
  border: 1px solid #f2efe85c; border-radius: 3px;
  background: #171714ad; color: #f2efe8; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  touch-action: manipulation;
}
.sbs-hero-caption-toggle[aria-expanded="false"] { top: auto; bottom: 72px; }
.sbs-hero:has(.sbs-hero-controls[hidden]) .sbs-hero-caption-toggle[aria-expanded="false"] { bottom: 14px; }
.sbs-hero-caption-toggle:focus-visible { outline: 2px solid #f2efe8; outline-offset: 3px; }
.sbs-hero:has(.sbs-hero-controls:not([hidden])) .sbs-hero-slide { padding-bottom: calc(clamp(16px, 2.4vw, 26px) + 44px); }
.sbs-hero:has(.sbs-hero-controls:not([hidden])) .sbs-hero-copy { padding: 14px 24px; }
.sbs-hero-slot .sbs-hero-title, #hero-studio-preview .sbs-hero-title { font-size: clamp(24px, 3.8vw, 44px); }
.sbs-hero-slot .sbs-hero-body, #hero-studio-preview .sbs-hero-body { margin-top: 12px; font-size: clamp(16px, 1.8vw, 21px); }
.sbs-hero-neighbor { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; pointer-events: auto; }
.sbs-hero-neighbor[hidden] { display: none; }
.sbs-hero-neighbor:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.sbs-hero-stage.is-moving .sbs-hero-destination { pointer-events: none; }
.sbs-hero-stage.is-moving .sbs-hero-neighbor { pointer-events: none; }
.sbs-hero-destination { color: inherit; text-decoration: none; cursor: pointer; }
.sbs-hero-destination:focus-visible { outline: 3px solid var(--signal); outline-offset: -4px; }
.sbs-hero-controls { position: absolute; inset: 0; display: block; padding: 0; border: 0; pointer-events: none; z-index: 5; }
.sbs-hero-controls > button, .sbs-hero-count {
  position: absolute; background: var(--page-bg); color: var(--text); border: 1px solid var(--border);
  font-family: inherit; font-size: 10px; font-weight: 800; letter-spacing: .1em;
  border-radius: 3px; box-shadow: 0 2px 8px #0002; opacity: .78;
}
.sbs-hero-controls > button { min-width: 44px; min-height: 44px; pointer-events: auto; transition: opacity 180ms ease; }
.sbs-hero-controls > button:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; box-shadow: 0 0 0 5px var(--page-bg); opacity: 1; }
.sbs-hero-controls .sbs-hero-prev, .sbs-hero-controls .sbs-hero-next { top: 50%; transform: translateY(-50%); font-size: 19px; }
.sbs-hero-prev { left: clamp(12px, 2.5vw, 36px); }
.sbs-hero-next { right: clamp(12px, 2.5vw, 36px); }
.sbs-hero-controls .sbs-hero-pause { left: calc(50% - var(--hero-cover-width) / 2 + 12px); bottom: 36px; padding: 0 10px; }
.sbs-hero-count { right: calc(50% - var(--hero-cover-width) / 2 + 12px); bottom: 36px; padding: 8px 10px; font-variant-numeric: tabular-nums; transition: opacity 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .sbs-hero:hover .sbs-hero-controls > button, .sbs-hero:focus-within .sbs-hero-controls > button { opacity: 1; }
  .sbs-hero-slot.is-neighbor:hover .sbs-hero-slide { filter: brightness(1.05); }
}
.sbs-hero-controls.intro-visible button { opacity: 1; }
.sbs-hero-slot.is-active .sbs-hero-slide.entrance { animation: sbs-hero-entrance 700ms ease-out forwards; }
@keyframes sbs-hero-entrance { from { transform: scale(1.02); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sbs-hero-slot .sbs-hero-link { cursor: pointer; }
@media (min-width: 900px) { .sbs-hero { --hero-cover-width: min(44vw, 560px, calc((100dvh - 200px) * .75)); } }
@media (max-width: 899px) {
  .sbs-hero-stage:not(.is-moving):not(.is-dragging) .sbs-hero-slot:not(.is-active) { visibility: hidden; }
  .sbs-hero-neighbor { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sbs-hero-slot { scroll-behavior: auto; } .sbs-hero-controls > button { transition: none; } }

/* One selected slide replaces the previous long list of full editors. */
.hero-manager { --hero-editor-height: clamp(340px, 55dvh, 540px); display: grid; gap: 14px; min-width: 0; }
.hero-strip-toolbar { display: flex; gap: 12px; align-items: stretch; min-width: 0; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.hero-thumbnail-strip { display: flex; flex: 1; gap: 10px; overflow-x: auto; min-width: 0; padding: 4px 4px 12px; touch-action: pan-x pinch-zoom; }
.hero-thumb-item { flex: 0 0 84px; }
.hero-thumbnail { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; border: 2px solid var(--border); background: var(--page-bg); color: var(--text); border-radius: 3px; cursor: pointer; }
.hero-thumbnail[aria-pressed="true"] { border-color: var(--signal); box-shadow: 0 0 0 2px var(--signal); }
.hero-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.hero-thumb-copy { display: block; padding: 10px 6px 30px; font-size: 11px; font-weight: 800; overflow-wrap: anywhere; }
.hero-thumb-number { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px; background: var(--text); color: var(--page-bg); font-size: 9px; font-weight: 800; }
.hero-thumbnail.is-dragging { opacity: .45; }
.hero-thumbnail.is-drop-target { border-color: var(--signal); transform: translateY(-3px); }
.hero-add-actions { display: grid; align-content: center; gap: 8px; flex: 0 0 auto; font-size: 10px; font-weight: 800; }
.hero-edit-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 20px; height: var(--hero-editor-height); min-width: 0; }
.hero-slide-editor { min-width: 0; overflow-y: auto; padding: 4px 12px 12px 4px; scrollbar-gutter: stable; }
.hero-editor-heading { margin-bottom: 12px; font-size: 16px; font-weight: 800; }
.hero-slide-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hero-enabled-label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 12px; font-weight: 800; }
.hero-fields { display: grid; gap: 12px; }
.hero-fields label { display: block; margin-bottom: 5px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.hero-fields .studio-control { width: 100%; min-width: 0; font-size: 16px; }
.hero-fields textarea { min-height: 96px; resize: vertical; }
.hero-preview-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 0 8px; background: var(--page-bg); border: 1px solid var(--border); }
.hero-preview-panel > p { width: 100%; margin: 0 0 10px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
#hero-studio-preview { position: relative; width: min(100%, calc((var(--hero-editor-height) - 70px) * .75)); aspect-ratio: 3 / 4; color: var(--text); }
#hero-studio-preview .sbs-hero-title { font-size: clamp(22px, 2.5vw, 34px); }
#hero-studio-preview .sbs-hero-body { font-size: 16px; }
.hero-empty { padding: 20px; font-size: 14px; line-height: 1.6; }
.hero-global-options { border: 1px solid var(--border); }
.hero-global-options summary { padding: 12px; min-height: 44px; font-size: 11px; font-weight: 800; cursor: pointer; }
.hero-global-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 12px; font-size: 12px; }
.hero-global-fields label { display: block; }
.hero-global-fields input[type=number] { display: block; width: 130px; margin-top: 8px; font-size: 16px; }
.hero-publish-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.hero-publish-actions p { font-size: 12px; flex: 1 1 220px; line-height: 1.5; }
@media (max-width: 899px) {
  .hero-strip-toolbar { flex-direction: column; }
  .hero-add-actions { display: flex; flex-wrap: wrap; align-items: center; }
  .hero-add-actions > span { width: 100%; }
  .hero-edit-workspace { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; gap: 14px; }
  .hero-preview-panel { order: -1; padding: 12px; }
  #hero-studio-preview { width: min(100%, 240px); }
  .hero-slide-editor { overflow: visible; padding: 0; scrollbar-gutter: auto; }
  .hero-manager .studio-button { min-height: 44px; font-size: 10px; }
  .hero-global-fields { align-items: start; flex-direction: column; }
}
.sbs-hero.is-pending { visibility: hidden; }
