/* ==========================================================================
   HELP CENTER
   Loaded only by support/help_center and support/article (content_for :head),
   on top of tailwind-marketing-light.css, so other marketing pages do not
   download it. Palette and type stay inside DESIGN-marketing-light.md.
   ========================================================================== */

/* Help index: guides grouped under their topic (anchors for topic cards). */
.help-guide-group {
  margin: 0 0 40px;
  scroll-margin-top: 96px;
}
.help-guide-group:last-of-type { margin-bottom: 56px; }
body.marketing-light .help-guide-group-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #045D56;
}
.help-guide-video {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid #E8DDC3;
  color: #6E6456;
  font-weight: 500;
}
html[dir="rtl"] .help-guide-video { margin-left: 0; margin-right: 10px; padding-left: 0; padding-right: 10px; border-left: 0; border-right: 1px solid #E8DDC3; }

/* Help index: how-to video row. Posters are lazy; each card opens its guide. */
.help-video-section { margin-bottom: 48px; }
.help-video-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.help-video-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #1F1915;
  text-decoration: none;
}
.help-video-card:hover { text-decoration: none; color: #034A45; }
.help-video-card-poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #E8DDC3;
  background-color: #EFEADD;
}
.help-video-card-poster picture { display: block; width: 100%; height: 100%; }
.help-video-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}
.help-video-card:hover .help-video-card-poster img { transform: scale(1.03); }
.help-video-card-time {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background-color: #045D56;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
.help-video-card-time svg { width: 12px; height: 12px; fill: currentColor; }
.help-video-card-title { font-weight: 600; font-size: 16px; line-height: 1.35; }
@media (prefers-reduced-motion: reduce) {
  .help-video-card-poster img { transition: none; }
}

/* -------------------------------------------------------------------------
   Help article template: video, "On this page", numbered steps, figures,
   callouts, related guides. The markdown renderer
   (HelpCenterMarkdownRenderer) emits these classes; the view adds the video
   and related blocks. Palette and type stay inside DESIGN-marketing-light.md.
   ------------------------------------------------------------------------- */

/* Video: a <picture> poster under a transparent <video controls>, so the
   poster paints first and native controls work without JS. */
.help-video {
  margin: 0 0 32px;
}
.help-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #E8DDC3;
  background-color: #1F1915;
}
.help-video-frame picture,
.help-video-frame img,
.help-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.help-video-frame video { background: transparent; }
.help-video-play {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.help-video.is-enhanced .help-video-play { display: block; }
.help-video.is-playing .help-video-play { display: none; }
.help-video-play-badge {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  background-color: #045D56;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  transition: background-color 150ms ease, transform 150ms ease;
}
.help-video-play:hover .help-video-play-badge,
.help-video-play:focus-visible .help-video-play-badge {
  background-color: #034A45;
  transform: translateY(-1px);
}
.help-video-play:focus-visible { outline: 3px solid #F4CE6F; outline-offset: -3px; }
.help-video-play-badge svg { width: 22px; height: 22px; flex: none; }
.help-video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 10px;
  font-size: 14px;
  color: #6E6456;
}
.help-video-meta strong { color: #1F1915; font-weight: 600; }
.help-video-transcript summary {
  cursor: pointer;
  color: #045D56;
  font-weight: 600;
}
.help-video-transcript[open] summary { margin-bottom: 8px; }
.help-video-transcript p {
  font-size: 15px;
  color: #3D362C;
  margin: 0 0 8px;
}

/* "On this page" */
.help-toc {
  margin: 0 0 40px;
  padding: 18px 22px;
  border-left: 3px solid #045D56;
  background-color: #FBF8F0;
  border-radius: 0 12px 12px 0;
}
.help-toc-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #045D56;
}
.help-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2 260px;
  column-gap: 32px;
}
.help-toc li { break-inside: avoid; margin: 0 0 6px; font-size: 15px; line-height: 1.45; }
.help-toc a { color: #1F1915; font-weight: 500; }
.help-toc a:hover { color: #034A45; text-decoration: underline; }

body.marketing-light .ml-article-content .prose h2[id],
body.marketing-light .ml-article-content .prose h3[id] { scroll-margin-top: 96px; }

/* Numbered steps: every ordered list in a guide is a sequence of steps. */
body.marketing-light .ml-article-content .prose ol.help-steps {
  list-style: none;
  counter-reset: help-step;
  padding-left: 0;
  margin: 0 0 24px;
}
body.marketing-light .ml-article-content .prose ol.help-steps > li {
  counter-increment: help-step;
  position: relative;
  padding-left: 48px;
  margin: 0 0 20px;
  min-height: 32px;
}
body.marketing-light .ml-article-content .prose ol.help-steps > li::before {
  content: counter(help-step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #045D56;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  line-height: 32px;
  text-align: center;
}
html[dir="rtl"] body.marketing-light .ml-article-content .prose ol.help-steps > li { padding-left: 0; padding-right: 48px; }
html[dir="rtl"] body.marketing-light .ml-article-content .prose ol.help-steps > li::before { left: auto; right: 0; }
body.marketing-light .ml-article-content .prose ol.help-steps > li > p { margin-bottom: 10px; }
body.marketing-light .ml-article-content .prose ul > li { margin-bottom: 6px; }
body.marketing-light .ml-article-content .prose strong { color: #1F1915; font-weight: 650; }

/* Figures: real screenshots, alt text and caption from the markdown. Each
   image renders at its own CSS size (width/height attributes) and never wider
   than the column, so a small dialog is not blown up to full width. */
.help-figure {
  margin: 16px 0 28px;
}
body.marketing-light .ml-article-content .prose .help-figure-zoom {
  display: inline-block;
  max-width: 100%;
  cursor: zoom-in;
  border-radius: 12px;
}
body.marketing-light .ml-article-content .prose .help-figure-zoom:focus-visible { outline: 3px solid #045D56; outline-offset: 3px; }
body.marketing-light .ml-article-content .prose .help-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
  border: 1px solid #E8DDC3;
  border-radius: 12px;
  background-color: #FBF8F0;
}
.help-figure figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #6E6456;
}

/* Callouts: > [!TIP], > [!NOTE], > [!WARNING] in the markdown. */
body.marketing-light .ml-article-content .prose .help-callout {
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid #9FC4B5;
  background-color: #EEF7F6;
}
body.marketing-light .ml-article-content .prose .help-callout > :last-child { margin-bottom: 0; }
.help-callout-label {
  margin: 0 0 6px !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #045D56 !important;
}
body.marketing-light .ml-article-content .prose .help-callout--note {
  border-color: #E8DDC3;
  background-color: #FBF8F0;
}
body.marketing-light .ml-article-content .prose .help-callout--note .help-callout-label { color: #6E6456 !important; }
body.marketing-light .ml-article-content .prose .help-callout--warning {
  border-color: #D4A84B;
  background-color: #FBF3DC;
}
body.marketing-light .ml-article-content .prose .help-callout--warning .help-callout-label { color: #8A6817 !important; }

body.marketing-light .ml-article-content .prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 15px;
}
body.marketing-light .ml-article-content .prose th,
body.marketing-light .ml-article-content .prose td {
  text-align: start;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid #E8DDC3;
  overflow-wrap: break-word;
}
/* The first column names the thing (a role, a plan, a policy): keep it
   readable on phones instead of breaking words letter by letter. */
body.marketing-light .ml-article-content .prose th:first-child,
body.marketing-light .ml-article-content .prose td:first-child { min-width: 8.5em; }
body.marketing-light .ml-article-content .prose th { color: #1F1915; font-weight: 700; }
/* Hostnames and URLs in code may break anywhere so a table never overflows. */
body.marketing-light .ml-article-content .prose td code { overflow-wrap: anywhere; }

/* Related guides */
.help-related { margin-top: 56px; }
.help-related h2 {
  font-size: 22px !important;
  margin: 0 0 16px !important;
}
.help-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.help-related li { display: flex; }
.help-related a {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  background-color: #FBF8F0;
  border: 1px solid #E8DDC3;
  border-radius: 12px;
  color: #1F1915;
  transition: border-color 150ms ease;
}
.help-related a:hover { border-color: #045D56; text-decoration: none; }
.help-related-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #045D56;
  margin-bottom: 6px;
}
.help-related-title { font-weight: 600; line-height: 1.35; }
.help-related-video {
  margin-top: auto;
  padding-top: 10px;
  font-size: 13px;
  color: #6E6456;
}

@media (max-width: 640px) {
  .help-video-play-badge { left: 12px; bottom: 12px; font-size: 14px; padding: 8px 14px 8px 10px; }
  .help-toc { padding: 16px 18px; }
  body.marketing-light .ml-article-content .prose ol.help-steps > li { padding-left: 44px; }
}

/* Phones: the video starts as a compact row (thumbnail + Watch) so the text,
   not the poster, is the first screen's largest paint. A tap adds .is-open,
   which restores the full-width player above. */
.help-video-open { display: none; }
@media (max-width: 767px) {
  .help-video:not(.is-open) {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid #E8DDC3;
    border-radius: 12px;
    background-color: #FBF8F0;
  }
  /* No poster is fetched on phones (see article.html.erb): an emerald tile. */
  .help-video:not(.is-open) .help-video-frame { border-radius: 8px; border-color: #045D56; background-color: #045D56; }
  .help-video:not(.is-open) .help-video-play-badge {
    left: 50%;
    top: 50%;
    bottom: auto;
    padding: 0;
    background-color: transparent;
    transform: translate(-50%, -50%);
  }
  .help-video:not(.is-open) .help-video-play:hover .help-video-play-badge,
  .help-video:not(.is-open) .help-video-play:focus-visible .help-video-play-badge {
    background-color: transparent;
    transform: translate(-50%, -50%);
  }
  .help-video:not(.is-open) .help-video-play-badge > span { display: none; }
  .help-video:not(.is-open) .help-video-play-badge svg { width: 30px; height: 30px; }
  .help-video:not(.is-open) .help-video-meta {
    margin-top: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .help-video.is-enhanced:not(.is-open) .help-video-open {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background-color: #045D56;
    color: #FFFFFF;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  .help-video-open:focus-visible { outline: 3px solid #F4CE6F; outline-offset: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .help-video-play-badge,
  .help-related a { transition: none; }
}
