/**
 * Geekflare V3 — homepage block re-skin
 *
 * The homepage is a page built from the theme's own blocks
 * (main/hero-banner, main/insights-section, main/articles-section,
 * main/article-carousel, main/meet-experts, main/numbers-section,
 * main/explore-categories) so editors keep control of it. Those blocks
 * also render on pages that haven't been migrated, so their render.php
 * files are left alone and re-skinned here instead.
 *
 * Everything is scoped to `.gf-home` (front-page.php's <main>) so nothing
 * here can leak onto an old-design page using the same blocks.
 *
 * The blocks are styled with hardcoded Tailwind utilities (bg-gray-25,
 * text-gray-900, bg-white, grey drop shadows, #FFF8F5 …) which have no
 * dark-mode story at all — most rules below exist to replace one of those
 * with a V3 token.
 *
 * @package Main
 * @since 1.0.0
 */

/* ---------- Shared shell ---------- */
.gf-home .container-1056,
.gf-home .container-1280 {
  max-width: var(--gf-max);
  margin-inline: auto;
  padding-inline: 28px;
}

/* Section bands: the design keeps the page on one surface and separates
   sections with space, not tinted bands. */
.gf-home .insights-section,
.gf-home .security-guides-section,
.gf-home .articles-section,
.gf-home .meet-experts-section,
.gf-home .home-numbers-section {
  background: none;
  padding-block: 56px;
}
.gf-home .meet-experts-section {
  background: var(--gf-sunk);
}

/* Section headings — display face, left aligned, design sizes. */
.gf-home .insights-section h2,
.gf-home .security-guides-section h2,
.gf-home .articles-section > .container-1056 > div > div:first-child,
.gf-home .meet-experts-section h2,
.gf-home .home-numbers-section h2 {
  font-family: var(--gf-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.16;
  letter-spacing: -0.03em;
  color: var(--gf-text);
}
.gf-home .insights-section .text-center,
.gf-home .articles-section .items-center,
.gf-home .articles-section .text-center,
.gf-home .meet-experts-section .text-center,
.gf-home .home-numbers-section .items-center {
  align-items: flex-start;
  text-align: left;
}

/* Sub-headings / excerpts / meta */
.gf-home .text-gray-900 { color: var(--gf-text); }
.gf-home .text-gray-800 { color: var(--gf-text); }
.gf-home .text-gray-500 { color: var(--gf-dim); }
.gf-home .text-primary { color: var(--gf-2-text); }

/* ---------- Hero row (hero banner + sponsored spotlight) ---------- */
/* front-page.php wraps a Hero Banner and an immediately-following
   Sponsored Spotlight in this element so they share a row. */
.gf-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 48px;
  align-items: center;
  max-width: var(--gf-max);
  margin-inline: auto;
  padding: 68px 28px 56px;
}
@media (max-width: 1020px) {
  .gf-hero-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
/* Inside the row the hero is already inside the shared gutter. */
.gf-hero-row .hero-banner .container-1056 {
  max-width: none;
  padding-inline: 0;
}

/* ---------- Sponsored spotlight ---------- */
.gf-spotlight__card {
  position: relative;
  overflow: hidden;
  border-radius: var(--gf-r);
  border: var(--gf-hair);
  background: var(--gf-panel);
  box-shadow: var(--gf-shadow);
  padding: 26px;
}
/* Fixed (not theme-varying) so it reads with the same strength in both modes. */
.gf-spotlight__glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 74, 0, 0.16), transparent 70%);
  pointer-events: none;
}
.gf-spotlight__brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.gf-spotlight__mark {
  height: 20px;
  width: auto;
  flex: none;
}
.gf-spotlight__name {
  font-family: var(--gf-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--gf-text);
}
.gf-spotlight__headline {
  position: relative;
  font-family: var(--gf-display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--gf-text);
  margin: 0 0 10px;
  text-wrap: pretty;
}
.gf-spotlight__blurb {
  position: relative;
  font-family: var(--gf-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--gf-dim);
  margin: 0 0 20px;
}
.gf-spotlight__logos {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.gf-spotlight__logos img {
  height: 22px;
  width: auto;
}
.gf-spotlight__card .gf-cta-glow {
  position: relative;
}
.gf-cta-glow--static {
  animation: none;
}
.gf-cta-glow--static::after {
  display: none;
}

/* ---------- Hero ---------- */
.gf-home .hero-banner {
  padding-block: 68px 56px;
}
.gf-hero-row .hero-banner {
  padding-block: 0;
}
.gf-home .hero-banner__content {
  text-align: left;
  align-items: flex-start;
}
.gf-home .hero-banner h1 {
  font-family: var(--gf-display);
  font-weight: 700;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: var(--gf-track-1);
  text-align: left;
  max-width: 17ch;
  margin: 0 0 18px;
  color: var(--gf-text);
}
.gf-home .hero-banner__description {
  font-family: var(--gf-serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--gf-dim);
  text-align: left;
  max-width: 54ch;
  margin: 0 0 30px;
}
/* The old hero's mascot video/still isn't part of the V3 hero. */
.gf-home .hero-banner__image {
  display: none;
}
/* Search: a plain row, not a raised card. */
.gf-home .hero-banner-form,
.gf-home .hero-banner__form-content {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: 560px;
}
.gf-home .hero-banner input.form-input {
  height: 50px;
  border-radius: var(--gf-r-sm);
  background: var(--gf-panel);
  border: 1px solid var(--gf-line-2);
  color: var(--gf-text);
  font-family: var(--gf-sans);
  font-size: 15px;
}
.gf-home .hero-banner input.form-input::placeholder {
  color: var(--gf-quiet);
}
/* The block absolutely positions the submit button over the input; the
   design has it sitting beside the field instead. */
.gf-home .hero-banner form > .flex {
  gap: 10px;
  align-items: stretch;
}
.gf-home .hero-banner form .md\:absolute {
  position: static !important;
  display: flex !important;
  align-items: stretch;
}
.gf-home .hero-banner form .md\:absolute .btn {
  height: 50px;
  padding-inline: 22px;
  white-space: nowrap;
}
/* The block's search icon carries an inline stroke colour. */
.gf-home .hero-banner svg path[stroke] {
  stroke: var(--gf-quiet) !important;
}
.gf-home .search-suggestions {
  gap: 8px;
  margin-top: 14px;
}
.gf-home .search-suggestions-item {
  background: none;
  border: var(--gf-hair);
  border-radius: 999px;
  color: var(--gf-dim);
  font-family: var(--gf-sans);
  font-size: 12.5px;
  padding: 6px 12px;
}
.gf-home .search-suggestions-item:hover,
.gf-home .search-suggestions-item.active {
  background: var(--gf-sunk);
  border-color: var(--gf-line-2);
  color: var(--gf-text);
}

/* ---------- Buttons (shared: .btn--primary / .btn--outline) ---------- */
/* The hero's search submit is the neutral ink button in the design — the
   orange is reserved for the sponsored CTA so there's one clear accent. */
.gf-home .hero-banner .btn.btn--primary {
  background: var(--gf-text);
  border-color: var(--gf-text);
  color: var(--gf-bg);
}
.gf-home .hero-banner .btn.btn--primary:hover {
  background: var(--gf-text);
  border-color: var(--gf-text);
  opacity: 0.88;
}
.gf-home .btn.btn--primary {
  background: var(--gf-brand);
  border-color: var(--gf-brand);
  color: #fff;
  border-radius: var(--gf-r-sm);
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 14px;
}
.gf-home .btn.btn--primary:hover {
  background: var(--gf-brand-hover);
  border-color: var(--gf-brand-hover);
}
.gf-home .btn.btn--outline {
  background: none;
  border: 1px solid var(--gf-line-2);
  color: var(--gf-text);
  border-radius: var(--gf-r-sm);
}
.gf-home .btn.btn--outline svg path,
.gf-home .btn.btn--outline svg line,
.gf-home .btn.btn--outline svg polyline {
  stroke: currentColor !important;
}
/* The design doesn't repeat a "Read Guide" link under every card — the
   whole card is already a link, and the meta line carries author + date
   instead (added by main_gf_home_card_meta()). */
.gf-home .insights-section .btn-read-guide,
.gf-home .articles-section .btn-read-guide,
.gf-home .security-guides-section .btn-read-guide {
  display: none;
}
.gf-home .btn-read-guide {
  color: var(--gf-2-text);
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 13.5px;
  background: none !important;
}
.gf-home .btn-read-guide:hover {
  color: var(--gf-accent-text);
}
.gf-home .gf-card-meta {
  font-family: var(--gf-sans);
  font-size: 12.5px;
  color: var(--gf-quiet);
}

/* Section CTA: the design uses a quiet text link on the right, not a
   centred orange button. */
.gf-home .insights-section > .container-1056 > .justify-center,
.gf-home .articles-section > .container-1056 > .justify-center,
.gf-home .security-guides-section > .container-1056 > .justify-center {
  justify-content: flex-end;
  margin-top: -6px;
}
.gf-home .insights-section > .container-1056 > .justify-center > .btn,
.gf-home .articles-section > .container-1056 > .justify-center > .btn,
.gf-home .security-guides-section > .container-1056 > .justify-center > .btn {
  background: none;
  border: none;
  padding: 0;
  height: auto;
  color: var(--gf-2-text);
  font-size: 13.5px;
  font-weight: 600;
}
.gf-home .insights-section > .container-1056 > .justify-center > .btn:hover,
.gf-home .articles-section > .container-1056 > .justify-center > .btn:hover,
.gf-home .security-guides-section > .container-1056 > .justify-center > .btn:hover {
  background: none;
  color: var(--gf-accent-text);
}
.gf-home .justify-center > .btn svg path,
.gf-home .justify-center > .btn svg line,
.gf-home .justify-center > .btn svg polyline {
  stroke: currentColor !important;
}

/* ---------- Cards (insights sticky, carousel, articles grid) ---------- */
.gf-home .article-item .article-thumb {
  border-radius: var(--gf-r);
  border: var(--gf-hair);
  background: var(--gf-sunk);
}
.gf-home .article-item .article-thumb img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.gf-home .article-item h3 {
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.28;
  letter-spacing: -0.018em;
  color: var(--gf-text);
}
.gf-home .article-item .text-xs.uppercase,
.gf-home .other_posts .text-xs.uppercase {
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--gf-2-text);
}
.gf-home article .line-clamp-1,
.gf-home .article-item .text-sm {
  font-family: var(--gf-serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--gf-dim);
}

/* Insights: the sticky post is the big card, the rest are a list. */
.gf-home .insights-section .sticky_posts:empty {
  display: none;
}
/* The block always wraps sticky posts in a Flickity carousel, which leaves
   a page-dot rail behind even when there's only one card. */
.gf-home .insights-section .feature-articles-carousel {
  margin: 0;
}
.gf-home .insights-section .flickity-page-dots {
  display: none;
}
.gf-home .insights-section .sticky_posts .article-item h3 {
  font-family: var(--gf-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.gf-home .insights-section .other_posts > article {
  border-color: var(--gf-line);
}
/* "Spotlight" pill on the sticky card. */
.gf-home .insights-section .article-thumb .absolute {
  background: var(--gf-panel);
  border: var(--gf-hair);
  box-shadow: none;
  color: var(--gf-2-text);
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 11px;
}
.gf-home .insights-section .article-thumb .absolute svg path {
  fill: var(--gf-brand) !important;
}

/* ---------- Meet experts ---------- */
/* The block paints a decorative texture over the whole section from an
   inline style (and its own inline <style> with !important at ≥1024px). */
.gf-home section.meet-experts-section .meet-experts-texture {
  background-image: none !important;
  display: none;
}
/* Heading and standfirst sit on one baseline, like every other section. */
.gf-home .meet-experts-section .container-1056 > div:first-child {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  max-width: none;
  width: 100%;
  padding: 0;
}
.gf-home .meet-experts-section .container-1056 > div:first-child > div {
  font-size: 14px;
  color: var(--gf-dim);
}

/* Fallback shape if src/js/gf-v3-experts.js hasn't run (no JS): the
   block's own bio cards, on V3 surfaces. */
.gf-home .meet-experts-section article {
  background: var(--gf-panel);
  border: var(--gf-hair);
  border-radius: var(--gf-r);
  box-shadow: none;
}
.gf-home .meet-experts-section article h3 {
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--gf-text);
}

/* --- Two-row marquee (built by src/js/gf-v3-experts.js) --- */
.gf-experts-marquee {
  display: grid;
  gap: 16px;
  width: 100%;
}
.gf-experts-lane {
  overflow: hidden;
  /* Cards enter and leave by fading rather than being cut off at the
     container edge. */
  mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.gf-experts-track {
  display: flex;
  width: max-content;
  animation: gf-experts-scroll var(--gf-marquee-duration, 60s) linear infinite;
}
.gf-experts-lane--reverse .gf-experts-track {
  animation-direction: reverse;
  /* Start the second row half a lap in, so the two rows don't read as
     one block of cards sliding apart. */
  animation-delay: calc(var(--gf-marquee-duration, 60s) / -2);
}
.gf-experts-marquee:hover .gf-experts-track,
.gf-experts-marquee:focus-within .gf-experts-track {
  animation-play-state: paused;
}
/* The track holds the run twice over, so -50% is exactly one run. The
   gap lives on the cards, not on the flex container, so that the two
   halves stay the same width and the loop doesn't jump. */
@keyframes gf-experts-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.gf-expert-card {
  display: flex;
  gap: 13px;
  align-items: center;
  flex: 0 0 288px;
  width: 288px;
  margin-right: 16px;
  padding: 16px;
  border-radius: var(--gf-r);
  background: var(--gf-panel);
  border: var(--gf-hair);
  box-shadow: none;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.gf-expert-card:hover {
  border-color: var(--gf-line-strong, var(--gf-quiet));
  background: var(--gf-bg);
}
.gf-expert-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  display: block;
  background: var(--gf-sunk);
}
.gf-expert-card__text {
  min-width: 0;
}
.gf-expert-card__name {
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--gf-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gf-expert-card__role {
  font-size: 12.5px;
  color: var(--gf-quiet);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .gf-experts-track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
    row-gap: 16px;
  }
  .gf-experts-lane {
    mask-image: none;
    -webkit-mask-image: none;
  }
  /* Nothing scrolls, so the duplicated run would just repeat the same
     faces down the page. */
  .gf-experts-track > [aria-hidden="true"] {
    display: none;
  }
}

/* ---------- Numbers ---------- */
.gf-home .stats-card {
  background: var(--gf-panel);
  border: var(--gf-hair);
  border-radius: var(--gf-r);
  box-shadow: none;
}

/* ---------- Explore categories ---------- */
/* This panel is intentionally dark in both themes, so it keeps its own
   surface — only the cards sitting on it get token colours. */
.gf-home .home-categories-container-1056 {
  border-radius: var(--gf-r);
}
.gf-home .home-categories-item {
  background: var(--gf-panel);
  border: var(--gf-hair);
  border-radius: var(--gf-r-sm);
}
.gf-home .home-categories-item h3 {
  font-family: var(--gf-sans);
  font-weight: 600;
  color: var(--gf-text);
}
.gf-home .home-categories-item svg path {
  stroke: var(--gf-quiet);
}

/* ---------- Kill the old design's grey drop shadows everywhere ---------- */
.gf-home [class*="shadow-"] {
  box-shadow: none;
}
