/* =========================================================
   PAGE STYLES — Catalog page sections only
   (Hero, Feature, Catalog, Book-demo + Catalog Card)
   ========================================================= */

/* small global tweak for hero offset on narrow desktops */
@media (max-width: 75rem) {
  .section--hero {
    padding-block-start: calc(var(--slab-h-sm) + var(--space-7));
  }
  :where(.hide-sm) {
    display: none;
  }
}

/* =========================================================
   Catalog card (page component)
   Notes:
   - NO functionality changes (still non-clickable because pointer-events:none)
   - Keeps equal-height behavior (block-size: 100% + subgrid span 3)
   - Hover is “logical”: subtle lift + shadow + border color, but NO layout/height change
   ========================================================= */
.catalog-card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  align-items: start;
  row-gap: var(--space-3);
  padding: var(--space-6);

  border: 1px solid #d9d9d9;
  border-radius: var(--r-4);

  background: #ffffff;
  color: #000000;

  /* keep transitions, but don’t accidentally override ourselves later */
  transition:
    transform 0.08s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;

  .card-link {
    grid-row: 1;
    display: grid;
    grid-template-columns: 30px 1fr 10px;
    align-items: start;
    align-content: start;

    --icon-h: 3rem;
    --gap-h: 6px;
    /* --title-lines: 5; */
    --title-lh: 1.3;
    --title-fs: 1.125rem;
    --title-block: calc(var(--title-lines) * var(--title-lh) * var(--title-fs));

    block-size: var(
      --card-header-h,
      max(calc(var(--icon-h) + var(--gap-h)), var(--title-block))
    );

    gap: var(--space-2);
    text-decoration: none;
    color: inherit;
    outline: none;

    position: relative;

    /* keep current behavior (not interactive) */
    cursor: default;
    pointer-events: none;

    &::after {
      content: '';
      position: absolute;
      inset: -12px;
      border-radius: 12px;
    }
  }

  .card-icon {
    inline-size: 30px;
    block-size: 30px;
    display: inline-block;

    img {
      inline-size: 100%;
      block-size: 100%;
      display: block;

      /* if your icons are already dark, remove this */
      filter: none;
    }
  }

  .card-title {
    margin: 0;
    font-weight: 500;
    font-size: 1.375rem;
    line-height: 1.3;
    color: inherit;

    word-break: break-word;

    display: -webkit-box;
    /* -webkit-line-clamp: var(--title-lines); */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-chevron {
    justify-self: end;
    width: 8px;
    height: 8px;

    opacity: 0; /* stays hidden */
    pointer-events: none;
  }

  .card-desc {
    grid-row: 2;
    margin: 0;

    display: grid;
    grid-template-rows: subgrid;
    align-self: start;

    text-align: left;
    font-family: var(--font-paragraph);
    font-size: 1.125rem;
    line-height: 1.5;
    color: inherit;
  }

  /* Logical hover:
     - do NOT change height
     - do NOT remove our own hover styles with later overrides */
  &:hover,
  &:has(.card-link:focus-visible) {
    background-color: #ffffff; /* keep light, since text is #000 */
    border-color: #bdbdbd;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
  }
}

/* Preferred behavior: use subgrid when available */
@supports (grid-template-rows: subgrid) {
  .section--catalog {
    .catalog-grid {
      grid-auto-rows: auto 1fr auto;
      align-items: stretch;

      > li {
        display: block;
      }
    }

    .catalog-card {
      grid-template-rows: subgrid;
      grid-row: span 3;

      /* This is the key for equal height.
         Keep it so every card matches the tallest one. */
      block-size: 100%;
      align-content: start;

      .card-link {
        grid-row: 1;
        min-block-size: var(--card-header-h, auto);
      }

      .card-desc {
        grid-row: 2;
      }
    }
  }
}

/* Fallback: no subgrid */
@supports not (grid-template-rows: subgrid) {
  .section--catalog {
    .catalog-card {
      grid-template-rows: auto 1fr auto;
      grid-row: auto;
    }
  }
}

/* =========================================================
   HERO
   ========================================================= */
.section--hero {
  /* background-image: url('../../assets/images/Fusion-logo-background-section.png'); */
  /* background-repeat: no-repeat;
  background-size: cover; */
  background: linear-gradient(68.03deg, #1c1c1c 13.12%, #383838 84.57%);
  padding-block-start: calc(var(--slab-h) + var(--space-7));
  /* padding-inline: clamp(var(--space-4), 4vw, var(--space-9)); */
  padding-block-end: var(--copy-bottom-pad);

  min-block-size: clamp(31rem, 58vh, 34rem);
  /* padding-block-end: var(--space-5); */
  /* padding-inline-end: clamp(18rem, 38vw, 46rem); */
  /* .hero {
    min-block-size: clamp(25rem, var(--hero-min), var(--hero-max));
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: clamp(var(--space-5), 5vw, var(--hero-gap-max));
  } */

  /* Spacing */
  padding-block-start: calc(var(--slab-h) + var(--space-7));
  padding-block-end: var(--space-8);

  .hero {
    /* Keep copy above decorative layers */
    position: relative;
    z-index: 1;

    min-block-size: clamp(23rem, var(--hero-min), var(--hero-max));
    display: grid;
    grid-template-columns: 1fr;

    /* Key change: place content near bottom like the design */
    align-content: end;

    /* Creates “lift” so text isn’t glued to the bottom */
    padding-block-end: var(--copy-bottom-pad);
    /* padding-inline-end: clamp(18rem, 38vw, 46rem); */
    gap: var(--space-4);
  }
  /* .hero__copy {
    display: grid;
    gap: var(--space-3);
    max-inline-size: 75ch;
  } */
  .hero__copy {
    max-inline-size: 75ch;
    /* inline-size: min(24rem, 88vw); */
    /* inline-size: clamp(20rem, 42vw, 48rem); */
    position: relative;
  }
  .hero__title {
    margin: 0;
    /* font-size: clamp(1.75rem, 1.2rem + 1.3vw, 2.25rem); */
    font-size: var(--fs-h1);
    line-height: var(--lh-tight);
    color: var(--text);
  }

  .hero__body {
    margin: 0;
    font-family: var(--font-paragraph);
    /* font-size: clamp(0.95rem, 0.6rem + 0.7vw, 1.25rem); */
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
    color: var(--text);
  }

  /* .hero__glass {
    display: grid;
    display: none;
    place-items: center;
    gap: var(--space-4);
    inline-size: clamp(10.5rem, 14vw, 11.25rem);
    aspect-ratio: 1; */
  /* max-inline-size: clamp(7.5rem, 20vw, 15rem);
    max-block-size: clamp(7.5rem, 20vw, 15rem); */
  /* border-radius: var(--r-6);
    background: rgba(11, 14, 21, 0.4);
    backdrop-filter: blur(12px);
    position: relative;
    border: 1.5px solid transparent;
    background-clip: padding-box;
    padding: clamp(0.5rem, 5%, 1rem);

    &::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: inherit;
      padding: 1.5px;
      background: linear-gradient(
        153deg,
        rgba(255, 255, 255, 0.9) -14%,
        rgba(255, 255, 255, 0) 57%,
        rgba(255, 255, 255, 0.9) 96%
      );
      -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none;
    }

    &::after {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: inherit;
      box-shadow:
        0 -3px 8px rgba(255, 255, 255, 0.15),
        0 6px 12px rgba(0, 0, 0, 0.45);
      pointer-events: none;
    }

    .app-vector {
      inline-size: 90%;
      max-inline-size: 100%;
      block-size: auto;
      display: block; */

  /* rotate should not change “centering feel” */
  /* transform-origin: 50% 50%; */
}
/* } */

.hero__glass {
  display: none;
}

/* Stack hero + tune text/icon below ~tablet width (container) */
@media (max-width: 51.25rem) {
  .section--hero {
    .hero {
      grid-template-columns: 1fr;
      gap: var(--space-5);
    }

    .hero__glass {
      justify-self: center;
      inline-size: clamp(7.5rem, 6.5rem + 8vw, 11.25rem);
      /* padding: clamp(0.5rem, 5%, 1rem); */

      .app-vector {
        inline-size: clamp(6rem, 5.25rem + 6vw, 8.75rem);
      }
    }

    .hero {
      .hero__title {
        /* font-size: clamp(1.75rem, 1.35rem + 1.2cqw, 2.25rem); */
        font-size: var(--fs-h1);
      }
      .hero__body {
        /* font-size: clamp(0.95rem, 0.9rem + 0.35cqw, 1.125rem); */
        font-size: var(--fs-body);
      }
    }
  }

  .section--feature {
    .feature__inner {
      grid-template-columns: 1fr;
      justify-items: center;
      gap: var(--space-6);
    }

    .feature__media {
      order: -1;
      display: grid;
      /* place-items: center; */
      margin: 0;
      width: 100%;
    }

    .feature__media img {
      inline-size: clamp(16.25rem, 85vw, 32.5rem);
      height: auto;
      max-inline-size: 100%;
    }

    .feature__content {
      max-inline-size: 68ch;
      justify-items: start;
    }

    .feature__title {
      /* font-size: clamp(1.5rem, 1.15rem + 1cqw, var(--fs-800)); */
      font-size: var(--fs-h2);
    }

    .feature__content p {
      /* font-size: clamp(0.95rem, 0.92rem + 0.2cqw, 1rem); */
      font-size: var(--fs-body);
      line-height: 1.5;
    }
  }
}

@media (max-width: 26rem) {
  .section--hero {
    .hero {
      grid-template-columns: 1fr;
      gap: var(--space-5);
    }

    .hero__glass {
      justify-self: center;
      order: -1; /* only if you want tile above text */
    }
  }
}

/* Landscape safeguard for very small phones (single block) */
@media (max-width: 51.25rem) and (orientation: landscape) {
  .section--hero {
    .hero {
      min-block-size: min(80vh, var(--hero-max));
    }

    .hero__glass {
      inline-size: clamp(6rem, 22vw, 8.75rem);
      padding: var(--space-4);

      .app-vector {
        inline-size: clamp(5rem, 4.25rem + 6vw, 7rem);
      }
    }
  }
}

/* Ensure the glass tile never overlaps text at tighter widths */
@media (max-width: 43.75rem) {
  .section--hero {
    .hero {
      grid-template-columns: 1fr;
    }
    .hero__glass {
      justify-self: center;
    }
  }
}

/* @media (max-width: 37.5rem) {
  .section--hero {
    .hero__copy {
      padding-inline: var(--space-4); 
    }
  }
} */

/* =========================================================
   Feature section
   ========================================================= */
.section--feature {
  color: #0b0e15;
  /* padding: var(--space-11) clamp(var(--space-4), 4vw, var(--space-9)); */
  padding-block: var(--space-11);

  .feature__inner {
    display: grid;
    grid-template-columns: minmax(16rem, clamp(20rem, 42vw, 36rem)) 1fr;
    align-items: start;
    gap: clamp(var(--space-5), 4vw, var(--space-7));
  }

  .feature__media {
    margin: 0;
    display: grid;
    /* place-items: center; */
  }

  .feature__media img {
    display: block;
    inline-size: 100%;
    max-inline-size: clamp(18rem, 44vw, 36rem);
    height: auto;
    object-fit: contain;
    transform: scale(1.1);
    transform-origin: center;
  }

  .feature__content {
    display: grid;
    gap: var(--space-3);

    p {
      margin: 0;
      font-family: var(--font-paragraph);
      line-height: 1.5;
      color: #0b0e15;
    }
  }

  .feature__title {
    margin: 0;
    /* font-size: var(--fs-800); */
    font-size: var(--fs-h2);
    line-height: var(--lh-tight);
    color: #0b0e15;
  }

  .feature__lead {
    font-family: var(--font-paragraph);
    font-size: clamp(1rem, 0.7rem + 0.6vw, 1.25rem);
    line-height: 1.4;
    color: #0b0e15;
    margin: 0;
  }
}

/* Mobile stack fallback when container queries are not supported */
/* @media (max-width: 51.25rem) { */
@media (max-width: 64rem) {
  .section--feature {
    padding: var(--space-11) clamp(var(--space-4), 4vw, var(--space-9));
    .feature__inner {
      grid-template-columns: 1fr;
      /* justify-items: center; */
      gap: var(--space-6);
    }

    .feature__media {
      order: -1;
      display: grid;
      /* place-items: center; */
      margin: 0;
      width: 100%;
    }

    .feature__media img {
      inline-size: clamp(16.25rem, 85vw, 42rem);
      height: auto;
      max-inline-size: 100%;
    }

    .feature__content {
      max-inline-size: 68ch;
      justify-items: start;
    }
  }

  .section--hero {
    padding-block-start: calc(var(--slab-h-sm) + var(--space-6));
  }

  .section--feature > .container {
    padding-inline: 0;
  }

  .catalog-card {
    padding: var(--space-3);
  }
}

/* =========================================================
   Catalog section
   ========================================================= */
.section--catalog {
  background: var(--bg-3);
  color: #000000;
  /* padding: var(--space-11) clamp(var(--space-4), 4vw, var(--space-9)); */
  padding-block: var(--space-11);
  .container {
    display: grid;
    gap: var(--space-6);
  }

  .chip {
    /* color: #fff; */
    border-color: #cfd6df;

    &:is(:hover, :focus-visible) {
      border-color: #fff;
      box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
    }
  }

  .cat-header {
    display: grid;
    gap: var(--space-3);
    /* color: #000000; */
  }

  .cat-title {
    margin: 0;
    /* font-size: var(--fs-800); */
    font-size: var(--fs-h2);
    line-height: var(--lh-tight);
    /* color: #fff; */
  }

  .cat-intro {
    margin: 0;
    font-family: var(--font-paragraph);
    line-height: 1.5;
    font-size: var(--fs-body);
    /* color: #fff; */
    font-weight: 400;

    .subtitle {
      display: block;
    }

    .subtitle + .subtitle {
      margin-block-start: 6px;
    }
  }

  /* .cat-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding-block-end: var(--space-4);
    max-width: 100%;
  } */
  .cat-filters {
    display: none;
  }
  .chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    justify-content: center;
  }

  .catalog-grid {
    /* display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(17.5rem, 100%), 1fr)); */
    --card-w: 23.75rem;

    display: grid;
    grid-template-columns: repeat(
      auto-fit,
      minmax(min(var(--card-w), 100%), var(--card-w))
    );

    /* justify-content: center; */
    gap: var(--space-5);
    grid-auto-rows: auto 1fr auto;
    list-style: none;
    padding: 0;
    margin: 0;

    > li {
      position: relative;
    }
  }
}
@media (max-width: 51.25rem) {
  .section--catalog {
    .catalog-grid {
      /* 🔥 disable card-width logic entirely */
      grid-template-columns: 1fr;
      justify-content: stretch;
      p {
        font-size: var(--fs-body);
      }
    }
  }
}
@media (max-width: 51.25rem) {
  .section--catalog {
    .catalog-grid {
      grid-template-columns: 1fr;
      justify-content: stretch;
      p {
        font-size: var(--fs-body);
      }
    }
  }
}

/* =========================================================
   Book demo section
   ========================================================= */
.section--book-demo {
  background: #b3def8;
  color: #fff;
  /* padding: var(--space-11) clamp(var(--space-4), 4vw, var(--space-9)); */
  padding-block: var(--space-11);
  .container {
    max-width: 1000px;
  }

  .cta-box {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-6);
    border-radius: var(--r-4);
    background: #181c25;
    box-shadow: 3px 5px 15px #0290e9;
  }

  .book-demo-title {
    margin: 0;
    font-size: var(--fs-800);
    line-height: var(--lh-tight);
    text-align: center;
  }

  .cta-desc {
    margin: 0;
    font-family: var(--font-paragraph);
    /* font-size: clamp(1rem, 0.7rem + 0.6vw, 1.25rem); */
    font-size: var(--fs-body);
    line-height: 1.35;
  }

  .btn.btn--primary {
    justify-self: center;
    min-inline-size: 8.125rem;
    min-block-size: 2.0625rem;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--r-2);
  }
}

/* =========================================================
   SOLUTIONS — STOREFRONT (Page Styles Only)
   Relies on globals.css for tokens, header, footer, buttons, focus.
   ========================================================= */

.section--hero-storefront {
  background: linear-gradient(68.03deg, #1e0d46 13.12%, #322452 84.57%);
}

/* Storefront hero in your screenshot has no glass/icon panel */
.section--hero-storefront {
  .hero__glass {
    display: none;
  }
}

.site-section--power-choice {
  min-height: var(--section-height);

  .section-content {
    h2 {
      margin-bottom: var(--space-3);
      font-size: var(--fs-h2);
      font-weight: var(--fw-medium);
    }

    > p {
      margin-bottom: var(--space-7);
      max-width: var(--paragraph-max-width);
      font-family: var(--font-sans);
    }

    ul {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: var(--space-6);

      li:has(span) {
        border-left: 4px solid #0290e9;
      }

      li {
        background: white;
        border-radius: var(--r-3);
        padding: var(--space-5);
        list-style: none;
        h4 {
          display: flex;
          gap: var(--space-3);
          align-items: center;
          margin-bottom: var(--space-3);
          font-weight: 500;
          font-family: var(--font-montserrat);
          font-size: 1.375rem;
        }
        p {
          font-family: var(--font-sans);
        }
      }
    }
  }
}

@media (width < 48rem) {
  .site-section--power-choice {
    min-height: var(--section-height);

    .section-content {
      ul {
        grid-template-columns: 1fr;
      }
    }
  }
}

/* =========================================================
   FAQ (details/summary)
   ========================================================= */

/* .site-section {
  padding-inline: var(--gutter);
} */

/* .site-section--book-demo {
  padding-inline: calc(var(--gutter) + var(--site-gutter));
  max-width: 100%;
  margin-inline: 0;
} */
