/*
Theme Name: かなぐら 2025.12.30
Author: かなぐら
Description: 2025.12.30 ver
Version: 1.0
*/

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

/* =========================================
   基本変数定義
   ========================================= */
:root {
    --besso-bg: #f8fafb; 
    --besso-brown: #3d3431; 
    --besso-accent: #7a8a99; 
    --besso-blue: #7bbcd5; 
    --besso-text-light: #717d8a; 
    --dot-color: rgba(123, 188, 213, 0.3); 
}

/* =========================================
   ベーススタイル
   ========================================= */
body {
    background-color: #ffffff;
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--besso-brown);
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
}

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

/* 背景：ドット + 紙の質感 */
.polka-dot-bg {
    background-color: var(--besso-bg);
    background-image: 
        radial-gradient(var(--dot-color) 1.2px, transparent 1.2px),
        url("https://kanagura.com/wp-content/uploads/bg.png");
    background-size: 24px 24px, auto;
}

/* =========================================
   サイドバー & カテゴリーリンク
   ========================================= */
.category-link .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cbd5e1;
    transition: all 0.3s ease;
}
.category-link:hover .dot {
    background-color: var(--besso-blue);
    transform: scale(1.4);
}

/* プロフィールカード */
.profile-card {
    background-color: #fcfdfe;
    border: 1px solid #f1f5f9;
    border-radius: 24px;
    padding: 24px;
    text-align: left;
    position: relative;
}

.profile-icon-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
}
.profile-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}
.profile-icon-wrap::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px dashed var(--besso-blue);
    border-radius: 20px;
    opacity: 0.5;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sns-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    color: var(--besso-text-light);
    transition: all 0.3s ease;
    cursor: pointer;
}
.sns-link:hover {
    color: var(--besso-blue);
    border-color: var(--besso-blue);
    transform: translateY(-2px);
}
.sns-link svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* =========================================
   記事一覧カード (Loop)
   ========================================= */
.post-card { 
    position: relative; 
    display: flex;
    align-items: center; 
    margin-bottom: 3.5rem;
    width: 100%;
    cursor: pointer;
}
.post-card a {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

/* 背景パネルのアニメーション */
.post-content-bg {
    position: absolute;
    right: 0;
    top: 2rem;
    width: 94%; 
    height: 90%;
    background-color: #ffffff;
    border-radius: 16px;
    z-index: 1;
    opacity: 0; 
    transform: translateY(10px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid transparent;
}
.post-card:hover .post-content-bg {
    opacity: 1;
    transform: translateY(0);
    border: 1px solid #f1f5f9;
}

/* サムネイル */
.thumb-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    background-color: #f1f5f9;
    width: 120px; 
    z-index: 10; 
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 768px) {
    .thumb-wrap { width: 180px; }
}
.post-card:hover .thumb-wrap { transform: scale(1.05) rotate(-1.5deg); }
.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 記事情報テキスト */
.post-info {
    position: relative;
    z-index: 5;
    padding: 3rem 1rem 1.5rem 1.5rem; 
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; 
}
@media (min-width: 768px) {
    .post-info { padding-left: 2.5rem; padding-top: 4rem; }
}

/* マスキングテープ装飾 */
.masking-tape {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(3deg);
    width: 60px; 
    height: 20px; 
    background-color: var(--besso-blue);
    opacity: 0.8;
    z-index: 20; 
    clip-path: polygon(0% 15%, 10% 0%, 90% 0%, 100% 15%, 95% 35%, 100% 50%, 95% 65%, 100% 80%, 90% 100%, 10% 100%, 0% 80%, 5% 65%, 0% 50%, 5% 35%);
    pointer-events: none;
}

/* 続きを読むボタン */
.read-more-btn {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--besso-blue);
    margin-top: 0.75rem;
    transition: gap 0.3s ease;
}
.read-more-btn::after {
    content: '→';
    margin-left: 8px;
    transition: margin-left 0.3s ease;
}
.post-card:hover .read-more-btn::after { margin-left: 12px; }

/* =========================================
   ページネーション (デザイン修正版)
   ========================================= */
.pagination,
.navigation.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem; /* 間隔調整 */
    margin-top: 4rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* nav-linksコンテナがある場合も強制横並び */
.pagination .nav-links,
.navigation.pagination .nav-links {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ページネーション内の全リンク共通 */
.pagination .page-numbers,
.navigation.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: bold;
}

/* 【数字のみ】囲み枠をつける */
.pagination .page-numbers:not(.prev):not(.next),
.navigation.pagination .page-numbers:not(.prev):not(.next) {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background-color: #fff;
    border: 1px solid #f1f5f9;
    color: #94a3b8;
    font-size: 10px;
}

/* 【数字のみ】ホバー時：色がメインカラーに変化 */
.pagination a.page-numbers:not(.prev):not(.next):hover,
.navigation.pagination a.page-numbers:not(.prev):not(.next):hover {
    color: var(--besso-blue);      /* 文字色を青に */
    border-color: var(--besso-blue); /* 枠線を青に */
    background-color: #fff;        /* 背景は白のまま */
}

/* 【数字のみ】現在地 (Active) */
.pagination .page-numbers.current,
.navigation.pagination .page-numbers.current {
    background-color: var(--besso-blue) !important;
    color: #ffffff !important;
    border-color: var(--besso-blue) !important;
}

/* 【矢印 (← →)】囲みなし・スタイル */
.pagination .prev, .pagination .next,
.navigation.pagination .prev, .navigation.pagination .next {
    border: none;
    background: transparent;
    color: #cbd5e1; /* 薄いグレー */
    font-size: 12px;
    padding: 0 10px;
}

/* 【矢印】ホバー時 */
.pagination .prev:hover, .pagination .next:hover,
.navigation.pagination .prev:hover, .navigation.pagination .next:hover {
    color: var(--besso-blue); /* ホバーで青く */
}

/* =========================================
   記事詳細ページ (Single) 用スタイル
   ========================================= */

/* 本文内の見出し */
.article-body h2 { 
    font-size: 1.25rem; 
    font-weight: 900; 
    margin: 3.5rem 0 1.5rem; 
    padding: 0.2rem 0 0.2rem 1.25rem; 
    border-left: 6px solid var(--besso-blue); 
    line-height: 1.4; 
}
@media (min-width: 768px) {
    /* PC: 1.75rem -> 1.5rem に縮小 */
    .article-body h2 { font-size: 1.5rem; margin: 4rem 0 1.5rem; }
}

.article-body h3 { 
    font-size: 1.125rem; 
    font-weight: 800; 
    margin: 2.5rem 0 1.25rem; 
    padding-bottom: 0.75rem; 
    border-bottom: 3px solid #e2e8f0; /* 線幅を 1px -> 3px に変更 */
    position: relative; 
    display: block; 
    width: 100%; 
}
@media (min-width: 768px) {
    /* PC: 1.4rem -> 1.25rem に縮小 */
    .article-body h3 { font-size: 1.25rem; margin: 3rem 0 1.25rem; }
}
.article-body h3::before { 
    content: ''; 
    position: absolute; 
    left: 0; 
    bottom: -3px; /* 線の太さに合わせて位置調整 -1px -> -3px */
    width: 40px; 
    height: 3px; 
    background: var(--besso-blue); 
    z-index: 1; 
}

/* 本文内の段落 */
.article-body p { 
    margin-bottom: 1.75rem; 
    line-height: 2.1; 
    font-size: 14px; 
    color: #444; 
}
/* PCのみ文字サイズを15pxにする場合はこの記述を残す。
   もしPCも14pxで良ければ、この@mediaごと削除してください */
@media (min-width: 768px) {
    .article-body p { font-size: 15px; }
}

/* 本文内のリスト */
.article-body ul { margin: 1.5rem 0; padding-left: 0.5rem; }
.article-body li {
    position: relative; 
    padding-left: 1.75rem; 
    margin-bottom: 0.85rem;
    list-style: none; 
    line-height: 1.8; 
    color: #555;
}
.article-body li::before {
    content: ''; 
    position: absolute; 
    left: 0.25rem; 
    top: 0.7em;
    width: 6px; 
    height: 6px; 
    border-radius: 50%; 
    background-color: var(--besso-blue);
}

/* 本文内のテーブル */
.table-wrapper { 
    width: 100%; 
    overflow-x: auto; 
    margin: 2.5rem 0; 
    border-radius: 16px; 
    background: #ffffff; 
    border: 1px solid #f1f5f9; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.02); 
}
.article-body table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 14px; 
    text-align: left; 
    min-width: 450px; 
}
.article-body th { 
    background: #f8fafc; 
    color: var(--besso-text-light); 
    font-weight: 700; 
    padding: 1.25rem; 
    border-bottom: 1px solid #f1f5f9; 
    letter-spacing: 0.05em; 
}
.article-body td { 
    padding: 1.25rem; 
    border-bottom: 1px solid #f8fafc; 
    color: #666; 
}
.article-body tr:last-child td { border-bottom: none; }

/* 戻るボタン */
.back-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1rem 3rem; background-color: #ffffff; border: 1px solid #e2e8f0;
    border-radius: 99px; color: var(--besso-brown); font-size: 11px;
    font-weight: 900; letter-spacing: 0.15em; transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative; overflow: hidden;
    text-decoration: none;
}
.back-btn::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--besso-blue); transform: scaleX(0); transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); z-index: 0;
}
.back-btn:hover { color: #ffffff; border-color: var(--besso-blue); }
.back-btn:hover::before { transform: scaleX(1); transform-origin: left; }
.back-btn span { position: relative; z-index: 1; }

/* コピー完了トースト通知 */
#copy-toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    padding: 0.75rem 1.5rem; background-color: var(--besso-brown);
    color: white; font-size: 10px; font-weight: 900; border-radius: 99px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); z-index: 200;
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
#copy-toast.show { opacity: 1; }

/* =========================================
   アニメーションユーティリティ
   ========================================= */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* =========================================
   スマホ表示の調整（バランス調整版）
   ========================================= */
@media (max-width: 767px) {
    .post-info {
        /* 上の余白：少し戻す (2.25rem → 2.5rem) */
        padding-top: 2.5rem !important;
        
        /* 下の余白：少し戻す (0.25rem → 0.75rem) */
        padding-bottom: 0.75rem !important;
    }

    /* 白い背景パネルの高さ調整 */
    .post-content-bg {
        /* コンテンツに合わせて少し余裕を持たせる */
        height: calc(100% - 1.5rem) !important;
    }
}
/* =========================================
   ロゴ背景設定
   ========================================= */
.logo-bg-style {
    /* URLを https に変更 */
    background-image: url('https://kanagura.com/wp-content/uploads/logo-bg.png');
    
    /* 画像を枠いっぱいに広げる */
    background-size: 100% 100%; 
    background-repeat: no-repeat;
    background-position: center;
    
    /* 背景が見えるように余白を確保 */
    padding: 12px 24px; 
    
    /* インラインブロックで要素を包む */
    display: inline-block;
}

/* スマホ調整 */
@media (max-width: 767px) {
    .logo-bg-style {
        padding: 8px 16px;
    }
}