/*
Theme Name: linkpage
Theme URI: https://kiyooka-masaki.jp/
Author: Custom Developer
Description: linkpage v1.0.1 - 左側アイコンエリア内の「中央揃え」を徹底し、アイコンごとの幅バラつきによるズレを解消した精密修正版。
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
    line-height: 1.5;
    display: block;
    min-height: 100vh;
    padding: 40px 20px;
    transition: background-color 0.3s ease;
}

.container {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

/* Profile Section */
.profile-section {
    margin-bottom: 32px;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

.profile-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 2px;
    letter-spacing: 0.05em;
}

.profile-subtitle {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    opacity: 0.85;
}

.profile-bio {
    font-size: 14px;
    white-space: pre-wrap;
    opacity: 0.9;
    max-width: 400px;
    margin: 0 auto;
}

/* Links Section */
.links-container {
    display: block;
}

.link-item {
    display: block;
    text-decoration: none;
    padding: 16px 20px;
    margin-bottom: 16px; /* 枠あり同士の基本間隔 */
    border-radius: 6px; 
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    background-color: var(--btn-bg-color);
    color: var(--btn-text-color);
}

.link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    opacity: 0.95;
}

.link-item:active {
    transform: translateY(0);
}

/* テーブルセル構造を利用した、正確な左右対称・3列レイアウト */
.link-content-table {
    display: table;
    width: 100%;
    table-layout: fixed; 
}

/* 左右のアイコンエリアの幅を完全に26px（均等）に固定 */
.link-cell-left,
.link-cell-right {
    display: table-cell;
    width: 26px;
    vertical-align: middle;
}

/* 【重要修正】左側のセル内も「左揃え」ではなく「中央揃え（text-align: center）」に指定 */
.link-cell-left {
    text-align: center;
}

.link-cell-right {
    text-align: right; /* 右側の矢印は枠に沿わせるため右揃えのまま維持 */
}

/* 中央のテキストエリアを完全に正中央に配置 */
.link-cell-center {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
}

/* 枠ありボタン用の任意の左端配置アイコンサイズ */
.link-icon {
    font-size: 21px; 
    vertical-align: middle;
    display: inline-block; /* 中央揃えを正確に効かせるためブロック要素化 */
}

.link-text-group {
    display: inline-block;
    vertical-align: middle;
    width: 100%;
}

.link-title {
    display: block;
}

.link-description {
    display: block;
    font-size: 11px;
    font-weight: normal;
    margin-top: 4px;
    opacity: 0.8;
}

/* 常時表示する右側の外部リンク用アイコンの基本定義 */
.external-arrow {
    font-size: 13px;
    opacity: 0.6;
    vertical-align: middle;
}

/* 枠なし（テキストのみ）のボタンスタイル */
.link-item.is-text-only {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0; 
    margin-bottom: 8px; /* 枠なし同士の基本距離 */
    text-align: center;
    transform: none !important;
}

.link-item.is-text-only:hover {
    opacity: 0.7;
}

.link-item.is-text-only .link-title {
    display: inline-block;
    vertical-align: middle;
    text-decoration: underline;
    font-size: 14px;
    color: var(--text-color) !important;
}

/* 枠なしテキスト用の左側アイコン配置設定 */
.link-text-only-left-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    font-size: 16px;
    color: var(--text-color) !important;
}

/* 枠なしテキストのすぐ右隣に置く外部リンクアイコン設定 */
.link-item.is-text-only .external-arrow {
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px; /* テキストとの距離を自然に広げる */
    color: var(--text-color) !important;
}

/* 【余白コントロール：CSS隣接セレクタによる動的調整】 */

/* 1. 枠なし同士が連続する場合：距離をさらに狭める */
.link-item.is-text-only + .link-item.is-text-only {
    margin-top: -2px; 
}

/* 2. 枠ありの後に枠なしが来る場合：距離を広げる */
.link-item:not(.is-text-only) + .link-item.is-text-only {
    margin-top: 24px; 
}

/* 3. 枠なしの後に枠あり（通常ボタン）が来る場合：距離を広げる */
.link-item.is-text-only + .link-item:not(.is-text-only) {
    margin-top: 32px; 
}

/* Footer */
.site-footer {
    margin-top: 48px;
    font-size: 12px;
    opacity: 0.6;
}
