/*
 * main.css - Sudan Theme グローバルスタイル
 *
 * Why this structure:
 * - 変数 → リセット → ベース → レイアウト → コンポーネント の順で定義
 * - ページ固有スタイルは assets/css/pages/ に分割して管理
 */

/* ============================================================
   CSS変数（デザイントークン）
   Why: Figmaからデザイントークンを抽出したらここに定義する。
        カラー・フォント・余白の一元管理で変更コストを下げる。
   ============================================================ */
:root {
    /* カラー（デザイン確認済み — ai/psdから吸い上げ） */
    --color-magenta: #FF0080;    /* メインアクセント：背景装飾・ボタン */
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-pink-light: #FFE0F0; /* 要確認：少し淡いピンク背景 */
    --color-gray: #888888;
    --color-gray-light: #f5f5f5;
    --color-border: #e0e0e0;
    --color-text: #000000;
    --color-text-light: #888888;
    /* 下位互換性のために旧変数名も維持 */
    --color-primary: var(--color-magenta);
    --color-bg: var(--color-white);
    --color-bg-light: var(--color-gray-light);

    /* フォント（デザイン指定: Noto Sans JP / Rubik / Inter） */
    --font-ja: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
    --font-en-heading: 'Rubik', 'Helvetica Neue', Arial, sans-serif;
    --font-en-ui: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    /* 下位互換性のために旧変数名も維持 */
    --font-base: var(--font-ja);
    --font-en: var(--font-en-ui);

    /* フォントサイズ */
    --fs-xs: 0.75rem;   /* 12px */
    --fs-sm: 0.875rem;  /* 14px */
    --fs-base: 1rem;    /* 16px */
    --fs-md: 1.125rem;  /* 18px */
    --fs-lg: 1.25rem;   /* 20px */
    --fs-xl: 1.5rem;    /* 24px */
    --fs-2xl: 2rem;     /* 32px */
    --fs-3xl: 2.5rem;   /* 40px */

    /* 余白 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;

    /* コンテナ幅（archive/singleページ用。TOPページでは使用禁止） */
    --container-width: 1200px;
    --container-padding: 24px;

    /* ヘッダー高さ */
    --header-height: 80px;

    /* トランジション */
    --transition-base: 0.2s ease;
    --transition-menu: 0.4s ease;
}

/* ============================================================
   リセット
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    /* Why: fixedヘッダーがアンカーリンク先を覆わないよう、
           スクロール位置をヘッダー高さ分だけ下げる。
           メニューから#hero/#hashtag等へジャンプしたとき正しい位置に止まる。 */
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-ja);
    font-size: var(--fs-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* ============================================================
   レイアウトユーティリティ
   ============================================================ */

/* archive / single ページ用コンテナ（TOPページでは使用禁止） */
.inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* TOPページ用: フル幅 + vwベースパディング */
.section-inner {
    width: 100%;
    padding: 0 5vw;
}

/* テキスト行長制約: ウルトラワイドモニターでの可読性を維持 */
.text-measure {
    max-width: 75ch;
}

@media (max-width: 767px) {
    :root {
        --header-height: 60px;
    }
}

/* ============================================================
   サイトヘッダー
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-header__logo a {
    font-size: var(--fs-lg);
    font-weight: 700;
}

/* 下層ページのメニューボタンをTOPヒーローのMENUボタンに統一 */
.site-header--top-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    border-bottom: 0;
    pointer-events: none;
}

.admin-bar .site-header--top-menu {
    top: 32px;
}

.site-header--top-menu .site-header__inner {
    max-width: none;
    justify-content: flex-end;
    height: auto;
    padding: 20px 20px 0;
}

.site-header--top-menu .section-hero__menu-trigger {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 120;
    width: 128px;
    height: 128px;
    border: 2px solid #333;
    border-radius: 50%;
    background: var(--color-white);
    color: var(--color-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    pointer-events: auto;
}

.site-header--top-menu .section-hero__menu-label {
    font-family: var(--font-en-heading);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
}

.site-header--top-menu .section-hero__menu-plus {
    font-size: 2rem;
    line-height: 1;
    font-weight: 400;
}

@media (max-width: 768px) {
    .site-header--top-menu .section-hero__menu-trigger {
        position: fixed;
        top: auto;
        right: 16px;
        bottom: 16px;
        width: 88px;
        height: 88px;
        gap: 0;
    }
}

@media (max-width: 782px) {
    .admin-bar .site-header--top-menu {
        top: 46px;
    }
}

.global-nav {
    display: flex;
    gap: var(--space-lg);
}

/* ============================================================
   サイトフッター — スタイルは assets/css/sections/footer.css に分離
   ============================================================ */

/* ============================================================
   記事カード
   ============================================================ */
.article-card {
    display: block;
    transition: opacity var(--transition-base);
}

.article-card:hover {
    opacity: 0.8;
}

.article-card__thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.article-card__body {
    padding: var(--space-md) 0;
}

.article-card__title {
    font-size: var(--fs-md);
    font-weight: 700;
    margin: var(--space-xs) 0;
}

.article-card__excerpt {
    font-size: var(--fs-sm);
    color: var(--color-text-light);
    margin-top: var(--space-xs);
}

.article-card__meta {
    font-size: var(--fs-xs);
    color: var(--color-text-light);
    margin-top: var(--space-sm);
}

/* ============================================================
   アーカイブページ
   ============================================================ */
.page-archive__inner,
.page-single__inner,
.page-static__inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--space-2xl) var(--container-padding);
}

.article-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl) var(--space-lg);
}

/* ページネーション */
.pagination {
    margin-top: var(--space-2xl);
    display: flex;
    justify-content: center;
}

/* ============================================================
   ページ固有スタイルは pages/ に分割
   例: @import url('./pages/top.css');
   ============================================================ */

/* TODO: デザインカンプに合わせてピクセル再現を進める */
