/* Home spotlight (SPEC 22): the banner at the top of Home, the owner's dialog and controls (watch page, Admin). */

/* The banner --------------------------------------------------------------- */

.spotlight {
  display: grid; grid-template-columns: minmax(0, 1fr);
  margin: 0 0 32px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface);
}
.spotlight-media {
  position: relative; min-width: 0; overflow: hidden;
  /* behind the picture, and instead of it when it can't load: the same colours as a card without a thumbnail */
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 14px, transparent 14px 28px),
    linear-gradient(135deg, hsl(var(--hue) 50% 30%), hsl(calc(var(--hue) + 50) 55% 13%));
}
/* 16:9 of its width (a padding sizer, so the picture is never wider than its column). On a computer it's centred
   beside a taller text column rather than stretched to it, so the picture is never cropped. */
.spotlight-media::before { content: ""; display: block; padding-top: 56.25%; }
.spotlight-link { position: absolute; inset: 0; display: block; }
.spotlight-img, .spotlight-preview {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
}
.spotlight-img { transition: transform 0.5s ease; }
.spotlight-link:hover .spotlight-img { transform: scale(1.02); }
.spotlight-fallback { display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); }
.spotlight-fallback .icon { fill: currentColor; }
.spotlight-preview { opacity: 0; transition: opacity 0.6s ease; background: transparent; }
.spotlight.is-previewing .spotlight-preview { opacity: 1; }

/* Pause / Play preview: a small round button in the corner (WCAG 2.2.2) */
.spotlight-toggle {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%;
  background: rgba(0, 0, 0, 0.62); color: #fff; cursor: pointer;
  transition: background-color 0.15s;
}
.spotlight-toggle:hover { background: rgba(0, 0, 0, 0.82); }
.spotlight-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px var(--focus); }
.spotlight-toggle .icon { fill: currentColor; stroke-width: 0; }
.spotlight-toggle[aria-pressed="false"] .icon-play,
.spotlight-toggle[aria-pressed="true"] .icon-pause { display: none; }

.spotlight-body {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 18px 18px 22px;
}
.spotlight-label {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em; line-height: 1.5; text-transform: uppercase;
}
.spotlight-label .icon { fill: currentColor; }
.spotlight-title {
  max-width: 100%;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 7.2vw, 34px); line-height: 1.04;
  letter-spacing: 0.01em; text-transform: uppercase; overflow-wrap: anywhere;
}
.spotlight-title.is-long { font-size: clamp(22px, 5.8vw, 28px); line-height: 1.08; } /* over 60 characters */
.spotlight-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.spotlight-video-title { max-width: 100%; font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.spotlight-by { display: flex; align-items: center; gap: 10px; max-width: 100%; min-width: 0; }
.spotlight-by .name-line { font-weight: 600; }
.spotlight-channel { min-width: 0; overflow-wrap: anywhere; }
.spotlight-channel:hover { text-decoration: underline; }
.spotlight-meta { color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.spotlight-watch { margin-top: 6px; }
.spotlight-watch .icon { fill: currentColor; }

/* Computers: the picture beside the text, which keeps the whole 16:9 picture and reads the same in both themes.
   A long headline can make the text column taller than the picture: the picture stays 16:9, centred, with the
   banner's surface around it (it isn't stretched and cropped). */
@media (min-width: 900px) {
  .spotlight { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
  .spotlight-media { align-self: center; }
  .spotlight-body { justify-content: center; gap: 12px; padding: 32px 36px; }
  .spotlight-title { font-size: clamp(34px, 3.1vw, 54px); }
  .spotlight-title.is-long { font-size: clamp(26px, 2.2vw, 38px); }
  .spotlight-video-title { font-size: 17px; }
}
/* Small computer screens: less padding and a smaller long headline, so the text column stays close to the picture's height */
@media (min-width: 900px) and (max-width: 1099px) {
  .spotlight-body { padding: 24px 26px; }
  .spotlight-title.is-long { font-size: 22px; }
}

@media (max-width: 720px) {
  .spotlight { margin-bottom: 28px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .spotlight-link:hover .spotlight-img { transform: none; }
}

/* The owner's dialog and watch-page controls --------------------------------- */

.spotlight-dialog .dialog-icon { color: var(--accent-text); }
.spotlight-dialog .field { margin: 2px 0 0; }
.spotlight-dialog .btn-primary .icon { flex: none; }
.manage-bar .spotlight-form { display: contents; }
/* The watch page's note while the spotlight video can't show on Home (the flash toast is gone in seconds) */
.manage-bar .spotlight-note {
  display: flex; align-items: flex-start; gap: 8px; flex: 1 1 100%; min-width: 0; margin: 2px 0 0;
  color: var(--text-2); font-size: 13.5px; line-height: 1.45;
}
.manage-bar .spotlight-note .icon { flex: none; margin-top: 1px; color: var(--accent-text); }
.manage-bar .spotlight-note > span { min-width: 0; overflow-wrap: anywhere; }
.manage-bar .spotlight-note strong { color: var(--text); }

/* Admin > Videos: the strip above the table, the row pill and button ---------- */

.admin .a-spotlight { display: grid; gap: 12px; margin-bottom: 18px; padding: 14px 16px; }
.admin .a-spotlight-heading {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2);
}
.admin .a-spotlight-heading .a-icon { color: var(--accent-text); }
.admin .a-spotlight-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.admin .a-spotlight-row .a-thumb { width: 128px; }
.admin .a-spotlight-text { display: grid; gap: 3px; flex: 1 1 240px; min-width: 0; }
.admin .a-spotlight-headline { overflow-wrap: anywhere; }
.admin .a-spotlight-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin .a-spotlight-actions form { margin: 0; }
.admin .a-spotlight-warn { margin: 0; }
.admin .a-spotlight-warn > span { min-width: 0; overflow-wrap: anywhere; }
.admin .a-spotlight-pill {
  display: inline-flex; align-items: center; gap: 4px; justify-self: start; margin-top: 2px;
  font-size: 11.5px; font-weight: 700; color: var(--text);
}
.admin .a-spotlight-pill .a-icon { color: var(--accent-text); }
.admin .a-spot-btn.is-on, .admin .a-spot-btn.is-on:hover { color: var(--accent-text); }
.admin .a-hint .a-icon, .admin .a-spotlight > p .a-icon { display: inline-block; vertical-align: -2px; }

@media (max-width: 480px) {
  .admin .a-spotlight-row .a-thumb { width: 96px; }
  .admin .a-spotlight-actions { width: 100%; }
  .admin .a-spotlight-actions > * { flex: 1 1 auto; }
  .admin .a-spotlight-actions .btn { width: 100%; }
}
