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

@layer pages {
  /* ===== Design Tokens ===== */
  .page-sitemap {
    --sm-gold: #b38f2d;
    --sm-gold-light: #c9a84a;
    --sm-dark: #0a0908;
    --sm-cream: #fffcf5;
    --sm-surface: #faf8f3;
    --sm-text: #1a1a1a;
    --sm-text-muted: #666;
    --sm-border: rgba(26, 26, 26, 0.1);
    --sm-radius: 12px;
    --sm-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    background: var(--sm-surface);
  }

  /* ===== Hero Section ===== */
  .sm-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    min-height: clamp(320px, 45vh, 420px);
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #fff;
  }

  .sm-hero__bg {
    position: absolute;
    inset: 0;
    background: var(--sm-dark);
  }

  .sm-hero__bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 9, 8, 0.92) 0%, rgba(10, 9, 8, 0.88) 100%);
  }

  .sm-hero__bg-grain {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
  }

  .sm-hero__decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .sm-hero__decor-line {
    position: absolute;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: rgba(179, 143, 45, 0.25);
  }

  .sm-hero__decor-line--left {
    left: clamp(24px, 6vw, 100px);
  }

  .sm-hero__decor-line--right {
    right: clamp(24px, 6vw, 100px);
  }

  .sm-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    padding: clamp(80px, 12vh, 120px) clamp(24px, 5vw, 48px);
  }

  .sm-hero__content {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 24px);
  }

  .sm-hero__eyebrow {
    margin: 0;
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--sm-gold);
  }

  .sm-hero__title {
    margin: 0;
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.3;
  }

  .sm-hero__lead {
    margin: 0;
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.75);
    max-width: 540px;
  }

  /* ===== Navigation Section ===== */
  .sm-nav {
    background: var(--sm-cream);
    border-bottom: 1px solid var(--sm-border);
    padding: clamp(20px, 3vw, 32px) 0;
  }

  .sm-nav__inner {
    max-width: 1000px;
    margin: 0 auto;
  }

  .sm-nav__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(8px, 1.2vw, 12px);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .sm-nav__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: clamp(10px, 1.5vw, 14px) clamp(14px, 2vw, 22px);
    background: #fff;
    border: 1px solid var(--sm-border);
    border-radius: 8px;
    text-decoration: none;
    transition: all var(--sm-transition);
  }

  .sm-nav__link:hover {
    border-color: var(--sm-gold);
    background: rgba(179, 143, 45, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  }

  .sm-nav__link-en {
    font-family: "DM Sans", sans-serif;
    font-size: clamp(10px, 1.2vw, 12px);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sm-gold);
  }

  .sm-nav__link-ja {
    font-size: clamp(12px, 1.4vw, 14px);
    font-weight: 600;
    color: var(--sm-text);
  }

  /* ===== Body Section ===== */
  .sm-body {
    padding: clamp(40px, 6vw, 80px) 0;
  }

  .sm-body__inner {
    display: flex;
    flex-direction: column;
    gap: clamp(40px, 6vw, 64px);
  }

  /* ===== Content Sections ===== */
  .sm-section {
    background: var(--sm-cream);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: clamp(24px, 4vw, 40px);
  }

  .sm-section__head {
    margin-bottom: clamp(20px, 3vw, 28px);
    padding-bottom: clamp(16px, 2vw, 20px);
    border-bottom: 1px solid var(--sm-border);
  }

  .sm-section__eyebrow {
    display: block;
    margin-bottom: clamp(4px, 0.8vw, 8px);
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sm-gold);
  }

  .sm-section__title {
    margin: 0;
    font-family: "Shippori Mincho", serif;
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--sm-text);
  }

  .sm-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 2px 10px;
    background: rgba(179, 143, 45, 0.1);
    border-radius: 999px;
    font-family: "DM Sans", sans-serif;
    font-size: clamp(11px, 1.3vw, 13px);
    font-weight: 500;
    color: var(--sm-gold);
  }

  .sm-section__empty {
    margin: 0;
    padding: clamp(24px, 4vw, 40px);
    background: rgba(26, 26, 26, 0.02);
    border-radius: 8px;
    color: var(--sm-text-muted);
    font-size: 14px;
    text-align: center;
  }

  .sm-section__footer {
    margin-top: clamp(20px, 3vw, 28px);
    padding-top: clamp(16px, 2vw, 20px);
    border-top: 1px solid var(--sm-border);
  }

  .sm-section__more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--sm-gold);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--sm-transition);
  }

  .sm-section__more:hover {
    background: var(--sm-gold-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(179, 143, 45, 0.25);
  }

  .sm-section__more svg {
    transition: transform var(--sm-transition);
  }

  .sm-section__more:hover svg {
    transform: translateX(4px);
  }

  /* ===== List Items ===== */
  .sm-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .sm-list__item {
    border-bottom: 1px solid var(--sm-border);
  }

  .sm-list__item:last-child {
    border-bottom: none;
  }

  .sm-list__link {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 16px);
    padding: clamp(12px, 2vw, 16px) 0;
    text-decoration: none;
    transition: all var(--sm-transition);
  }

  .sm-list__link:hover {
    padding-left: 8px;
  }

  .sm-list__link:hover .sm-list__text {
    color: var(--sm-gold);
  }

  .sm-list__link:hover .sm-list__arrow {
    opacity: 1;
    transform: translateX(4px);
    color: var(--sm-gold);
  }

  .sm-list__date {
    flex-shrink: 0;
    font-family: "DM Sans", sans-serif;
    font-size: clamp(11px, 1.3vw, 13px);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--sm-text-muted);
  }

  .sm-list__text {
    flex: 1;
    font-size: clamp(13px, 1.6vw, 15px);
    line-height: 1.6;
    color: var(--sm-text);
    transition: color var(--sm-transition);
  }

  .sm-list__arrow {
    flex-shrink: 0;
    opacity: 0.3;
    color: var(--sm-text-muted);
    transition: all var(--sm-transition);
  }

  /* ===== Pages List ===== */
  .sm-pages {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .sm-pages__item {
    border-bottom: 1px solid var(--sm-border);
  }

  .sm-pages__item:last-child {
    border-bottom: none;
  }

  .sm-pages__link {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 16px);
    padding: clamp(14px, 2vw, 18px) 0;
    text-decoration: none;
    transition: all var(--sm-transition);
  }

  .sm-pages__link:hover {
    padding-left: 8px;
  }

  .sm-pages__link:hover .sm-pages__text {
    color: var(--sm-gold);
  }

  .sm-pages__link:hover .sm-pages__arrow {
    opacity: 1;
    transform: translateX(4px);
    color: var(--sm-gold);
  }

  .sm-pages__text {
    flex: 1;
    font-size: clamp(14px, 1.8vw, 16px);
    font-weight: 600;
    line-height: 1.5;
    color: var(--sm-text);
    transition: color var(--sm-transition);
  }

  .sm-pages__arrow {
    flex-shrink: 0;
    opacity: 0.3;
    color: var(--sm-text-muted);
    transition: all var(--sm-transition);
  }

  .sm-pages__children {
    list-style: none;
    margin: 0 0 clamp(12px, 2vw, 16px) 0;
    padding: 0 0 0 clamp(20px, 3vw, 28px);
    border-left: 2px solid rgba(179, 143, 45, 0.2);
  }

  .sm-pages__children li {
    margin: 0;
  }

  .sm-pages__children a {
    display: block;
    padding: clamp(8px, 1.2vw, 10px) 0 clamp(8px, 1.2vw, 10px) clamp(12px, 2vw, 16px);
    font-size: clamp(13px, 1.5vw, 14px);
    color: var(--sm-text-muted);
    text-decoration: none;
    transition: all var(--sm-transition);
  }

  .sm-pages__children a:hover {
    color: var(--sm-gold);
    padding-left: clamp(16px, 2.5vw, 20px);
  }

  /* ===== Responsive ===== */
  @media (max-width: 768px) {
    .sm-hero__decor-line {
      display: none;
    }

    .sm-nav__list {
      gap: 8px;
    }

    .sm-nav__link {
      padding: 8px 12px;
    }

    .sm-section {
      padding: clamp(20px, 4vw, 28px);
    }

    .sm-list__link {
      flex-wrap: wrap;
    }

    .sm-list__date {
      width: 100%;
      margin-bottom: -4px;
    }
  }

  @media (max-width: 480px) {
    .sm-nav__link {
      padding: 6px 10px;
    }

    .sm-nav__link-en {
      font-size: 9px;
    }

    .sm-nav__link-ja {
      font-size: 11px;
    }

    .sm-section__more {
      width: 100%;
      justify-content: center;
    }
  }

  /* ===== Reduced Motion ===== */
  @media (prefers-reduced-motion: reduce) {
    .sm-nav__link,
    .sm-list__link,
    .sm-pages__link,
    .sm-section__more,
    .sm-list__arrow,
    .sm-pages__arrow {
      transition: none;
    }
  }
}
