/*
Theme Name: ゲイ速報ちゃんねる
Version: 1.0
*/

/* =============================================
   Variables
   ============================================= */
:root {
  --bg:           #191917;
  --surface:      #222220;
  --surface-alt:  #2a2a28;
  --surface-hover:#323230;
  --accent:       #E8415A;
  --accent-dim:   #b83048;
  --text:         #E4E0DA;
  --text-dim:     #A8A49F;
  --text-muted:   #68645F;
  --border:       #333330;
  --radius:       8px;
  --shadow:       0 1px 4px rgba(0,0,0,.45);
  --header-h:     56px;
  --catnav-h:     44px;

  /* font stacks */
  --font-sans:  'Hiragino Sans', 'ヒラギノ角ゴシック', 'Yu Gothic UI', 'Noto Sans JP', system-ui, sans-serif;
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* =============================================
   Header
   ============================================= */
.site-header {
  background: #111110;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.site-title-link { display: flex; align-items: center; gap: 10px; }
.site-logo { flex-shrink: 0; border-radius: 6px; }
.site-title-text { display: flex; flex-direction: column; gap: 1px; }
.site-name {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  letter-spacing: .03em;
}
.site-tagline { font-size: 11px; color: var(--text-muted); }

/* =============================================
   Category Nav
   ============================================= */
.cat-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  height: var(--catnav-h);
  align-items: center;
  white-space: nowrap;
}
.cat-nav-inner a {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}
.cat-nav-inner a:hover,
.cat-nav-inner a.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* =============================================
   Content Layout
   ============================================= */
.site-content { padding: 20px 0 40px; }

.content-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) {
  .content-wrap { grid-template-columns: 1fr; }
}

/* =============================================
   Section Heading
   ============================================= */
.section-heading {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 0 0 8px 10px;
  border-left: 3px solid var(--accent);
  margin-bottom: 16px;
  letter-spacing: .04em;
}

/* =============================================
   Card Grid
   ============================================= */
.card-section { margin-bottom: 28px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 540px) {
  .card-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.55);
}

.card-thumb {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface-alt);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.card:hover .card-thumb img { transform: scale(1.04); }
.card-no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.cat-label {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat-label:hover { background: var(--accent-dim); color: #fff; }

.post-date { color: var(--text-muted); }

.card-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }

.card-excerpt {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 0 4px;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: background .15s, color .15s;
}
.pagination .page-numbers:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* =============================================
   Sidebar
   ============================================= */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.widget-box {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.widget-box-title {
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-left: 3px solid var(--accent);
  letter-spacing: .04em;
}
.widget-box-body { padding: 12px; }

/* Popular posts */
.popular-list { display: flex; flex-direction: column; gap: 12px; }
.popular-item { display: flex; gap: 10px; align-items: flex-start; }

.popular-rank {
  font-size: 20px;
  font-weight: 900;
  font-family: var(--font-sans);
  color: var(--accent);
  min-width: 22px;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.popular-rank.r1 { color: #D4A017; }
.popular-rank.r2 { color: #9A9A9A; }
.popular-rank.r3 { color: #B87333; }

.popular-thumb {
  width: 60px;
  height: 45px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-alt);
  flex-shrink: 0;
}
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }

.popular-info { flex: 1; min-width: 0; }
.popular-title {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.popular-title:hover { color: var(--accent); }
.popular-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Category list */
.cat-list { display: flex; flex-direction: column; }
.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  font-size: 13px;
  color: var(--text-dim);
}
.cat-list a:hover { color: var(--accent); }
.cat-count {
  font-size: 11px;
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Archive */
.archive-list { display: flex; flex-direction: column; }
.archive-list li { border-bottom: 1px solid var(--border); }
.archive-list li:last-child { border-bottom: none; }
.archive-list a { display: block; padding: 9px 0; font-size: 13px; color: var(--text-dim); }
.archive-list a:hover { color: var(--accent); }

/* =============================================
   Ad Placeholder
   ============================================= */
.ad-placeholder {
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  min-height: 90px;
  margin: 20px 0;
  letter-spacing: .06em;
}

/* =============================================
   Single Post
   ============================================= */
.post-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.post-breadcrumb a { color: var(--text-muted); }
.post-breadcrumb a:hover { color: var(--accent); }
.post-breadcrumb .sep { color: var(--border); }

.post-header { margin-bottom: 20px; }

/* スレバッジ */
.thread-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
  letter-spacing: .1em;
}

.post-title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: .02em;
}
@media (max-width: 540px) { .post-title { font-size: 17px; } }

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.post-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.post-hero img { width: 100%; max-height: 420px; object-fit: cover; }

/* Entry content */
.entry-content {
  font-size: 15px;
  line-height: 1.85;
  color: #D4D0CA;
  counter-reset: res-counter;
}
/* まとめ主コメント（直接子のp） */
.entry-content > p {
  margin-bottom: 1.2em;
  color: var(--text);
  padding-left: 2px;
}

.entry-content h2 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  margin: 2em 0 .8em;
  padding: 7px 12px;
  background: var(--surface-alt);
  border-left: 4px solid var(--accent);
  border-radius: 0 4px 4px 0;
  color: var(--text);
  letter-spacing: .03em;
}
.entry-content h3 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  margin: 1.6em 0 .6em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.entry-content ul { list-style: disc; margin: 0 0 1.2em 1.5em; }
.entry-content ol { list-style: decimal; margin: 0 0 1.2em 1.5em; }
.entry-content li { margin-bottom: .4em; }

/* 2ch レス引用ボックス */
.entry-content blockquote {
  counter-increment: res-counter;
  background: #1c1c1a;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 4px 0 14px;
  padding: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.75;
}
/* レス番号バー */
.entry-content blockquote::before {
  content: counter(res-counter) " 名無しさん";
  display: block;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 12px;
  font-family: var(--font-sans);
  letter-spacing: .02em;
}
.entry-content blockquote p {
  margin: 0;
  padding: 8px 14px;
  color: var(--text-dim);
}
.entry-content blockquote p + p { padding-top: 0; }
.entry-content blockquote p:last-child { padding-bottom: 12px; }

/* レス内の >>引用 リンク */
.entry-content blockquote a { color: #4a9eff; }

.entry-content a { color: var(--accent); }
.entry-content a:hover { text-decoration: underline; }
.entry-content img { border-radius: var(--radius); margin: 1em auto; }

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0;
}
.post-tags a {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
}
.post-tags a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Related posts */
.related-posts { margin: 32px 0 20px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 540px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }

.related-item { display: flex; flex-direction: column; gap: 6px; }
.related-thumb {
  display: block;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-alt);
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.related-item:hover .related-thumb img { transform: scale(1.05); }
.related-title {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-title:hover { color: var(--accent); }

/* Prev/Next */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}
@media (max-width: 400px) { .post-nav { grid-template-columns: 1fr; } }

.post-nav-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s;
}
.post-nav-item:hover { border-color: var(--accent); }
.post-nav-item.next { text-align: right; }
.post-nav-label { font-size: 11px; color: var(--text-muted); }
.post-nav-title {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-nav-item:hover .post-nav-title { color: var(--accent); }

/* Archive */
.archive-title { margin-bottom: 20px; }

/* =============================================
   Footer
   ============================================= */
.site-footer {
  background: #111110;
  border-top: 1px solid var(--border);
  padding: 28px 0 20px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}
.footer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.footer-cats a {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.footer-cats a:hover { color: var(--accent); border-color: var(--accent); }
.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* =============================================
   Misc
   ============================================= */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.aligncenter { display: block; margin: 1em auto; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
