/* ==========================================================================
   IPTV From Canada — pages/installation-guides.css
   Page stylesheet for the IPTV Setup Guides page (slug iptv-setup-guide).
   Loaded after general.css. Namespace: ifc-ig- (section "installation-guides").

   1. Device picker (charcoal)
   2. Guide viewer states (loading / empty / missing / error)
   3. Guide header (light)
   4. Guide article: reading width (content rules: article.css .ifc-prose)
   ========================================================================== */

.ifc-ig {
  --ifc-ig-accent-tint: rgba(206, 32, 53, .12);
  --ifc-ig-measure: 780px;       /* same reading width as the standalone article */
}

/* --------------------------------------------------------------------------
   1. Device picker
   -------------------------------------------------------------------------- */

.ifc-ig-picker {
  --ifc-ig-pad-y: 44px;                  /* 56 px tablet, 64 px desktop */
  --ifc-ig-cols: 2;                      /* 3 from 700 px, 4 from 1024 px */
  --ifc-ig-gap: 12px;                    /* 16 px tablet, 20 px desktop */
  --ifc-ig-folds-opacity: .2;

  --ifc-bg: var(--ifc-ink);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding-block: var(--ifc-ig-pad-y);
  background: var(--ifc-ink);
  color: var(--ifc-paper);
}

/* Dark folds at both outer edges (start layer mirrored). */
.ifc-ig-picker__folds {
  position: absolute;
  z-index: 0;
  inset-block: 0;
  width: clamp(200px, 30vw, 560px);
  background-image: url("../../brand/backgrounds/fold-hero-dark.svg");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
  opacity: var(--ifc-ig-folds-opacity);
  pointer-events: none;
}

.ifc-ig-picker__folds--start {
  inset-inline-start: 0;
  transform: scaleX(-1);
}

.ifc-ig-picker__folds--end {
  inset-inline-end: 0;
}

.ifc-ig-picker__inner {
  position: relative;
  z-index: 1;
}

.ifc-ig-picker__intro {
  text-align: center;
}

.ifc-scope .ifc-ig-picker__title {
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);   /* 32 → 48 px */
  line-height: 1.1;
  color: var(--ifc-paper);
}

.ifc-scope .ifc-ig-picker__lead {
  margin-block-start: 10px;
  font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
  line-height: 1.5;
  color: var(--ifc-text-dim);
}

/* Flex grid: equal widths per breakpoint, incomplete rows centred, cards
   in a row share the tallest height. */
.ifc-scope .ifc-ig-picker__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ifc-ig-gap);
  margin-block-start: 28px;
}

.ifc-ig-picker__item {
  display: flex;
  flex: 0 0 calc((100% - (var(--ifc-ig-cols) - 1) * var(--ifc-ig-gap)) / var(--ifc-ig-cols));
  min-width: 0;
}

/* Card (a link or tile before JavaScript, a button after). Every property
   the parent theme sets on buttons is restated. */
.ifc-scope .ifc-ig-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;           /* logo areas line up across a row */
  gap: 12px;                             /* logo area → label */
  width: 100%;
  margin: 0;
  padding: 18px 12px 20px;
  border: 1px solid var(--ifc-white-a15);
  border-radius: 8px;
  background-color: var(--ifc-graphite);
  background-image: none;
  box-shadow: none;
  color: var(--ifc-paper);
  font: inherit;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  cursor: default;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color var(--ifc-duration) var(--ifc-ease), background-color var(--ifc-duration) var(--ifc-ease);
}

.ifc-scope a.ifc-ig-card,
.ifc-scope button.ifc-ig-card {
  cursor: pointer;
}

.ifc-scope .ifc-ig-card:visited,
.ifc-scope .ifc-ig-card:focus {
  color: var(--ifc-paper);
  background-color: var(--ifc-graphite);
}

@media (hover: hover) {
  .ifc-scope a.ifc-ig-card:hover,
  .ifc-scope button.ifc-ig-card:hover {
    border-color: var(--ifc-white-a35);
    background-color: var(--ifc-graphite);
    color: var(--ifc-paper);
  }
}

.ifc-scope .ifc-ig-card:focus-visible {
  outline: 3px solid var(--ifc-surface);
  outline-offset: 3px;
}

/* Selected: red border (inset ring keeps the size), subtle red tint and a
   visible check badge — never colour alone. */
.ifc-scope .ifc-ig-card.is-selected,
.ifc-scope .ifc-ig-card[aria-pressed="true"],
.ifc-scope .ifc-ig-card[aria-pressed="true"]:hover,
.ifc-scope .ifc-ig-card[aria-pressed="true"]:focus {
  border-color: var(--ifc-action);
  background-color: var(--ifc-graphite);
  background-image: linear-gradient(var(--ifc-ig-accent-tint), var(--ifc-ig-accent-tint));
  box-shadow: inset 0 0 0 1px var(--ifc-action);
}

/* The badge sits on the card's corner, over the border, so it never covers a
   wide logo or a pair on a narrow card; the ink ring separates it from the
   border. It stays inside the grid gap. */
.ifc-ig-card__check {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ifc-action);
  box-shadow: 0 0 0 2px var(--ifc-ink);
  color: var(--ifc-surface);
}

.ifc-ig-card[aria-pressed="true"] .ifc-ig-card__check {
  display: flex;
}

.ifc-scope .ifc-ig-card__check-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

/* Generic device icon: only for a card whose brands have no approved logo;
   the same 44 px height as the logo area, so labels still line up. */
.ifc-ig-card__icon {
  display: block;
  color: var(--ifc-paper);
  line-height: 0;
}

.ifc-scope .ifc-ig-card__svg {
  width: 44px;
  height: 44px;
}

/*
 * Brand logos on the graphite card: one 44 px area, centred above the label.
 * Each logo is sized per brand in inc/device-logos.php, and a card with two
 * brands centres both together as one group.
 */
.ifc-scope .ifc-ig-card__logos {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 100%;
  height: 44px;
}

.ifc-scope .ifc-ig-card__logos .ifc-device-logo {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
}

/* The card's one label: 16 px at every width; long labels wrap to two or
   three lines rather than shrink. */
.ifc-ig-card__label {
  max-width: 100%;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ifc-paper);
  overflow-wrap: break-word;
  text-wrap: balance;
}

@media (min-width: 700px) {
  .ifc-ig-picker {
    --ifc-ig-pad-y: 56px;
    --ifc-ig-cols: 3;
    --ifc-ig-gap: 16px;
    --ifc-ig-folds-opacity: .28;
  }
}

@media (min-width: 1024px) {
  .ifc-ig-picker {
    --ifc-ig-pad-y: 64px;
    --ifc-ig-cols: 4;
    --ifc-ig-gap: 20px;
    --ifc-ig-folds-opacity: .34;
  }

  .ifc-scope .ifc-ig-picker__grid {
    margin-block-start: 36px;
  }

  .ifc-scope .ifc-ig-card {
    padding: 22px 16px 24px;
  }
}

/* Very narrow phones: one card per row so labels never cramp. */
@media (max-width: 359.98px) {
  .ifc-ig-picker {
    --ifc-ig-cols: 1;
  }
}

/* --------------------------------------------------------------------------
   2. Viewer + states
   -------------------------------------------------------------------------- */

.ifc-ig-viewer {
  padding-block: 28px 64px;
  background: var(--ifc-paper);          /* warm white under the dark picker */
  color: var(--ifc-ink);
}

/* One reading container for every state; it grows with the guide, never
   scrolls on its own. */
.ifc-ig-panel {
  box-sizing: border-box;
  max-width: 1200px;
  margin-inline: auto;
  padding: 18px;
  border: 1px solid var(--ifc-line);
  border-radius: 14px;
  background: var(--ifc-surface);
  box-shadow: none;
}

.ifc-ig-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-block: 28px;
  text-align: center;
}

.ifc-ig-state__icon-svg {
  width: 28px;
  height: 28px;
  color: var(--ifc-muted);
}

.ifc-scope .ifc-ig-state__title {
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--ifc-ink);
}

.ifc-scope .ifc-ig-state__text {
  max-width: 46ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ifc-muted);
}

.ifc-scope .ifc-ig-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-block-start: 6px;
}

/* Restrained loading placeholder: spinner, status text, three bars. */
.ifc-ig-state__skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, var(--ifc-ig-measure));
  margin-block-start: 10px;
}

.ifc-ig-state__bar {
  height: 12px;
  border-radius: var(--ifc-radius-pill);
  background: var(--ifc-line);
  opacity: .7;
}

.ifc-ig-state__bar:nth-child(2) {
  width: 92%;
}

.ifc-ig-state__bar:nth-child(3) {
  width: 68%;
}

@media (min-width: 768px) {
  .ifc-ig-panel {
    padding: 32px;
  }

  .ifc-ig-state {
    min-height: 200px;                   /* compact empty state on desktop */
  }
}

.ifc-ig-state__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--ifc-line);
  border-top-color: var(--ifc-action);
  border-radius: 50%;
  animation: ifc-ig-spin .9s linear infinite;
}

@keyframes ifc-ig-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ifc-ig-state__spinner {
    animation: none;
    border-top-color: var(--ifc-line);
    border-right-color: var(--ifc-action);
  }
}

/* --------------------------------------------------------------------------
   3. Guide header
   -------------------------------------------------------------------------- */

.ifc-ig-guide__header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block-end: 20px;
  border-block-end: 1px solid var(--ifc-line);   /* thin divider before the article */
}

/* Short red vertical accent beside the label + title. */
.ifc-ig-guide__titlebox {
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--ifc-action);
}

.ifc-scope .ifc-ig-guide__title {
  margin-block-start: 0;
  font-size: clamp(1.75rem, 1.25rem + 2vw, 2.625rem);  /* 28 → 42 px */
  line-height: 1.12;
  text-wrap: balance;
  color: var(--ifc-ink);
}

.ifc-scope .ifc-ig-guide__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 16px;
  padding: 0;
  list-style: none;                      /* chips, never bullets */
}

.ifc-scope .ifc-ig-guide__tag {
  display: block;
}

.ifc-ig-guide__tag {
  padding: 4px 10px;
  border: 1px solid var(--ifc-line);
  border-radius: var(--ifc-radius-sm);
  background: var(--ifc-surface);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ifc-ink-soft);
}

.ifc-scope .ifc-ig-guide__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 16px 0 0;
}

.ifc-ig-guide__fact {
  display: flex;
  gap: 6px;
  font-size: .9375rem;
  line-height: 1.5;
}

.ifc-scope .ifc-ig-guide__fact dt {
  font-weight: 600;
  color: var(--ifc-ink);
}

.ifc-scope .ifc-ig-guide__fact dt::after {
  content: ":";
}

.ifc-scope .ifc-ig-guide__fact dd {
  margin: 0;
  color: var(--ifc-ink-soft);
}

.ifc-scope .ifc-ig-guide__action {
  margin: 0;
}

.ifc-scope .ifc-ig-guide__full {
  --ifc-button-height: 46px;
  --ifc-button-padding: 10px 20px;
  --ifc-button-size: .9375rem;
}

/* Desktop: title group left, action aligned on the right. */
@media (min-width: 900px) {
  .ifc-ig-guide__header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    padding-block-end: 24px;
  }

  .ifc-scope .ifc-ig-guide__action {
    flex: none;
    padding-block-start: 4px;
  }
}

/* "Before you begin" (installation requirements metadata). */
.ifc-ig-guide__requirements {
  max-width: var(--ifc-ig-measure);
  margin-inline: auto;
  padding-block: 28px 0;
}

.ifc-scope .ifc-ig-guide__requirements-title {
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ifc-ink);
}

.ifc-scope .ifc-ig-guide__requirements-list {
  margin-block-start: 10px;
  padding-inline-start: 1.25em;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ifc-ink-soft);
}

/* --------------------------------------------------------------------------
   4. Guide article — WordPress content
   Typography, lists, images, quotes, tables, code, buttons and embeds come
   from the shared .ifc-prose rules in assets/css/article.css (the same rules
   as the standalone guide page). Only the viewer's reading width lives here.
   -------------------------------------------------------------------------- */

.ifc-ig-guide__body {
  padding-block: 28px 8px;
}

/* Contents inside the viewer: the shared component from article.css. The
   sidebar appears only in the two-column layout; below that the arrow tab
   and drawer take over (the script sets the drawer's data-narrow). */
.ifc-ig-guide__side {
  display: none;
}

/* Guides keep the article's reading width when there is no sidebar. */
.ifc-toc-enhanced .ifc-ig-guide__content {
  padding-inline-end: 0;
}

.ifc-toc__toggle-chevron {
  display: block;
  width: 8px;
  height: 8px;
  margin-inline: auto;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);   /* points down: collapsed */
  transition: transform 180ms ease;
}

.ifc-toc__toggle[aria-expanded="true"] .ifc-toc__toggle-chevron {
  transform: rotate(-135deg) translate(-1px, -1px); /* points up: expanded */
}

@media (min-width: 1280px) {
  .ifc-ig-guide__body--toc {
    display: grid;
    grid-template-columns: minmax(0, 720px) 300px;
    justify-content: center;
    align-items: start;
    column-gap: 40px;
  }

  .ifc-ig-guide__body--toc .ifc-ig-guide__content {
    max-width: 720px;
    margin-inline: 0;
  }

  /* Sticky beside the article, inside the panel. */
  .ifc-ig-guide__side {
    display: flex;
    position: sticky;
    top: calc(var(--ifc-header-h, 0px) + var(--ifc-header-top, 0px) + 20px);
    max-height: calc(100vh - var(--ifc-header-h, 0px) - var(--ifc-header-top, 0px) - 40px);
    display: flex;
    flex-direction: column;
  }
}

.ifc-ig-guide__content {
  max-width: var(--ifc-ig-measure);
  margin-inline: auto;
}

.ifc-ig-viewer {
  scroll-margin-block-start: calc(var(--ifc-header-h) + var(--ifc-header-top));
}

/* --------------------------------------------------------------------------
   5. Troubleshooting cards (ifc-gh) — permanent section under the viewer
   -------------------------------------------------------------------------- */

/* Warm-white band with the light fold artwork on its LEFT edge; the dark
   picker above and the FAQ below both carry artwork on both edges, so the
   left anchor keeps this band from doubling up on the right. */
.ifc-gh {
  --ifc-gh-fold-w: min(420px, 34%);
  --ifc-gh-folds-opacity: .2;

  position: relative;      /* positioning + clipping boundary for the fold layer */
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding-block: 40px;
  background: var(--ifc-paper);
  color: var(--ifc-ink);
}

.ifc-gh__folds {
  position: absolute;
  z-index: 0;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--ifc-gh-fold-w);
  background-image: url("../../brand/backgrounds/fold-hero-light.svg");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
  opacity: var(--ifc-gh-folds-opacity);
  transform: scaleX(-1);
  transform-origin: center;
  pointer-events: none;
}

.ifc-gh__inner {
  position: relative;
  z-index: 1;
}

.ifc-gh__intro {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

.ifc-scope .ifc-gh__heading {
  margin-block-start: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);     /* 24 → 32 px */
  line-height: 1.2;
  color: var(--ifc-ink);
}

.ifc-scope .ifc-gh__lead {
  max-width: 62ch;
  margin: 10px auto 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ifc-muted);
}

.ifc-gh__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-block-start: 28px;
}

/* Informational cards: equal heights come from the grid row, never from a
   fixed height, so long text simply makes its row taller. */
.ifc-gh__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--ifc-line);
  border-radius: 12px;
  background: var(--ifc-surface);
  box-shadow: none;
}

.ifc-gh__number {
  position: absolute;
  inset-block-start: 20px;
  inset-inline-end: 20px;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--ifc-muted);
  opacity: .75;
}

/* Restrained red accent: a small tinted icon tile. */
.ifc-gh__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ifc-blush);
  color: var(--ifc-action);
}

.ifc-gh__icon-svg {
  width: 20px;
  height: 20px;
}

.ifc-scope .ifc-gh__card-title {
  padding-inline-end: 36px;                /* clears the number */
  font-size: 1.1875rem;                    /* 19 px */
  line-height: 1.35;
  color: var(--ifc-ink);
}

.ifc-scope .ifc-gh__card-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ifc-muted);
}

.ifc-scope .ifc-gh__support {
  max-width: 68ch;
  margin: 28px auto 0;
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
  color: var(--ifc-ink-soft);
}

.ifc-scope .ifc-gh__support-action {
  margin-block-start: 8px;
  text-align: center;
}

/* Inline-flex keeps the arrow on the same line (.ifc-icon is display:block). */
.ifc-scope .ifc-gh__support-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ifc-action);
}

.ifc-gh__support-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

@media (min-width: 768px) {
  .ifc-gh {
    padding-block: 64px;
  }

  .ifc-gh__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));  /* tablet: 2 × 3 */
    gap: 22px;
    margin-block-start: 32px;
  }

  .ifc-scope .ifc-gh__card-title {
    font-size: 1.25rem;                    /* 20 px */
  }
}

@media (min-width: 1024px) {
  .ifc-gh__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));  /* desktop: 3 × 2 */
    gap: 24px;
  }
}

@media (min-width: 1200px) {
  .ifc-gh {
    padding-block: 76px;
  }
}