/*
Theme Name: Hamusoku Style Theme
Theme URI: https://example.com/hamusoku-theme
Author: Your Name
Author URI: https://example.com
Description: ハム速風のまとめサイト用WordPressテーマ。3カラムレイアウト、相互RSS管理機能、広告管理、レスポンシブ対応。
Version: 1.1.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hamusoku-theme
Tags: blog, news, three-columns, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ===============================
   基本設定
   =============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Meiryo, メイリオ, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    text-decoration: underline;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* スキップリンク */
.skip-link {
    position: absolute;
    top: -100px;
    left: 6px;
    z-index: 100000;
    padding: 8px 16px;
    background-color: #ff6b35;
    color: #fff;
    font-size: 14px;
    border-radius: 0 0 4px 4px;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid;
    outline-color: #ff6b35;
    outline-offset: 2px;
}

/* ===============================
   ヘッダー
   =============================== */
.site-header {
    background-color: #fff;
    border-bottom: 3px solid #ff6b35;
    padding: 15px 0;
    margin-bottom: 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.site-title a {
    color: #ff6b35;
    text-decoration: none;
}

.site-description {
    font-size: 12px;
    color: #666;
    margin: 2px 0 0 0;
}

/* ハンバーガーメニュー */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s;
}

.main-navigation {
    display: flex;
    gap: 20px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
    color: #333;
    font-size: 14px;
}

.main-navigation a:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

/* ===============================
   パンくずリスト
   =============================== */
.breadcrumb {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
    margin-bottom: 10px;
    font-size: 12px;
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    margin: 0 auto;
    max-width: 1200px;
    padding-left: 15px;
    padding-right: 15px;
}

.breadcrumb-list li {
    display: inline-flex;
    align-items: center;
    color: #666;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '>';
    margin: 0 8px;
    color: #ccc;
}

.breadcrumb-list li:last-child {
    color: #333;
}

.breadcrumb-list a {
    color: #0066cc;
}

/* ===============================
   広告エリア
   =============================== */
.ad-area {
    text-align: center;
    margin: 15px 0;
    overflow: hidden;
}

.ad-below_header {
    max-width: 1200px;
    margin: 10px auto;
    padding: 0 15px;
}

.ad-below_title {
    margin: 15px 0 20px 0;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.ad-below_content {
    margin: 25px 0 15px 0;
}

.ad-in_loop {
    margin: 10px 0;
}

.ad-sidebar_top {
    margin-bottom: 20px;
}

/* ===============================
   相互RSSエリア
   =============================== */
.rss-area {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    padding: 15px;
}

.rss-area-title {
    font-size: 16px;
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #ff6b35;
}

.rss-list {
    list-style: none;
    margin: 0;
    padding: 0;
    column-count: 2;
    column-gap: 20px;
}

.rss-list li {
    padding: 6px 0;
    border-bottom: 1px dotted #ddd;
    break-inside: avoid;
    font-size: 13px;
    line-height: 1.4;
}

.rss-list li:last-child {
    border-bottom: none;
}

.rss-list a {
    color: #0066cc;
    font-weight: normal;
}

.rss-site-name {
    color: #999;
    font-size: 11px;
    margin-left: 5px;
}

/* ===============================
   メインコンテンツエリア（3カラム）
   =============================== */
.site-content {
    margin-bottom: 40px;
}

.content-wrapper {
    display: flex;
    gap: 20px;
}

/* 左サイドバー */
.sidebar-left {
    width: 250px;
    flex-shrink: 0;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    min-width: 0;
}

/* 右サイドバー */
.sidebar-right {
    width: 250px;
    flex-shrink: 0;
}

/* ===============================
   ウィジェット
   =============================== */
.widget {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

.widget-title {
    background-color: #ff6b35;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 15px;
    margin: 0;
}

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

.widget li {
    border-bottom: 1px solid #f0f0f0;
}

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

.widget a {
    display: block;
    padding: 10px 15px;
    color: #333;
    transition: background-color 0.3s;
}

.widget a:hover {
    background-color: #f9f9f9;
    text-decoration: none;
}


/* サムネイル付き記事リスト（ウィジェット用） */
.thumbnail-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.thumbnail-post-item {
    border-bottom: 1px solid #f0f0f0;
}

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

.thumbnail-post-link {
    display: flex;
    padding: 10px 15px;
    gap: 10px;
    align-items: flex-start;
    transition: background-color 0.3s;
}

.thumbnail-post-link:hover {
    background-color: #f9f9f9;
    text-decoration: none;
}

.post-thumbnail-small {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.post-title-small {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* プロフィールウィジェット */
.widget-profile {
    text-align: center;
}

.profile-image {
    margin-bottom: 10px;
}

.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-description {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 10px;
}

.profile-links {
    margin-top: 10px;
}

.profile-twitter {
    display: inline-block;
    padding: 6px 16px;
    background-color: #1da1f2;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    transition: opacity 0.3s;
}

.profile-twitter:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

/* ===============================
   記事一覧（リスト表示）
   =============================== */
.hentry-list {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 0;
    transition: box-shadow 0.2s;
}

.hentry-list:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.entry-list-link {
    display: flex;
    padding: 15px;
    gap: 15px;
    align-items: flex-start;
    color: #333;
    text-decoration: none;
}

.entry-list-link:hover {
    text-decoration: none;
}

.entry-list-thumb {
    flex-shrink: 0;
    width: 160px;
    height: 100px;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f0f0f0;
}

.entry-list-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.entry-list-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entry-list-body {
    flex: 1;
    min-width: 0;
}

.entry-title-list {
    font-size: 16px;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: #333;
}

.hentry-list:hover .entry-title-list {
    color: #ff6b35;
}

.entry-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===============================
   記事（個別投稿）
   =============================== */
.hentry:not(.hentry-list) {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    padding: 20px;
}

.entry-header {
    margin-bottom: 15px;
}

.entry-title {
    font-size: 20px;
    line-height: 1.4;
    margin: 0 0 10px 0;
}

.entry-title a {
    color: #333;
}

.entry-title a:hover {
    color: #ff6b35;
}

.entry-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.posted-on,
.byline,
.cat-links,
.comments-link {
    display: inline-block;
}

.cat-links a,
.cat-label {
    background-color: #ff6b35;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.cat-links a:hover {
    text-decoration: none;
    opacity: 0.85;
}

.entry-content {
    line-height: 1.8;
    margin-bottom: 20px;
}

.entry-content p {
    margin-bottom: 15px;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin: 25px 0 15px 0;
    line-height: 1.4;
}

.entry-content h2 {
    font-size: 18px;
    color: #ff6b35;
    padding-bottom: 5px;
    border-bottom: 2px solid #ff6b35;
}

.entry-content h3 {
    font-size: 16px;
    color: #ff6b35;
}

.entry-content img {
    border-radius: 4px;
    margin: 15px 0;
}

.entry-content blockquote {
    background-color: #f9f9f9;
    border-left: 4px solid #0066cc;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.entry-content ul,
.entry-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.entry-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.entry-footer .tags-links {
    font-size: 12px;
}

.entry-footer .tags-links a {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 3px 8px;
    margin: 2px;
    border-radius: 3px;
    font-size: 11px;
}

.more-link {
    display: inline-block;
    padding: 8px 20px;
    background-color: #ff6b35;
    color: #fff;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.more-link:hover {
    background-color: #e55a25;
    text-decoration: none;
}

/* ===============================
   SNSシェアボタン
   =============================== */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex-wrap: wrap;
}

.share-label {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.share-btn {
    display: inline-block;
    padding: 8px 16px;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.3s;
}

.share-btn:hover {
    opacity: 0.85;
    text-decoration: none;
    color: #fff;
}

.share-twitter {
    background-color: #1da1f2;
}

.share-line {
    background-color: #06c755;
}

.share-hatena {
    background-color: #00a4de;
}

/* ===============================
   関連記事
   =============================== */
.related-posts {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.related-posts-title {
    font-size: 16px;
    color: #ff6b35;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ff6b35;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.related-post-item {
    display: block;
    text-decoration: none;
    color: #333;
    transition: opacity 0.3s;
}

.related-post-item:hover {
    opacity: 0.8;
    text-decoration: none;
}

.related-post-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.related-post-thumb-placeholder {
    width: 100%;
    height: 100px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
}

.related-post-title {
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===============================
   ページネーション
   =============================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 30px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    transition: all 0.3s;
    text-decoration: none;
}

.pagination a:hover,
.pagination .current {
    background-color: #ff6b35;
    color: #fff;
    border-color: #ff6b35;
    text-decoration: none;
}

.pagination .prev,
.pagination .next {
    font-weight: bold;
}

/* ===============================
   コメント
   =============================== */
.comments-area {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.comments-title,
.comment-reply-title {
    font-size: 18px;
    color: #ff6b35;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6b35;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.comment-author {
    font-weight: bold;
    margin-bottom: 5px;
}

.comment-metadata {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.comment-content {
    margin-bottom: 10px;
}

.reply {
    text-align: right;
}

.comment-reply-link {
    font-size: 12px;
    padding: 4px 10px;
    background-color: #0066cc;
    color: #fff;
    border-radius: 3px;
}

/* コメントフォーム */
.comment-form {
    margin-top: 20px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.comment-form textarea {
    min-height: 150px;
}

.comment-form input[type="submit"] {
    padding: 10px 30px;
    background-color: #ff6b35;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.comment-form input[type="submit"]:hover {
    background-color: #e55a25;
}

.no-comments {
    color: #999;
    font-style: italic;
    padding: 15px 0;
}

/* ===============================
   フッター
   =============================== */
.site-footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    margin-top: 40px;
}

.footer-widgets {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #555;
}

.footer-widgets .widget {
    flex: 1;
    background-color: transparent;
    border: none;
    color: #ccc;
}

.footer-widgets .widget-title {
    background-color: transparent;
    color: #fff;
    font-size: 14px;
    padding: 0 0 8px 0;
    border-bottom: 1px solid #555;
    margin-bottom: 10px;
}

.footer-widgets .widget a {
    color: #ccc;
    padding: 5px 0;
}

.footer-widgets .widget a:hover {
    color: #ff6b35;
}

.footer-widgets .widget li {
    border-bottom-color: #555;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-info {
    font-size: 14px;
}

.footer-navigation ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.footer-navigation a {
    color: #fff;
}

.footer-navigation a:hover {
    color: #ff6b35;
}

/* ===============================
   レスポンシブ対応
   =============================== */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar-left,
    .sidebar-right,
    .main-content {
        width: 100%;
    }

    /* ★修正: メインコンテンツを最上位に */
    .main-content {
        order: 1;
    }

    .sidebar-left {
        order: 2;
    }

    .sidebar-right {
        order: 3;
    }

    .rss-list {
        column-count: 2;
    }

    .related-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .site-header .container {
        flex-wrap: wrap;
    }

    /* ハンバーガーメニュー表示 */
    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        display: none;
        width: 100%;
        order: 10;
        margin-top: 10px;
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation li {
        border-bottom: 1px solid #f0f0f0;
    }

    .main-navigation a {
        display: block;
        padding: 12px 15px;
        border-radius: 0;
    }

    .site-footer .container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer-widgets {
        flex-direction: column;
    }

    .entry-title {
        font-size: 18px;
    }

    .entry-list-thumb {
        width: 120px;
        height: 80px;
    }

    .entry-title-list {
        font-size: 14px;
    }

    .rss-list {
        column-count: 1;
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-thumbnail-small {
        width: 60px;
        height: 45px;
    }

    .share-buttons {
        justify-content: center;
    }

    .breadcrumb-list {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .hentry:not(.hentry-list) {
        padding: 15px;
    }

    .hentry-list {
        margin-bottom: 8px;
    }

    .entry-list-link {
        padding: 12px;
        gap: 10px;
    }

    .entry-list-thumb {
        width: 90px;
        height: 65px;
    }

    .entry-title {
        font-size: 16px;
    }

    .entry-title-list {
        font-size: 13px;
    }

    .entry-excerpt {
        display: none;
    }

    .pagination a,
    .pagination span {
        padding: 6px 12px;
        font-size: 13px;
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .share-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ===============================
   WordPress 標準クラス
   =============================== */

/* サイトアイデンティティ（ヘッダー内） */
.site-identity {
    display: flex;
    flex-direction: column;
}

/* ページ分割リンク（wp_link_pages） */
.page-links {
    clear: both;
    margin: 20px 0;
    padding: 10px 0;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.page-links .post-page-numbers {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
}

.page-links .post-page-numbers.current,
.page-links .post-page-numbers:hover {
    background-color: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
}

/* アーカイブ */
.page-header {
    margin-bottom: 20px;
}

.archive-description {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

.aligncenter {
    display: block;
    margin: 20px auto;
}

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

.wp-caption-text {
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 5px 0;
}

.sticky {
    /* スティッキー投稿用のスタイル */
}

.bypostauthor {
    /* 投稿者のコメント用のスタイル */
}

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

.screen-reader-text:focus {
    clip: auto !important;
    display: block;
    height: auto;
    width: auto;
    z-index: 100000;
}

/* ===============================
   カスタム画像キャプション
   =============================== */
.custom-image-caption {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

.custom-image-caption a {
    color: #0066cc;
}

/* ===============================
   投稿ナビゲーション
   =============================== */
.post-navigation {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

.post-navigation .nav-links {
    display: flex;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    padding: 15px;
}

.post-navigation .nav-next {
    text-align: right;
    border-left: 1px solid #ddd;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 5px;
}

.post-navigation .nav-title {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.post-navigation a:hover {
    text-decoration: none;
}

.post-navigation a:hover .nav-title {
    color: #ff6b35;
}

/* ===============================
   フォーカス表示（アクセシビリティ）
   =============================== */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}
