/*
Theme Name: Caramel Kissa
Theme URI: https://caramel-sp.com
Author: Caramel
Description: キャラメル喫茶 - 女性向けエロ漫画サイト用WordPressテーマ。TL/BL漫画の紹介に最適化。
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: caramel-kissa
*/

/* === VARIABLES === */
:root {
  --bg: #ffffff;
  --bg2: #dbb896;
  --bg3: #f5f0eb;
  --card: #ffffff;
  --card-h: #faf7f4;
  --pk: #dbb896;
  --pk-g: rgba(219,184,150,0.15);
  --bl: #8eb4d4;
  --bl-g: rgba(142,180,212,0.15);
  --gd: #f5c842;
  --w: #333333;
  --g1: rgba(0,0,0,0.85);
  --g2: rgba(0,0,0,0.6);
  --g3: rgba(0,0,0,0.4);
  --g4: rgba(0,0,0,0.2);
  --g5: rgba(0,0,0,0.06);
  --f: 'Zen Maru Gothic', sans-serif;
  --r: 14px;
  --r-sm: 8px;
  --mx: 1100px;
}

/* === RESET === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--g1);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* === HEADER === */
.site-header {
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  max-width: var(--mx);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-logo img {
  height: 36px;
  width: auto;
}
.site-logo-text {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  color: rgba(255,255,255,0.8);
  transition: all 0.2s;
}
.main-nav a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.nav-tl {
  border: 1px solid #fff !important;
  color: #fff !important;
}
.nav-tl:hover {
  background: #fff !important;
  color: var(--bg2) !important;
}
.nav-bl {
  border: 1px solid rgba(255,255,255,0.6) !important;
  color: rgba(255,255,255,0.8) !important;
}
.nav-bl:hover {
  background: #fff !important;
  color: var(--bg2) !important;
}
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* Sub nav */
.sub-nav {
  background: var(--bg2);
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 6px 0;
}
.sub-nav-inner {
  max-width: var(--mx);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 20px;
  align-items: center;
}
.sub-nav a {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  transition: color 0.15s;
}
.sub-nav a:hover { color: #fff; }
.header-search {
  margin-left: auto;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.3);
}
.header-search input {
  background: rgba(255,255,255,0.1);
  border: none;
  padding: 5px 10px;
  color: #fff;
  font-size: 11px;
  font-family: var(--f);
  width: 140px;
  outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,0.5); }
.header-search button {
  background: #c9a47a;
  border: none;
  color: #fff;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  font-family: var(--f);
}

/* === HERO === */
.hero {
  max-width: var(--mx);
  margin: 20px auto;
  padding: 0 20px;
}
.hero-box {
  background: var(--bg2);
  border-radius: var(--r);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}
.hero-box::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  line-height: 1.9;
  position: relative;
  z-index: 1;
  max-width: 700px;
}

/* === WHAT IS (SEO text) === */
.what-is {
  background: var(--bg3);
  border-radius: var(--r);
  padding: 16px;
  font-size: 12px;
  color: var(--g2);
  line-height: 2;
  margin-bottom: 20px;
}

/* === SECTION HEADERS === */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 14px;
}
.section-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 4px;
  color: #fff;
}
.badge-pk { background: var(--pk); }
.badge-bl { background: var(--bl); }
.badge-gd { background: var(--gd); color: #1a1a2e; }
.section-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--w);
}

/* === CATEGORY TABS === */
.cat-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--g5);
  color: var(--g3);
  background: none;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat-tab:hover { border-color: var(--pk); color: var(--pk); }
.cat-tab.active {
  background: var(--pk);
  border-color: var(--pk);
  color: #fff;
}

/* === POST GRID === */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* === POST CARD === */
.post-card {
  background: var(--card);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid #e8e0d8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  background: var(--card-h);
}
.post-card-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
  background: var(--bg3);
}
.post-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-cat {
  position: absolute;
  top: 6px; left: 6px;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 100px;
  color: #fff;
  z-index: 2;
}
.post-card-cat.tl { background: var(--pk); }
.post-card-cat.bl { background: var(--bl); }
.post-card-body { padding: 10px 12px 12px; }
.post-card-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--w);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-circle {
  font-size: 10px;
  color: var(--g3);
  margin-bottom: 6px;
}
.post-card-date {
  font-size: 9px;
  color: var(--g4);
  margin-top: 6px;
}
.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.post-card-tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--g5);
  color: var(--g3);
  transition: all 0.15s;
}
.post-card-tag:hover {
  background: var(--pk);
  color: #fff;
}

/* === SINGLE POST === */
.single-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px;
}
.breadcrumb {
  font-size: 11px;
  color: var(--g3);
  margin-bottom: 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--g3); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--pk); }
.single-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--w);
  line-height: 1.4;
  margin-bottom: 4px;
}
.single-subtitle {
  font-size: 13px;
  color: var(--g3);
  margin-bottom: 12px;
}
.single-description {
  font-size: 13px;
  color: var(--g1);
  line-height: 1.9;
  padding: 16px;
  background: var(--bg3);
  border-radius: var(--r);
  border-left: 3px solid var(--pk);
  margin-bottom: 16px;
}
.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--g3);
  margin-bottom: 14px;
}
.single-meta a { color: var(--pk); }
.single-meta a:hover { text-decoration: underline; }
.single-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 18px;
}
.single-tag {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--g5);
  color: var(--g3);
  transition: all 0.15s;
}
.single-tag:hover { background: var(--pk); color: #fff; }

/* Like button */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--pk);
  color: var(--pk);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: none;
  margin-bottom: 18px;
  transition: all 0.2s;
}
.like-btn:hover { background: var(--pk); color: #fff; }

/* Manga viewer */
.manga-viewer img {
  width: 100%;
  border-radius: var(--r-sm);
  margin-bottom: 4px;
}

/* CTA */
.single-cta {
  background: var(--bg3);
  border: 1px solid var(--pk);
  border-radius: var(--r);
  padding: 20px;
  text-align: center;
  margin: 24px 0;
}
.single-cta-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--w);
  margin-bottom: 10px;
}
.single-cta-btn {
  display: inline-block;
  background: var(--pk);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  padding: 11px 28px;
  border-radius: 100px;
  transition: all 0.2s;
}
.single-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(219,184,150,0.4);
}

/* === RANKING === */
.rank-card {
  display: flex;
  gap: 14px;
  background: #fff;
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 10px;
  align-items: center;
  transition: background 0.2s;
  border: 1px solid #e8e0d8;
}
.rank-card:hover { background: var(--bg3); }
.rank-num {
  font-size: 20px;
  font-weight: 900;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.rank-1 { color: var(--gd); }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }
.rank-img {
  width: 70px;
  height: 93px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg3);
}
.rank-img img { width: 100%; height: 100%; object-fit: cover; }
.rank-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--w);
  margin-bottom: 4px;
}
.rank-circle {
  font-size: 10px;
  color: var(--g3);
}

/* === TAG CLOUD === */
.tag-group { margin-bottom: 24px; }
.tag-group-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--w);
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid var(--pk);
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  background: #fff;
  color: var(--g1);
  border: 1px solid #e8e0d8;
  transition: all 0.2s;
}
.tag-pill:hover {
  border-color: var(--pk);
  background: var(--pk-g);
}
.tag-pill .count {
  font-size: 9px;
  color: var(--g4);
  margin-left: 3px;
}

/* === AUTHOR === */
.author-card {
  background: #fff;
  border-radius: var(--r);
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  border: 1px solid #e8e0d8;
}
.author-card:hover {
  background: var(--bg3);
  transform: translateY(-2px);
}
.author-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--bg3);
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.author-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--w);
  margin-bottom: 4px;
}
.author-count {
  font-size: 10px;
  color: var(--g3);
}

/* === PAGINATION === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 28px 0;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s;
}
.pagination a {
  background: #fff;
  color: var(--g2);
  border: 1px solid #e8e0d8;
}
.pagination a:hover { background: var(--pk); color: #fff; border-color: var(--pk); }
.pagination .current {
  background: var(--pk);
  color: #fff;
}

/* === FOOTER === */
.site-footer {
  background: var(--bg2);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--mx);
  margin: 0 auto;
  padding: 28px 20px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.footer-brand { max-width: 300px; }
.footer-brand p {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 8px;
  line-height: 1.8;
}
.footer-cols {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-col h4 {
  font-size: 10px;
  font-weight: 900;
  color: rgba(255,255,255,0.9);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.footer-col ul li { padding: 3px 0; }
.footer-col a {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 14px;
  text-align: center;
}
.footer-copy {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
}

/* === CONTENT AREA === */
.content-wrap {
  max-width: var(--mx);
  margin: 0 auto;
  padding: 0 20px;
  overflow: hidden;
}

/* === SCROLL TOP === */
.scroll-top {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 42px; height: 42px;
  background: var(--pk);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(219,184,150,0.3);
}
.scroll-top.show { display: flex; }
.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(219,184,150,0.4);
}

/* === RESPONSIVE === */

/* タブレット */
@media (max-width: 768px) {
  /* ヘッダー */
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--bg2);
    padding: 16px;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }
  .main-nav.open a {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 8px;
  }
  .mobile-toggle { display: block; }
  .sub-nav { display: none; }

  /* ヒーロー */
  .hero { margin: 12px auto; }
  .hero-box { padding: 20px; border-radius: 10px; }
  .hero h1 { font-size: 18px; }
  .hero-desc { font-size: 12px; }

  /* SEOテキスト */
  .what-is { padding: 12px; font-size: 11px; }
  .what-is h2 { font-size: 13px !important; }

  /* カテゴリタブ */
  .cat-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .cat-tab { white-space: nowrap; flex-shrink: 0; }

  /* セクション */
  .section-header { margin: 16px 0 10px; }
  .section-title { font-size: 15px; }

  /* カードグリッド */
  .post-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .post-card { border-radius: 10px; }
  .post-card-body { padding: 8px 10px 10px; }
  .post-card-title { font-size: 11px; }
  .post-card-circle { font-size: 9px; }
  .post-card-tags { display: none; }
  .post-card-date { font-size: 8px; }

  /* 記事ページ */
  .single-wrap { padding: 14px; }
  .single-title { font-size: 17px; }
  .single-description { padding: 12px; font-size: 12px; }
  .single-meta { font-size: 10px; gap: 8px; }
  .single-tags { gap: 4px; }
  .single-tag { font-size: 9px; padding: 3px 8px; }
  .single-cta { padding: 16px; }
  .single-cta-title { font-size: 14px; }
  .single-cta-btn { font-size: 13px; padding: 10px 24px; width: 100%; text-align: center; }

  /* ランキング */
  .rank-card { padding: 10px; gap: 10px; }
  .rank-num { font-size: 16px; width: 28px; }
  .rank-img { width: 55px; height: 73px; }
  .rank-title { font-size: 12px; }

  /* パンくず */
  .breadcrumb { font-size: 10px; }

  /* タグクラウド */
  .tag-pill { font-size: 10px; padding: 4px 10px; }

  /* 作家カード */
  .author-icon { width: 48px; height: 48px; font-size: 16px; }
  .author-name { font-size: 11px; }

  /* ページネーション */
  .pagination a,
  .pagination span { width: 30px; height: 30px; font-size: 11px; }

  /* フッター */
  .footer-top { flex-direction: column; }
  .footer-inner { padding: 20px 16px; }
  .footer-cols { gap: 16px; }

  /* コンテンツ */
  .content-wrap { padding: 0 14px; }
}

/* スマホ */
@media (max-width: 480px) {
  /* ヘッダー */
  .header-inner { height: 48px; padding: 0 14px; }
  .site-logo img { height: 28px; }
  .site-logo-text { font-size: 15px; }

  /* ヒーロー */
  .hero { padding: 0 14px; margin: 10px auto; }
  .hero-box { padding: 16px; }
  .hero h1 { font-size: 16px; }
  .hero-desc { font-size: 11px; line-height: 1.7; }

  /* カードグリッド：2列固定 */
  .post-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .post-card { border-radius: 8px; }
  .post-card-img { aspect-ratio: 3/4; }
  .post-card-body { padding: 6px 8px 8px; }
  .post-card-title { font-size: 10px; -webkit-line-clamp: 2; }
  .post-card-circle { font-size: 8px; margin-bottom: 2px; }
  .post-card-cat { font-size: 8px; padding: 1px 6px; top: 4px; left: 4px; }
  .post-card-date { font-size: 8px; margin-top: 4px; }

  /* 記事ページ */
  .single-wrap { padding: 10px; }
  .single-title { font-size: 15px; line-height: 1.45; }
  .single-title small { font-size: 11px !important; }
  .single-description { padding: 10px; font-size: 11px; line-height: 1.8; border-left-width: 2px; }
  .single-meta { flex-direction: column; gap: 4px; font-size: 10px; }
  .single-tags { gap: 3px; }
  .single-tag { font-size: 9px; padding: 2px 7px; }
  .like-btn { font-size: 12px; padding: 5px 14px; }

  /* CTA：全幅ボタン */
  .single-cta { padding: 14px; margin: 16px 0; border-radius: 10px; }
  .single-cta-title { font-size: 13px; }
  .single-cta-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border-radius: 10px;
  }

  /* ランキング */
  .rank-card { padding: 8px; gap: 8px; border-radius: 10px; }
  .rank-num { font-size: 14px; width: 24px; }
  .rank-img { width: 48px; height: 64px; }
  .rank-title { font-size: 11px; }
  .rank-circle { font-size: 9px; }

  /* タグ */
  .tag-group-title { font-size: 13px; }
  .tag-pill { font-size: 10px; padding: 4px 10px; }

  /* 作家一覧 */
  .content-wrap .post-grid[style] { grid-template-columns: repeat(3, 1fr) !important; }
  .author-card { padding: 12px 8px; }
  .author-icon { width: 40px; height: 40px; font-size: 14px; }
  .author-name { font-size: 10px; }
  .author-count { font-size: 9px; }

  /* パンくず */
  .breadcrumb { font-size: 9px; gap: 4px; }

  /* ページネーション */
  .pagination { gap: 4px; }
  .pagination a,
  .pagination span { width: 28px; height: 28px; font-size: 10px; }

  /* フッター */
  .footer-inner { padding: 16px 14px; }
  .footer-brand p { font-size: 10px; }
  .footer-col h4 { font-size: 9px; }
  .footer-col a { font-size: 10px; }
  .footer-copy { font-size: 9px; }

  /* スクロールトップ */
  .scroll-top { width: 36px; height: 36px; font-size: 14px; bottom: 14px; right: 14px; }

  /* セクション */
  .section-header { margin: 12px 0 8px; gap: 6px; }
  .section-badge { font-size: 9px; padding: 2px 8px; }
  .section-title { font-size: 14px; }

  /* カテゴリタブ */
  .cat-tabs { gap: 5px; margin-bottom: 12px; }
  .cat-tab { font-size: 11px; padding: 5px 12px; }
}
