/* ==========================================================================
   GGDS UI primitives — badge, hex, meta-row, section-header, socials, ad-slot
   Buttons live in buttons.css (.gg-btn + legacy .cta-button / .newsletter-submit).
   ========================================================================== */

/* ----- Hex brand marks ----- */

.gg-hex {
  --gg-hex-size: var(--gg-hex-size-glyph);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Regular pointy-top: height = size, width = size × √3/2 (all variants) */
  width: calc(var(--gg-hex-size) * var(--gg-hex-aspect));
  height: var(--gg-hex-size);
  aspect-ratio: var(--gg-hex-aspect);
  color: rgb(var(--gg-hex-color));
  vertical-align: middle;
  pointer-events: none;
  box-sizing: border-box;
}

.gg-hex--size-glyph {
  --gg-hex-size: var(--gg-hex-size-glyph);
}

.gg-hex--size-tick {
  --gg-hex-size: var(--gg-hex-size-tick);
}

.gg-hex--size-badge {
  --gg-hex-size: var(--gg-hex-size-badge);
}

.gg-hex--size-play {
  --gg-hex-size: var(--gg-hex-size-play);
}

.gg-hex--outline {
  background: transparent;
  overflow: visible;
}

.gg-hex__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gg-hex--filled,
.gg-hex--accent,
.gg-hex--play {
  background: rgb(var(--gg-hex-color));
  clip-path: var(--gg-hex-clip);
}

.gg-hex--accent {
  --gg-hex-color: var(--gg-hex-accent);
  background: rgb(var(--gg-hex-accent));
}

.gg-hex--play {
  --gg-hex-size: var(--gg-hex-size-play);
  color: #fff;
}

/* Video play control keeps its own sizing / icon; share clip + color tokens only. */
.video-play-btn.gg-hex--play {
  width: calc(var(--gg-hex-size-play) * var(--gg-hex-aspect));
  height: var(--gg-hex-size-play);
  aspect-ratio: var(--gg-hex-aspect);
  pointer-events: none;
}

/* Soft motion only on interactive filled play hex (cards.css wires hover). */
@media (prefers-reduced-motion: reduce) {
  .gg-hex--play,
  .video-play-wrap {
    transition: none !important;
  }

  .video-card:hover .video-play-wrap {
    transform: none;
  }
}

/*
 * Carousel / strip / lightbox prev–next controls — shared pointy-top hex chrome.
 * Geometry matches --gg-hex-clip / --gg-hex-aspect (same as play button).
 * Component CSS owns placement (absolute, transforms); this owns shape + states.
 */
.carousel-nav,
.breves-strip__nav,
.scroll-row-prev,
.scroll-row-next,
.article-lightbox__nav {
  --gg-carousel-nav-size: var(--gg-hex-size-nav);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--gg-carousel-nav-size) * var(--gg-hex-aspect));
  height: var(--gg-carousel-nav-size);
  aspect-ratio: var(--gg-hex-aspect);
  padding: 0;
  margin: 0;
  color: rgb(var(--color-ink));
  /* Outer hex = border color; ::before inset hex = surface fill */
  background: rgb(var(--color-border));
  border: none;
  border-radius: 0;
  clip-path: var(--gg-hex-clip);
  cursor: pointer;
  isolation: isolate;
  transition:
    background-color var(--duration-base, 0.25s) var(--ease-standard, ease),
    color var(--duration-base, 0.25s) var(--ease-standard, ease),
    opacity var(--duration-base, 0.25s) var(--ease-standard, ease);
}

.carousel-nav::before,
.breves-strip__nav::before,
.scroll-row-prev::before,
.scroll-row-next::before,
.article-lightbox__nav::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: 0;
  background: rgb(var(--color-surface));
  clip-path: var(--gg-hex-clip);
  transition: background-color var(--duration-base, 0.25s) var(--ease-standard, ease);
}

.carousel-nav > *,
.breves-strip__nav > *,
.scroll-row-prev > *,
.scroll-row-next > *,
.article-lightbox__nav > * {
  position: relative;
  z-index: 1;
}

.carousel-nav:hover,
.carousel-nav:focus-visible,
.breves-strip__nav:hover,
.breves-strip__nav:focus-visible,
.scroll-row-prev:hover,
.scroll-row-prev:focus-visible,
.scroll-row-next:hover,
.scroll-row-next:focus-visible,
.article-lightbox__nav:hover,
.article-lightbox__nav:focus-visible {
  color: #fff;
  background: rgb(var(--color-brand));
  outline: none;
}

.carousel-nav:hover::before,
.carousel-nav:focus-visible::before,
.breves-strip__nav:hover::before,
.breves-strip__nav:focus-visible::before,
.scroll-row-prev:hover::before,
.scroll-row-prev:focus-visible::before,
.scroll-row-next:hover::before,
.scroll-row-next:focus-visible::before,
.article-lightbox__nav:hover::before,
.article-lightbox__nav:focus-visible::before {
  background: rgb(var(--color-brand));
}

.carousel-nav:disabled,
.breves-strip__nav:disabled,
.scroll-row-prev:disabled,
.scroll-row-next:disabled,
.article-lightbox__nav:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

@media (min-width: 640px) {
  .carousel-nav,
  .breves-strip__nav,
  .scroll-row-prev,
  .scroll-row-next,
  .article-lightbox__nav {
    --gg-carousel-nav-size: 3rem; /* 48px */
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-nav,
  .carousel-nav::before,
  .breves-strip__nav,
  .breves-strip__nav::before,
  .scroll-row-prev,
  .scroll-row-prev::before,
  .scroll-row-next,
  .scroll-row-next::before,
  .article-lightbox__nav,
  .article-lightbox__nav::before {
    transition: none;
  }
}

/* Contest / CTA pip: tiny orange hex beside a label or badge. */
.gg-hex-accent-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gg-hex-accent-mark .gg-hex {
  --gg-hex-size: var(--gg-hex-size-badge);
}

/* Optional lead-media corner ticks (outline hex pips). Seed for featured video. */
.gg-hex-ticks {
  position: absolute;
  inset: 0.65rem;
  pointer-events: none;
  z-index: 2;
}

.gg-hex-ticks__tick {
  position: absolute;
  display: flex;
  color: rgb(var(--gg-hex-color));
  opacity: 0.88;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.45));
}

.gg-hex-ticks__tick .gg-hex {
  --gg-hex-size: var(--gg-hex-size-tick);
  color: inherit;
}

/* Large low-opacity outline watermark (one per tint band, not a tile). */
.gg-hex-watermark {
  position: absolute;
  top: 8%;
  right: -2%;
  z-index: 0;
  display: block;
  color: rgb(var(--color-brand));
  opacity: 0.1;
  pointer-events: none;
}

.gg-hex-watermark .gg-hex {
  --gg-hex-size: min(46vw, 22rem);
  width: calc(var(--gg-hex-size) * var(--gg-hex-aspect));
  height: var(--gg-hex-size);
  aspect-ratio: var(--gg-hex-aspect);
}

.light-mode .gg-hex-watermark {
  opacity: 0.08;
}

.gg-hex-ticks__tick--tl {
  top: 0;
  left: 0;
}

.gg-hex-ticks__tick--tr {
  top: 0;
  right: 0;
}

.gg-hex-ticks__tick--bl {
  bottom: 0;
  left: 0;
}

.gg-hex-ticks__tick--br {
  bottom: 0;
  right: 0;
}

/* Optional band divider: 1–3 outline hexes between major bands. */
.gg-hex-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-block: var(--space-2);
  color: rgb(var(--gg-hex-color) / 0.45);
  pointer-events: none;
}

.gg-hex-divider .gg-hex {
  --gg-hex-size: var(--gg-hex-size-tick);
  color: inherit;
}

/* ----- Badge ----- */

.gg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  font-size: var(--text-label-size);
  line-height: var(--text-label-line);
  font-weight: var(--text-label-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgb(var(--color-brand));
  border-radius: var(--radius-sm);
}

.gg-badge--has-icon {
  gap: 0.3rem;
}

.gg-badge--icon-only {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
}

.gg-badge__icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  display: block;
}

.gg-badge--platform {
  text-transform: none;
  letter-spacing: 0.02em;
}

.gg-badge--score {
  min-width: 2.25rem;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-md);
}

.gg-badge--tone-brand {
  background: rgb(var(--color-brand));
  color: #fff;
}

.gg-badge--tone-accent {
  background: rgb(var(--color-accent));
  color: #fff;
}

.gg-badge--tone-success {
  background: rgb(var(--color-success));
  color: #fff;
}

.gg-badge--tone-warning {
  background: rgb(var(--color-warning));
  color: rgb(var(--color-ink-inverse));
}

.gg-badge--tone-danger,
.gg-badge--tone-live {
  background: rgb(var(--color-danger));
  color: #fff;
}

.gg-badge--tone-muted {
  background: rgb(var(--color-surface-elevated));
  color: rgb(var(--color-ink-muted));
  border: 1px solid rgb(var(--color-border));
}

/* ----- Meta row ----- */

.gg-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  font-size: var(--text-meta-size);
  line-height: var(--text-meta-line);
  color: rgb(var(--color-ink-muted));
}

.feed-card__meta .gg-meta-row {
  gap: 0.55rem 0.85rem;
  font-size: 0.8125rem;
}

.gg-meta-row__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.gg-meta-row__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ----- Section header ----- */

.gg-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (min-width: 640px) {
  .gg-section-header {
    align-items: center;
    margin-bottom: var(--space-8);
  }
}

.gg-section-header__copy {
  min-width: 0;
  max-width: 42rem;
}

.gg-section-header__title {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.gg-section-header__title--hex {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 639px) {
  .gg-section-header__title--hex {
    gap: 0.5rem;
  }

  .gg-section-header__connector {
    display: none;
  }
}

/*
 * Section brand sigil — dual-layer regular hex + orange nucleus + bar tip.
 * Aspect stays √3/2 via --gg-hex-aspect / clip-path tokens. Decorative only.
 */
.gg-section-header__mark {
  --gg-section-sigil-size: var(--gg-hex-size-sigil);
  --gg-section-sigil-offset: 0.22rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  color: rgb(var(--color-brand));
  transform: translateY(-1px);
}

.gg-section-header__sigil {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: calc(var(--gg-section-sigil-size) * var(--gg-hex-aspect) + var(--gg-section-sigil-offset));
  height: calc(var(--gg-section-sigil-size) + var(--gg-section-sigil-offset));
}

/* Soft filled ghost, offset down-right for depth without gradients. */
.gg-section-header__sigil-ghost {
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(var(--gg-section-sigil-size) * var(--gg-hex-aspect));
  height: var(--gg-section-sigil-size);
  background: rgb(var(--color-brand) / 0.18);
  clip-path: var(--gg-hex-clip);
  pointer-events: none;
}

.light-mode .gg-section-header__sigil-ghost {
  background: rgb(var(--color-brand) / 0.14);
}

.gg-section-header__sigil-face {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: calc(var(--gg-section-sigil-size) * var(--gg-hex-aspect));
  height: var(--gg-section-sigil-size);
}

.gg-section-header__title--hex .gg-hex,
.gg-section-header__hex {
  --gg-hex-size: var(--gg-section-sigil-size);
  grid-area: 1 / 1;
  color: inherit;
}

/* Tiny orange nucleus — sole accent pip in the lockup. */
.gg-section-header__sigil-core {
  grid-area: 1 / 1;
  z-index: 2;
  width: calc(0.42rem * var(--gg-hex-aspect));
  height: 0.42rem;
  aspect-ratio: var(--gg-hex-aspect);
  background: rgb(var(--color-accent));
  clip-path: var(--gg-hex-clip);
  pointer-events: none;
}

/* Refined connector: solid brand bar + trailing hex tip (not a hairline). */
.gg-section-header__connector {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
  color: inherit;
}

.gg-section-header__rule {
  display: block;
  width: 1.35rem;
  height: 3px;
  background: currentColor;
}

.gg-section-header__rule-tip {
  display: block;
  width: calc(0.5rem * var(--gg-hex-aspect));
  height: 0.5rem;
  aspect-ratio: var(--gg-hex-aspect);
  background: currentColor;
  clip-path: var(--gg-hex-clip);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .gg-section-header__title {
    font-size: 1.875rem;
  }

  .gg-section-header__title--hex {
    gap: 0.9rem;
  }

  .gg-section-header__mark {
    --gg-section-sigil-size: 2.125rem; /* 34px */
    gap: 0.7rem;
  }

  .gg-section-header__sigil-core {
    width: calc(0.48rem * var(--gg-hex-aspect));
    height: 0.48rem;
  }

  .gg-section-header__rule {
    width: 1.75rem;
  }

  .gg-section-header__rule-tip {
    width: calc(0.55rem * var(--gg-hex-aspect));
    height: 0.55rem;
  }
}

/* Footer column titles — same lockup, compact scale (~24–26px). */
.gg-section-header__mark--footer {
  --gg-section-sigil-size: 1.5rem;
  --gg-section-sigil-offset: 0.16rem;
  gap: 0.4rem;
}

.gg-section-header__mark--footer .gg-section-header__sigil-core {
  width: calc(0.32rem * var(--gg-hex-aspect));
  height: 0.32rem;
}

.gg-section-header__mark--footer .gg-section-header__connector {
  gap: 0.2rem;
}

.gg-section-header__mark--footer .gg-section-header__rule {
  width: 1rem;
  height: 2px;
}

.gg-section-header__mark--footer .gg-section-header__rule-tip {
  width: calc(0.38rem * var(--gg-hex-aspect));
  height: 0.38rem;
}

@media (min-width: 640px) {
  .gg-section-header__mark--footer {
    --gg-section-sigil-size: 1.625rem; /* 26px */
    gap: 0.45rem;
  }

  .gg-section-header__mark--footer .gg-section-header__sigil-core {
    width: calc(0.34rem * var(--gg-hex-aspect));
    height: 0.34rem;
  }

  .gg-section-header__mark--footer .gg-section-header__rule {
    width: 1.15rem;
    height: 2px;
  }

  .gg-section-header__mark--footer .gg-section-header__rule-tip {
    width: calc(0.4rem * var(--gg-hex-aspect));
    height: 0.4rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .gg-section-header__mark {
    animation: gg-hex-mark-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes gg-hex-mark-in {
  from {
    opacity: 0;
    transform: translateX(-0.4rem) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.gg-section-header__lede {
  margin: 0.4rem 0 0;
  color: rgb(var(--color-ink-muted));
  font-size: 0.9375rem;
  line-height: 1.5;
}

.gg-section-header__more {
  align-items: center;
  gap: var(--space-2);
  color: rgb(var(--color-brand));
  font-size: 0.875rem;
  text-decoration: none;
}

@media (min-width: 640px) {
  .gg-section-header__more {
    font-size: 1rem;
  }
}

.gg-section-header__arrow {
  width: 1rem;
  height: 1rem;
}

@media (min-width: 640px) {
  .gg-section-header__arrow {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* ----- Social links ----- */

.gg-social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.gg-social-links--icon {
  gap: var(--space-4);
}

.gg-social-links--boxed {
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .gg-social-links--boxed {
    gap: var(--space-4);
  }
}

.gg-social-links--community {
  justify-content: center;
  gap: var(--space-6);
}

.gg-social-links--community .gg-social-links__link {
  color: rgb(var(--color-ink-muted));
}

.gg-social-links__icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.gg-social-links--icon .gg-social-links__link {
  color: rgb(var(--color-ink-muted));
  cursor: pointer;
}

.gg-social-links--boxed .gg-social-links__link {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--color-bg));
  border: 1px solid rgb(var(--color-border));
  color: rgb(var(--color-ink-muted));
}

.gg-social-links--community .gg-social-links__link:hover {
  color: var(--brand);
  border-color: var(--brand);
}

/* ----- Ad slot (GAM targets #cgdiv920 / #cgdiv922; do not reserve empty billboards) ----- */

.gg-ad-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-block: var(--space-4);
  overflow: visible;
}

.gg-ad-slot--flush-y,
.gg-ad-slot--footer {
  padding-block: 0;
}

.gg-ad-slot--chrome {
  padding-block: var(--space-4);
}

.gg-ad-slot.is-empty {
  display: none;
}

.gg-ad-slot__label {
  text-align: center;
  font-size: var(--text-meta-size);
  color: rgb(var(--color-ink-muted));
  margin-bottom: var(--space-1);
}

.gg-ad-slot__unit {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  border: 0;
  overflow: hidden;
}

.gg-ad-slot--header .gg-ad-slot__unit {
  width: 728px;
  max-width: 100%;
  height: 90px;
  flex-shrink: 0;
}

.gg-ad-slot--sidebar .gg-ad-slot__unit,
.gg-ad-slot--footer .gg-ad-slot__unit {
  width: 300px;
  max-width: 100%;
  height: 250px;
}

.gg-ad-slot iframe,
.gg-ad-slot .gg-ad-slot__unit iframe {
  display: block;
  max-width: 100%;
  border: 0;
}
