/* GenerateBlocks homepage — dark editorial/community direction */

.bl-gb-home {
  --bl-home-red: #e33922;
  --bl-home-red-bright: #ff5037;
  --bl-home-blue: #159fda;
  width: min(100%, 1160px);
  margin-inline: auto;
  padding: clamp(16px, 2.4vw, 28px) clamp(12px, 2vw, 24px) 48px;
  color: var(--text-main, #f7f7f7);
}

.bl-gb-home *,
.bl-gb-home *::before,
.bl-gb-home *::after {
  box-sizing: border-box;
}

.bl-gb-home a {
  text-decoration: none;
}

/* Single posts reuse the exact GenerateBlocks section/grid/card component
   without the homepage page-level padding. */
.single .bl-related-videos.bl-gb-home {
  width: 100%;
  margin-top: clamp(34px, 5vw, 58px);
  padding: 0;
}

.single .bl-related-videos.bl-gb-section {
  margin-bottom: 0;
}

/* Hero */
.bl-gb-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: clamp(245px, 28vw, 320px);
  padding: clamp(28px, 4vw, 46px) clamp(18px, 6vw, 72px) 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -30%, rgba(227, 57, 34, 0.34), transparent 46%),
    radial-gradient(circle at 95% 110%, rgba(227, 57, 34, 0.12), transparent 38%),
    linear-gradient(145deg, #1b1b1b 0%, #101010 58%, #151515 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: clamp(20px, 3vw, 32px);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

.bl-gb-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.bl-gb-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 220px;
  height: 220px;
  right: -110px;
  top: -110px;
  border: 1px solid rgba(227, 57, 34, 0.24);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(227, 57, 34, 0.025), 0 0 0 58px rgba(227, 57, 34, 0.018);
}

.bl-gb-hero-title {
  max-width: 820px;
  margin: 0;
  color: #fff;
  font-size: clamp(1.8rem, 4.1vw, 3.35rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.bl-gb-hero-title mark {
  color: var(--bl-home-red-bright);
  background: transparent;
}

.bl-gb-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.bl-gb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.2;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.bl-gb-button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--bl-home-red-bright), #d72b18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 26px rgba(227, 57, 34, 0.24);
}

.bl-gb-button-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.bl-gb-button:hover,
.bl-gb-button:focus-visible {
  color: #fff;
  transform: translateY(-2px);
}

.bl-gb-button-primary:hover,
.bl-gb-button-primary:focus-visible {
  box-shadow: 0 14px 32px rgba(227, 57, 34, 0.34);
}

.bl-gb-button-secondary:hover,
.bl-gb-button-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.bl-gb-signals {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: auto;
  padding-top: 18px;
  color: #858585;
  font-size: 0.72rem;
  font-weight: 600;
}

.bl-gb-signals span:first-child {
  color: #bdbdbd;
}

.bl-gb-signals span:first-child::first-letter {
  color: var(--bl-home-red-bright);
}

/* Section rhythm */
.bl-gb-section {
  margin-top: clamp(34px, 5vw, 58px);
}

.bl-gb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.bl-gb-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bl-gb-section-label::before {
  content: "";
  width: 3px;
  height: 24px;
  flex: 0 0 auto;
  background: var(--bl-home-red);
  border-radius: 99px;
}

.bl-gb-section-label h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bl-gb-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bl-home-red-bright);
  font-size: 1rem;
}

.bl-gb-section-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: #f2604c;
  font-size: 0.78rem;
  font-weight: 750;
}

.bl-gb-section-link:hover,
.bl-gb-section-link:focus-visible {
  color: #ff806e;
}

/* GenerateBlocks Query Loops */
.bl-gb-query {
  min-width: 0;
}

.bl-gb-popular-row {
  counter-reset: bl-popular;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(10.5rem, 19%);
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(227, 57, 34, 0.65) rgba(255, 255, 255, 0.04);
}

.bl-gb-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bl-gb-video-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(155deg, #1c1c1c, #151515);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  scroll-snap-align: start;
  transition: transform 190ms ease, border-color 190ms ease, box-shadow 190ms ease;
}

.bl-gb-popular-card {
  counter-increment: bl-popular;
}

.bl-gb-popular-card:nth-child(-n+3)::before {
  content: "TOP " counter(bl-popular);
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  color: #fff;
  background: linear-gradient(135deg, #ff563d, #d92b18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.35);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.bl-gb-video-thumb,
.bl-gb-video-card .wp-block-post-featured-image {
  aspect-ratio: 9 / 13;
  width: 100%;
  overflow: hidden;
  flex: 0 0 auto;
  margin: 0 !important;
  background: linear-gradient(135deg, #242424, #171717);
}

.bl-gb-video-thumb a,
.bl-gb-video-card .wp-block-post-featured-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.bl-gb-video-thumb img,
.bl-gb-video-card .wp-block-post-featured-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center top;
  transition: transform 320ms ease;
}

.bl-gb-video-title,
.bl-gb-video-card .wp-block-post-title {
  margin: 0 !important;
  padding: 0.75rem;
  font-size: var(--bl-video-card-title-size, 0.9375rem) !important;
  font-weight: 700 !important;
  line-height: var(--bl-video-card-title-leading, 1.4) !important;
  letter-spacing: -0.01em;
}

.bl-gb-video-title a,
.bl-gb-video-card .wp-block-post-title a {
  display: -webkit-box;
  overflow: hidden;
  color: #f6f6f6 !important;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.bl-gb-centered-button {
  width: max-content;
  max-width: 100%;
  margin: 20px auto 0;
}

@media (hover: hover) and (pointer: fine) {
  .bl-gb-video-card:hover {
    z-index: 1;
    transform: translateY(-4px);
    border-color: rgba(227, 57, 34, 0.38);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
  }

  .bl-gb-video-card:hover .wp-block-post-featured-image img {
    transform: scale(1.045);
  }
}

/* Telegram banner */
.bl-gb-banner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  margin-top: clamp(30px, 4vw, 46px);
  padding: 16px clamp(16px, 3vw, 26px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(0, 109, 164, 0.2);
}

.bl-gb-banner-telegram {
  background:
    radial-gradient(circle at 90% -40%, rgba(255, 255, 255, 0.25), transparent 45%),
    linear-gradient(115deg, #087bb7, var(--bl-home-blue));
}

.bl-gb-banner::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -35%;
  width: 28%;
  height: 220%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: rotate(18deg);
  transition: left 600ms ease;
}

.bl-gb-banner:hover::after {
  left: 120%;
}

.bl-gb-banner-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--bl-home-blue);
  background: #fff;
  border-radius: 50%;
  font-size: 1rem;
  transform: rotate(-18deg);
}

.bl-gb-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.bl-gb-banner-title {
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
}

.bl-gb-banner-copy > span:last-child {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
}

.bl-gb-banner-arrow {
  font-size: 1.45rem;
  transition: transform 180ms ease;
}

.bl-gb-banner:hover .bl-gb-banner-arrow {
  transform: translateX(4px);
}

/* Community stage */
.bl-gb-community {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: clamp(38px, 6vw, 68px);
  padding: clamp(24px, 4vw, 44px);
  color: #fff;
  background:
    radial-gradient(circle at 85% 30%, rgba(227, 57, 34, 0.28), transparent 34%),
    linear-gradient(140deg, #221512 0%, #171717 45%, #101010 100%);
  border: 1px solid rgba(227, 57, 34, 0.28);
  border-radius: 24px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
}

.bl-gb-community::before {
  content: "COMMUNAUTÉ";
  position: absolute;
  right: -22px;
  bottom: -20px;
  color: rgba(255, 255, 255, 0.025);
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  pointer-events: none;
}

.bl-gb-community-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.bl-gb-live-badge {
  display: inline-flex;
  margin-bottom: 12px;
  color: #ff6a54;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.bl-gb-community h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.45rem, 3.4vw, 2.5rem);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.bl-gb-community p {
  margin: 12px 0 0;
  color: #aaa;
  line-height: 1.55;
}

.bl-gb-community > .bl-gb-button {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

/* Final CTA cards */
.bl-gb-cta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(38px, 6vw, 68px);
}

.bl-gb-cta-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: clamp(24px, 4vw, 38px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  transition: transform 200ms ease, border-color 200ms ease;
}

.bl-gb-cta-publish {
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(145deg, #e6422a, #a81c0e);
}

.bl-gb-cta-groups {
  background:
    radial-gradient(circle at 90% 10%, rgba(31, 164, 224, 0.26), transparent 30%),
    linear-gradient(145deg, #202020, #101010);
}

.bl-gb-cta-card::after {
  content: "→";
  position: absolute;
  right: 22px;
  bottom: 12px;
  color: rgba(255, 255, 255, 0.07);
  font-size: 7rem;
  font-weight: 200;
  line-height: 1;
  transition: transform 220ms ease, color 220ms ease;
}

.bl-gb-cta-card:hover {
  color: #fff;
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.bl-gb-cta-card:hover::after {
  color: rgba(255, 255, 255, 0.12);
  transform: translateX(6px);
}

.bl-gb-cta-kicker {
  display: inline-flex;
  padding: 5px 9px;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.bl-gb-cta-card h2 {
  max-width: 390px;
  margin: 24px 0 8px;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.bl-gb-cta-card p {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.5;
}

.bl-gb-cta-link {
  position: absolute;
  z-index: 1;
  left: clamp(24px, 4vw, 38px);
  bottom: 28px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Category shortcode spacing */
.bl-gb-categories-grid {
  padding: 0;
}

/* Editorial SEO block */
.bl-gb-seo {
  max-width: 920px;
  margin: clamp(48px, 8vw, 88px) auto 0;
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bl-gb-seo > h2 {
  max-width: 760px;
  margin: 0;
  color: #f2f2f2;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.bl-gb-seo > p {
  max-width: 760px;
  margin: 14px 0 0;
  color: #909090;
  line-height: 1.7;
}

.bl-gb-seo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.bl-gb-seo-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 16px;
}

.bl-gb-seo-card h3 {
  margin: 0;
  color: #e8e8e8;
  font-size: 1rem;
}

.bl-gb-seo-card p {
  margin: 9px 0 0;
  color: #858585;
  font-size: 0.86rem;
  line-height: 1.65;
}

/* Responsive */
@media (min-width: 490px) {
  .bl-gb-video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 700px) {
  .bl-gb-video-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 980px) {
  .bl-gb-video-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 359px) {
  .bl-gb-video-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 760px) {
  .bl-gb-home {
    padding-top: 12px;
  }

  .bl-gb-hero {
    min-height: 0;
    padding-top: 30px;
  }

  .bl-gb-hero-title {
    line-height: 1.04;
  }

  .bl-gb-popular-row {
    grid-auto-columns: minmax(9.75rem, 46%);
    scrollbar-width: none;
  }

  .bl-gb-video-title a,
  .bl-gb-video-card .wp-block-post-title a {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .bl-gb-popular-row::-webkit-scrollbar {
    display: none;
  }

  .bl-gb-community {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }

  .bl-gb-cta-grid,
  .bl-gb-seo-grid {
    grid-template-columns: 1fr;
  }

  .bl-gb-cta-card {
    min-height: 230px;
  }
}

@media (max-width: 470px) {
  .bl-gb-hero {
    border-radius: 20px;
  }

  .bl-gb-actions,
  .bl-gb-actions .bl-gb-button {
    width: 100%;
  }

  .bl-gb-signals {
    align-items: center;
    flex-direction: column;
  }

  .bl-gb-section-head {
    align-items: flex-end;
  }

  .bl-gb-section-link {
    max-width: 108px;
    text-align: right;
  }

  .bl-gb-banner {
    grid-template-columns: auto 1fr;
  }

  .bl-gb-banner-arrow {
    display: none;
  }
}

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

.bl-gb-home :focus-visible {
  outline: 2px solid var(--bl-home-red-bright);
  outline-offset: 3px;
}
