/*
Theme Name:   Twenty Twenty-Five Child
Template:     twentytwentyfive
Version:      1.0
*/

/* WordPressのCSS変数を上書きして記事幅を拡張 */
:root {
    --wp--style--global--content-size: 1200px !important;
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin: 0 auto;
    max-width: 1500px;
}

/* 大きなデスクトップ画面では3列表示 */
@media (min-width: 1400px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1700px;
        gap: 8px;
    }
}

.thumbnail-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    background-color: #000;
    aspect-ratio: 1;
}

.thumbnail-gallery-link {
    display: block;
    text-decoration: none;
    position: relative;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

.thumbnail-gallery-item:hover {
    transform: scale(1.02);
    z-index: 1;
}

.thumbnail-gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.thumbnail-gallery-item:hover img {
    transform: none;
}

/* いいねボタンの配置 */
.thumbnail-gallery-like {
    position: absolute;
    bottom: 0px;
    left: 5px;
    z-index: 2;
    padding: 0px;
}

/* WP ULikeのスタイル調整 */
.thumbnail-gallery-like .wpulike {
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.thumbnail-gallery-like .wpulike-heart .wp_ulike_general_class {
    background: none;
    border: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
}

/* 未いいねの状態（透明な白枠のハート） */
.thumbnail-gallery-like .wpulike-heart .wp_ulike_put_image:after {
    width: 16px;
    height: 16px;
    background-size: contain;
    padding: 2px;
    filter: none;
    opacity: 1;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>');
}

/* いいね済みの状態（赤いハート） */
.thumbnail-gallery-like .wpulike-heart .wp_ulike_put_image.wp_ulike_btn_is_active:after {
    filter: none;
    opacity: 1;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="%23ff4b4b"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>');
    padding: 2px;
}

/* ホバー時の効果 */
.thumbnail-gallery-like .wpulike-heart .wp_ulike_put_image:hover:after {
    opacity: 0.8;
}

.thumbnail-gallery-like .wpulike-heart .wp_ulike_put_image.wp_ulike_btn_is_active:hover:after {
    opacity: 0.8;
}

.thumbnail-gallery-like .wp_ulike_btn {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
}

.thumbnail-gallery-like .wp_ulike_btn.wp_ulike_btn_is_active {
    background: transparent;
    box-shadow: none;
}

/* カウンターのスタイル */
.thumbnail-gallery-like .count-box {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8em;
    padding: 0 0 0 5px;
    margin: 0;
}

/* いいね済みの場合のカウンター色 */
.thumbnail-gallery-like .wp_ulike_is_liked + .count-box {
    color: #ff4b4b;
}

/* カウンターの矢印を非表示 */
.thumbnail-gallery-like .count-box:before {
    display: none;
}

/* いいねボタンのホバー時の背景を透明に */
.thumbnail-gallery-like .wp_ulike_btn:hover {
    background: transparent;
}

/* ページネーションのスタイル */
.gallery-pagination {
    margin: 10px 0;
    text-align: center;
    padding: 0px;
}

.gallery-pagination .page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.gallery-pagination .page-numbers li {
    display: inline;
}

.gallery-pagination .page-numbers a,
.gallery-pagination .page-numbers span {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #f0f0f0;
    color: #f0f0f0;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 36px;
    text-align: center;
}

.gallery-pagination .page-numbers a:hover {
    background: #e0e0e0;
    color: #333;
}

.gallery-pagination .page-numbers .current {
    background: #008CBA;
    color: #fff;
    border: 1px solid #008CBA;
    font-weight: bold;
}

.gallery-pagination .page-numbers .dots {
    background: none;
    color: #666;
    cursor: default;
    padding: 8px 4px;
    min-width: auto;
    border: none;
    box-shadow: none;
}

.gallery-pagination .prev,
.gallery-pagination .next {
    padding: 8px 15px;
}

/* スマートフォン向けのページネーションスタイル */
@media (max-width: 768px) {
    .gallery-pagination .page-numbers {
        gap: 3px;
    }
    
    .gallery-pagination .page-numbers a,
    .gallery-pagination .page-numbers span {
        padding: 5px 8px;
        font-size: 18px;
        min-width: 32px;
    }
    
    .gallery-pagination .page-numbers .dots {
        padding: 6px 2px;
        font-size: 14px;
    }
    
    .gallery-pagination .prev,
    .gallery-pagination .next {
        padding: 5px 10px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .gallery-pagination .page-numbers {
        gap: 2px;
    }
    
    .gallery-pagination .page-numbers a,
    .gallery-pagination .page-numbers span {
        padding: 4px 6px;
        font-size: 14px;
        min-width: 28px;
    }
    
    .gallery-pagination .page-numbers .dots {
        padding: 5px 2px;
        font-size: 12px;
    }
    
    .gallery-pagination .prev,
    .gallery-pagination .next {
        padding: 4px 8px;
        font-size: 14px;
    }
}

/* ローディングインジケーターを削除 */
.loading-indicator,
.loading-spinner {
    display: none;
}

/* 投稿が見つからない場合のメッセージ */
.gallery-no-posts-message {
    grid-column: 1 / -1; /* グリッドの全幅を使用 */
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
    font-size: 16px;
    line-height: 1.6;
    border-radius: 8px;
    margin: 20px auto;
    min-height: 200px;
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    border: 1px solid #404040;
}

.gallery-no-posts-message p {
    margin: 0 0 16px 0;
    max-width: 500px;
}

.gallery-no-posts-message p:last-child {
    margin-bottom: 0;
}

/* フィルターコンテナのスタイル */
.gallery-filter-container {
    background: #1a1a1a;
    border: 0px;
    padding: 0px;
    text-align: center;
}

/* ソートボタンのスタイル */
.gallery-sort-buttons {
    /*margin-bottom: 24px;*/
    text-align: center;
    padding-top: 5px;
    padding-bottom: 10px
}

.sort-button {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 6px 16px;
    margin: 0 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: 600;
    color: #ccc;
    text-decoration: none;
    position: relative;
    border-bottom: 2px solid transparent;
}

.sort-button:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.sort-button.active {
    background: transparent;
    color: #fff;
    border-bottom-color: #008CBA;
}

/* ソートボタンのテキスト */
.sort-button[data-sort="date"]:after {
    content: ' New';
}

.sort-button[data-sort="popular"]:after {
    content: ' Hot';
}

.sort-button[data-sort="random"]:after {
    content: ' Shuffle';
}


/* タグフィルター */
.gallery-tag-filter {
    margin: 0px ;
    text-align: center;
    padding: 20px 0px 0px 0px;
}

.tag-filter-label {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.tag-filter-label:before {
    content: 'Tag filter';
    margin-right: 0;
}

.tag-filter-buttons {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center !important;
    gap: 12px;
    text-align: center;
}

.tag-filter-button {
    padding: 10px 18px;
    background: #1a1a1a;
    color: #ccc;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
}

.tag-filter-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tag-filter-button:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #1e40af;
    text-decoration: none;
    border-color: #008CBA;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}

.tag-filter-button:hover::before {
    opacity: 1;
}

.tag-filter-button.active {
    background: #f5f5f5;
    color: #333;
    border-color: #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tag-filter-button.active::before {
    opacity: 0;
}

/* 複数選択タグのスタイル */
.tag-filter-button.removable {
    position: relative;
    padding-right: 32px;
    background: #f5f5f5 !important;
    color: #333 !important;
    border-color: #ddd !important;
}

.tag-filter-button .tag-remove {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    width: 16px;
    height: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: bold;
    color: #666;
}

.tag-filter-button.removable:hover .tag-remove {
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-50%) scale(1.1);
    color: #333;
}

.tag-filter-button.addable {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tag-filter-button.addable:hover {
    background: #f5f5f5 !important;
    color: #333 !important;
    border-color: #ddd !important;
}

/* more...ボタンのスタイル */
.tag-more-button {
    color: #ccc !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    position: relative;
    padding: 8px 8px !important;
    border-radius: 50%;
    transition: all 0.3s ease !important;
}

.tag-more-button::after {
    content: '•••';
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
}

.tag-more-button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    transform: scale(1.05) !important;
}

/* タグオーバーレイのスタイル */
.tag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* より暗い背景 */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tag-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.tag-overlay-content {
    background: #2a2a2a; /* 暗いグレー（モノトーン） */
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #404040;
}

.tag-overlay-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    background: #3a3a3a;
}

.tag-overlay-header h3 {
    margin: 0;
    font-size: 18px;
    color: #ecf0f1; /* 明るいグレー */
    font-weight: 600;
}



.tag-overlay-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #95a5a6;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tag-overlay-close:hover {
    background: #505050;
    color: #ecf0f1;
}

.tag-overlay-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    background: #2a2a2a;
}

.tag-overlay-button {
    background: #3a3a3a;
    border: 1px solid #505050;
    color: #ecf0f1;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-overlay-button:hover {
    background: #505050;
    border-color: #606060;
}

.tag-overlay-button.active {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

/* タグ選択フォームのスタイル */
.tag-selection-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tag-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
    border: 1px solid #505050;
    border-radius: 8px;
    padding: 15px;
    background: #3a3a3a;
}

.tag-checkboxes::-webkit-scrollbar {
    width: 8px;
}

.tag-checkboxes::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.tag-checkboxes::-webkit-scrollbar-thumb {
    background: #606060;
    border-radius: 4px;
}

.tag-checkboxes::-webkit-scrollbar-thumb:hover {
    background: #707070;
}

.tag-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: transparent;
    border: 1px solid #a5d6a7;
    margin-bottom: 8px;
}

.tag-checkbox-item:hover {
    background: #e8f5e8;
    border-color: #a5d6a7;
    color: #2e7d32;
    transform: translateY(-2px);
}

.tag-checkbox-item input[type="checkbox"] {
    display: none;
}

.tag-checkbox-item input[type="checkbox"]:checked + .tag-checkbox-label {
    color: white;
    font-weight: 500;
}

.tag-checkbox-item input[type="checkbox"]:checked {
    background: #388e3c;
    border-color: #388e3c;
}

/* 選択済みの項目のスタイル */
.tag-checkbox-item:has(input[type="checkbox"]:checked) {
    background: #388e3c;
    border-color: #388e3c;
    color: white;
}

.tag-checkbox-label {
    flex: 1;
    font-size: 14px;
    color: #a5d6a7;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
}

.tag-overlay-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #404040;
    background: #2a2a2a;
}

.tag-clear-all,
.tag-apply-selection {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-clear-all {
    background: #505050;
    color: #ecf0f1;
}

.tag-clear-all:hover {
    background: #606060;
}

.tag-apply-selection {
    background: #27ae60;
    color: white;
}

.tag-apply-selection:hover {
    background: #229954;
}

.tag-apply-selection:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    cursor: not-allowed;
    transform: none;
}

/* レスポンシブデザイン */

/* 統合フィルター用のスタイル */
.gallery-unified-filter {
    margin: 10px 0;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.unified-filter-buttons {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center !important;
    text-align: center;
}

.unified-filter-button {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.unified-filter-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
}

/* すべて表示ボタン */
.unified-filter-button.all-button {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
    font-weight: 500;
}

.unified-filter-button.all-button:hover {
    background: #5a6268;
    border-color: #5a6268;
    color: white;
}

.unified-filter-button.all-button.active {
    background: #495057;
    border-color: #495057;
    color: white;
}

/* カテゴリボタン（青系） */
.unified-filter-button.category-button {
    background: transparent;
    border-color: #1976d2;
    color: #1976d2;
}

.unified-filter-button.category-button::before {
    content: "📁 ";
    margin-right: 4px;
}

.unified-filter-button.category-button:hover {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}

.unified-filter-button.category-button.active {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
    font-weight: 500;
}

.unified-filter-button.category-button.active::before {
    content: "📂 ";
}

/* タグボタン（緑系） */
.unified-filter-button.tag-button {
    background: transparent;
    border-color: #388e3c;
    color: #a5d6a7;
}

.unified-filter-button.tag-button::before {
    margin-right: 4px;
}

.unified-filter-button.tag-button:hover {
    background: #e8f5e8;
    border-color: #a5d6a7;
    color: #2e7d32;
}

.unified-filter-button.tag-button.active {
    background: #388e3c;
    color: white;
    border-color: #388e3c;
    font-weight: 500;
}

/* 削除可能なボタン */
.unified-filter-button.removable {
    padding-right: 30px;
    position: relative;
}

.unified-filter-button .filter-remove {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.unified-filter-button.removable:hover .filter-remove {
    background: rgba(255, 255, 255, 0.5);
}

/* 追加可能なタグボタン */
.unified-filter-button.tag-button.addable {
    border-style: solid;
    border-color: #a5d6a7;
}


/* レスポンシブデザイン */
@media (max-width: 768px) {
    .gallery-sort-buttons,
    .unified-filter-buttons,
    .tag-filter-buttons,
    .category-filter-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }

    .sort-button {
        padding: 4px 12px;
        font-size: 16px;
        margin: 0 4px;
    }

    .unified-filter-button,
    .tag-filter-button,
    .category-filter-button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .unified-filter-button.removable {
        padding-right: 26px;
    }

    .unified-filter-button .filter-remove {
        right: 6px;
        width: 14px;
        height: 14px;
        font-size: 10px;
    }

    /* オーバーレイ関連 */
    .tag-overlay-content,
    .category-overlay-content {
        margin: 10px;
        max-height: 90vh;
        width: 95%;
    }

    .tag-overlay-header,
    .category-overlay-header {
        padding: 15px;
    }

    .tag-overlay-body,
    .category-overlay-body {
        padding: 15px;
    }

    .tag-overlay-button,
    .category-overlay-button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .tag-checkboxes,
    .category-radios {
        max-height: 250px;
    }

    .tag-overlay-actions,
    .category-overlay-actions {
        flex-direction: column;
        gap: 10px;
        padding-top: 10px;
    }

    .tag-clear-all,
    .tag-apply-selection,
    .category-apply-selection {
        width: 100%;
        font-size: 14px;
        padding: 8px 15px;
    }
}

/* 個別投稿ページのアイキャッチ画像をセンタリング */
.single .wp-post-image,
.single .post-thumbnail img,
.single .featured-image img,
.single .entry-content .wp-post-image,
.single .attachment-large,
.single .attachment-medium,
.single .attachment-full,
.single .wp-block-post-featured-image img,
.single .wp-block-post-featured-image .wp-post-image {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

/* 個別投稿ページのアイキャッチ画像コンテナもセンタリング */
.single .post-thumbnail,
.single .featured-image,
.single .wp-block-post-featured-image {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Twenty Twenty-Five テーマ特有のクラスに対応 */
.single .wp-block-post-featured-image figure {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 記事コンテンツ内の画像も念のためセンタリング */
.single .entry-content img,
.single .wp-block-image img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 記事コンテンツ内の画像ブロック自体もセンタリング */
.single .wp-block-image {
    text-align: center !important;
}




