/*
Theme Name: MangaFree
Theme URI: https://manga.himablo.xyz
Description: FANZA エロ漫画レビューサイト専用テーマ。ダーク背景+ピンクアクセントで男性向けに最適化。
Version: 1.0
Author: MangaFree
Text Domain: mangafree
*/

/* ========== Variables ========== */
:root {
  --bg: #0d0d0d;
  --bg2: #1a1a1a;
  --bg3: #242424;
  --card: #1f1f1f;
  --card-hover: #2a2a2a;
  --pink: #ff3366;
  --pink-soft: #ff6b9d;
  --pink-dim: rgba(255, 51, 102, 0.15);
  --yellow: #ffeb3b;
  --text: #f0f0f0;
  --text2: #b0b0b0;
  --text3: #777;
  --border: #333;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pink); text-decoration: none; transition: color .15s; }
a:hover { color: var(--pink-soft); text-decoration: underline; }

/* ========== Layout ========== */
.inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.site-content { padding: 24px 0 60px; }
.layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}
.main-content { min-width: 0; }
.sidebar { min-width: 0; }
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 99; }
}

/* ========== Header ========== */
.site-header {
  background: linear-gradient(135deg, #1a0a14 0%, #0d0d0d 100%);
  border-bottom: 2px solid var(--pink);
  padding: 18px 0;
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
}
.site-title {
  font-size: 22px; font-weight: bold; line-height: 1.2;
}
.site-title a { color: var(--text); text-decoration: none; }
.site-title a:hover { color: var(--pink); }
.site-title .accent { color: var(--pink); }
.site-desc {
  font-size: 12px; color: var(--text2); margin-top: 4px;
}

/* ========== Navigation ========== */
.site-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.site-nav .inner {
  display: flex; gap: 0; padding: 0;
}
.site-nav a {
  color: var(--text2); padding: 14px 18px; font-size: 13px; font-weight: 500;
  display: inline-block; text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}
.site-nav a:hover {
  color: var(--pink);
  background: var(--bg3);
  border-bottom-color: var(--pink);
}

/* ========== Hero (front-page) ========== */
.hero {
  background: linear-gradient(135deg, #ff3366 0%, #c2185b 100%);
  color: #fff;
  padding: 50px 16px;
  text-align: center;
  margin-bottom: 32px;
  border-radius: 0 0 16px 16px;
}
.hero h1 {
  font-size: 28px; margin: 0 0 12px; font-weight: bold;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero .lead {
  font-size: 15px; margin: 0 0 8px; opacity: 0.95;
}
.hero .badge {
  display: inline-block;
  background: var(--yellow);
  color: #c2185b;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 13px;
  margin-top: 12px;
}

/* ========== Section Heading ========== */
.section-title {
  font-size: 22px;
  margin: 0 0 18px;
  padding-left: 14px;
  border-left: 5px solid var(--pink);
  color: var(--text);
  font-weight: bold;
}
.section-title .count {
  font-size: 13px; color: var(--text2); font-weight: normal; margin-left: 8px;
}

/* ========== Card Grid ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin: 0 0 32px;
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
.card {
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  transition: transform .15s, background .15s;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  border-color: var(--pink);
}
.card-img {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg2);
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.card:hover .card-img img { transform: scale(1.04); }
.card-img .free-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--yellow); color: var(--pink);
  padding: 4px 10px; border-radius: 12px;
  font-size: 11px; font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.card-title {
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card a { color: inherit; text-decoration: none; display: block; }
.card a:hover .card-title { color: var(--pink); }
.card-meta {
  font-size: 11px; color: var(--text3); margin-top: auto;
  display: flex; justify-content: space-between; align-items: center;
}
.card-tag {
  display: inline-block;
  background: var(--pink-dim);
  color: var(--pink);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  margin-right: 4px;
}

/* ========== Breadcrumbs ========== */
.breadcrumb {
  font-size: 12px; color: var(--text2); margin: 0 0 16px;
  padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px;
}
.breadcrumb a { color: var(--text2); }
.breadcrumb a:hover { color: var(--pink); }
.breadcrumb li::after { content: " ›"; margin-left: 6px; color: var(--text3); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb li:last-child { color: var(--text); }

/* ========== Single Post ========== */
.post {
  background: var(--bg2);
  border-radius: 12px;
  padding: 28px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
@media (max-width: 600px) { .post { padding: 18px; border-radius: 0; } }

.post-title {
  font-size: 24px;
  line-height: 1.4;
  margin: 0 0 16px;
  padding-left: 14px;
  border-left: 5px solid var(--pink);
  color: var(--text);
  font-weight: bold;
}
.post-meta {
  color: var(--text3); font-size: 12px; margin-bottom: 16px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.post-meta .cat {
  background: var(--pink-dim); color: var(--pink);
  padding: 3px 10px; border-radius: 10px; font-size: 11px;
}
.post-content { color: var(--text); }
.post-content h2 {
  font-size: 19px;
  margin: 32px 0 14px;
  padding: 8px 0 8px 14px;
  border-left: 4px solid var(--pink);
  background: linear-gradient(90deg, var(--pink-dim), transparent);
  color: var(--text);
  font-weight: bold;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.post-content h3 {
  font-size: 16px; margin: 24px 0 12px; color: var(--pink-soft);
}
.post-content p { margin: 0 0 14px; }
.post-content a { color: var(--pink); }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 14px; }
.post-content img { border-radius: 4px; }

/* CTAボタン補強 */
.post-content a[style*="background"] {
  text-decoration: none !important;
}

/* ========== Share Buttons ========== */
.share-buttons {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 24px 0;
}
.share-btn {
  flex: 1; min-width: 100px;
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: #fff !important;
  font-weight: 500; font-size: 13px;
  transition: opacity .15s;
}
.share-btn:hover { opacity: 0.85; }
.share-x { background: #000; }
.share-line { background: #06c755; }
.share-fb { background: #1877f2; }
.share-copy { background: #555; cursor: pointer; }

/* ========== Related Posts ========== */
.related-posts {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.related-posts h2 {
  font-size: 18px; margin: 0 0 16px;
  padding-left: 12px; border-left: 4px solid var(--pink);
}

/* ========== Sidebar ========== */
.widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}
.widget h3 {
  font-size: 14px; margin: 0 0 12px; color: var(--pink);
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.widget li:last-child { border-bottom: none; }
.widget li a { color: var(--text2); }
.widget li a:hover { color: var(--pink); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a {
  background: var(--bg3); color: var(--text2);
  padding: 4px 10px; border-radius: 10px;
  font-size: 11px; text-decoration: none;
  transition: all .15s;
}
.tag-cloud a:hover { background: var(--pink); color: #fff; }
.popular-card {
  display: flex; gap: 10px; align-items: start; padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.popular-card:last-child { border-bottom: none; }
.popular-card img { width: 60px; height: 80px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.popular-card .info { flex: 1; min-width: 0; }
.popular-card .ttl {
  font-size: 12px; color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.popular-card a { text-decoration: none; }
.popular-card a:hover .ttl { color: var(--pink); }

/* ========== Pagination ========== */
.pagination {
  display: flex; justify-content: center; gap: 6px; margin: 32px 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  background: var(--bg2); color: var(--text2);
  border-radius: 6px; text-decoration: none;
  border: 1px solid var(--border);
  font-size: 13px;
}
.pagination a:hover { background: var(--pink); color: #fff; border-color: var(--pink); }
.pagination .current {
  background: var(--pink); color: #fff; border-color: var(--pink); font-weight: bold;
}

/* ========== Footer ========== */
.site-footer {
  background: #050505;
  border-top: 1px solid var(--border);
  padding: 32px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text3);
}
.site-footer a { color: var(--text2); margin: 0 10px; }
.site-footer .copyright { margin-top: 12px; font-size: 11px; }

/* ========== Genre Tabs (front-page) ========== */
.genre-pills {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0 0 24px;
}
.genre-pills a {
  background: var(--bg2);
  color: var(--text2);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all .15s;
}
.genre-pills a:hover {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}

/* ========== R18 警告 ========== */
.age-gate {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.age-gate-box {
  background: var(--bg2); padding: 32px;
  border-radius: 12px; max-width: 420px; width: 100%;
  border: 2px solid var(--pink); text-align: center;
}
.age-gate-box h2 { color: var(--pink); margin-top: 0; }
.age-gate-box p { color: var(--text2); font-size: 14px; }
.age-gate .btn {
  display: inline-block; margin: 8px 6px; padding: 12px 24px;
  border-radius: 6px; text-decoration: none; font-weight: bold;
}
.age-gate .btn-yes { background: var(--pink); color: #fff; }
.age-gate .btn-no { background: var(--bg3); color: var(--text2); }
