/* =========================================================================
   CA PRO Toolkit - caprotoolkit.in, the video tutorials page (tutorials.html), v1 (2026-10-12).
   Loaded after styles-v39.css and built only from its tokens. The player's chapter list reuses the
   video guides' .guide-steps rules and the video frame their .guide-player; a problem with a video
   is drawn by fix-v1.js in the site's shared box. Nothing here styles another page. Like every site
   stylesheet the version is in the name: once published, this file is never edited in place.
   ========================================================================= */

/* ---- The opening: what the page is ---- */
.tut-hero { padding-block: clamp(36px, 5vw, 64px) clamp(16px, 3vw, 28px); }
.tut-hero h1 { margin: 0; }
.tut-hero .lead { max-width: 66ch; }
.tut-facts {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.tut-facts li { display: inline-flex; align-items: flex-start; gap: 8px; }
.tut-facts li[hidden] { display: none; }
.tut-facts i { flex: none; color: var(--teal); font-size: 1.15rem; margin-top: 1px; }

/* ---- The list: a filter, a count, and the cards ---- */
.tut-library { padding-block: 8px var(--section); }
.tut-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 24px;
}
.tut-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}
.tut-filter[hidden] { display: none; }
.tut-filter button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.tut-filter button:hover { background: var(--surface-2); color: var(--teal-dark); }
.tut-filter button:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; }
.tut-filter button[aria-pressed="true"] { background: var(--teal-dark); color: #fff; }
.tut-filter button i { font-size: 1.1rem; }
.tut-filter-n {
  min-width: 1.6em;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.tut-filter button[aria-pressed="true"] .tut-filter-n { background: rgba(255, 255, 255, 0.18); color: #fff; }
.tut-filter-n:empty { display: none; }
.tut-count { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.tut-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 24px;
}
.tut-grid[hidden] { display: none; }

/* A card is one link (its title); the link's ::after covers the whole card, so the poster and the
   words open the tutorial too, and the keyboard ring is drawn around the card. */
.tut-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-sm);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.tut-card[hidden] { display: none; }
.tut-card:hover { border-color: var(--teal); box-shadow: var(--sh-md); transform: translateY(-2px); }
/* The card does not clip (the keyboard ring sits outside it), so the poster rounds its own corners. */
.tut-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--r-xl) - 1px) calc(var(--r-xl) - 1px) 0 0;
  overflow: hidden;
  background: var(--teal-deep);
  border-bottom: 1px solid var(--line-soft);
}
.tut-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tut-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 63, 75, 0.82);
  color: var(--on-dark);
  font-size: 1.35rem;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.35);
  transition: background-color var(--fast) var(--ease);
}
.tut-card:hover .tut-play { background: var(--teal); }
.tut-time {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: rgba(10, 63, 75, 0.9);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.tut-card-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; }
.tut-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.tut-card-meta .tut-feature { flex-basis: 100%; }
.tut-card-title { margin: 0; font-size: 1.0625rem; line-height: 1.35; }
.tut-link { color: var(--ink); text-decoration: none; }
.tut-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-xl); }
.tut-link:focus-visible { outline: none; }
.tut-link:focus-visible::after { outline: 3px solid var(--teal); outline-offset: 2px; }
.tut-card:hover .tut-link { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }

/* The product a tutorial is for: the same two names the rest of the site uses. */
.tut-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.tut-chip:empty { display: none; }
.tut-chip i { font-size: 1rem; }
.tut-chip-extension { background: var(--teal-soft); color: var(--teal-dark); }
.tut-chip-desktop { background: var(--green-soft); color: var(--green-dark); }
.tut-feature { font-weight: 600; color: var(--ink-2); }

/* Without JavaScript, and if the list cannot be read: a plain list, each title a link to the video. */
.tut-noscript, .tut-fallback { max-width: 820px; }
.tut-fallback[hidden] { display: none; }
.tut-noscript-note { margin: 0 0 12px; color: var(--muted); }
.tut-noscript-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.tut-noscript-list li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); line-height: 1.5; }
.tut-noscript-list a { font-weight: 600; }
.tut-noscript-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 0.875rem; }
.tut-noscript-text { display: block; margin-top: 4px; color: var(--ink-2); }

/* ---- The player: a modal dialog ---- */
html.tut-lock { overflow: hidden; }
.tut-dialog {
  width: min(1180px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tut-dialog::backdrop { background: rgba(10, 30, 36, 0.66); }
.tut-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
  background: var(--surface);
}
.tut-dialog-heading { min-width: 0; }
.tut-dialog-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; font-size: 0.875rem; color: var(--muted); }
.tut-dialog h2 { margin: 0; font-size: clamp(1.2rem, 1rem + 0.9vw, 1.6rem); line-height: 1.25; }
.tut-close {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
}
.tut-close:hover { border-color: var(--teal); color: var(--teal-dark); }
.tut-close:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.tut-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: 24px;
  align-items: start;
}
.tut-stage { min-width: 0; }
.tut-video { box-shadow: none; }
.tut-video video:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.tut-summary { margin: 14px 0 0; color: var(--ink-2); line-height: 1.6; }
.tut-side { min-width: 0; }
.tut-chapters { margin-bottom: 8px; }

.tut-transcript { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.tut-transcript > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 2px;
  color: var(--teal-dark);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.tut-transcript > summary::-webkit-details-marker { display: none; }
.tut-transcript > summary i { transition: transform var(--fast) var(--ease); }
.tut-transcript[open] > summary i { transform: rotate(90deg); }
.tut-transcript > summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; border-radius: var(--r-sm); }
.tut-lines { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.tut-lines li { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 8px; font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); }
.tut-line-at { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; padding-top: 2px; }

@media (max-width: 960px) {
  .tut-dialog-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 640px) {
  .tut-toolbar { flex-direction: column; align-items: stretch; }
  .tut-filter { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
  .tut-filter button { padding-inline: 10px; white-space: normal; text-align: center; }
  .tut-filter button i { display: none; }
  /* On a phone the player is the whole screen. */
  .tut-dialog { width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0 16px 20px; border: 0; border-radius: 0; }
  .tut-dialog-head { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .tut-card, .tut-play, .tut-filter button, .tut-transcript > summary i { transition: none; }
  .tut-card:hover { transform: none; }
}
@media (forced-colors: active) {
  .tut-card, .tut-filter, .tut-chip { border: 1px solid CanvasText; }
  .tut-filter button[aria-pressed="true"] { outline: 2px solid Highlight; }
}
