@layer base, layout, components, utilities, pages;

/**
 * Single Page Hero - Refined Industrial Design
 * A sophisticated hero component for manufacturing excellence
 * Typography: Outfit (EN) + Zen Kaku Gothic New (JP)
 */

@layer components {

  /* --------------------------------------------------------------------------
     Design Tokens
     -------------------------------------------------------------------------- */
  .single-hero {
    --sh-color-text: #f8fafc;
    --sh-color-text-secondary: rgba(248, 250, 252, 0.7);
    --sh-color-accent: #38bdf8;
    --sh-color-accent-glow: rgba(56, 189, 248, 0.15);
    --sh-color-surface: #0c1220;
    --sh-color-surface-elevated: rgba(15, 23, 42, 0.8);
    --sh-radius-sm: 4px;
    --sh-radius-md: 8px;
    --sh-radius-pill: 100px;
    --sh-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --sh-font-display: 'Outfit', system-ui, sans-serif;
    --sh-font-body: 'Zen Kaku Gothic New', system-ui, sans-serif;
  }

  /* --------------------------------------------------------------------------
     Hero Container - Centered content with refined proportions
     -------------------------------------------------------------------------- */
  .single-hero {
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--sh-color-surface);
  }

  /* Ambient gradient orb */
  .single-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 60%;
    height: 140%;
    background: radial-gradient(
      ellipse at center,
      rgba(56, 189, 248, 0.08) 0%,
      rgba(56, 189, 248, 0.02) 40%,
      transparent 70%
    );
    pointer-events: none;
    z-index: 1;
  }

  /* No-image variant */
  .single-hero--no-image {
    min-height: 320px;
  }

  .single-hero--no-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, transparent 0%, var(--sh-color-surface) 100%),
      repeating-linear-gradient(
        90deg,
        transparent,
        transparent 120px,
        rgba(56, 189, 248, 0.03) 120px,
        rgba(56, 189, 248, 0.03) 121px
      );
    z-index: 1;
    pointer-events: none;
  }

  /* --------------------------------------------------------------------------
     Background Image with Ken Burns
     -------------------------------------------------------------------------- */
  .single-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .single-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 12s var(--sh-ease);
    will-change: transform;
  }

  .single-hero:hover .single-hero__bg img {
    transform: scale(1.06);
  }

  /* --------------------------------------------------------------------------
     Overlay - Cinematic gradient
     -------------------------------------------------------------------------- */
  .single-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
      linear-gradient(
        90deg,
        rgba(12, 18, 32, 0.95) 0%,
        rgba(12, 18, 32, 0.8) 50%,
        rgba(12, 18, 32, 0.6) 100%
      ),
      linear-gradient(
        180deg,
        rgba(12, 18, 32, 0.3) 0%,
        rgba(12, 18, 32, 0.7) 100%
      );
  }

  .single-hero--no-image .single-hero__overlay {
    display: none;
  }

  /* --------------------------------------------------------------------------
     Content Container
     -------------------------------------------------------------------------- */
  .single-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 48px 64px;
  }

  .single-hero__content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* --------------------------------------------------------------------------
     Eyebrow - Refined pill label
     -------------------------------------------------------------------------- */
  .single-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-family: var(--sh-font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sh-color-accent);
    background: var(--sh-color-accent-glow);
    padding: 6px 16px;
    border-radius: var(--sh-radius-pill);
    margin-bottom: 20px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* Decorative dot before text */
  .single-hero__eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--sh-color-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--sh-color-accent);
  }

  /* --------------------------------------------------------------------------
     Title - Large, confident typography
     -------------------------------------------------------------------------- */
  .single-hero__title {
    font-family: var(--sh-font-body);
    font-size: clamp(28px, 3.5vw, 44px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--sh-color-text);
    margin: 0 0 16px;
    max-width: 100%;
  }

  /* --------------------------------------------------------------------------
     Lead text
     -------------------------------------------------------------------------- */
  .single-hero__lead {
    font-family: var(--sh-font-body);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.8;
    color: var(--sh-color-text-secondary);
    margin: 0 0 24px;
    max-width: 720px;
  }

  /* --------------------------------------------------------------------------
     Tags - Minimal inline chips
     -------------------------------------------------------------------------- */
  .single-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .single-hero__tags li {
    margin: 0;
  }

  .single-hero__tags a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-family: var(--sh-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--sh-color-text);
    background: var(--sh-color-surface-elevated);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(248, 250, 252, 0.1);
    border-radius: var(--sh-radius-sm);
    text-decoration: none;
    transition:
      background 0.2s var(--sh-ease),
      border-color 0.2s var(--sh-ease),
      transform 0.2s var(--sh-ease);
  }

  .single-hero__tags a:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-2px);
  }

  /* --------------------------------------------------------------------------
     Meta - Date/Author info
     -------------------------------------------------------------------------- */
  .single-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(248, 250, 252, 0.08);
  }

  .single-hero__meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sh-font-body);
    font-size: 13px;
    color: var(--sh-color-text-secondary);
  }

  .single-hero__meta-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    stroke: currentColor;
  }

  .single-hero__meta-item time {
    font-family: var(--sh-font-display);
    font-weight: 500;
    font-feature-settings: 'tnum';
    letter-spacing: 0.02em;
  }

  /* --------------------------------------------------------------------------
     Responsive: Large Tablet (1024px)
     -------------------------------------------------------------------------- */
  @media (max-width: 1024px) {
    .single-hero {
      min-height: 340px;
    }

    .single-hero--no-image {
      min-height: 300px;
    }

    .single-hero__inner {
      padding: 40px 48px;
    }

    .single-hero__title {
      font-size: clamp(26px, 4vw, 38px);
    }
  }

  /* --------------------------------------------------------------------------
     Responsive: Tablet Portrait (768px)
     -------------------------------------------------------------------------- */
  @media (max-width: 768px) {
    .single-hero {
      min-height: 300px;
    }

    .single-hero--no-image {
      min-height: 280px;
    }

    .single-hero::before {
      width: 80%;
      top: -20%;
    }

    .single-hero__inner {
      padding: 36px 28px;
    }

    .single-hero__eyebrow {
      font-size: 10px;
      padding: 5px 14px;
      margin-bottom: 16px;
    }

    .single-hero__eyebrow::before {
      width: 5px;
      height: 5px;
    }

    .single-hero__title {
      font-size: clamp(24px, 5vw, 32px);
      line-height: 1.4;
      margin-bottom: 14px;
    }

    .single-hero__lead {
      font-size: 14px;
      margin-bottom: 20px;
    }

    .single-hero__tags {
      gap: 6px;
    }

    .single-hero__tags a {
      font-size: 12px;
      padding: 6px 12px;
    }

    .single-hero__meta {
      gap: 16px;
      margin-top: 20px;
      padding-top: 16px;
    }

    .single-hero__meta-item {
      font-size: 12px;
    }
  }

  /* --------------------------------------------------------------------------
     Responsive: Mobile (600px)
     -------------------------------------------------------------------------- */
  @media (max-width: 600px) {
    .single-hero {
      min-height: 260px;
    }

    .single-hero--no-image {
      min-height: 240px;
    }

    .single-hero::before {
      display: none;
    }

    .single-hero__inner {
      padding: 28px 20px;
    }

    .single-hero__eyebrow {
      font-size: 9px;
      padding: 4px 12px;
      letter-spacing: 0.15em;
      margin-bottom: 14px;
      gap: 6px;
    }

    .single-hero__eyebrow::before {
      width: 4px;
      height: 4px;
    }

    .single-hero__title {
      font-size: 22px;
      line-height: 1.45;
      margin-bottom: 12px;
    }

    .single-hero__lead {
      font-size: 13px;
      line-height: 1.75;
      margin-bottom: 16px;
    }

    .single-hero__tags {
      gap: 5px;
    }

    .single-hero__tags a {
      font-size: 11px;
      padding: 5px 10px;
    }

    .single-hero__meta {
      gap: 12px;
      margin-top: 16px;
      padding-top: 14px;
    }

    .single-hero__meta-item {
      font-size: 11px;
      gap: 6px;
    }

    .single-hero__meta-item svg {
      width: 14px;
      height: 14px;
    }
  }
}
