/*
Theme Name: Happening Archive
Theme URI:
Author:
Description: ハプニングアーカイブ カスタムテーマ
Version: 1.0.0
License: private
Text Domain: happening-archive
*/

/* =====================
   リセット & ベース
   ===================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    background: #0d0d0d;
    color: #e8e8e8;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

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

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

ul, ol {
    list-style: none;
}

/* =====================
   レイアウト
   ===================== */
.site-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
}

/* =====================
   ヘッダー
   ===================== */
.site-header {
    background: #111;
    border-bottom: 0.5px solid #2a2a2a;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e1e1e;
    border: 0.5px solid #333;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    min-width: 220px;
}

.header-search span {
    font-size: 13px;
    color: #555;
}

/* =====================
   フィルターバー
   ===================== */
.filter-bar {
    background: #111;
    border-bottom: 0.5px solid #1e1e1e;
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.filter-bar-inner {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 10px 32px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-label {
    font-size: 12px;
    color: #555;
    margin-right: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    border: 0.5px solid #2a2a2a;
    background: transparent;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #555;
    color: #ccc;
}

.filter-btn.is-active {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* =====================
   メインコンテンツ
   ===================== */
.site-main {
    padding: 20px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

/* =====================
   ソートバー
   ===================== */
.sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sort-bar .count {
    font-size: 12px;
    color: #555;
}

.sort-bar select {
    font-size: 12px;
    background: #1e1e1e;
    border: 0.5px solid #2a2a2a;
    color: #888;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}

/* =====================
   カードグリッド
   ===================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

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

@media (max-width: 540px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================
   カード
   ===================== */
.post-card {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    border: 0.5px solid #222;
    text-decoration: none;
    display: block;
    transition: border-color 0.2s;
}

.post-card:hover {
    border-color: #444;
}

.card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    background: #222;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #222;
}

.cat-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    z-index: 1;
}

/* カテゴリ別バッジカラー */
.cat-dance  { background: #c0392b; color: #fff; }
.cat-vlog   { background: #2980b9; color: #fff; }
.cat-event  { background: #8e44ad; color: #fff; }
.cat-attraction     { background: #FFCC36; color: #fff; }
.cat-other  { background: #050304; color: #fff; }
.cat-live  { background: #8437FF; color: #fff; }
.cat-massage  { background: #27ae60; color: #fff; }

.card-body {
    padding: 10px 12px 12px;
}

.card-title {
    font-size: 12px;
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-views {
    font-size: 11px;
    color: #555;
}

.card-country {
    font-size: 13px;
}

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

.page-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 0.5px solid #2a2a2a;
    background: transparent;
    color: #888;
    text-decoration: none;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #555;
    color: #ccc;
}

.page-btn.is-current {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* =====================
   検索モーダル
   ===================== */
.search-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 72px;
}

.search-modal.is-open {
    display: flex;
}

.search-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.search-modal-panel {
    position: relative;
    background: #161616;
    border: 0.5px solid #2a2a2a;
    border-radius: 10px;
    width: 520px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}

.search-modal-panel::-webkit-scrollbar {
    width: 4px;
}
.search-modal-panel::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 2px;
}

/* フリーワード行 */
.search-modal-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-keyword {
    flex: 1;
    background: #1e1e1e;
    border: 0.5px solid #333;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e8e8e8;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.search-keyword::placeholder {
    color: #555;
}

.search-keyword:focus {
    border-color: #555;
}

.search-submit-btn {
    background: #c0392b;
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.2s;
}

.search-submit-btn:hover {
    background: #a93226;
}

/* セクションラベル */
.search-section-label {
    font-size: 11px;
    color: #555;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid #222;
}

/* カテゴリチェックボックス */
.search-check-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.search-check-item {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.search-check-input {
    display: none;
}

.search-check-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 0.5px solid #444;
    background: #222;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.search-check-input:checked + .search-check-box {
    background: #c0392b;
    border-color: #c0392b;
}

.search-check-input:checked + .search-check-box::after {
    content: '';
    display: block;
    width: 4px;
    height: 7px;
    border-right: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px);
}

.search-check-label {
    font-size: 12px;
    color: #aaa;
}

/* タグボタン */
.search-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.search-tag-btn {
    font-size: 11px;
    padding: 4px 11px;
    border-radius: 12px;
    border: 0.5px solid #2a2a2a;
    background: transparent;
    color: #777;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.search-tag-btn:hover {
    border-color: #555;
    color: #ccc;
}

.search-tag-btn.is-active {
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.15);
    color: #e8a090;
}

/* フッターボタン */
.search-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

.search-clear-btn {
    font-size: 12px;
    color: #666;
    background: transparent;
    border: 0.5px solid #333;
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.search-clear-btn:hover {
    color: #aaa;
    border-color: #555;
}

/* =====================
   固定ページ
   ===================== */
.page-content {
    font-size: 14px;
    line-height: 1.8;
    color: #ccc;
}

.page-content p {
    margin-bottom: 1.2em;
}

.page-content h2 {
    font-size: 15px;
    font-weight: 500;
    color: #e8e8e8;
    margin: 1.8em 0 0.8em;
    padding-bottom: 8px;
    border-bottom: 0.5px solid #1e1e1e;
}

.page-content h3 {
    font-size: 13px;
    font-weight: 500;
    color: #ccc;
    margin: 1.4em 0 0.6em;
}

.page-content a {
    color: #c0392b;
    text-decoration: underline;
}

.page-content ul,
.page-content ol {
    padding-left: 1.4em;
    margin-bottom: 1.2em;
}

.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }

.page-content li {
    margin-bottom: 0.4em;
}

/* =====================
   フッター
   ===================== */
.site-footer {
    border-top: 0.5px solid #1e1e1e;
    padding: 20px 24px;
    text-align: center;
    font-size: 12px;
    color: #444;
    margin-top: 20px;
}

.footer-nav {
    margin-bottom: 10px;
}

.footer-nav-list {
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-list a {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav-list a:hover {
    color: #aaa;
}
