/* Scoped styles for embedding the video gallery inside an existing page. */
@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&family=Quicksand:wght@300..700&display=swap");

.livehelp-video-gallery {
  --paper: #ffffff;
  --ink: #171716;
  --muted: #77746e;
  --line: #e9e6e0;
  --warm: #f7f5f1;
  --accent: #edac21;
  --font-display: "Lexend";
  --font-sans: "Quicksand";
}

.livehelp-video-gallery * {
  box-sizing: border-box;
}

.livehelp-video-gallery {
  background: var(--paper);
  scroll-behavior: smooth;
}

.livehelp-video-gallery {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans), Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.livehelp-video-gallery a {
  color: inherit;
  text-decoration: none;
}

.livehelp-video-gallery button,
.livehelp-video-gallery input,
.livehelp-video-gallery textarea {
  font: inherit;
}

.livehelp-video-gallery button,
.livehelp-video-gallery a {
  -webkit-tap-highlight-color: transparent;
}

.livehelp-video-gallery ::selection {
  background: #eadad6;
}

.livehelp-video-gallery .site-shell {
  width: min(100% - 40px, 1440px);
  margin: 0 auto;
}

.livehelp-video-gallery .site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  border-bottom: 1px solid var(--line);
}

.livehelp-video-gallery .brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.livehelp-video-gallery .brand-mark {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.livehelp-video-gallery .header-label,
.livehelp-video-gallery .eyebrow,
.livehelp-video-gallery .gallery-count,
.livehelp-video-gallery .video-index,
.livehelp-video-gallery .admin-kicker {
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 11px;
  font-weight: 600;
}

.livehelp-video-gallery .header-label {
  color: var(--muted);
}

.livehelp-video-gallery .admin-link {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  transition: color 180ms ease;
}

.livehelp-video-gallery .admin-link::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.livehelp-video-gallery .admin-link:hover,
.livehelp-video-gallery .admin-link:focus-visible {
  color: var(--ink);
}

.livehelp-video-gallery .admin-link:hover::after,
.livehelp-video-gallery .admin-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.livehelp-video-gallery .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 48px;
  align-items: end;
  padding: clamp(72px, 10vw, 150px) 0 clamp(68px, 9vw, 128px);
}

.livehelp-video-gallery .eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 26px;
  color: var(--accent);
}

.livehelp-video-gallery .eyebrow::before {
  width: 28px;
  height: 1px;
  background: currentColor;
  content: "";
}

.livehelp-video-gallery .hero h1 {
  max-width: 850px;
  margin: 0;
  font-family: var(--font-display), Arial, sans-serif;
  font-size: clamp(64px, 9vw, 138px);
  font-weight: 430;
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.livehelp-video-gallery .hero h1 em {
  color: var(--accent);
  font-style: normal;
  font-weight: 430;
}

.livehelp-video-gallery .hero-copy {
  margin: 0;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.livehelp-video-gallery .gallery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}

.livehelp-video-gallery .gallery-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.livehelp-video-gallery .gallery-count {
  color: var(--muted);
}

.livehelp-video-gallery .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(48px, 5vw, 86px) clamp(22px, 3vw, 42px);
  padding-bottom: 120px;
}

.livehelp-video-gallery .video-card {
  min-width: 0;
}

.livehelp-video-gallery .thumbnail-button {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #eceae5;
  box-shadow:
    0 32px 58px -36px rgba(23, 23, 22, 0.52),
    0 10px 26px -18px rgba(23, 23, 22, 0.25);
  cursor: pointer;
  isolation: isolate;
}

.livehelp-video-gallery .thumbnail-button::before {
  display: block;
  padding-top: 56.25%;
  content: "";
}

.livehelp-video-gallery .thumbnail-button::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.24));
  content: "";
  opacity: 0.65;
  transition: opacity 280ms ease;
}

.livehelp-video-gallery .thumbnail-button img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f7f5f1;
  transition: transform 650ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.livehelp-video-gallery .play-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
  transform: translate(-50%, -50%);
  transition:
    transform 280ms ease,
    background 280ms ease;
}

.livehelp-video-gallery .play-triangle {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.livehelp-video-gallery .thumbnail-button:hover img,
.livehelp-video-gallery .thumbnail-button:focus-visible img {
  transform: scale(1.035);
}

.livehelp-video-gallery .thumbnail-button:hover::after,
.livehelp-video-gallery .thumbnail-button:focus-visible::after {
  opacity: 0.35;
}

.livehelp-video-gallery .thumbnail-button:hover .play-button,
.livehelp-video-gallery .thumbnail-button:focus-visible .play-button {
  background: var(--paper);
  transform: translate(-50%, -50%) scale(1.08);
}

.livehelp-video-gallery .thumbnail-button:focus-visible,
.livehelp-video-gallery .admin-link:focus-visible,
.livehelp-video-gallery .button:focus-visible,
.livehelp-video-gallery .text-button:focus-visible,
.livehelp-video-gallery .modal-close:focus-visible,
.livehelp-video-gallery .back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.livehelp-video-gallery .video-meta {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px;
  margin-top: 24px;
}

.livehelp-video-gallery .video-index {
  padding-top: 4px;
  color: var(--accent);
}

.livehelp-video-gallery .video-description {
  margin: 0;
  font-family: var(--font-display), Arial, sans-serif;
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 420;
  line-height: 1.13;
  letter-spacing: -0.025em;
}

.livehelp-video-gallery .video-date {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.livehelp-video-gallery .gallery-state {
  display: grid;
  min-height: 340px;
  place-items: center;
  margin-bottom: 100px;
  border: 1px solid var(--line);
  background: var(--warm);
  text-align: center;
}

.livehelp-video-gallery .gallery-state-inner {
  max-width: 440px;
  padding: 48px 24px;
}

.livehelp-video-gallery .gallery-state h2 {
  margin: 0 0 12px;
  font-family: var(--font-display), Arial, sans-serif;
  font-size: 40px;
  font-weight: 420;
  letter-spacing: -0.035em;
}

.livehelp-video-gallery .gallery-state p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.livehelp-video-gallery .loading-line {
  width: 72px;
  height: 2px;
  margin: 24px auto 0;
  overflow: hidden;
  background: #ddd8cf;
}

.livehelp-video-gallery .loading-line::after {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  content: "";
  animation: loading-line 1.1s ease-in-out infinite;
}

@keyframes loading-line {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.livehelp-video-gallery .modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 48px;
  background: rgba(12, 12, 11, 0.92);
  backdrop-filter: blur(12px);
  animation: modal-in 220ms ease both;
}

.livehelp-video-gallery .modal-backdrop[hidden],
.livehelp-video-gallery .thumbnail-preview[hidden] {
  display: none;
}

.livehelp-video-gallery .video-modal {
  width: min(1180px, 100%);
  color: white;
}

.livehelp-video-gallery .modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.livehelp-video-gallery .modal-description {
  max-width: 860px;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display), Arial, sans-serif;
  font-size: 24px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livehelp-video-gallery .modal-close {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.livehelp-video-gallery .close-icon {
  position: relative;
  width: 18px;
  height: 18px;
}

.livehelp-video-gallery .close-icon::before,
.livehelp-video-gallery .close-icon::after {
  position: absolute;
  top: 8px;
  left: 0;
  width: 18px;
  height: 1px;
  background: currentColor;
  content: "";
}

.livehelp-video-gallery .close-icon::before { transform: rotate(45deg); }
.livehelp-video-gallery .close-icon::after { transform: rotate(-45deg); }

.livehelp-video-gallery .video-frame {
  position: relative;
  overflow: hidden;
  padding-top: 56.25%;
  background: black;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.5);
}

.livehelp-video-gallery .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@keyframes modal-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.livehelp-video-gallery .site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Admin */
.livehelp-video-gallery .admin-page {
  min-height: 100vh;
  background: var(--warm);
}

.livehelp-video-gallery .admin-shell {
  width: min(100% - 40px, 1180px);
  margin: 0 auto;
  padding-bottom: 80px;
}

.livehelp-video-gallery .admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  border-bottom: 1px solid #dfdbd3;
}

.livehelp-video-gallery .back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.livehelp-video-gallery .back-link::before {
  content: "←";
  font-size: 17px;
}

.livehelp-video-gallery .admin-content {
  padding-top: clamp(60px, 8vw, 104px);
}

.livehelp-video-gallery .admin-kicker {
  margin: 0 0 20px;
  color: var(--accent);
}

.livehelp-video-gallery .admin-title {
  max-width: 750px;
  margin: 0 0 52px;
  font-family: var(--font-display), Arial, sans-serif;
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 420;
  line-height: 0.92;
  letter-spacing: -0.052em;
}

.livehelp-video-gallery .admin-card {
  max-width: 760px;
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid #dedad2;
  background: white;
  box-shadow: 0 32px 80px -62px rgba(23, 23, 22, 0.5);
}

.livehelp-video-gallery .login-card {
  max-width: 520px;
}

.livehelp-video-gallery .admin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.livehelp-video-gallery .admin-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display), Arial, sans-serif;
  font-size: 34px;
  font-weight: 420;
  letter-spacing: -0.03em;
}

.livehelp-video-gallery .admin-card-copy,
.livehelp-video-gallery .field-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.livehelp-video-gallery .admin-form {
  display: grid;
  gap: 24px;
}

.livehelp-video-gallery .field {
  display: grid;
  gap: 9px;
}

.livehelp-video-gallery .field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.livehelp-video-gallery .field input,
.livehelp-video-gallery .field select,
.livehelp-video-gallery .field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #c9c4ba;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  transition: border-color 160ms ease;
}

.livehelp-video-gallery .field input,
.livehelp-video-gallery .field select {
  height: 48px;
}

.livehelp-video-gallery .field select {
  cursor: pointer;
}

.livehelp-video-gallery .field textarea {
  min-height: 108px;
  padding: 13px 0;
  line-height: 1.55;
  resize: vertical;
}

.livehelp-video-gallery .field input:focus,
.livehelp-video-gallery .field select:focus,
.livehelp-video-gallery .field textarea:focus {
  border-color: var(--accent);
}

.livehelp-video-gallery .thumbnail-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-top: 6px;
  background: #ece9e3;
}

.livehelp-video-gallery .thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.livehelp-video-gallery .button-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 8px;
}

.livehelp-video-gallery .button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.livehelp-video-gallery .button:hover:not(:disabled) {
  background: transparent;
  color: var(--ink);
}

.livehelp-video-gallery .button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.livehelp-video-gallery .text-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.livehelp-video-gallery .form-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.livehelp-video-gallery .form-message.error { color: #a62b23; }
.livehelp-video-gallery .form-message.success { color: #397044; }

.livehelp-video-gallery .admin-loading {
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.livehelp-video-gallery .global-message {
  max-width: 760px;
  margin: -28px 0 28px;
  padding: 14px 16px;
  border: 1px solid currentColor;
  background: white;
}

.livehelp-video-gallery .warning-text {
  color: #9b6118;
}

.livehelp-video-gallery .admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(250px, 340px);
  gap: 28px;
  align-items: start;
}

.livehelp-video-gallery .admin-side,
.livehelp-video-gallery .compact-card {
  min-width: 0;
}

.livehelp-video-gallery .compact-card {
  padding: 30px;
}

.livehelp-video-gallery .compact-card .admin-form {
  gap: 18px;
}

.livehelp-video-gallery .secondary-button {
  width: 100%;
  margin-top: 4px;
  background: transparent;
  color: var(--ink);
}

.livehelp-video-gallery .secondary-button:hover:not(:disabled) {
  background: var(--ink);
  color: white;
}

.livehelp-video-gallery .admin-library {
  margin-top: 72px;
}

.livehelp-video-gallery .admin-video-list {
  display: grid;
  border-top: 1px solid #d8d3ca;
}

.livehelp-video-gallery .admin-video-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid #d8d3ca;
}

.livehelp-video-gallery .admin-video-row img {
  width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e5e1da;
}

.livehelp-video-gallery .admin-video-row h3,
.livehelp-video-gallery .admin-video-row p {
  margin: 0;
}

.livehelp-video-gallery .admin-video-row h3 {
  font-family: var(--font-display), Arial, sans-serif;
  font-size: 18px;
  font-weight: 450;
}

.livehelp-video-gallery .admin-video-row p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.livehelp-video-gallery .danger-text {
  color: #a62b23;
}

@media (max-width: 900px) {
  .livehelp-video-gallery .hero {
    grid-template-columns: 1fr;
  }

  .livehelp-video-gallery .hero-copy {
    max-width: 480px;
  }

  .livehelp-video-gallery .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .livehelp-video-gallery .modal-backdrop {
    padding: 28px;
  }

  .livehelp-video-gallery .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .livehelp-video-gallery .site-shell,
  .livehelp-video-gallery .admin-shell {
    width: min(100% - 28px, 1440px);
  }

  .livehelp-video-gallery .site-header,
  .livehelp-video-gallery .admin-header {
    height: 74px;
  }

  .livehelp-video-gallery .header-label {
    display: none;
  }

  .livehelp-video-gallery .hero {
    gap: 32px;
    padding: 72px 0 76px;
  }

  .livehelp-video-gallery .hero h1 {
    font-size: clamp(60px, 20vw, 88px);
  }

  .livehelp-video-gallery .gallery-grid {
    grid-template-columns: 1fr;
    gap: 54px;
  }

  .livehelp-video-gallery .video-description {
    font-size: 25px;
  }

  .livehelp-video-gallery .modal-backdrop {
    align-items: center;
    padding: 14px;
  }

  .livehelp-video-gallery .modal-toolbar {
    align-items: flex-end;
  }

  .livehelp-video-gallery .modal-description {
    font-size: 19px;
    white-space: normal;
  }

  .livehelp-video-gallery .modal-close span:last-child {
    display: none;
  }

  .livehelp-video-gallery .site-footer {
    flex-direction: column;
  }

  .livehelp-video-gallery .admin-card-header {
    display: block;
  }

  .livehelp-video-gallery .admin-card-header .text-button {
    margin-top: 16px;
  }

  .livehelp-video-gallery .admin-video-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .livehelp-video-gallery .admin-video-row img {
    width: 92px;
  }

  .livehelp-video-gallery .admin-video-row form {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .livehelp-video-gallery *,
  .livehelp-video-gallery *::before,
  .livehelp-video-gallery *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
