/* =====================================================================
   about.php — page-specific styles
   Builds on the shared design tokens & components in style.css.
   Only About-page flourishes live here; shared components
   (.profile-icon / .card / .ai-card-icon / .tech-tags) are reused
   from style.css and only overridden where the layout differs.
   ===================================================================== */

/* Screen-reader-only utility（.visually-hidden）は style.css に集約 */

/* ---- Page table of contents ----
   チップの見た目・現在地ハイライトは refine.css（render_page_toc 統一様式）に集約。
   ここは main 直下に置かれるこのページ特有の上余白だけ。 */
.page-toc {
    margin-top: 16px;
    padding-top: 16px;
}

/* ---- アンカー先見出しがヘッダーに隠れないよう余白を確保 ----
   style.css の section[id] と同じ計算（ヘッダー高さ + 16px）に揃える。 */
#about-title,
#interests-title,
#journey-title,
#experience-title,
#values-title {
    scroll-margin-top: calc(var(--header-height) + 16px);
}

/* ---- セクション件数バッジ（見出し脇に控えめに添える）----
   見た目 (accent 枠/地/文字色/pill) は style.css V17 基底。ここは差分のみ。 */
.section-count {
    margin-left: 12px;
    font-size: 0.72rem;
    /* letter-spacing はここでは指定しない: console.css の .section-count が
       常に後勝ちで上書きするため死宣言だった。 */
    /* 2-4: home/skills の見出し脇バッジと寸法(padding)を統一 */
    padding: var(--badge-pad);
    vertical-align: middle;
}

/* ---- Intro: profile figure + body side by side ---- */
.about-intro {
    display: flex;
    align-items: flex-start;
    gap: 36px;
}

.about-intro-figure {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 180px;
}

/* 共有の .profile-icon を再利用し、About 用にサイズだけ上書きする。 */
.about-avatar {
    width: 160px;
    height: 160px;
}

.about-handle {
    margin: 14px 0 2px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.about-role {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
}

.about-intro-body {
    flex: 1 1 auto;
    min-width: 0;
}

.about-text-sub {
    margin-top: 16px;
    font-size: 1.02rem;
    line-height: 1.85;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

/* ---- Interests: three cards (reuse .card / .ai-card-icon) ---- */
.about-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.interest-card {
    display: flex;
    flex-direction: column;
}

/* 共有の .ai-card-icon を再利用し、サイズだけ小さめに上書き。
   縦積みのため見出しとの間隔だけ追加する。 */
.interest-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

/* card-text を伸ばして tech-tags を各カード下端で揃える。 */
.interest-card .card-text {
    flex: 1;
}

/* ---- Journey timeline ---- */
.about-journey-lead {
    margin-bottom: 28px;
}

/* これらのタイムライン項目はモーダルを開かないので、
   共有CSSの cursor:pointer / hover の横スライドを打ち消す。 */
.about-timeline .timeline-content {
    cursor: default;
}

.about-timeline .timeline-content:hover {
    transform: none;
}

.about-timeline .timeline-content .card-text {
    margin-bottom: 0;
}

/* 現在地（「いま」）のドット発光は refine.css（同一セレクタで後勝ち）に集約。
   カードの枠だけこのページで付ける。 */
.about-timeline .timeline-item.is-current .timeline-content {
    border-color: var(--accent);
}

/* 「現在」バッジ（card-tag を流用しつつ余白だけ調整）。 */
.timeline-now {
    margin-left: auto;
}

/* ---- 実務経験 (reuse .card / .ai-card-icon / .card-tag / .card-title / .card-text) ---- */
/* 同一クライアント兼務の注記。community-note と同じトーンで揃え、
   両カードにバッジを重ねずセクション単位で1回だけ透明性を担保する。 */
.experience-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 16px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--dim);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.experience-note .fa-icon {
    flex: 0 0 auto;
    color: var(--accent);
}

.experience-list {
    /* list reset: style.css :where() で一元管理 */
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.experience-item {
    max-width: none;
}

.experience-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 10px;
}

/* 共有の .ai-card-icon を再利用し、サイズだけ小さめに上書き（両方とも同寸）。 */
.experience-icon,
.value-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

.experience-head-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.experience-head-body .card-title {
    margin: 0;
    font-size: 1.02rem;
}

/* 役職タグ(.tech-tags は上マージンのみ)と本文の間に呼吸を作る */
.experience-item .card-text {
    margin-top: 12px;
}

/* ---- Values (reuse .card / .ai-card-icon) ---- */
.value-list {
    /* list reset: style.css :where() で一元管理 */
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* surface / border / hover は共有の .card から継承。
   ここではアイコン横並びのレイアウトとやや詰めた余白だけ上書きする。 */
.value-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
}

.value-body {
    min-width: 0;
}

.value-title {
    margin: 2px 0 6px;
    font-size: 1.02rem;
    /* Noto Sans JP に 600 実体が無く 700 にフォールバックされるため、和文見出しは指定を実体に合わせる */
    font-weight: 700;
    color: var(--text);
}

.value-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--muted);
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 860px) {
    .about-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .about-intro {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }

    .about-intro-figure {
        width: auto;
    }

    .about-text {
        text-align: left;
    }

    .about-actions {
        justify-content: center;
    }

    .value-list {
        grid-template-columns: 1fr;
    }
}

/* ── GitHub の活動（草グリッド） ───────────────────────────────────────
   private/github_contrib.php がサーバー側で取得した実データを描画する。
   セル11px + gap3px = 列ピッチ14px。月ラベル(.gh-months)は同じピッチの
   グリッドに grid-column で置き、セル列と桁を揃える。 */
.github-lead strong {
    color: var(--text);
    font-weight: 700;
}

.github-card {
    /* カードは草の幅にフィットさせる（全幅だと右側が大きく空く）。
       狭い画面では max-width で収まり、内側の scroll が横スクロールを担う */
    width: max-content;
    max-width: 100%;
    padding: 22px;
}

/* デスクトップは横スクロール不要（草はカードにフィット）。ホバーで出す
   ツールチップは ::after で上方向に伸びるが、overflow-x: auto を敷くと
   y も clip されて上端が切れる。よって overflow は必要な狭幅時だけに限定。 */
.github-graph-scroll {
    padding-bottom: 4px;
}

@media (max-width: 860px) {
    .github-graph-scroll {
        overflow-x: auto;
    }
}

.github-graph {
    width: max-content;
}

.gh-months {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 14px;
    margin-bottom: 6px;
    font-size: 0.68rem;
    color: var(--dim);
}

.gh-months span {
    grid-row: 1;
    white-space: nowrap;
}

.gh-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, 11px);
    grid-auto-columns: 11px;
    gap: 3px;
}

.gh-grid i,
.github-legend i {
    display: block;
    width: 11px;
    height: 11px;
    border-radius: 2px;
}

/* ── ホバーツールチップ（CSS のみ、JS 不使用）
   GitHub と同様にセル上に「N件 · 2026年n月j日」を出す。
   狭幅は @media でスクロールを付けた側に切り替わるためツールチップ非表示。 */
.gh-grid i {
    position: relative;
}

/* V15: 901 → 861 (BP policy 準拠。同ファイル :296 の max-width: 860 と対になり、
   861-900 帯でスクロール有り + tooltip 非表示という辻褄の合わない状態を排除) */
@media (hover: hover) and (min-width: 861px) {
    .gh-grid i[data-tip]:hover::after {
        content: attr(data-tip);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%);
        padding: 5px 10px;
        background: var(--bg-2);
        border: 1px solid var(--border-bright);
        border-radius: var(--radius-sm);
        color: var(--text);
        font-size: 0.72rem;
        line-height: 1.4;
        white-space: nowrap;
        pointer-events: none;
        z-index: 10;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    }

    /* 端のセルはツールチップの半分がカード外に出て見切れる。
       グリッドは 53週 × 7日 = 371セル・column-major に並ぶため、
       先頭5列 (35セル) は左端アンカーに、末尾5列 (35セル) は右端アンカーに
       切り替えて、ツールチップの表示範囲を常にセルより内側へ寄せる。 */
    .gh-grid i[data-tip]:nth-child(-n+35):hover::after {
        left: 0;
        transform: translateX(0);
    }

    .gh-grid i[data-tip]:nth-last-child(-n+35):hover::after {
        left: auto;
        right: 0;
        transform: translateX(0);
    }
}

/* 無活動マスは方眼に沈む薄面、活動はアクセント青の濃度4段階
   （GitHub の緑ではなくサイトの言語に合わせる） */
.gh-l0 { background: rgba(255, 255, 255, 0.05); }
.gh-l1 { background: rgba(var(--accent-rgb), 0.26); }
.gh-l2 { background: rgba(var(--accent-rgb), 0.48); }
.gh-l3 { background: rgba(var(--accent-rgb), 0.72); }
.gh-l4 { background: var(--accent); }

.github-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 0.72rem;
    color: var(--dim);
}

.github-legend span:first-child { margin-right: 2px; }
.github-legend span:last-child  { margin-left: 2px; }

.github-foot {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
