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

/* Type-level CSS for News (お知らせ) - 2025 News/Magazine Design */

@layer pages {
  body.single-news {
    --news-bg: #f7f7f9;
    --news-surface: #ffffff;
    --news-text: #17171a;
    --news-text-muted: rgba(23, 23, 26, 0.6);
    --news-accent: #b38f2d;
    --news-accent-dark: #8a6d22;
    --news-border: rgba(23, 23, 26, 0.06);
    --news-border-strong: rgba(23, 23, 26, 0.12);

    background: var(--news-bg);
  }

  body.single-news .news-entry {
    margin-bottom: clamp(56px, 10vw, 100px);
  }

  /* ─────────────────────────────────────────────
     Main Content Section
     ───────────────────────────────────────────── */
  body.single-news .section--news {
    background: var(--news-surface);
    padding: clamp(32px, 5vw, 52px);
    border: 1px solid var(--news-border-strong);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    position: relative;
    margin-top: clamp(48px, 8vw, 80px);
  }

  /* Top accent bar */
  body.single-news .section--news::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--news-accent);
  }

  /* ─────────────────────────────────────────────
     Details Table
     ───────────────────────────────────────────── */
  body.single-news .news-entry__details {
    background: var(--news-bg);
    padding: clamp(20px, 3.5vw, 28px);
    border: 1px solid var(--news-border-strong);
    margin-bottom: clamp(24px, 4vw, 32px);
    position: relative;
    border-left: 3px solid var(--news-accent);
  }

  body.single-news .news-entry__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    color: var(--news-text);
  }

  body.single-news .news-entry__table tr {
    border-bottom: 1px solid var(--news-border-strong);
  }

  body.single-news .news-entry__table tr:last-child {
    border-bottom: none;
  }

  body.single-news .news-entry__table tr:hover {
    background: rgba(179, 143, 45, 0.03);
  }

  body.single-news .news-entry__table th,
  body.single-news .news-entry__table td {
    padding: clamp(12px, 2vw, 16px);
    vertical-align: top;
  }

  body.single-news .news-entry__table th {
    width: clamp(100px, 22vw, 160px);
    font-family: "DM Sans", var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--news-text-muted);
    position: relative;
    padding-left: clamp(16px, 2.5vw, 22px);
  }

  body.single-news .news-entry__table th::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background: var(--news-accent);
  }

  body.single-news .news-entry__table td a {
    color: var(--news-accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
  }

  body.single-news .news-entry__table td a:hover,
  body.single-news .news-entry__table td a:focus-visible {
    color: var(--news-accent-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* Coverage links list */
  body.single-news .news-entry__coverage {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body.single-news .news-entry__coverage li {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  body.single-news .news-entry__coverage li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--news-accent);
    flex-shrink: 0;
  }

  /* ─────────────────────────────────────────────
     Entry Content
     ───────────────────────────────────────────── */
  body.single-news .entry-content {
    margin-top: clamp(28px, 4vw, 40px);
  }

  body.single-news .entry-content > *:first-child {
    margin-top: 0;
  }

  body.single-news .entry-content p {
    font-size: 1rem;
    line-height: 1.95;
    color: var(--news-text);
    margin-bottom: 1.6em;
  }

  body.single-news .entry-content h2 {
    margin-top: clamp(40px, 6vw, 56px);
    margin-bottom: clamp(16px, 2.5vw, 24px);
    font-family: var(--font-serif);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--news-text);
  }

  body.single-news .entry-content h3 {
    margin-top: clamp(32px, 5vw, 44px);
    margin-bottom: clamp(12px, 2vw, 18px);
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 600;
    line-height: 1.45;
    color: var(--news-text);
  }

  body.single-news .entry-content a {
    color: var(--news-accent);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: all 0.2s ease;
  }

  body.single-news .entry-content a:hover {
    color: var(--news-accent-dark);
  }

  /* ─────────────────────────────────────────────
     Lists
     ───────────────────────────────────────────── */
  body.single-news .entry-content ul,
  body.single-news .entry-content ol {
    margin: clamp(18px, 2.5vw, 24px) 0;
    padding-left: 0;
    list-style: none;
  }

  body.single-news .entry-content ul li,
  body.single-news .entry-content ol li {
    position: relative;
    padding-left: clamp(20px, 2.5vw, 26px);
    margin-bottom: 0.7em;
    line-height: 1.8;
  }

  body.single-news .entry-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 6px;
    height: 6px;
    background: var(--news-accent);
  }

  body.single-news .entry-content ol {
    counter-reset: news-counter;
  }

  body.single-news .entry-content ol li {
    counter-increment: news-counter;
  }

  body.single-news .entry-content ol li::before {
    content: counter(news-counter);
    position: absolute;
    left: 0;
    top: 0;
    font-family: "DM Sans", var(--font-sans);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--news-accent);
  }

  /* ─────────────────────────────────────────────
     Images
     ───────────────────────────────────────────── */
  body.single-news .entry-content figure {
    margin: clamp(28px, 4vw, 40px) 0;
  }

  body.single-news .entry-content figure img {
    border: 1px solid var(--news-border-strong);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
  }

  body.single-news .entry-content figure:hover img {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }

  body.single-news .entry-content figcaption {
    margin-top: clamp(10px, 1.5vw, 14px);
    font-size: 0.85rem;
    color: var(--news-text-muted);
    text-align: center;
    font-weight: 400;
  }

  /* ─────────────────────────────────────────────
     Related News Section
     ───────────────────────────────────────────── */
  body.single-news .section--news-related {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    margin-top: clamp(56px, 9vw, 80px);
  }

  body.single-news .news-related {
    display: grid;
    gap: clamp(28px, 5vw, 40px);
  }

  body.single-news .news-related__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: clamp(14px, 3vw, 24px);
  }

  body.single-news .news-related__label {
    margin: 0;
    font-family: "DM Sans", var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--news-accent);
  }

  body.single-news .news-related__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.8vw, 1.9rem);
    font-weight: 700;
    color: var(--news-text);
  }

  body.single-news .news-related__more {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: "DM Sans", var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--news-text);
    text-decoration: none;
    background: transparent;
    border: 1px solid var(--news-border-strong);
    transition: all 0.25s ease;
  }

  body.single-news .news-related__more:hover,
  body.single-news .news-related__more:focus-visible {
    color: var(--news-surface);
    background: var(--news-accent);
    border-color: var(--news-accent);
  }

  body.single-news .news-related__chevron {
    transition: transform 0.25s ease;
  }

  body.single-news .news-related__more:hover .news-related__chevron,
  body.single-news .news-related__more:focus-visible .news-related__chevron {
    transform: translateX(3px);
  }

  /* Related cards grid */
  body.single-news .card-list--news-related {
    display: grid;
    gap: clamp(16px, 3vw, 24px);
    grid-template-columns: repeat(3, 1fr);
    padding: 0;
    margin: 0;
    width: 100%;
    list-style: none;
  }

  body.single-news .card-list--news-related .card {
    min-height: 100%;
    border: 1px solid var(--news-border-strong);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
  }

  body.single-news .card-list--news-related .card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }

  /* ─────────────────────────────────────────────
     Responsive
     ───────────────────────────────────────────── */
  @media (max-width: 1024px) {
    body.single-news .card-list--news-related {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 767px) {
    body.single-news .section--news {
      margin-top: clamp(36px, 8vw, 56px);
      padding: clamp(24px, 6vw, 36px);
    }

    body.single-news .news-entry__details {
      padding: clamp(16px, 5vw, 24px);
    }

    body.single-news .news-related__head {
      flex-direction: column;
      align-items: flex-start;
    }

    body.single-news .card-list--news-related {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 480px) {
    body.single-news .section--news {
      padding: 20px;
    }

    body.single-news .news-entry__details {
      padding: 16px;
    }

    body.single-news .news-entry__table th {
      width: 100%;
      display: block;
      padding-bottom: 4px;
    }

    body.single-news .news-entry__table td {
      display: block;
      padding-top: 0;
    }
  }
}
