/*
Theme Name: simplemodern_card
Theme URI: 
Author: Trae AI
Author URI: 
Description: 各記事をカード形式でトップページに表示するWordPressテーマです。各記事カテゴリ毎にカードが一覧で表示され、各カテゴリ毎のトップページ最大表示記事数を管理画面で設定出来ます。
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.0
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: simplemodern_card
Tags: blog, fashion, portfolio, custom-colors, custom-logo, custom-menu, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, dark-mode
*/

/* Base Styles */
:root {
    --primary-color: #888888; /* グレーに変更 */
    --secondary-color: #666666; /* ダークグレーに変更 */
    --text-color: #333;
    --background-color: #fff;
    --light-gray: #f8f8f8;
    --dark-gray: #333333;
    --footer-bg: #f8f8f8;
    --footer-text: #333;
}

/* ダークモード用の変数 */
[data-theme="dark"] {
    --primary-color: #aaaaaa; /* ダークモード用の明るいグレーに変更 */
    --secondary-color: #888888; /* ダークモード用のグレーに変更 */
    --text-color: #f8f8f8;
    --background-color: #222;
    --light-gray: #444;
    --dark-gray: #ddd;
    --footer-bg: #333;
    --footer-text: #f8f8f8;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

/* レイアウト設定 - デフォルトは2カラム */
.content-area {
    width: 70%;
    margin-right: 0;
}

.widget-area {
    width: 25%;
    margin-left: 0;
}

/* 1カラムレイアウト用のスタイル */
.one-column .content-area {
    width: 100%;
    float: none;
}

.one-column .widget-area {
    display: none;
}

/* Header Styles */
.site-header {
    padding: 15px 0;
    background-color: var(--background-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

.site-branding {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    margin-bottom: 15px;
    margin-right: 0;
}

.custom-logo-link {
    margin-bottom: 10px;
}

.custom-logo {
    max-height: 50px;
    width: auto;
}

.site-title {
    font-size: 1.6rem;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    color: var(--text-color);
}

.site-title a:hover {
    color: var(--primary-color);
}

.site-description {
    margin: 0.5em 0 0;
    font-size: 0.9rem;
    color: #666;
}

/* ナビゲーションスタイル */
.main-navigation {
    width: 100%;
    text-align: left;
    margin-top: 5px;
}

.main-navigation ul {
    display: flex;
    justify-content: flex-start;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    position: relative;
    margin: 0 5px;
}

.main-navigation a {
    display: block;
    padding: 5px 10px;
    color: var(--text-color);
    font-weight: 500;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

/* Article Card Styles */
.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--category-border-color, var(--primary-color));
    padding-bottom: 10px;
}

.resource-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, var(--card-width-pc, 300px));
    gap: 20px;
}

.resource-card {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 20px;
    background-color: var(--background-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.resource-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.resource-thumbnail {
    margin-bottom: 15px;
    text-align: center; /* 画像を中央揃えにする場合 */
}

.resource-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px; /* 画像の角を少し丸める */
}

.resource-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.resource-description {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 15px;
    height: 60px; /* 3行分程度の高さを確保 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 表示する行数を3行に制限 */
    -webkit-box-orient: vertical;
}

.resource-links a {
    display: inline-block;
    background-color: var(--button-color, var(--primary-color));
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.resource-links a:hover {
    background-color: var(--button-hover-color, var(--secondary-color));
    color: #fff;
}

/* Footer Styles */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-widgets {
    margin-bottom: 30px;
}

.footer-widget-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-widget {
    width: 30%;
    margin-bottom: 20px;
}

.site-info {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
    width: 100%;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: flex;
    justify-content: center;
}

.footer-menu li {
    margin: 0 10px;
}

/* ダークモード切替ボタン */
.dark-mode-toggle {
    color: var(--text-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 101;
}

.dark-mode-toggle:hover {
    color: var(--primary-color);
}

.dark-mode-toggle svg {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

/* ダークモード時のアイコン表示切り替え */
[data-theme="dark"] .dark-mode-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .dark-mode-toggle .moon-icon,
.dark-mode-toggle .moon-icon /* 初期状態（JS未処理またはlightモード）で月を非表示 */ {
    display: none;
}

[data-theme="light"] .dark-mode-toggle .sun-icon {
    display: inline-block;
}

[data-theme="dark"] .dark-mode-toggle .moon-icon {
    display: inline-block;
}


/* レスポンシブスタイル */
@media screen and (max-width: 768px) {
    .resource-cards-container {
        grid-template-columns: repeat(auto-fit, var(--card-width-mobile, 100%));
        flex-direction: column;
    }
    
    .content-area,
    .one-column .content-area {
        width: 100%;
        float: none;
    }
    
    /* スマートフォン表示時はサイドバーを非表示にする */
    .widget-area {
        display: none;
    }
    
    .footer-widget {
        width: 100%;
    }
    
    .main-navigation ul {
        flex-direction: column;
    }
    
    .dark-mode-toggle {
        position: absolute;
        top: 10px;
        right: 10px;
        margin: 0;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 101;
        background-color: rgba(255, 255, 255, 0.7);
        border-radius: 8px;
        width: auto;
        min-width: 30px;
        height: 30px;
    }
    
    .dark-mode-toggle .dark-mode-label {
        font-size: 0.8rem;
        font-weight: bold;
        margin-left: 2px;
    }
    
    /* アイコンを表示するために削除 */
    
    [data-theme="dark"] .dark-mode-toggle {
        background-color: rgba(50, 50, 50, 0.7);
    }
}