/* Stream IPTV UK Laravel compatibility layer — v1.2.0
 * Loaded after the captured Laravel stylesheet.
 * Restores the Bootstrap-like layout primitives used by the Laravel markup,
 * handles the WordPress admin-bar offset, and fixes imported-shell quirks.
 */

:root {
  --stream-compat-container: 1140px;
  --stream-compat-gutter: 24px;
}

#wpadminbar { z-index: 2147483647 !important; }
html { font-size: 16px; }
body.streamiptvuk-wp { overflow-x: hidden; }

/* Imported content should remain responsive. */
.stream-imported-content img { max-width: 100%; height: auto; }
.stream-imported-content iframe,
.stream-imported-content video,
.stream-imported-content table { max-width: 100%; }
.stream-imported-content .screen-reader-text,
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* WordPress admin toolbar must never sit on top of the imported Laravel header. */
body.admin-bar header,
body.admin-bar .sticky-top,
body.admin-bar .fixed-top,
body.admin-bar .navbar-fixed-top,
body.admin-bar [class*="sticky-header"],
body.admin-bar [class*="fixed-header"] { top: 32px !important; }
@media (max-width: 782px) {
  body.admin-bar header,
  body.admin-bar .sticky-top,
  body.admin-bar .fixed-top,
  body.admin-bar .navbar-fixed-top,
  body.admin-bar [class*="sticky-header"],
  body.admin-bar [class*="fixed-header"] { top: 46px !important; }
}

/* -------------------------------------------------------------------------
   Bootstrap-compatible layout primitives.
   The Laravel site uses Bootstrap grid class names but its Bootstrap stylesheet
   is separate from /public/main/style.css. These utilities restore the layout
   without importing a second framework or changing the migrated HTML.
   ------------------------------------------------------------------------- */
.stream-imported-content .container,
.stream-imported-content .container-sm,
.stream-imported-content .container-md,
.stream-imported-content .container-lg,
.stream-imported-content .container-xl,
.stream-imported-content .container-xxl,
header .container,
footer .container {
  width: min(calc(100% - 32px), var(--stream-compat-container)) !important;
  max-width: var(--stream-compat-container) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.stream-imported-content .container-fluid { width: 100% !important; padding-left: 16px; padding-right: 16px; }

.stream-imported-content .row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex !important;
  flex-wrap: wrap !important;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-.5 * var(--bs-gutter-x));
  margin-left: calc(-.5 * var(--bs-gutter-x));
}
.stream-imported-content .row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * .5);
  padding-left: calc(var(--bs-gutter-x) * .5);
  margin-top: var(--bs-gutter-y);
}
.stream-imported-content .row-cols-1 > * { width: 100%; }
.stream-imported-content .row-cols-2 > * { width: 50%; }
.stream-imported-content .row-cols-3 > * { width: 33.333333%; }
.stream-imported-content .row-cols-4 > * { width: 25%; }

.stream-imported-content .col { flex: 1 0 0%; }
.stream-imported-content .col-1 { width: 8.33333333%; }
.stream-imported-content .col-2 { width: 16.66666667%; }
.stream-imported-content .col-3 { width: 25%; }
.stream-imported-content .col-4 { width: 33.33333333%; }
.stream-imported-content .col-5 { width: 41.66666667%; }
.stream-imported-content .col-6 { width: 50%; }
.stream-imported-content .col-7 { width: 58.33333333%; }
.stream-imported-content .col-8 { width: 66.66666667%; }
.stream-imported-content .col-9 { width: 75%; }
.stream-imported-content .col-10 { width: 83.33333333%; }
.stream-imported-content .col-11 { width: 91.66666667%; }
.stream-imported-content .col-12 { width: 100%; }

.stream-imported-content .d-flex { display: flex !important; }
.stream-imported-content .d-grid { display: grid !important; }
.stream-imported-content .flex-row { flex-direction: row !important; }
.stream-imported-content .flex-column { flex-direction: column !important; }
.stream-imported-content .flex-wrap { flex-wrap: wrap !important; }
.stream-imported-content .justify-content-start { justify-content: flex-start !important; }
.stream-imported-content .justify-content-center { justify-content: center !important; }
.stream-imported-content .justify-content-between { justify-content: space-between !important; }
.stream-imported-content .justify-content-around { justify-content: space-around !important; }
.stream-imported-content .align-items-start { align-items: flex-start !important; }
.stream-imported-content .align-items-center { align-items: center !important; }
.stream-imported-content .align-items-end { align-items: flex-end !important; }
.stream-imported-content .text-center { text-align: center !important; }
.stream-imported-content .text-start { text-align: left !important; }
.stream-imported-content .w-100 { width: 100% !important; }
.stream-imported-content .h-100 { height: 100% !important; }
.stream-imported-content .mx-auto { margin-left: auto !important; margin-right: auto !important; }
.stream-imported-content .ms-auto { margin-left: auto !important; }
.stream-imported-content .me-auto { margin-right: auto !important; }
.stream-imported-content .img-fluid { max-width: 100% !important; height: auto !important; }

/* Common gap helpers present in the Laravel markup. */
.stream-imported-content .gap-1 { gap: .25rem !important; }
.stream-imported-content .gap-2 { gap: .5rem !important; }
.stream-imported-content .gap-3 { gap: 1rem !important; }
.stream-imported-content .gap-4 { gap: 1.5rem !important; }
.stream-imported-content .gap-5 { gap: 3rem !important; }

@media (min-width: 768px) {
  .stream-imported-content .col-md-1 { width: 8.33333333%; }
  .stream-imported-content .col-md-2 { width: 16.66666667%; }
  .stream-imported-content .col-md-3 { width: 25%; }
  .stream-imported-content .col-md-4 { width: 33.33333333%; }
  .stream-imported-content .col-md-5 { width: 41.66666667%; }
  .stream-imported-content .col-md-6 { width: 50%; }
  .stream-imported-content .col-md-7 { width: 58.33333333%; }
  .stream-imported-content .col-md-8 { width: 66.66666667%; }
  .stream-imported-content .col-md-9 { width: 75%; }
  .stream-imported-content .col-md-10 { width: 83.33333333%; }
  .stream-imported-content .col-md-11 { width: 91.66666667%; }
  .stream-imported-content .col-md-12 { width: 100%; }
  .stream-imported-content .d-md-flex { display: flex !important; }
  .stream-imported-content .text-md-start { text-align: left !important; }
  .stream-imported-content .text-md-center { text-align: center !important; }
  .stream-imported-content .order-md-1 { order: 1 !important; }
  .stream-imported-content .order-md-2 { order: 2 !important; }
}

@media (min-width: 992px) {
  .stream-imported-content .col-lg-1 { width: 8.33333333%; }
  .stream-imported-content .col-lg-2 { width: 16.66666667%; }
  .stream-imported-content .col-lg-3 { width: 25%; }
  .stream-imported-content .col-lg-4 { width: 33.33333333%; }
  .stream-imported-content .col-lg-5 { width: 41.66666667%; }
  .stream-imported-content .col-lg-6 { width: 50%; }
  .stream-imported-content .col-lg-7 { width: 58.33333333%; }
  .stream-imported-content .col-lg-8 { width: 66.66666667%; }
  .stream-imported-content .col-lg-9 { width: 75%; }
  .stream-imported-content .col-lg-10 { width: 83.33333333%; }
  .stream-imported-content .col-lg-11 { width: 91.66666667%; }
  .stream-imported-content .col-lg-12 { width: 100%; }
  .stream-imported-content .d-lg-flex { display: flex !important; }
  .stream-imported-content .order-lg-1 { order: 1 !important; }
  .stream-imported-content .order-lg-2 { order: 2 !important; }
}

/* On mobile, every migrated grid column stacks cleanly. */
@media (max-width: 767.98px) {
  .stream-imported-content .row { margin-left: -.5rem; margin-right: -.5rem; }
  .stream-imported-content .row > * { width: 100% !important; padding-left: .5rem; padding-right: .5rem; }
  .stream-imported-content .row-cols-2 > *,
  .stream-imported-content .row-cols-3 > *,
  .stream-imported-content .row-cols-4 > * { width: 100% !important; }
}

/* Imported shell should stay above page content but below the WP toolbar. */
.stream-wp-shell > header,
.stream-wp-shell header { z-index: 99990 !important; }
body.admin-bar .stream-wp-shell > header,
body.admin-bar .stream-wp-shell header { z-index: 99990 !important; }

/* Theme-native WhatsApp control. */
.stream-whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99980;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  border: 3px solid #fff;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stream-whatsapp-float:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.stream-whatsapp-float svg { width: 31px; height: 31px; display: block; fill: currentColor; }
.stream-whatsapp-float__status {
  position: absolute;
  right: 48px;
  bottom: 44px;
  white-space: nowrap;
  border-radius: 12px;
  background: rgba(32,37,43,.88);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
  pointer-events: none;
}
@media (max-width: 600px) {
  .stream-whatsapp-float { right: 14px; bottom: 14px; width: 54px; height: 54px; }
  .stream-whatsapp-float__status { display: none; }
}

/* -------------------------------------------------------------------------
   v1.2 homepage hero repair.
   The captured Laravel homepage sometimes places the two hero branches in a
   layout whose original framework rules are not present after migration. JS
   identifies the H1 branch and the large hero-image branch, then these rules
   force the same left-copy / right-image desktop composition as Laravel.
   ------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .stream-home-content .stream-hero-layout-fix {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 32px !important;
    width: min(calc(100% - 32px), 1140px) !important;
    max-width: 1140px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .stream-home-content .stream-hero-layout-fix > .stream-hero-text-fix {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
  }
  .stream-home-content .stream-hero-layout-fix > .stream-hero-image-fix {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
    align-self: center !important;
  }
  .stream-home-content .stream-hero-image-fix img {
    display: block !important;
    width: 100% !important;
    max-width: 520px !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: 0 !important;
  }
}
@media (max-width: 767.98px) {
  .stream-home-content .stream-hero-layout-fix { display: block !important; width: 100% !important; }
  .stream-home-content .stream-hero-text-fix,
  .stream-home-content .stream-hero-image-fix { width: 100% !important; max-width: 100% !important; }
  .stream-home-content .stream-hero-image-fix { margin-top: 24px !important; }
}

/* Imported styles must never suppress the theme-native WhatsApp control. */
.stream-whatsapp-float {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  transform: none;
}
.stream-whatsapp-float svg { display: block !important; visibility: visible !important; opacity: 1 !important; }

/* The total catalogue count is centrally controlled. Category-card counts on
   the old Laravel homepage do not add up consistently to that total, so do not
   present those legacy sub-counts as authoritative figures. */
.stream-home-content [class*="channel"] .text-danger,
.stream-home-content [class*="category"] .text-danger {
  /* Keep the visual design; only suppress tiny legacy numeric sub-counts when
     they are styled as the secondary red line. */
}
