/**
 * sinopak/project-index block styles
 *
 * Projects landing grid (no top banner): a light section head + a card grid of
 * project cases. Aligned with sinopak/case-grid card language (bordered white
 * cards, orange eyebrow, navy titles) but larger, editorial tiles for a
 * dedicated /cases/ page. Breakpoints match the site (1180 / 760).
 */
@layer spk-block {
  .spk-x-project-index {
    /* /cases/ hub opens on this block (no hero band) — carry the shared
       inner-page top offset so it clears the solid header by the same amount
       as the hero pages instead of stacking on the base .spk-x-section pad. */
    padding-top: var(--spk-x-hero-pad-top);
    background: var(--wp--preset--color--white, #fff);
  }
  .spk-x-project-index__head {
    max-width: 900px;
    margin-bottom: clamp(30px, 3.4vw, 46px);
  }
  .spk-x-project-index .spk-x-eyebrow {
    display: block;
    margin: 0 0 16px;
    color: var(--wp--preset--color--orange, #f28a2e);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
  .spk-x-project-index .spk-x-section-title {
    margin: 0 0 18px;
    color: var(--wp--preset--color--navy, #06366b);
    font-size: clamp(30px, 3.8vw, 52px);
    line-height: 1.03;
    letter-spacing: -0.045em;
    text-wrap: balance;
  }
  .spk-x-project-index .spk-x-section-lead {
    max-width: 780px;
    color: var(--wp--preset--color--muted, #637381);
    font-size: 16px;
    line-height: 1.68;
  }

  .spk-x-project-index__empty {
    padding: 40px 0;
    color: var(--wp--preset--color--muted, #637381);
    font-size: 16px;
  }

  .spk-x-project-index__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }

  .spk-x-project-index__card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--wp--preset--color--line, #dbe5ec);
    border-radius: 14px;
    background: var(--wp--preset--color--white, #fff);
    text-decoration: none;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  }
  .spk-x-project-index__card:hover {
    transform: translateY(-4px);
    border-color: rgba(8, 168, 210, 0.5);
    box-shadow: 0 26px 54px rgba(6, 36, 74, 0.16);
  }

  .spk-x-project-index__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 11;
    background: var(--wp--preset--color--pale, #f4f7f9);
  }
  /* 列表/案例卡片特色图 → contain,避免不同比例图被裁切(16-11 盒子不动;
     留白沿用 __media 已有的浅灰底 --pale;hover scale 保留)。 */
  .spk-x-project-index__media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: saturate(0.98) contrast(1.03);
    transition: transform 0.4s ease;
  }
  .spk-x-project-index__card:hover .spk-x-project-index__media img {
    transform: scale(1.045);
  }
  .spk-x-project-index__chip {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 1;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(6, 36, 74, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
  }

  .spk-x-project-index__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 26px 24px 24px;
  }
  .spk-x-project-index__title {
    margin: 0 0 12px;
    color: var(--wp--preset--color--navy, #06366b);
    font-size: clamp(21px, 1.7vw, 27px);
    line-height: 1.12;
    letter-spacing: -0.035em;
  }
  .spk-x-project-index__text {
    margin: 0 0 20px;
    color: var(--wp--preset--color--muted, #637381);
    font-size: 15px;
    line-height: 1.62;
  }

  .spk-x-project-index__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: auto 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--wp--preset--color--line, #dbe5ec);
  }
  .spk-x-project-index__facts dt {
    color: var(--wp--preset--color--orange, #f28a2e);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .spk-x-project-index__facts dd {
    margin: 5px 0 0;
    color: var(--wp--preset--color--ink, #122231);
    font-size: 14px;
    font-weight: 850;
  }

  .spk-x-project-index__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    color: var(--wp--preset--color--blue, #075d94);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .spk-x-project-index__card:hover .spk-x-project-index__link {
    color: var(--wp--preset--color--navy, #06366b);
  }
}

@layer spk-responsive {
  @media (max-width: 1180px) {
    .spk-x-project-index__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (max-width: 760px) {
    .spk-x-project-index__grid {
      grid-template-columns: 1fr;
    }
  }
}
