/*
  Sectioned template CSS
  - Fully multi-line formatted
  - Deduplicated and ordered selectors
  - Badge spacing fixed
  - Category ribbon full-width and color-coded
*/

/* Theme variables */
body.template-sectioned {
  --bg: #05081a;
  --text: #e6eef7;
  --muted: #a7b3c6;
  --accent: #37a1ff;
  --accent2: #8BCF3F;
  --card: rgb(255 255 255 / 4%);
  --border: rgb(255 255 255 / 12%);
  --radius: 16px;
  --shadow: 0 12px 34px rgb(0 0 0 / 38%);
  --container: clamp(320px, 92vw, 1120px);
  --h1: clamp(2.1rem, 1.2rem + 3vw, 3.2rem);
  --h2: clamp(1.3rem, 1rem + 1.6vw, 1.9rem);
}

/* Base site wrapper */
.site {
  color: var(--text);
  background: var(--bg);
}

/* Enforce dark mode inside template */
body.template-sectioned,
.site {
  background: var(--bg) !important;
  color: var(--text) !important;
}

.site a {
  color: inherit;
  text-decoration: none;
}

/* Top progress bar */
.site .progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #3cd0ff);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 80;
}

/* Hero */
.site .hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.site .hero .wrap {
  width: var(--container);
  margin: auto;
  padding: 72px 0 48px;
}

.site .hero-inner {
  display: flex;
  gap: 28px;
  align-items: center;
}

.site .hero-text {
  flex: 1;
  min-width: 0;
}

.site .hero-media {
  width: 40%;
  min-height: 260px;
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* Center a logo image inside hero-media and size via CSS variable (like product pages) */
.site .hero .hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site .hero .hero-media img.product-logo {
  width: var(--product-logo-width, 120px);
  max-width: 100%;
  height: auto;
  display: block;
}

.site .eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-size: .78rem;
}

.site h1 {
  font-family: "Space Grotesk", system-ui;
  font-size: var(--h1);
  line-height: 1.1;
  margin: .3rem 0 .6rem;
}

.site .lead {
  color: var(--muted);
  max-width: 65ch;
}

.site .cta {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.site .btn {
  position: relative;
  display: inline-block;
  padding: 11px 15px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid transparent;
}

.site .btn.primary {
  background: linear-gradient(135deg, var(--accent), #3cd0ff);
  color: #001018;
}

.site .btn.ghost {
  border: 1px solid var(--border);
  background: var(--card);
}

/* Aurora background visuals */
.site .aurora {
  position: absolute;
  inset: -30% -10%;
  z-index: -1;
  filter: saturate(120%) contrast(105%);
}

.site .blob {
  position: absolute;
  width: 60vw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(55 161 255 / 26%), transparent 70%);
  animation: site-drift 22s ease-in-out infinite alternate;
}


.site .blob.b2 {
  left: 55%;
  top: 10%;
  background: radial-gradient(closest-side, rgb(139 207 63 / 23%), transparent 70%);
  animation-duration: 28s;
}


.site .blob.b3 {
  left: 10%;
  top: 60%;
  background: radial-gradient(closest-side, rgb(108 88 255 / 20%), transparent 70%);
  animation-duration: 26s;
}


.site .grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.05'/></svg>");
  mix-blend-mode: overlay;
}

@keyframes site-drift {
  from {
    transform: translate(-8%, 0) scale(1);
  }

  to {
    transform: translate(8%, -6%) scale(1.1);
  }
}

/* Sections and container */
.site .section {
  padding: 48px 0;
  border-top: 1px solid rgb(255 255 255 / 6%);
}

.site .section:last-of-type {
  padding-bottom: 16px;
}

.site .container {
  width: var(--container);
  margin: auto;
}

/* ── Prose typography baseline ───────────────────────────────────────────────
   Raised to .site level so ALL templates inherit readable spacing regardless
   of nesting depth. Adding a new template or deeper nesting will never silently
   miss these rules again.

   Specificity ladder (intentional):
     .site p / .site li            → (0,1,1)  base prose
     .site .card p / .site .card li → (0,2,1)  card compact — always wins
   ───────────────────────────────────────────────────────────────────────── */
.site p,
.site li {
  line-height: 1.75;
  margin-bottom: 0.6em;
}

.site h2 {
  margin-top: 2.2rem;
  margin-bottom: 0.7rem;
}

.site h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
}

.site ul,
.site ol {
  padding-left: 1.4em;
  margin-bottom: 1em;
}

.site hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Cards: compact text — higher specificity than .site p so this always wins */
.site .card p,
.site .card li {
  margin-bottom: 0.2em;
  line-height: 1.5;
}

.site .grid {
  display: grid;
  gap: 16px;
}

.site .cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Allow full-width cards within the grid */
.site .grid .card.wide {
  grid-column: 1 / -1;
}

@media (width <= 960px) {
  .site .cols-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (width <= 640px) {
  .site .cols-3 {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.site .card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .12s;
}

.site .card.has-link {
  cursor: pointer;
}

.site .card .card-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
}

.site .card.has-link:hover {
  transform: translateY(-2px);
}

.site .card h3 {
  font-size: var(--h2);
  margin: .2rem 0 .3rem;
}

/* Space for badge so title doesn’t get cut */
.site .card.has-badge h3 {
  padding-right: 96px;
}

.site .card p {
  color: var(--muted);
}

.site .card p .icon {
  margin-right: .5em;
}

.site .chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.site .chip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .9rem;
  color: var(--muted);
}

.site .card .badge {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: .78rem;
  line-height: 1.2;
  border: 1px solid var(--border);
  background: rgb(255 255 255 / 10%);
  backdrop-filter: blur(4px);
  z-index: 6;
  pointer-events: none; /* don’t block clicks on the card link */
}

.site .card .badge.beta {
  background: linear-gradient(135deg, #7c4dff, #00e5ff);
  color: #001018;
}

.site .card .badge.coming-soon {
  background: linear-gradient(135deg, #b0bec5, #eceff1);
  color: #001018;
}

.site .card .badge.new {
  background: linear-gradient(135deg, #8BCF3F, #37a1ff);
  color: #001018;
}

.site .card .badge.promotion {
  background: linear-gradient(135deg, #ff8a00, #ff3d00);
  color: #001018;
}

.site .card .badge.released {
  background: linear-gradient(135deg, #8BCF3F, #37a1ff);
  color: #001018;
}

.site .card .badge.alpha {
  background: linear-gradient(135deg, #ff6b6b, #ff8a00);
  color: #001018;
}

/* Subtle highlight */
.site .card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgb(255 255 255 / 18%), transparent 30% 70%, rgb(255 255 255 / 12%));
  opacity: .06;
  pointer-events: none;
}

/* Featured accent card variant (aligned with product pages) */
.site .card.feature-accent {
  border-left-color: var(--accent, #37a1ff);
}

/* Reveal animation */
.site .reveal {
  opacity: 0;
  transform: translateY(16px) scale(.985);
  clip-path: inset(18% round 20px);
  transition: opacity .5s, transform .5s, clip-path .7s;
}

.site .reveal.in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 round 14px);
}

/* Category ribbon inside card */
.site .card.has-category {
  padding-bottom: 56px;
}

.site .card .category-ribbon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  background: var(--cat-color, var(--accent));
  color: #001018;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-weight: 700;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  z-index: 4;
}

/* Category banner under the grid */
.section-categories {
  padding-top: 12px;
}

.category-banner .category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-banner .chip {
  border: 1px solid var(--border);
}

/* CircleMenu section spacing */
.site .section.circlemenu-section {
  padding-top: 96px;
  padding-bottom: 240px;
}

.site .section.circlemenu-section:last-of-type {
  padding-bottom: 240px;
}

.site .section.circlemenu-section .container {
  overflow: visible;
}

.site .section.circlemenu-section .menu-wrapper {
  position: relative;
  min-height: 640px;
}

@media (width <= 960px) {
  .site .hero-inner {
    flex-direction: column-reverse;
    gap: 14px;
  }

  .site .hero-media {
    width: 100%;
    min-height: 200px;
  }

  .site .hero-text {
    width: 100%;
  }

  .site .section.circlemenu-section .menu-wrapper {
    min-height: 520px;
  }
}

@media (width <= 640px) {
  .site .section.circlemenu-section {
    padding-top: 64px;
    padding-bottom: 120px;
  }

  .site .section.circlemenu-section .menu-wrapper {
    min-height: 0;
  }
}

@media (width <= 340px) {
  .site .hero { overflow: visible; }
  .site .hero .wrap { padding: 52px 0 38px; }
  .site .hero-media { min-height: 180px; background-size: cover; background-repeat: no-repeat; background-position: center top; }
  .site .hero-text { margin-top: 8px; }
  .site h1 { font-size: clamp(1.75rem, 1.25rem + 6.5vw, 2.15rem); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .site .blob {
    animation: none;
  }

  .site .btn,
  .site .card,
  .site .reveal {
    transition: none;
  }

  .site .progress {
    display: none;
  }
}

/* Category color system via data-cat on ribbon, chips (banner + filter) */
.site .card .category-ribbon[data-cat="grav"],
.category-banner .chip[data-cat="grav"],
.site .chip[data-cat="grav"] {
  --cat-color: #37a1ff;
  background-color: #37a1ff;
  color: #001018;
}

.site .card .category-ribbon[data-cat="vagrant"],
.category-banner .chip[data-cat="vagrant"],
.site .chip[data-cat="vagrant"] {
  --cat-color: #8BCF3F;
  background-color: #8BCF3F;
  color: #001018;
}

.site .card .category-ribbon[data-cat="vm"],
.category-banner .chip[data-cat="vm"],
.site .chip[data-cat="vm"] {
  --cat-color: #7c4dff;
  background-color: #7c4dff;
  color: #f5fbff;
}

.site .card .category-ribbon[data-cat="prestashop"],
.category-banner .chip[data-cat="prestashop"],
.site .chip[data-cat="prestashop"] {
  --cat-color: #ff8a00;
  background-color: #ff8a00;
  color: #001018;
}

.site .card .category-ribbon[data-cat="shopware"],
.category-banner .chip[data-cat="shopware"],
.site .chip[data-cat="shopware"] {
  --cat-color: #00e5ff;
  background-color: #00e5ff;
  color: #001018;
}

.site .card .category-ribbon[data-cat="windows"],
.category-banner .chip[data-cat="windows"],
.site .chip[data-cat="windows"] {
  --cat-color: #00bcf2;
  background-color: #00bcf2;
  color: #001018;
}

.site .card .category-ribbon[data-cat="vscode"],
.category-banner .chip[data-cat="vscode"],
.site .chip[data-cat="vscode"] {
  --cat-color: #d7c1ff;
  background-color: #d7c1ff;
  color: #001018;
}

.site .card .category-ribbon[data-cat="web"],
.category-banner .chip[data-cat="web"],
.site .chip[data-cat="web"] {
  --cat-color: #bdf4c8;
  background-color: #bdf4c8;
  color: #001018;
}

.site .card .category-ribbon[data-cat="php"],
.category-banner .chip[data-cat="php"],
.site .chip[data-cat="php"] {
  --cat-color: #8892be;
  background-color: #8892be;
  color: #001018;
}

.site .card .category-ribbon[data-cat="javascript"],
.category-banner .chip[data-cat="javascript"],
.site .chip[data-cat="javascript"] {
  --cat-color: #f0db4f;
  background-color: #f0db4f;
  color: #001018;
}

.site .card .category-ribbon[data-cat="python"],
.category-banner .chip[data-cat="python"],
.site .chip[data-cat="python"] {
  --cat-color: #4b8bbe;
  background-color: #4b8bbe;
  color: #001018;
}

.site .card .category-ribbon[data-cat="mobile"],
.category-banner .chip[data-cat="mobile"],
.site .chip[data-cat="mobile"] {
  --cat-color: #ff6b6b;
  background-color: #ff6b6b;
  color: #001018;
}

.site .card .category-ribbon[data-cat="next"],
.category-banner .chip[data-cat="next"],
.site .chip[data-cat="next"] {
  --cat-color: #e2e8f0;
  background-color: #e2e8f0;
  color: #001018;
}

.site .card .category-ribbon[data-cat="react"],
.category-banner .chip[data-cat="react"],
.site .chip[data-cat="react"] {
  --cat-color: #61dafb;
  background-color: #61dafb;
  color: #001018;
}

.site .card .category-ribbon[data-cat="tool"],
.category-banner .chip[data-cat="tool"],
.site .chip[data-cat="tool"] {
  --cat-color: #ffd166;
  background-color: #ffd166;
  color: #001018;
}

.site .card .category-ribbon[data-cat="hardware"],
.category-banner .chip[data-cat="hardware"],
.site .chip[data-cat="hardware"] {
  --cat-color: #a8dadc;
  background-color: #a8dadc;
  color: #001018;
}

/* Filter chip: colored chip-style toggle. Deselected = dimmed. */
.filter-chip {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s, box-shadow 0.15s;
  border: 1px solid transparent;
}

.filter-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.filter-chip:has(input:not(:checked)) {
  opacity: 0.35;
  filter: saturate(0.6);
}
