/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #1a1a2e;
  --navy2: #16213e;
  --navy3: #0f3460;
  --red: #ff4757;
  --red2: #c0392b;
  --green: #2ed573;
  --purple: #a29bfe;
  --orange: #ffa502;
  --text: #222;
  --text-light: #666;
  --border: #e9ecef;
  --bg: #f4f5f7;
  --white: #fff;
}
html { scroll-behavior: smooth; }
body { font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; height: 56px; }
.site-logo { font-size: 20px; font-weight: 900; color: #fff; letter-spacing: 1px; white-space: nowrap; }
.site-logo span { color: var(--red); }
.site-nav { display: flex; gap: 4px; flex: 1; }
.site-nav a { color: #ccc; padding: 6px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; transition: background 0.15s, color 0.15s; }
.site-nav a:hover, .site-nav a.active { background: rgba(255,255,255,0.1); color: #fff; }
.header-yt { background: #ff0000; color: #fff; padding: 7px 14px; border-radius: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 5px; transition: opacity 0.15s; }
.header-yt:hover { opacity: 0.85; }

/* ===== AD BARS ===== */
.ad-horizontal { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; padding: 10px; min-height: 60px; display: flex; align-items: center; justify-content: center; }
.ad-label { font-size: 10px; color: #aaa; display: block; margin-bottom: 4px; }

/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 60%, var(--navy3) 100%); padding: 40px 20px; }
.hero-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 32px; }
.hero-text { flex: 1; }
.hero-text h1 { font-size: 28px; font-weight: 900; color: #fff; line-height: 1.35; margin-bottom: 12px; }
.hero-text h1 em { color: var(--red); font-style: normal; }
.hero-text p { font-size: 13px; color: #adb5bd; margin-bottom: 20px; line-height: 1.7; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary { background: var(--red); color: #fff; padding: 10px 20px; border-radius: 6px; font-weight: 700; font-size: 13px; transition: opacity 0.15s; }
.btn-primary:hover { opacity: 0.85; }
.btn-outline { border: 2px solid rgba(255,255,255,0.5); color: #fff; padding: 10px 20px; border-radius: 6px; font-size: 13px; font-weight: 600; transition: border-color 0.15s; }
.btn-outline:hover { border-color: #fff; }
.hero-channel { background: rgba(255,255,255,0.08); border-radius: 14px; padding: 20px 22px; text-align: center; min-width: 180px; border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(4px); }
.ch-icon { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--red), #ff6b81); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.ch-name { font-size: 13px; font-weight: 900; color: #fff; margin-bottom: 4px; line-height: 1.3; }
.ch-sub-text { font-size: 11px; color: #aaa; margin-bottom: 12px; }
.ch-subscribe-btn { background: #ff0000; color: #fff; border: none; border-radius: 5px; padding: 9px 0; font-size: 12px; font-weight: 700; cursor: pointer; width: 100%; transition: opacity 0.15s; }
.ch-subscribe-btn:hover { opacity: 0.85; }

/* ===== MAIN LAYOUT ===== */
.main-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px; display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }

/* ===== CATEGORY BAR ===== */
.cat-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-pill { padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; cursor: pointer; border: 2px solid var(--border); background: var(--white); color: var(--text-light); transition: all 0.15s; }
.cat-pill:hover { border-color: var(--navy); color: var(--navy); }
.cat-pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-pill[data-cat="drama"] { border-color: var(--red); color: var(--red); }
.cat-pill[data-cat="drama"].active { background: var(--red); color: #fff; }
.cat-pill[data-cat="food"] { border-color: var(--green); color: #1e8449; }
.cat-pill[data-cat="food"].active { background: var(--green); color: #fff; }
.cat-pill[data-cat="kpop"] { border-color: var(--purple); color: #6c5ce7; }
.cat-pill[data-cat="kpop"].active { background: var(--purple); color: #fff; }
.cat-pill[data-cat="life"] { border-color: var(--orange); color: #e67e22; }
.cat-pill[data-cat="life"].active { background: var(--orange); color: #fff; }

/* ===== FEATURED POST ===== */
.featured-card { background: var(--navy); border-radius: 12px; overflow: hidden; margin-bottom: 20px; display: flex; min-height: 180px; cursor: pointer; transition: transform 0.15s; }
.featured-card:hover { transform: translateY(-2px); }
.featured-thumb { width: 260px; min-height: 180px; display: flex; align-items: center; justify-content: center; font-size: 64px; flex-shrink: 0; }
.featured-body { padding: 20px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.feat-cat-tag { display: inline-block; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 3px; margin-bottom: 10px; }
.feat-title { font-size: 18px; font-weight: 900; color: #fff; line-height: 1.4; margin-bottom: 8px; }
.feat-excerpt { font-size: 12px; color: #aaa; line-height: 1.7; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat-meta { display: flex; align-items: center; gap: 12px; font-size: 11px; color: #888; flex-wrap: wrap; }
.feat-yt-btn { background: #ff0000; color: #fff; padding: 4px 12px; border-radius: 4px; font-size: 11px; font-weight: 700; }

/* ===== IN-FEED AD ===== */
.ad-infeed { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.ad-infeed-placeholder { flex: 1; text-align: center; min-height: 80px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; }

/* ===== POST GRID ===== */
.section-title { font-size: 14px; font-weight: 900; color: var(--navy); border-left: 4px solid var(--red); padding-left: 10px; margin-bottom: 14px; }
.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.post-card { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.07); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.post-thumb { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.thumb-drama { background: linear-gradient(135deg, var(--red), var(--red2)); }
.thumb-food { background: linear-gradient(135deg, var(--green), #1e8449); }
.thumb-kpop { background: linear-gradient(135deg, var(--purple), #6c5ce7); }
.thumb-life { background: linear-gradient(135deg, var(--orange), #e67e22); }
.thumb-default { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.post-body { padding: 10px 12px 12px; }
.post-cat-tag { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 2px; display: inline-block; margin-bottom: 5px; }
.tag-drama { background: #fff0f1; color: var(--red); }
.tag-food { background: #f0fff4; color: #1e8449; }
.tag-kpop { background: #f3f0ff; color: #6c5ce7; }
.tag-life { background: #fff8f0; color: #e67e22; }
.tag-default { background: #f0f7ff; color: #0984e3; }
.post-title { font-size: 13px; font-weight: 700; line-height: 1.45; color: var(--navy); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { font-size: 10px; color: #999; display: flex; justify-content: space-between; align-items: center; }
.yt-badge { background: #ff0000; color: #fff; font-size: 9px; padding: 2px 5px; border-radius: 2px; }

/* ===== LOAD MORE ===== */
.load-more-wrap { text-align: center; margin-bottom: 20px; }
.load-more-btn { background: var(--white); border: 2px solid var(--navy); color: var(--navy); padding: 10px 28px; border-radius: 6px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.load-more-btn:hover { background: var(--navy); color: #fff; }
.load-more-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 72px; }
.sb-card { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.sb-card-header { padding: 12px 14px 0; }
.sb-title { font-size: 13px; font-weight: 900; color: var(--navy); border-left: 3px solid var(--red); padding-left: 8px; margin-bottom: 10px; }

/* YT Widget */
.yt-widget { background: linear-gradient(135deg, var(--navy), var(--navy3)); border-radius: 10px; padding: 18px; text-align: center; }
.yt-widget-icon { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--red), #ff6b81); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.yt-widget-name { font-size: 13px; font-weight: 900; color: #fff; margin-bottom: 4px; }
.yt-widget-desc { font-size: 11px; color: #aaa; margin-bottom: 14px; line-height: 1.5; }
.yt-widget-btn { background: #ff0000; color: #fff; border: none; border-radius: 5px; padding: 9px 0; font-size: 12px; font-weight: 700; cursor: pointer; width: 100%; transition: opacity 0.15s; }
.yt-widget-btn:hover { opacity: 0.85; }

/* Sidebar AD */
.ad-sidebar { background: var(--white); border-radius: 10px; padding: 10px; text-align: center; border: 1px dashed #ddd; min-height: 260px; display: flex; align-items: center; justify-content: center; flex-direction: column; }

/* Popular posts */
.popular-list { padding: 0 14px 14px; }
.pop-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: opacity 0.15s; }
.pop-item:last-child { border-bottom: none; }
.pop-item:hover { opacity: 0.7; }
.pop-num { font-size: 20px; font-weight: 900; color: #e9ecef; min-width: 24px; line-height: 1; }
.pop-num.rank-1 { color: var(--red); }
.pop-num.rank-2 { color: #ff9f43; }
.pop-num.rank-3 { color: #ffd32a; }
.pop-text { font-size: 12px; font-weight: 700; color: var(--navy); line-height: 1.45; }

/* ===== SINGLE POST ===== */
.post-page { max-width: 1100px; margin: 0 auto; padding: 24px 20px; display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
.post-article { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.post-article-hero { min-height: 200px; display: flex; align-items: center; justify-content: center; font-size: 80px; }
.post-article-body { padding: 28px 32px; }
.post-article-cat { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 3px; margin-bottom: 12px; }
.post-article-title { font-size: 26px; font-weight: 900; line-height: 1.4; color: var(--navy); margin-bottom: 12px; }
.post-article-meta { display: flex; gap: 14px; font-size: 12px; color: #999; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--border); align-items: center; flex-wrap: wrap; }
.post-article-yt { background: #ff0000; color: #fff; padding: 5px 14px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.ad-post-top { background: #f8f9fa; border-radius: 8px; padding: 12px; text-align: center; margin-bottom: 20px; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.post-content { line-height: 1.85; }
.post-content h2 { font-size: 20px; font-weight: 900; color: var(--navy); margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.post-content h3 { font-size: 16px; font-weight: 900; color: var(--navy); margin: 20px 0 10px; padding-left: 10px; border-left: 4px solid var(--red); }
.post-content p { margin-bottom: 14px; }
.post-content ul, .post-content ol { padding-left: 20px; margin-bottom: 14px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote { background: #f8f9fa; border-left: 4px solid var(--red); padding: 12px 16px; margin: 16px 0; border-radius: 0 6px 6px 0; color: #555; }
.post-content strong { color: var(--navy); }
.post-content a { color: var(--red); text-decoration: underline; }
.ad-post-mid { background: #f8f9fa; border-radius: 8px; padding: 12px; text-align: center; margin: 24px 0; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.post-yt-cta { background: linear-gradient(135deg, var(--navy), var(--navy3)); border-radius: 10px; padding: 20px; text-align: center; margin: 24px 0; }
.post-yt-cta p { color: #aaa; font-size: 12px; margin-bottom: 10px; }
.post-yt-cta-title { font-size: 16px; font-weight: 900; color: #fff; margin-bottom: 6px; }
.post-yt-cta-btn { background: #ff0000; color: #fff; border: none; border-radius: 5px; padding: 10px 20px; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.15s; }
.post-yt-cta-btn:hover { opacity: 0.85; }
.ad-post-bottom { background: #f8f9fa; border-radius: 8px; padding: 12px; text-align: center; margin-top: 24px; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-light); font-size: 13px; margin-top: 16px; padding: 0 32px 20px; }
.back-link:hover { color: var(--navy); }

/* ===== FOOTER ===== */
.site-footer { background: var(--navy); color: #aaa; margin-top: 40px; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 28px 20px; text-align: center; }
.footer-social { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; }
.social-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; transition: transform 0.15s; }
.social-btn:hover { transform: scale(1.1); }
.s-yt { background: #ff0000; }
.s-ig { background: linear-gradient(135deg, #e1306c, #fd1d1d, #fcb045); }
.s-tt { background: #010101; border: 1px solid #333; }
.s-x { background: #000; border: 1px solid #333; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 12px; font-size: 12px; flex-wrap: wrap; }
.footer-links a { color: #888; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 11px; color: #555; }

/* ===== EMPTY / LOADING ===== */
.loading-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.skeleton { background: #e9ecef; border-radius: 10px; animation: pulse 1.5s infinite; }
.skeleton-thumb { height: 110px; border-radius: 10px 10px 0 0; }
.skeleton-body { padding: 10px 12px 12px; }
.skeleton-line { height: 12px; background: #dee2e6; border-radius: 4px; margin-bottom: 6px; }
.skeleton-line.short { width: 60%; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.no-posts { text-align: center; padding: 40px 20px; color: var(--text-light); grid-column: 1/-1; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-wrap, .post-page { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero-inner { flex-direction: column; }
  .hero-channel { width: 100%; }
  .featured-card { flex-direction: column; }
  .featured-thumb { width: 100%; height: 140px; }
  .post-grid { grid-template-columns: 1fr; }
  .post-article-body { padding: 20px; }
  .post-article-title { font-size: 20px; }
  .site-nav { display: none; }
}

/* ===== PAGINATION ===== */
.pagination-wrap { display:flex; justify-content:center; gap:6px; margin:20px 0; flex-wrap:wrap; }
.page-btn { padding:6px 13px; border:1px solid #e9ecef; border-radius:5px; background:#fff; font-size:13px; text-decoration:none; color:#333; transition:all .15s; }
.page-btn:hover { background:#1a1a2e; color:#fff; border-color:#1a1a2e; }
.page-btn.active { background:#1a1a2e; color:#fff; border-color:#1a1a2e; }

/* PHP版: aタグをブロック要素に */
a.cat-pill { text-decoration:none; display:inline-block; }
a.post-card { text-decoration:none; display:block; color:inherit; }
a.featured-card { text-decoration:none; display:flex; min-height:180px; }
a.pop-item { text-decoration:none; }

/* INFORMATION / KOREAN カテゴリ */
.thumb-info   { background: linear-gradient(135deg,#74b9ff,#0984e3); }
.thumb-korean { background: linear-gradient(135deg,#fd79a8,#e84393); }
.tag-info   { background:#f0f7ff; color:#0984e3; }
.tag-korean { background:#fff0f7; color:#e84393; }
