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

/* Entry Hero - 2025 Clean Editorial Design */

@layer pages {
  .entry-hero {
    --hero-bg: #0e0e10;
    --hero-accent: #b38f2d;
    --hero-accent-bright: #d4ad50;
    --hero-text: #faf8f5;
    --hero-text-muted: rgba(250, 248, 245, 0.65);
    --hero-border: rgba(179, 143, 45, 0.25);

    position: relative;
    padding: clamp(52px, 8vw, 88px) 0;
    color: var(--hero-text);
    background: var(--hero-bg);
    overflow: hidden;
  }

  /* Subtle texture overlay */
  .entry-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
      repeating-linear-gradient(
        90deg,
        transparent,
        transparent 120px,
        rgba(179, 143, 45, 0.02) 120px,
        rgba(179, 143, 45, 0.02) 121px
      );
    pointer-events: none;
  }

  /* Top accent line */
  .entry-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--hero-accent);
    pointer-events: none;
  }

  .entry-hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: clamp(32px, 5vw, 56px);
    align-items: center;
  }

  .entry-hero__copy {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2.5vw, 20px);
  }

  /* Eyebrow - Clean uppercase label */
  .entry-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.65rem, 0.9vw, 0.72rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--hero-accent-bright);
  }

  .entry-hero__eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--hero-accent);
  }

  /* Taxonomy badges - Compact pills */
  .entry-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .entry-hero__badges .term-badges {
    display: inherit;
    flex-wrap: inherit;
    gap: inherit;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .entry-hero__badges .term-badges__item {
    margin: 0;
  }

  .entry-hero__badges .term-badges__link {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: rgba(179, 143, 45, 0.12);
    border: 1px solid rgba(179, 143, 45, 0.25);
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--hero-accent-bright);
    text-decoration: none;
    transition: all 0.2s ease;
  }

  .entry-hero__badges .term-badges__link:hover,
  .entry-hero__badges .term-badges__link:focus-visible {
    background: var(--hero-accent);
    border-color: var(--hero-accent);
    color: var(--hero-bg);
  }

  /* Title - Unified size across all entry pages */
  .entry-hero__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    line-height: 1.55;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--hero-text);
    text-wrap: balance;
  }

  /* Lead text */
  .entry-hero__lead {
    margin: 0;
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    line-height: 1.85;
    color: var(--hero-text-muted);
    max-width: 50ch;
    font-weight: 400;
  }

  /* Meta items */
  .entry-hero__meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: clamp(6px, 1.5vw, 12px) 0 0;
    padding: 0;
    list-style: none;
  }

  .entry-hero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(250, 248, 245, 0.05);
    border: 1px solid rgba(250, 248, 245, 0.08);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--hero-text-muted);
    transition: all 0.2s ease;
  }

  .entry-hero__meta-item:hover {
    background: rgba(179, 143, 45, 0.1);
    border-color: rgba(179, 143, 45, 0.2);
    color: var(--hero-accent-bright);
  }

  .entry-hero__meta-item span,
  .entry-hero__meta-item time {
    color: inherit;
  }

  .entry-hero__meta-item--pill {
    background: var(--hero-accent);
    border-color: var(--hero-accent);
    color: var(--hero-bg);
    font-weight: 600;
  }

  .entry-hero__meta-item--pill:hover {
    background: var(--hero-accent-bright);
    border-color: var(--hero-accent-bright);
  }

  .entry-hero__meta-item--subtle {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--hero-text-muted);
  }

  /* Visual frame - Constrained for portrait images */
  .entry-hero__visual {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
    justify-self: center;
  }

  .entry-hero__visual-frame {
    position: relative;
    overflow: hidden;
    background: #18181a;
    border: 1px solid var(--hero-border);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.45);
    width: 100%;
    max-height: 380px;
    aspect-ratio: var(--entry-hero-aspect, 4 / 3);
    transition: all 0.3s ease;
  }

  /* Limit height for very tall images */
  .entry-hero__visual-frame[style*="--entry-hero-aspect:0."] {
    max-height: 340px;
    aspect-ratio: auto;
  }

  .entry-hero__visual-frame:hover {
    border-color: var(--hero-accent);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.55);
  }

  .entry-hero__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
  }

  .entry-hero__visual-frame:hover .entry-hero__image {
    transform: scale(1.02);
  }

  /* Responsive */
  @media (max-width: 1024px) {
    .entry-hero {
      padding: clamp(40px, 7vw, 64px) 0;
    }

    .entry-hero__inner {
      grid-template-columns: 1fr;
      gap: clamp(24px, 5vw, 36px);
    }

    .entry-hero__visual {
      max-width: 260px;
      order: -1;
    }

    .entry-hero__visual-frame {
      max-height: 300px;
    }

    .entry-hero__visual-frame[style*="--entry-hero-aspect:0."] {
      max-height: 280px;
    }

    .entry-hero__copy {
      text-align: center;
      align-items: center;
    }

    .entry-hero__eyebrow::before {
      display: none;
    }

    .entry-hero__badges {
      justify-content: center;
    }

    .entry-hero__title {
      font-size: clamp(1.2rem, 3.5vw, 1.55rem);
    }

    .entry-hero__lead {
      max-width: 42ch;
    }

    .entry-hero__meta {
      justify-content: center;
    }
  }

  @media (max-width: 680px) {
    .entry-hero {
      padding: clamp(36px, 8vw, 52px) 0;
    }

    .entry-hero__inner {
      gap: clamp(20px, 5vw, 30px);
    }

    .entry-hero__visual {
      max-width: 200px;
    }

    .entry-hero__visual-frame {
      max-height: 240px;
    }

    .entry-hero__visual-frame[style*="--entry-hero-aspect:0."] {
      max-height: 220px;
    }

    .entry-hero__title {
      font-size: clamp(1.1rem, 4.5vw, 1.4rem);
      line-height: 1.55;
    }

    .entry-hero__badges .term-badges__link {
      padding: 4px 10px;
      font-size: 0.65rem;
    }
  }

  /* Context variations */

  /* Column - Warm editorial */
  .entry-hero--column {
    --hero-bg: #0f0e0c;
  }

  /* ─────────────────────────────────────────────
     Case Study - Sharp Editorial Design
     ───────────────────────────────────────────── */
  .entry-hero--case {
    --hero-bg: #0a0a0b;
    padding: clamp(56px, 8vw, 96px) 0;
  }

  .entry-hero--case::before {
    background-image: none;
  }

  .entry-hero--case .entry-hero__inner {
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(40px, 6vw, 72px);
    align-items: center;
  }

  /* Sharp visual frame */
  .entry-hero--case .entry-hero__visual {
    max-width: 100%;
    order: 1;
  }

  .entry-hero--case .entry-hero__visual-frame {
    max-height: 520px;
    aspect-ratio: 4 / 3;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  /* Accent line on image */
  .entry-hero--case .entry-hero__visual-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--hero-accent);
    z-index: 2;
  }

  .entry-hero--case .entry-hero__image {
    border-radius: 0;
  }

  .entry-hero--case .entry-hero__visual-frame:hover {
    border-color: transparent;
    box-shadow: none;
  }

  .entry-hero--case .entry-hero__visual-frame:hover .entry-hero__image {
    transform: none;
  }

  /* Copy styling */
  .entry-hero--case .entry-hero__copy {
    order: 0;
    gap: clamp(14px, 2vw, 20px);
  }

  .entry-hero--case .entry-hero__eyebrow {
    padding: 0;
    background: transparent;
    color: var(--hero-accent-bright);
    border-radius: 0;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
  }

  .entry-hero--case .entry-hero__eyebrow::before {
    display: inline-block;
  }

  .entry-hero--case .entry-hero__title {
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    line-height: 1.55;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .entry-hero--case .entry-hero__lead {
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    max-width: 44ch;
    line-height: 1.9;
  }

  .entry-hero--case .entry-hero__badges .term-badges__link {
    background: transparent;
    border: 1px solid rgba(179, 143, 45, 0.4);
    color: var(--hero-accent-bright);
    border-radius: 0;
    padding: 5px 12px;
    font-size: 0.68rem;
  }

  .entry-hero--case .entry-hero__badges .term-badges__link:hover {
    background: var(--hero-accent);
    border-color: var(--hero-accent);
    color: var(--hero-bg);
  }

  /* Case study responsive */
  @media (max-width: 1024px) {
    .entry-hero--case {
      padding: clamp(44px, 7vw, 64px) 0;
    }

    .entry-hero--case .entry-hero__inner {
      grid-template-columns: 1fr;
      gap: clamp(32px, 5vw, 44px);
    }

    .entry-hero--case .entry-hero__visual {
      order: -1;
      max-width: 560px;
      justify-self: center;
    }

    .entry-hero--case .entry-hero__visual-frame {
      max-height: 400px;
    }

    .entry-hero--case .entry-hero__visual-frame::before {
      width: 100%;
      height: 3px;
      left: 0;
      top: auto;
      bottom: 0;
    }

    .entry-hero--case .entry-hero__copy {
      text-align: center;
      align-items: center;
    }

    .entry-hero--case .entry-hero__eyebrow::before {
      display: none;
    }

    .entry-hero--case .entry-hero__badges {
      justify-content: center;
    }

    .entry-hero--case .entry-hero__title {
      font-size: clamp(1.2rem, 3.5vw, 1.55rem);
    }
  }

  @media (max-width: 680px) {
    .entry-hero--case {
      padding: clamp(36px, 7vw, 52px) 0;
    }

    .entry-hero--case .entry-hero__visual {
      max-width: 100%;
    }

    .entry-hero--case .entry-hero__visual-frame {
      max-height: 300px;
    }

    .entry-hero--case .entry-hero__eyebrow {
      font-size: 0.62rem;
    }

    .entry-hero--case .entry-hero__title {
      font-size: clamp(1.1rem, 4.5vw, 1.4rem);
      line-height: 1.55;
    }

    .entry-hero--case .entry-hero__lead {
      font-size: 0.82rem;
    }

    .entry-hero--case .entry-hero__badges .term-badges__link {
      padding: 4px 10px;
      font-size: 0.62rem;
    }
  }

  /* News */
  .entry-hero--news {
    --hero-bg: #0c0d0f;
  }

  /* ─────────────────────────────────────────────
     Solution - Large Image + Text Side by Side
     Sharp editorial design matching case study
     ───────────────────────────────────────────── */
  .entry-hero--solution {
    --hero-bg: #0a0a0b;
    padding: clamp(56px, 8vw, 96px) 0;
  }

  .entry-hero--solution::before {
    background-image: none;
  }

  .entry-hero--solution .entry-hero__inner {
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(40px, 6vw, 72px);
    align-items: center;
  }

  /* Large visual frame - prominent image */
  .entry-hero--solution .entry-hero__visual {
    max-width: 100%;
    order: 1;
  }

  .entry-hero--solution .entry-hero__visual-frame {
    max-height: 520px;
    aspect-ratio: 4 / 3;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  /* Left accent line on image */
  .entry-hero--solution .entry-hero__visual-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--hero-accent);
    z-index: 2;
  }

  .entry-hero--solution .entry-hero__image {
    border-radius: 0;
  }

  .entry-hero--solution .entry-hero__visual-frame:hover {
    border-color: transparent;
    box-shadow: none;
  }

  .entry-hero--solution .entry-hero__visual-frame:hover .entry-hero__image {
    transform: none;
  }

  /* Copy styling */
  .entry-hero--solution .entry-hero__copy {
    order: 0;
    gap: clamp(14px, 2vw, 20px);
  }

  .entry-hero--solution .entry-hero__eyebrow {
    padding: 0;
    background: transparent;
    color: var(--hero-accent-bright);
    border-radius: 0;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
  }

  .entry-hero--solution .entry-hero__eyebrow::before {
    display: inline-block;
  }

  .entry-hero--solution .entry-hero__title {
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    line-height: 1.55;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .entry-hero--solution .entry-hero__lead {
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    max-width: 44ch;
    line-height: 1.9;
  }

  .entry-hero--solution .entry-hero__badges .term-badges__link {
    background: transparent;
    border: 1px solid rgba(179, 143, 45, 0.4);
    color: var(--hero-accent-bright);
    border-radius: 0;
    padding: 5px 12px;
    font-size: 0.68rem;
  }

  .entry-hero--solution .entry-hero__badges .term-badges__link:hover {
    background: var(--hero-accent);
    border-color: var(--hero-accent);
    color: var(--hero-bg);
  }

  /* Solution responsive */
  @media (max-width: 1024px) {
    .entry-hero--solution {
      padding: clamp(44px, 7vw, 64px) 0;
    }

    .entry-hero--solution .entry-hero__inner {
      grid-template-columns: 1fr;
      gap: clamp(32px, 5vw, 44px);
    }

    .entry-hero--solution .entry-hero__visual {
      order: -1;
      max-width: 560px;
      justify-self: center;
    }

    .entry-hero--solution .entry-hero__visual-frame {
      max-height: 400px;
    }

    .entry-hero--solution .entry-hero__visual-frame::before {
      width: 100%;
      height: 3px;
      left: 0;
      top: auto;
      bottom: 0;
    }

    .entry-hero--solution .entry-hero__copy {
      text-align: center;
      align-items: center;
    }

    .entry-hero--solution .entry-hero__eyebrow::before {
      display: none;
    }

    .entry-hero--solution .entry-hero__badges {
      justify-content: center;
    }

    .entry-hero--solution .entry-hero__title {
      font-size: clamp(1.2rem, 3.5vw, 1.55rem);
    }
  }

  @media (max-width: 680px) {
    .entry-hero--solution {
      padding: clamp(36px, 7vw, 52px) 0;
    }

    .entry-hero--solution .entry-hero__visual {
      max-width: 100%;
    }

    .entry-hero--solution .entry-hero__visual-frame {
      max-height: 300px;
    }

    .entry-hero--solution .entry-hero__eyebrow {
      font-size: 0.62rem;
    }

    .entry-hero--solution .entry-hero__title {
      font-size: clamp(1.1rem, 4.5vw, 1.4rem);
      line-height: 1.55;
    }

    .entry-hero--solution .entry-hero__lead {
      font-size: 0.82rem;
    }

    .entry-hero--solution .entry-hero__badges .term-badges__link {
      padding: 4px 10px;
      font-size: 0.62rem;
    }
  }
}
