/*
Theme Name: まとめリンク
Theme URI: https://matome-link.com
Description: URLキュレーションサイト「まとめリンク」の独自テーマ
Author: mmStudio
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: matome-link
*/

/* ==========================================================================
   CSS カスタムプロパティ（デザイントークン）
   8px グリッドベースのスペーシングシステム
   ========================================================================== */

:root {
    /* カラーパレット */
    --color-primary: #17bebb;
    --color-primary-dark: #0fa3a1;
    --color-primary-light: #e6f8f8;
    --color-accent: #e05535;
    --color-bg: #f7f8fa;
    --color-card: #ffffff;
    --color-text: #1a1a2e;
    --color-text-secondary: #5f6880;
    --color-text-muted: #9ca3b4;
    --color-border: #e8eaef;
    --color-border-light: #f0f1f4;
    --color-link: #17bebb;
    --color-success-bg: #edf7ee;
    --color-success-border: #c6e6c8;
    --color-success-text: #1a6b2a;
    --color-warning-bg: #fef7e6;
    --color-warning-border: #f5d97a;
    --color-warning-text: #7a5f00;

    /* スペーシング（8px グリッド） */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;
    --space-9: 64px;

    /* タイポグラフィ */
    --font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.8125rem;   /* 13px */
    --text-base: 0.9375rem; /* 15px */
    --text-md: 1rem;        /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.375rem;    /* 22px */
    --text-2xl: 1.75rem;    /* 28px */
    --text-3xl: 2.25rem;    /* 36px */
    --leading-tight: 1.3;
    --leading-normal: 1.6;
    --leading-relaxed: 1.8;

    /* 角丸 */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-full: 999px;

    /* シャドウ */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

    /* トランジション */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* レイアウト */
    --max-width: 1080px;
    --content-width: 720px;
    --header-height: 56px;
}

/* ==========================================================================
   リセット & ベーススタイル
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: var(--leading-normal);
    font-size: var(--text-base);
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-primary-dark);
}

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

/* フォーカス表示の統一 */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   レイアウト
   ========================================================================== */

.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- ヘッダー --- */
.site-header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

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

.site-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    color: var(--color-primary);
}

/* ナビゲーション */
.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.site-nav a {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
    position: relative;
    padding: var(--space-1) 0;
}

.site-nav a:not(.btn-submit)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.site-nav a:not(.btn-submit):hover::after {
    width: 100%;
}

.site-nav a:hover {
    color: var(--color-primary);
}

/* 投稿ボタン */
.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-primary);
    color: #fff !important;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

.btn-submit:hover {
    background: var(--color-primary-dark);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ハンバーガーメニューボタン（モバイル用） */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    color: var(--color-text);
    line-height: 0;
}

.menu-toggle__icon {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    position: relative;
    transition: background var(--transition-fast);
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform var(--transition-fast);
}

.menu-toggle__icon::before {
    top: -7px;
}

.menu-toggle__icon::after {
    bottom: -7px;
}

/* ハンバーガーメニュー 開いた状態 */
.menu-toggle.is-active .menu-toggle__icon {
    background: transparent;
}

.menu-toggle.is-active .menu-toggle__icon::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.is-active .menu-toggle__icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* --- メインコンテンツ --- */
.site-main {
    max-width: var(--max-width);
    margin: var(--space-7) auto;
    padding: 0 var(--space-5);
    flex: 1;
    width: 100%;
}

/* --- フッター --- */
.site-footer {
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    padding: var(--space-7) var(--space-5);
    text-align: center;
}

.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-footer__nav {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
    margin-bottom: var(--space-4);
}

.site-footer__nav a {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.site-footer__nav a:hover {
    color: var(--color-primary);
}

.site-footer__copy {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    line-height: var(--leading-relaxed);
}

/* ==========================================================================
   記事一覧（カードグリッド）
   ========================================================================== */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
}

.post-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border: 1px solid var(--color-border-light);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.post-card__thumb {
    display: block;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background: var(--color-primary-light);
}

.post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.post-card:hover .post-card__thumb img {
    transform: scale(1.03);
}

.post-card__body {
    padding: var(--space-4) var(--space-5);
}

.post-card__category {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: var(--space-2);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.post-card__title {
    font-size: var(--text-md);
    font-weight: 700;
    line-height: var(--leading-tight);
    margin-bottom: var(--space-3);
}

.post-card__title a {
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__title a:hover {
    color: var(--color-primary);
}

.post-card__meta {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.post-card__urls {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
    flex-wrap: wrap;
}

.post-card__url-badge {
    font-size: 0.6875rem;
    background: var(--color-bg);
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    border: 1px solid var(--color-border-light);
}

/* ==========================================================================
   記事詳細ページ
   ========================================================================== */

.single-post {
    max-width: var(--content-width);
    margin: 0 auto;
}

.single-header {
    margin-bottom: var(--space-6);
}

.single-header__category {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: var(--space-3);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.single-header__title {
    font-size: var(--text-2xl);
    font-weight: 800;
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.single-header__meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.single-overview {
    background: var(--color-primary-light);
    padding: var(--space-5);
    border-radius: var(--radius);
    margin-bottom: var(--space-6);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    border-left: 3px solid var(--color-primary);
}

/* リンクセクション見出し */
.single-links-heading {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-border);
}

/* ==========================================================================
   リンクカード
   ========================================================================== */

.link-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.link-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.link-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.link-card > a {
    display: block;
    color: inherit;
}

.link-card > a:hover {
    color: inherit;
}

.link-card__inner {
    display: flex;
}

.link-card__image {
    width: 200px;
    min-height: 140px;
    flex-shrink: 0;
    background: var(--color-bg);
    overflow: hidden;
}

.link-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.link-card:hover .link-card__image img {
    transform: scale(1.03);
}

.link-card__content {
    padding: var(--space-4) var(--space-5);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.link-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: var(--space-2);
    flex-shrink: 0;
}

.link-card__title {
    font-size: var(--text-base);
    font-weight: 700;
    line-height: var(--leading-tight);
    margin-bottom: var(--space-2);
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-card__description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-card__domain {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ドメインの前にアイコン風の丸をつける */
.link-card__domain::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.5;
}

.link-card__comment {
    margin: 0;
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-border-light);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--color-text-secondary);
    background: var(--color-bg);
}

/* ==========================================================================
   投稿フォーム
   ========================================================================== */

.submit-form {
    max-width: var(--content-width);
    margin: 0 auto;
}

.submit-form .page-title {
    text-align: center;
}

/* フォームステップインジケーター */
.form-section {
    margin-bottom: var(--space-6);
}

.form-section__label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
}

.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.form-group label .required {
    color: var(--color-accent);
    margin-left: var(--space-1);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-family: inherit;
    background: var(--color-card);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(23, 190, 187, 0.12);
}

.form-group textarea {
    min-height: 96px;
    resize: vertical;
}

.form-group .hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* URL入力エリア */
.url-entry {
    background: var(--color-bg);
    padding: var(--space-5);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    border: 1px solid var(--color-border-light);
    transition: border-color var(--transition-base);
}

.url-entry:focus-within {
    border-color: var(--color-primary);
}

.url-entry__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.url-entry__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--color-primary);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.url-entry__label {
    font-weight: 600;
    font-size: var(--text-sm);
}

/* URLプレビュー */
.url-preview {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    margin-top: var(--space-3);
    display: none;
}

.url-preview.is-visible {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.url-preview__image {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-bg);
}

.url-preview__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.url-preview__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
}

.url-preview__desc {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* 重複警告 */
.duplicate-warning {
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    color: var(--color-warning-text);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
    display: none;
}

.duplicate-warning.is-visible {
    display: block;
}

/* ボタン */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius);
    font-size: var(--text-md);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    min-height: 48px;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    min-height: 40px;
}

.btn-secondary:hover {
    background: var(--color-primary-light);
}

/* 送信完了メッセージ */
.submit-success {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: var(--color-success-text);
    padding: var(--space-7);
    border-radius: var(--radius-lg);
    text-align: center;
}

.submit-success h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

.submit-success p {
    margin-bottom: var(--space-3);
}

.submit-success__key {
    background: var(--color-card);
    border: 1px dashed var(--color-border);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin: var(--space-4) 0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    word-break: break-all;
    user-select: all;
}

/* エラーメッセージ */
.form-error {
    color: var(--color-accent);
    font-size: var(--text-sm);
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(224, 85, 53, 0.06);
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   検索 & フィルター
   ========================================================================== */

.search-bar {
    max-width: var(--content-width);
    margin: 0 auto var(--space-6);
}

.search-bar__form {
    display: flex;
    gap: var(--space-2);
}

.search-bar__input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: var(--text-base);
    background: var(--color-card);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-bar__input::placeholder {
    color: var(--color-text-muted);
}

.search-bar__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(23, 190, 187, 0.12);
}

.search-bar__btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-base);
    white-space: nowrap;
}

.search-bar__btn:hover {
    background: var(--color-primary-dark);
}

/* カテゴリチップ */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.category-chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.category-chip.is-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.category-chip span {
    font-size: var(--text-xs);
    opacity: 0.7;
}

/* ==========================================================================
   ページネーション
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-7);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-3);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.pagination .current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.pagination a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* ==========================================================================
   ページタイトル
   ========================================================================== */

.page-title {
    font-size: var(--text-xl);
    font-weight: 800;
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.page-title__count {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-text-muted);
    margin-left: var(--space-2);
}

/* 記事なしメッセージ */
.no-results {
    text-align: center;
    padding: var(--space-9) var(--space-4);
    color: var(--color-text-secondary);
    font-size: var(--text-base);
}

/* ==========================================================================
   ユーティリティ
   ========================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   レスポンシブ（モバイルファースト）
   ========================================================================== */

/* タブレット以下 (768px) */
@media (max-width: 768px) {
    :root {
        --header-height: 52px;
    }

    .site-header__inner {
        padding: 0 var(--space-4);
    }

    /* モバイルメニュー表示切替 */
    .menu-toggle {
        display: block;
    }

    .site-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-card);
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-5);
        gap: 0;
        transform: translateX(100%);
        transition: transform var(--transition-slow);
        overflow-y: auto;
        z-index: 99;
    }

    .site-nav.is-open {
        transform: translateX(0);
    }

    .site-nav a {
        padding: var(--space-4) 0;
        font-size: var(--text-md);
        border-bottom: 1px solid var(--color-border-light);
    }

    .site-nav a:not(.btn-submit)::after {
        display: none;
    }

    .site-nav .btn-submit {
        margin-top: var(--space-4);
        justify-content: center;
        padding: var(--space-4);
        font-size: var(--text-md);
    }

    /* メインコンテンツ */
    .site-main {
        margin: var(--space-5) auto;
        padding: 0 var(--space-4);
    }

    /* カードグリッド 1カラム */
    .post-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    /* リンクカード 縦並び */
    .link-card__inner {
        flex-direction: column;
    }

    .link-card__image {
        width: 100%;
        min-height: 0;
        aspect-ratio: 1200 / 630;
    }

    /* 記事詳細タイトル縮小 */
    .single-header__title {
        font-size: var(--text-xl);
    }

    /* ページタイトル */
    .page-title {
        font-size: var(--text-lg);
    }

    /* フッター */
    .site-footer {
        padding: var(--space-6) var(--space-4);
    }

    .site-footer__nav {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
    }
}

/* 小型モバイル (480px以下) */
@media (max-width: 480px) {
    .search-bar__form {
        flex-direction: column;
    }

    .search-bar__btn {
        width: 100%;
    }

    .post-card__body {
        padding: var(--space-3) var(--space-4);
    }

    .link-card__content {
        padding: var(--space-3) var(--space-4);
    }

    .submit-success {
        padding: var(--space-5);
    }
}

/* デスクトップ (1024px以上) */
@media (min-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* オーバーレイ（モバイルメニュー背景） */
.menu-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 98;
}

.menu-overlay.is-visible {
    display: block;
}

/* ==========================================================================
   テンプレートセレクター（投稿フォーム）
   ========================================================================== */

.template-selector {
    max-width: var(--content-width);
    margin: 0 auto var(--space-6);
}

.template-selector__label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.template-selector__options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
}

.template-option {
    background: var(--color-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    font-family: inherit;
}

.template-option:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.template-option.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(23, 190, 187, 0.15);
}

.template-option__icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-1);
}

.template-option__name {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text);
}

.template-option__desc {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* ==========================================================================
   URL詳細ページ
   ========================================================================== */

.url-detail {
    max-width: var(--max-width);
    margin: 0 auto;
}

.url-detail__header {
    display: flex;
    gap: var(--space-6);
    margin-bottom: var(--space-7);
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
}

.url-detail__ogp-image {
    width: 280px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
}

.url-detail__ogp-image img {
    width: 100%;
    height: auto;
    display: block;
}

.url-detail__info {
    flex: 1;
    min-width: 0;
}

.url-detail__title {
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: var(--leading-tight);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

.url-detail__description {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
}

.url-detail__meta {
    margin-bottom: var(--space-3);
}

.url-detail__link {
    font-size: var(--text-sm);
    word-break: break-all;
    color: var(--color-link);
}

.url-detail__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.url-detail__domain-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.url-detail__domain-badge:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.url-detail__status-badge {
    display: inline-flex;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.url-detail__status-badge--ok {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}

.url-detail__status-badge--broken {
    background: rgba(224, 85, 53, 0.08);
    color: var(--color-accent);
    border: 1px solid rgba(224, 85, 53, 0.2);
}

.url-detail__stat {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
}

.url-detail__section {
    margin-bottom: var(--space-7);
}

.url-detail__section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-border);
}

/* ==========================================================================
   URL一覧（共通コンポーネント）
   ========================================================================== */

.url-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border-light);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}

.url-list__item {
    display: block;
    background: var(--color-card);
    padding: var(--space-3) var(--space-4);
    color: inherit;
    transition: background var(--transition-fast);
}

.url-list__item:hover {
    background: var(--color-primary-light);
    color: inherit;
}

.url-list__item--broken {
    border-left: 3px solid var(--color-accent);
}

.url-list__item-inner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.url-list__thumb {
    width: 48px;
    height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-bg);
}

.url-list__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.url-list__content {
    flex: 1;
    min-width: 0;
}

.url-list__title {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-list__url {
    display: block;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-list__domain {
    display: block;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.url-list__right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.url-list__count {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.url-list__badge {
    font-size: 0.6875rem;
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
    font-weight: 600;
}

.url-list__badge--broken {
    background: rgba(224, 85, 53, 0.08);
    color: var(--color-accent);
}

/* ==========================================================================
   ドメイン詳細ページ
   ========================================================================== */

.domain-detail {
    max-width: var(--max-width);
    margin: 0 auto;
}

.domain-detail__header {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
}

.domain-detail__title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-2xl);
    font-weight: 800;
    margin-bottom: var(--space-5);
    letter-spacing: -0.02em;
}

.domain-detail__favicon {
    border-radius: 4px;
}

.domain-detail__stats {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.domain-detail__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.domain-detail__stat--warning .domain-detail__stat-value {
    color: var(--color-accent);
}

.domain-detail__stat-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--color-primary);
}

.domain-detail__stat-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
}

.domain-detail__section {
    margin-bottom: var(--space-6);
}

.domain-detail__section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-border);
}

/* ==========================================================================
   ブックマークレットページ
   ========================================================================== */

.bookmarklet-page {
    max-width: var(--content-width);
    margin: 0 auto;
}

.bookmarklet-page__intro {
    text-align: center;
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-7);
    line-height: var(--leading-relaxed);
}

.bookmarklet-page__section {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
}

.bookmarklet-page__section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-border);
}

.bookmarklet-page__steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.bookmarklet-page__step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.bookmarklet-page__step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--color-primary);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.bookmarklet-page__step p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    padding-top: 2px;
}

.bookmarklet-page__button-area {
    text-align: center;
    padding: var(--space-4) 0;
}

.bookmarklet-page__button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: var(--color-primary);
    color: #fff !important;
    border-radius: var(--radius);
    font-size: var(--text-md);
    font-weight: 700;
    box-shadow: var(--shadow-md);
    cursor: grab;
    transition: all var(--transition-base);
}

.bookmarklet-page__button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: #fff !important;
}

.bookmarklet-page__code {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    margin-top: var(--space-3);
    overflow-x: auto;
}

.bookmarklet-page__code code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    word-break: break-all;
    color: var(--color-text-secondary);
}

/* ==========================================================================
   関連記事（記事末尾に自動挿入）
   ========================================================================== */

.related-posts {
    margin-top: var(--space-7);
    padding-top: var(--space-6);
    border-top: 2px solid var(--color-border);
}

.related-posts__title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-3);
}

.related-posts__item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    color: inherit;
}

.related-posts__item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    color: inherit;
}

.related-posts__thumb {
    width: 64px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-bg);
}

.related-posts__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-posts__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-posts__item-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: var(--leading-tight);
}

.related-posts__shared-count {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* ==========================================================================
   SNSシェアボタン
   ========================================================================== */

.single-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.share-buttons__label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
    margin-right: var(--space-1);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.share-btn--x:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.share-btn--fb:hover {
    background: #1877f2;
    color: #fff;
    border-color: #1877f2;
}

.share-btn--line:hover {
    background: #06c755;
    color: #fff;
    border-color: #06c755;
}

.share-btn--copy:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.share-btn--copy.is-copied {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success-text);
}

/* ==========================================================================
   お気に入りボタン
   ========================================================================== */

.favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-card);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-base);
}

.favorite-btn:hover {
    border-color: #e74c8b;
    color: #e74c8b;
}

.favorite-btn.is-active {
    background: #fef0f5;
    border-color: #e74c8b;
    color: #e74c8b;
}

.favorite-btn.is-active .favorite-btn__icon {
    fill: #e74c8b;
}

/* ==========================================================================
   人気記事ウィジェット
   ========================================================================== */

.popular-posts {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
}

.popular-posts__title {
    font-size: var(--text-md);
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-primary);
}

.popular-posts__list {
    list-style: none;
}

.popular-posts__item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.popular-posts__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-posts__rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: var(--text-xs);
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-bg);
    color: var(--color-text-muted);
}

.popular-posts__item:nth-child(1) .popular-posts__rank {
    background: #ffd700;
    color: #fff;
}

.popular-posts__item:nth-child(2) .popular-posts__rank {
    background: #c0c0c0;
    color: #fff;
}

.popular-posts__item:nth-child(3) .popular-posts__rank {
    background: #cd7f32;
    color: #fff;
}

.popular-posts__item-thumb {
    width: 56px;
    height: 42px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-bg);
}

.popular-posts__item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-posts__item-content {
    flex: 1;
    min-width: 0;
}

.popular-posts__item-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: var(--leading-tight);
}

.popular-posts__item-title:hover {
    color: var(--color-primary);
}

.popular-posts__item-views {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   レスポンシブ追加（新ページ用）
   ========================================================================== */

@media (max-width: 768px) {
    .url-detail__header {
        flex-direction: column;
        padding: var(--space-4);
    }

    .url-detail__ogp-image {
        width: 100%;
    }

    .url-detail__title {
        font-size: var(--text-lg);
    }

    .domain-detail__header {
        padding: var(--space-4);
    }

    .domain-detail__title {
        font-size: var(--text-xl);
    }

    .domain-detail__stats {
        gap: var(--space-4);
    }

    .bookmarklet-page__section {
        padding: var(--space-4);
    }

    .template-selector__options {
        grid-template-columns: 1fr;
    }

    .related-posts__grid {
        grid-template-columns: 1fr;
    }

    .single-header__actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
