/* ==========================================================================
   CSS 変数
   ========================================================================== */

:root {
    /* カスタマイザー管理変数（customizer.php で上書き可能） */
    --goimaru-color-main:       #1a3a5c;
    --goimaru-color-accent:     #e74c3c;
    --goimaru-color-text:       #333333;
    --goimaru-color-bg:         #ffffff;
    --goimaru-color-header-bg:  #ffffff;
    --goimaru-color-footer-bg:  #f9fafb;
    --goimaru-color-sidebar-bg: #f8f8f8;
    --goimaru-font-size:        16px;
    --goimaru-line-height:      1.8;

    /* テーマ固定変数 */
    --color-primary:     var(--goimaru-color-main, #2563eb);
    --color-primary-dark:#1d4ed8;
    --color-text:        var(--goimaru-color-text, #1f2937);
    --color-text-muted:  #6b7280;
    --color-border:      #e5e7eb;
    --color-bg:          var(--goimaru-color-bg, #ffffff);
    --color-bg-alt:      #f9fafb;
    --color-link:        var(--goimaru-color-main, #2563eb);
    --color-link-hover:  var(--goimaru-color-accent, #1d4ed8);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN',
                 'Hiragino Sans', Meiryo, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    --spacing-xs:  0.25rem;
    --spacing-sm:  0.5rem;
    --spacing-md:  1rem;
    --spacing-lg:  1.5rem;
    --spacing-xl:  2rem;
    --spacing-2xl: 3rem;

    --content-width:   720px;
    --sidebar-width:   280px;
    --layout-gap:      2rem;
    --container-max:   1200px;
    --border-radius:   0.375rem;
}

/* ==========================================================================
   リセット・ベース
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--goimaru-font-size, 1rem);
    line-height: var(--goimaru-line-height, 1.8);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-text-size-adjust: 100%;
}

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

a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--color-link-hover);
}

/* ==========================================================================
   スキップリンク
   ========================================================================== */

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
    z-index: 9999;
}

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

.site-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.site-content {
    display: flex;
    gap: var(--layout-gap);
    padding: var(--spacing-2xl) 0;
    align-items: flex-start;
}

/* 1 カラム */
body.layout-single .primary {
    flex: 1;
    min-width: 0;
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
}

body.layout-single .sidebar {
    display: none;
}

/* 固定ページは常にコンテンツ幅でセンタリング（プラグインによるレイアウト上書き時も有効） */
body.page .primary {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
}

/* 2 カラム（サイドバー右） */
body.layout-two-column .primary {
    flex: 1;
    min-width: 0;
}

body.layout-two-column .sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

/* ==========================================================================
   サイトヘッダー
   ========================================================================== */

.site-header {
    background: var(--goimaru-color-header-bg, var(--color-bg));
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-lg) 0;
}

.site-header .site-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.site-title a {
    color: var(--color-text);
    text-decoration: none;
}

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

.site-description {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   グローバルナビゲーション
   ========================================================================== */

.global-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* トップレベルメニューのみ横並び */
.global-nav .nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

/* 親 li を absolute の起点に */
.global-nav .nav-menu > li.menu-item-has-children {
    position: relative;
}

/* サブメニュー: デフォルト非表示（transition のため visibility/opacity で制御） */
.global-nav .sub-menu {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 10rem;
    background: var(--goimaru-color-header-bg, var(--color-bg));
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 200;
    list-style: none;
    margin: 0;
    padding: var(--spacing-xs) 0;
    transition: visibility 0s 0.15s, opacity 0.15s;
}

/* ホバー + キーボード focus-within で表示 */
.global-nav .nav-menu > li.menu-item-has-children:hover > .sub-menu,
.global-nav .nav-menu > li.menu-item-has-children:focus-within > .sub-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: visibility 0s, opacity 0.15s;
}

/* サブメニュー内リンク */
.global-nav .sub-menu a {
    display: block;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
    white-space: nowrap;
}

.global-nav a {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.global-nav a:hover {
    background: var(--color-bg-alt);
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--color-text);
}

/* デスクトップではサブメニュートグルボタンを非表示（モバイルのみ表示） */
.sub-menu-toggle {
    display: none;
}

/* ==========================================================================
   記事一覧
   ========================================================================== */

.posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.post-card {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-xl);
}

.post-card:last-child {
    border-bottom: none;
}

.post-card .post-thumbnail {
    margin-bottom: var(--spacing-md);
}

.post-card .post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.post-card .entry-title {
    margin: 0 0 var(--spacing-sm);
    font-size: 1.25rem;
    line-height: 1.4;
}

.post-card .entry-title a {
    color: var(--color-text);
    text-decoration: none;
}

.post-card .entry-title a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.post-card .entry-excerpt {
    margin: var(--spacing-sm) 0 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   投稿メタ情報
   ========================================================================== */

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}

.entry-meta a {
    color: var(--color-text-muted);
}

.entry-meta a:hover {
    color: var(--color-primary);
}

.entry-meta .sep {
    color: var(--color-border);
}

/* ==========================================================================
   投稿・固定ページ
   ========================================================================== */

.entry-header {
    margin-bottom: var(--spacing-xl);
}

.entry-title {
    margin: 0 0 var(--spacing-md);
    font-size: 1.75rem;
    line-height: 1.3;
}

.entry-thumbnail {
    margin-bottom: var(--spacing-xl);
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.entry-content {
    line-height: 1.9;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
}

.entry-content h2 {
    font-size: 1.5rem;
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--color-primary);
}

.entry-content h3 {
    font-size: 1.25rem;
}

.entry-content p {
    margin: 0 0 var(--spacing-lg);
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5rem;
    margin: 0 0 var(--spacing-lg);
}

.entry-content li {
    margin-bottom: var(--spacing-xs);
}

.entry-content blockquote {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    border-left: 4px solid var(--color-primary);
    background: var(--color-bg-alt);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    color: var(--color-text-muted);
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 var(--spacing-lg);
}

.entry-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-bg-alt);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    border: 1px solid var(--color-border);
}

.entry-content pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 1em;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 var(--spacing-lg);
    font-size: 0.9rem;
}

.entry-content th,
.entry-content td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    text-align: left;
}

.entry-content th {
    background: var(--color-bg-alt);
    font-weight: 600;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.entry-content a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
}

.entry-content a:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: 2px;
}

.entry-content a:visited {
    color: var(--color-link);
}

.entry-content .wp-block-button a {
    color: inherit;
    text-decoration: none;
}

.entry-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

/* カテゴリ・タグ */
.cat-links,
.tags-links {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.cat-links a,
.tags-links a {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    margin: 0.1em;
    transition: background 0.15s, color 0.15s;
}

.cat-links a:hover,
.tags-links a:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ==========================================================================
   パンくずリスト
   ========================================================================== */

.breadcrumb-wrapper {
    margin-bottom: var(--spacing-lg);
}

#breadcrumb {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

#breadcrumb li {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#breadcrumb li:not(:last-child)::after {
    content: '›';
    color: var(--color-border);
}

#breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
}

#breadcrumb a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-2xl);
    font-size: 0.9rem;
}

.pagination a,
.pagination .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.15s, color 0.15s;
}

.pagination a:hover {
    background: var(--color-bg-alt);
    color: var(--color-primary);
}

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

/* 前後記事ナビ */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.post-navigation .nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.nav-previous,
.nav-next {
    flex: 1;
    max-width: 48%;
}

.nav-next {
    text-align: right;
}

/* ==========================================================================
   サイドバー
   ========================================================================== */

.widget {
    margin-bottom: var(--spacing-2xl);
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--color-primary);
}

.widget ul,
.widget li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--color-text);
    text-decoration: none;
}

.widget ul li a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   コメント
   ========================================================================== */

.comments-area {
    margin-top: var(--spacing-2xl);
}

.comments-title,
.comment-reply-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--color-primary);
}

.comment-list {
    list-style: none;
    margin: 0 0 var(--spacing-xl);
    padding: 0;
}

.comment-body {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
}

.comment-author img {
    border-radius: 50%;
}

.comment-content p {
    margin: 0 0 var(--spacing-sm);
    font-size: 0.9rem;
}

.comment-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.15s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-form .form-submit input[type="submit"] {
    padding: var(--spacing-sm) var(--spacing-xl);
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.comment-form .form-submit input[type="submit"]:hover {
    background: var(--color-primary-dark);
}

/* ==========================================================================
   アーカイブヘッダー
   ========================================================================== */

.page-header {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.page-title {
    font-size: 1.5rem;
    margin: 0 0 var(--spacing-sm);
}

.page-description {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ==========================================================================
   検索フォーム
   ========================================================================== */

.search-form {
    display: flex;
    gap: var(--spacing-xs);
}

.search-form .search-field {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: var(--color-bg);
    color: var(--color-text);
}

.search-form .search-field:focus {
    outline: none;
    border-color: var(--color-primary);
}

.search-form .search-submit {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

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

/* ==========================================================================
   404 ページ
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: var(--spacing-2xl) 0;
}

.error-404 .page-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

/* ==========================================================================
   サイトフッター
   ========================================================================== */

.site-footer {
    background: var(--goimaru-color-footer-bg, var(--color-bg-alt));
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.site-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
}

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

/* ==========================================================================
   管理バー対応
   ========================================================================== */

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

/* ==========================================================================
   レスポンシブ
   ========================================================================== */

@media (max-width: 900px) {
    .site-content {
        flex-direction: column;
    }

    body.layout-two-column .sidebar {
        width: 100%;
    }

    /* モバイルナビゲーション */
    .menu-toggle {
        display: block;
    }

    .global-nav .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: var(--spacing-sm) 0;
        border-top: 1px solid var(--color-border);
        margin-top: var(--spacing-sm);
    }

    .global-nav .nav-menu.nav-open {
        display: flex;
    }

    /* モバイル: デスクトップの absolute/visibility を解除してアコーディオン制御に切り替え */
    .global-nav .sub-menu {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        position: static;
        box-shadow: none;
        border: none;
        background: none;
        display: none;          /* JS の sub-open クラスで制御 */
        transition: none;
        white-space: normal;
        padding: 0;
        min-width: 0;
    }

    .global-nav .sub-menu.sub-open {
        display: block;
    }

    /* 親リンクと ▼ ボタンを横並び */
    .global-nav .menu-item-has-children {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .global-nav .menu-item-has-children > a {
        flex: 1;
    }

    /* ▼ トグルボタン */
    .sub-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--color-text);
        font-size: 0.75rem;
        flex-shrink: 0;
        transition: transform 0.2s;
    }

    .sub-menu-toggle[aria-expanded="true"] {
        transform: rotate(180deg);
    }

    /* サブメニュー: 幅いっぱいに展開 */
    .global-nav .sub-menu {
        width: 100%;
    }

    .global-nav .sub-menu a {
        padding-left: calc(var(--spacing-md) * 2);
        border-top: 1px solid var(--color-border);
        font-size: 0.875rem;
        white-space: normal;
    }

    .global-nav a {
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: 0;
    }

    /* sticky 固定時: 展開メニューをコンテンツの上にオーバーレイ表示 */
    .global-nav.sticky.is-stuck .nav-menu.nav-open {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--goimaru-color-header-bg, var(--color-bg));
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        z-index: 101;
    }
}

@media (max-width: 600px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }

    .site-header .site-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .entry-title {
        font-size: 1.4rem;
    }

    .post-navigation {
        flex-direction: column;
    }

    .nav-next {
        text-align: left;
    }
}

/* ==========================================================================
   WordPress コアクラス
   ========================================================================== */

.alignleft {
    float: left;
    margin-right: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.alignright {
    float: right;
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--spacing-md);
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: var(--spacing-xs);
}

/* ==========================================================================
   アクセシビリティ
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ==========================================================================
   プリント
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .sidebar,
    .global-nav,
    .post-navigation,
    .pagination {
        display: none;
    }

    .site-content {
        display: block;
    }

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

/* ==========================================================================
   サイドバー背景・位置
   ========================================================================== */

.sidebar .widget-area {
    background: var(--goimaru-color-sidebar-bg, #f8f8f8);
    padding: var(--spacing-md);
    border-radius: 4px;
}

/* サイドバー左レイアウト */
body.layout-two-column.sidebar-left .site-content {
    flex-direction: row-reverse;
}

/* ==========================================================================
   sticky グローバルナビ
   ========================================================================== */

.global-nav.sticky.is-stuck {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: var(--goimaru-color-header-bg, var(--color-bg));
}

/* ==========================================================================
   PAGE TOP ボタン
   ========================================================================== */

.pagetop {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    line-height: 48px;
    text-align: center;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    z-index: 99;
    transition: opacity 0.2s, transform 0.2s;
}

.pagetop.is-visible {
    display: block;
    opacity: 1;
}

.pagetop:hover {
    transform: translateY(-3px);
    opacity: 0.85;
}

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

.sns-share {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin: var(--spacing-xl) 0;
}

.sns-share__btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5em 1.2em;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
}

.sns-share__btn:hover {
    opacity: 0.85;
}

.sns-share__btn--twitter {
    background: #000;
    color: #fff;
}

.sns-share__btn--facebook {
    background: #1877f2;
    color: #fff;
}

/* ==========================================================================
   内部リンク ブログカード
   ========================================================================== */

.blog-card {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    margin: var(--spacing-lg) 0;
}

.blog-card__link {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.15s;
}

.blog-card__link:hover {
    background: var(--color-bg-alt);
}

.blog-card__thumb {
    display: block; /* span をブロック表示 */
    width: 120px;
    flex-shrink: 0;
    overflow: hidden;
}

.blog-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-card__body {
    display: block; /* span をブロック表示 */
    padding: var(--spacing-md);
    flex: 1;
    min-width: 0;
}

.blog-card__title {
    display: block; /* span をブロック表示 */
    font-weight: 600;
    margin: 0 0 0.4em;
    font-size: 0.95rem;
}

.blog-card__excerpt {
    display: -webkit-box; /* span をブロック表示（行制限付き） */
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 480px) {
    .blog-card__thumb {
        width: 80px;
    }
}

/* ==========================================================================
   広告プレビュー枠（管理者ログイン中のみ表示）
   ========================================================================== */

.ads-preview {
    border: 2px dashed #f0ad4e;
    background: repeating-linear-gradient(
        -45deg,
        #fffbe6,
        #fffbe6 10px,
        #fff8d6 10px,
        #fff8d6 20px
    );
    padding: 24px;
    text-align: center;
    margin: 1.5em 0;
    border-radius: 4px;
}

.ads-preview-label {
    display: inline-block;
    background: #f0ad4e;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    padding: 4px 16px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.ads-preview-disabled {
    border-color: #ccc;
    background: repeating-linear-gradient(
        -45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #eee 10px,
        #eee 20px
    );
}

.ads-preview-disabled .ads-preview-label {
    background: #999;
}
