/*
Theme Name: AFFINGER Child
Template: affinger
Description: AFFINGER6 対応
Version: 1.1.0
*/

/* ========================================
   デザインシステム - CSS変数
   ======================================== */
:root {
    /* カラーパレット */
    --color-main: #304d5b;           /* メインカラー（ダークティール） */
    --color-main-light: #3d6273;     /* メインカラー（明るめ） */
    --color-main-dark: #243a45;      /* メインカラー（暗め） */
    --color-white: #ffffff;
    --color-black: #333333;
    --color-gray: #666666;
    --color-gray-light: #f5f5f5;
    --color-bg: #fafafa;
    --color-border: #e8e8e8;

    /* フォント */
    --font-heading: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;

    /* スペーシング */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* 角丸 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* シャドウ */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);

    /* トランジション */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ========================================
   ベーススタイル（フォント・タイポグラフィ）
   ======================================== */

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

body {
    font-family: var(--font-body) !important;
    font-size: 1rem;
    line-height: 1.9;
    letter-spacing: 0.02em;
    color: var(--color-black);
    background-color: var(--color-bg);
}

/* 見出しフォント */
h1, h2, h3, h4, h5, h6,
.entry-title,
.post-title,
article h1,
article h2,
article h3,
article h4 {
    font-family: var(--font-heading) !important;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

/* 本文の段落 */
p,
.entry-content p,
article p {
    line-height: 2;
    margin-bottom: 1.5em;
}

/* リストの行間 */
ul, ol {
    line-height: 1.8;
}

li {
    margin-bottom: 0.5em;
}

/* ========================================
   ヘッダー（一番上）
   ======================================== */

#st-header-top-widgets-box,
header.st-header,
#headbox-bg,
.st-header-flexbox {
    background: var(--color-main) !important;
    background-color: var(--color-main) !important;
}

/* ヘッダーのテキストを白に */
header .sitename a,
.st-header .sitename a,
header .descr,
.st-header .descr {
    color: var(--color-white) !important;
}

/* ロゴ画像がある場合の調整 */
header .sitename img {
    filter: brightness(0) invert(1);
}

/* ========================================
   ナビゲーション
   ======================================== */

/* ナビバー背景 */
#st-menuwide,
nav.stnavi,
#st-menubox,
#s-navi,
.st-header-flexbox nav,
#st-menuwide .menu-box,
nav.stnavi .menu-box {
    background: var(--color-main) !important;
    background-color: var(--color-main) !important;
}

/* ナビのリンク文字色を白に */
#st-menuwide a,
nav.stnavi a,
#st-menubox a,
#s-navi a,
.menu-box a {
    color: var(--color-white) !important;
}

/* ナビのホバー時 - 少し明るく */
#st-menuwide a:hover,
nav.stnavi a:hover,
#st-menubox a:hover,
#s-navi a:hover,
#st-menuwide .menu-item:hover > a,
nav.stnavi .menu-item:hover > a {
    background-color: var(--color-main-light) !important;
    opacity: 1 !important;
}

/* ナビの区切り線を調整 */
#st-menuwide li,
nav.stnavi li,
.menu-box li {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ドロップダウンメニュー */
#st-menuwide ul ul,
nav.stnavi ul ul,
#st-menubox ul ul,
.menu-box ul ul,
#st-menuwide .sub-menu,
nav.stnavi .sub-menu,
.st-header-flexbox .sub-menu {
    background: var(--color-main) !important;
    background-color: var(--color-main) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* ドロップダウンのリンク */
#st-menuwide ul ul a,
nav.stnavi ul ul a,
#st-menubox ul ul a,
.menu-box ul ul a,
#st-menuwide .sub-menu a,
nav.stnavi .sub-menu a {
    color: var(--color-white) !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ドロップダウンのホバー */
#st-menuwide ul ul a:hover,
nav.stnavi ul ul a:hover,
#st-menubox ul ul a:hover,
.menu-box ul ul a:hover,
#st-menuwide .sub-menu a:hover,
nav.stnavi .sub-menu a:hover {
    background-color: var(--color-main-light) !important;
}

/* ドロップダウンのli */
#st-menuwide ul ul li,
nav.stnavi ul ul li,
.sub-menu li {
    border: none !important;
}

/* ========================================
   フッター（一番下）
   ======================================== */

footer,
#footer,
.st-footer,
#footer-box,
#footer-top,
.footer-inner,
#footer-widget-area {
    background: var(--color-main) !important;
    background-color: var(--color-main) !important;
}

/* フッターのテキスト・リンクを白に */
footer,
#footer,
footer a,
#footer a,
.st-footer a,
footer p,
#footer p,
#footer-widget-area,
#footer-widget-area a,
.footer-inner a {
    color: var(--color-white) !important;
}

/* フッターリンクのホバー */
footer a:hover,
#footer a:hover,
#footer-widget-area a:hover {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1 !important;
}

/* コピーライト */
.copy,
.copyright,
#copyright {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ========================================
   リンク・ボタン
   ======================================== */

/* 通常のリンク（SNS系は除外） */
a:not([href*="twitter"]):not([href*="facebook"]):not([href*="instagram"]):not([href*="line"]):not(.sns a):not(.st-sns a):not(.sharewrap a) {
    color: var(--color-main) !important;
}

a:not([href*="twitter"]):not([href*="facebook"]):not([href*="instagram"]):not([href*="line"]):not(.sns a):not(.st-sns a):not(.sharewrap a):hover {
    color: var(--color-main-dark) !important;
}

/* ボタン */
.btn,
.st-btn,
button,
input[type="submit"],
.st-author-button,
a.st-author-button {
    background-color: var(--color-main) !important;
    color: var(--color-white) !important;
    border: none !important;
}

.btn:hover,
.st-btn:hover,
button:hover,
input[type="submit"]:hover,
.st-author-button:hover,
a.st-author-button:hover {
    background-color: var(--color-main-dark) !important;
}

/* プロフィールのボタン */
.st-author-box a.st-author-button {
    background-color: var(--color-main) !important;
    color: var(--color-white) !important;
}

.st-author-box a.st-author-button:hover {
    background-color: var(--color-main-dark) !important;
}

/* ========================================
   サイドバー・ウィジェット
   ======================================== */

/* ウィジェットタイトル */
#side .widgettitle,
aside .widgettitle,
.st-widgets-title,
#side h4.menu_underh2,
aside h4,
.st-sidebar h4 {
    background: var(--color-main) !important;
    background-color: var(--color-main) !important;
    color: var(--color-white) !important;
    border: none !important;
}

/* サイドバーリンク */
#side a,
aside a,
.st-sidebar a {
    color: var(--color-main) !important;
}

#side a:hover,
aside a:hover,
.st-sidebar a:hover {
    color: var(--color-main-dark) !important;
}

/* ========================================
   見出し装飾
   ======================================== */

/* h2の装飾 */
.post h2,
article h2,
.entry-content h2 {
    border-color: var(--color-main) !important;
}

/* h3の装飾 */
.post h3,
article h3,
.entry-content h3 {
    border-left-color: var(--color-main) !important;
}

/* h4の装飾 */
.post h4,
article h4,
.entry-content h4 {
    border-color: var(--color-main) !important;
}

/* ========================================
   余白・スペーシング
   ======================================== */

/* メインコンテンツエリア */
#content,
.st-main,
main,
#main {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

/* 記事コンテンツ */
.entry-content,
.post-content,
article .content {
    padding: var(--spacing-md);
}

/* 記事間の余白 */
article,
.post {
    margin-bottom: var(--spacing-lg);
}

/* セクション間の余白 */
.entry-content h2,
article h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.entry-content h3,
article h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.entry-content h4,
article h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* サイドバーの余白 */
#side,
aside,
.sidebar {
    padding-left: var(--spacing-md);
}

/* ウィジェット間の余白 */
.widget,
#side .widget {
    margin-bottom: var(--spacing-md);
}

/* ========================================
   SNSボタン - 元の色を維持
   ======================================== */

/* SNSボタンは元の色を維持（上書きしない） */
.sns li a,
.st-sns li a,
.sharewrap li a,
.sns-design-type01 li a,
.sns-design-type02 li a {
    /* 元のスタイルを維持 */
}

/* Instagram - 元のグラデーションを復元 */
li.instagram a,
.instagram a,
a[href*="instagram.com"] {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%) !important;
    color: #ffffff !important;
}

/* Instagramアイコン */
li.instagram a i,
.instagram a i,
.st-fa.st-svg-instagram,
i.st-svg-instagram {
    color: #ffffff !important;
}

/* ========================================
   カード・ボックスのモダン化
   ======================================== */

/* 記事カード */
article,
.post,
.kanren-item,
.st-cardbox,
.st-card-box {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* 記事カードのホバー */
article:hover,
.post:hover,
.kanren-item:hover,
.st-cardbox:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* サイドバーウィジェット */
.widget,
#side .widget,
aside .widget {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-sm);
    overflow: hidden;
}

/* ウィジェットタイトルの角丸 */
#side .widgettitle,
aside .widgettitle,
.st-widgets-title,
#side h4.menu_underh2,
aside h4,
.st-sidebar h4 {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: calc(-1 * var(--spacing-sm));
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm);
}

/* プロフィールボックス */
.st-author-box,
.author-box,
.profile-box {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    text-align: center;
}

/* プロフィール画像 */
.st-author-box img,
.author-box img,
.profile-box img {
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

/* 関連記事・人気記事カード */
.kanren,
.st-kanren,
.popular-box {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* カード内の画像 */
article img,
.post img,
.kanren-item img,
.st-cardbox img {
    border-radius: var(--radius-md);
}

/* 引用ボックス */
blockquote {
    background: var(--color-gray-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

/* コードブロック */
pre,
code {
    background: #2d2d2d;
    border-radius: var(--radius-sm);
    padding: 0.2em 0.4em;
}

pre {
    padding: var(--spacing-sm);
    overflow-x: auto;
}

pre code {
    padding: 0;
}

/* ボタンの角丸 */
.btn,
.st-btn,
button,
input[type="submit"],
.st-author-button,
a.st-author-button {
    border-radius: var(--radius-md);
    padding: 0.75em 1.5em;
}

/* 検索フォーム */
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75em 1em;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus {
    border-color: var(--color-main);
    outline: none;
    box-shadow: 0 0 0 3px rgba(48, 77, 91, 0.1);
}

/* ========================================
   その他の要素
   ======================================== */

/* ページネーション */
.pagination a:hover,
.pagination .current,
.wp-pagenavi a:hover,
.wp-pagenavi .current {
    background-color: var(--color-main) !important;
    color: var(--color-white) !important;
}

/* カテゴリーラベル */
.st-catgroup,
.catname,
.st-label {
    background-color: var(--color-main) !important;
    color: var(--color-white) !important;
}

/* タグ */
.tagcloud a:hover,
.st-tags a:hover {
    background-color: var(--color-main) !important;
    color: var(--color-white) !important;
}

/* テーブルのヘッダー */
table th {
    background-color: var(--color-main) !important;
    color: var(--color-white) !important;
}

/* 引用 */
blockquote {
    border-left-color: var(--color-main) !important;
}

/* 選択時のハイライト */
::selection {
    background-color: var(--color-main) !important;
    color: var(--color-white) !important;
}

/* スクロールバー（対応ブラウザのみ） */
::-webkit-scrollbar-thumb {
    background-color: var(--color-main) !important;
}

/* ========================================
   モバイルメニュー
   ======================================== */

/* ハンバーガーメニュー */
#st-mobile-menu,
.st-mobile-menu,
#s-navi-menu {
    background-color: var(--color-main) !important;
}

#st-mobile-menu a,
.st-mobile-menu a,
#s-navi-menu a {
    color: var(--color-white) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

#st-mobile-menu a:hover,
.st-mobile-menu a:hover,
#s-navi-menu a:hover {
    background-color: var(--color-main-light) !important;
}

/* ========================================
   アニメーション・トランジション
   ======================================== */

/* 基本のトランジション */
a,
button,
input,
.btn,
.st-btn,
article,
.post,
.widget,
.kanren-item,
.st-cardbox {
    transition: all var(--transition-normal);
}

/* リンクのホバーアニメーション */
.entry-content a,
article a,
#side a,
aside a {
    position: relative;
    text-decoration: none;
}

.entry-content a:not([class])::after,
article p a:not([class])::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-main);
    transition: width var(--transition-normal);
}

.entry-content a:not([class]):hover::after,
article p a:not([class]):hover::after {
    width: 100%;
}

/* ボタンのホバーアニメーション */
.btn:hover,
.st-btn:hover,
button:hover,
input[type="submit"]:hover,
.st-author-button:hover,
a.st-author-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* カードのホバーアニメーション */
article,
.post,
.kanren-item,
.st-cardbox,
.st-card-box {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* ナビゲーションのホバー */
#st-menuwide a,
nav.stnavi a,
#st-menubox a,
#s-navi a,
.menu-box a {
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* 画像のホバー */
article img,
.post img,
.kanren-item img,
.st-cardbox img {
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

article:hover img,
.post:hover img,
.kanren-item:hover img,
.st-cardbox:hover img {
    transform: scale(1.02);
}

/* サイドバーウィジェットのホバー */
.widget:hover,
#side .widget:hover {
    box-shadow: var(--shadow-md);
}

/* ページネーションのホバー */
.pagination a,
.wp-pagenavi a {
    transition: all var(--transition-fast);
}

.pagination a:hover,
.wp-pagenavi a:hover {
    transform: translateY(-2px);
}

/* フォーカス時のアニメーション */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus {
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* スムーススクロール */
html {
    scroll-behavior: smooth;
}

/* フェードインアニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 記事カードのフェードイン */
article,
.post {
    animation: fadeIn 0.5s ease forwards;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
