/* ============================================
   DOUJIN.REVIEW - Magazine Style CSS
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #faf8f5;
  color: #2d2d2d;
  font-family: "Noto Serif JP", Georgia, "Hiragino Mincho ProN", serif;
  font-size: 16px;
  line-height: 1.8;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --- Reading Progress Bar --- */
#progress-bar {
  position: fixed; top: 0; left: 0;
  width: 0%; height: 2px;
  background: #db4a37;
  z-index: 10000;
  transition: width 0.1s linear;
}

/* --- Header --- */
.site-header {
  border-bottom: 1px solid #e0dcd6;
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 9000;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
}
.site-logo {
  font-family: "Noto Serif JP", Georgia, serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 2px;
  color: #2d2d2d;
}
.site-logo span { color: #db4a37; }
.site-tagline {
  font-size: 13px;
  color: #888;
  letter-spacing: 1px;
}

/* --- Section Heading --- */
.section-heading {
  max-width: 1200px;
  margin: 40px auto 24px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-heading::before,
.section-heading::after {
  content: ""; flex: 1; height: 1px; background: #d4d0ca;
}
.section-heading h2 {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #2d2d2d;
  white-space: nowrap;
}

/* --- Hero / Editor's Pick (1ページ目のみ) --- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 32px;
  cursor: pointer;
}
.hero a { display: block; }
.hero-image {
  width: 100%; height: 400px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: #ddd;
}
.hero-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-image::after {
  content: "";
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}
.hero-badge {
  position: absolute; top: 20px; left: 20px;
  background: #db4a37; color: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 900; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 14px; z-index: 2;
}
.hero-body { padding: 24px 0 0; }
.hero-genre {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700; font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase;
  color: #db4a37; margin-bottom: 6px;
}
.hero-title {
  font-size: 28px; font-weight: 700;
  line-height: 1.4; margin-bottom: 8px;
}
.hero-circle {
  font-size: 13px; color: #444;
}
.hero-desc {
  font-size: 15px; line-height: 1.8; color: #333;
  border-left: 4px solid #db4a37;
  padding-left: 16px; margin: 12px 0;
}

/* ===== MAIN + SIDEBAR LAYOUT ===== */
.page-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  display: flex;
  gap: 32px;
}
.page-main {
  flex: 1;
  min-width: 0;
}
.page-sidebar {
  width: 220px;
  flex-shrink: 0;
}

/* --- Sidebar --- */
.sidebar-section {
  background: #fff;
  border: 1px solid #e8e4de;
  padding: 16px;
  margin-bottom: 16px;
}
.sidebar-section-title {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e4de;
}
.sidebar-tag-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #333;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.sidebar-tag:hover {
  color: #2d2d2d;
  background: #fdf3f0;
}
.sidebar-tag.active {
  color: #db4a37;
  background: #fdf3f0;
  border-color: rgba(219, 74, 55, 0.2);
}
.sidebar-tag .tag-count {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  color: #333;
  background: #f5f3f0;
  padding: 1px 6px;
}
.sidebar-tag.active .tag-count {
  color: #db4a37;
  background: rgba(219, 74, 55, 0.1);
}

/* --- Active Filter Display --- */
.active-filter-display {
  font-size: 13px;
  color: #444;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.active-filter-display .filter-tag {
  display: inline-flex;
  align-items: center;
  background: #fdf3f0;
  color: #db4a37;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid rgba(219, 74, 55, 0.2);
}
.active-filter-display .filter-tag.format {
  background: #f0faf4;
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}
.active-filter-display .filter-tag::after {
  content: '\00d7';
  margin-left: 6px;
  font-size: 14px;
}
.active-filter-display .filter-tag:hover { opacity: 0.7; }
.active-filter-display .clear-all {
  font-size: 12px;
  color: #333;
  cursor: pointer;
  margin-left: 4px;
}
.active-filter-display .clear-all:hover { color: #db4a37; }

/* --- Result Count --- */
.result-count {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: #333;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* ===== GRID CARDS (top.html) ===== */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.work-card {
  background: #fff;
  border: 1px solid #e8e4de;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.work-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(219, 74, 55, 0.1);
}
.work-card a { display: block; }
.work-card .card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.work-card .card-rating-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(219, 74, 55, 0.9);
  color: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  font-size: 12px;
  padding: 3px 8px;
}
.work-card .card-info {
  padding: 12px;
}
.work-card .card-title {
  font-size: 14px;
  font-weight: 700;
  color: #2d2d2d;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.work-card .card-circle {
  font-size: 12px;
  color: #333;
  margin-bottom: 6px;
}
.work-card .card-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 6px;
}
.work-card .card-sales {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #db4a37;
  font-weight: 700;
}
.work-card .card-date {
  color: #333;
}
.work-card .card-rating {
  color: #fff;
  font-weight: 700;
}
.work-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.work-card .card-tag {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #db4a37;
  background: #fdf3f0;
  padding: 2px 7px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.work-card .card-tag:hover {
  border-color: #db4a37;
}
.work-card .card-format {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
  background: #f0faf4;
  padding: 2px 7px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.work-card .card-format:hover {
  border-color: #10b981;
}

/* --- Pagination --- */
#pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 32px;
}
#pagination button {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  background: #fff;
  border: 1px solid #e0dcd6;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
#pagination button:hover {
  background: #db4a37;
  color: #fff;
  border-color: #db4a37;
}
#pagination button.current {
  background: #db4a37;
  color: #fff;
  border-color: #db4a37;
}

/* --- Work Detail Page --- */
.container {
  max-width: 840px;
  margin: 32px auto;
  padding: 0 20px;
}
.work-detail { background: #fff; padding: 32px; border: 1px solid #e8e4de; }
.work-title {
  font-size: 28px; font-weight: 700;
  line-height: 1.4; margin: 24px 0 16px;
}
.work-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: #444;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8e4de;
  margin-bottom: 16px;
}
/* detail page tags (keep old .card-tags for work pages) */
.work-detail .card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.work-detail .card-tag,
.work-detail .card-format {
  display: inline-block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 1px;
  padding: 3px 10px;
  border: 1px solid #e0dcd6;
  color: #333;
  transition: all 0.2s;
}
.work-detail .card-tag:hover,
.work-detail .card-format:hover {
  background: #db4a37; color: #fff; border-color: #db4a37;
}
.work-description {
  font-size: 16px; line-height: 2;
  color: #444; margin: 24px 0;
}
.work-description p { margin-bottom: 16px; }
.cta-area { text-align: center; margin: 32px 0 16px; }
.cta-button {
  display: inline-block;
  background: #db4a37; color: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700; font-size: 14px;
  letter-spacing: 2px;
  padding: 14px 40px;
  transition: opacity 0.2s;
}
.cta-button:hover { opacity: 0.85; color: #fff; }

/* --- Gallery (work page) --- */
.work-gallery { display: flex; gap: 12px; margin-bottom: 24px; }
.gallery-main {
  flex: 1; height: 450px;
  display: flex; align-items: center; justify-content: center;
  background: #f5f3f0; overflow: hidden;
  border: 1px solid #e8e4de;
}
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-side { display: flex; flex-direction: column; gap: 4px; width: 80px; height: 450px; }
.gallery-thumbs {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: hidden; padding: 4px 0;
}
.gallery-thumb-wrap { position: relative; flex-shrink: 0; }
.gallery-thumb {
  width: 80px; height: 60px; object-fit: cover;
  cursor: pointer; opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
  display: block;
}
.gallery-thumb:hover { opacity: 0.9; }
.gallery-thumb.active { opacity: 1; border-color: #db4a37; }
.gallery-thumb-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  background: rgba(0,0,0,0.7); border-radius: 50%;
  color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; padding-left: 2px;
}
.gallery-scroll-btn {
  width: 80px; height: 24px; flex-shrink: 0;
  background: #f0ece6; border: 1px solid #e0dcd6;
  color: #444; cursor: pointer; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.gallery-scroll-btn:hover { background: #e8e4de; }

/* --- Age Gate --- */
.age-gate {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; text-align: center;
  padding: 20px;
}
.age-gate h1 {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 900; font-size: 28px;
  letter-spacing: 4px; text-transform: uppercase;
  margin-bottom: 24px;
}
.age-gate h1 span { color: #db4a37; }
.age-gate p {
  font-size: 14px; color: #333;
  margin-bottom: 32px; line-height: 1.8;
}
.btn-group { display: flex; gap: 12px; }
.btn-yes, .btn-no {
  padding: 14px 36px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700; font-size: 13px;
  letter-spacing: 2px; text-transform: uppercase;
  border: none; cursor: pointer;
  transition: opacity 0.2s;
}
.btn-yes { background: #db4a37; color: #fff; }
.btn-no { background: #e8e4de; color: #2d2d2d; }
.btn-yes:hover, .btn-no:hover { opacity: 0.85; }

/* --- Footer --- */
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px;
  border-top: 1px solid #d4d0ca;
  text-align: center;
}
.site-footer p {
  font-size: 12px; color: #444; line-height: 1.8;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .works-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 10px; text-align: center; }
  .site-nav { gap: 16px; }
  .hero-image { height: 260px; }
  .hero-title { font-size: 22px; }

  .page-layout { flex-direction: column; }
  .page-sidebar { width: 100%; order: -1; }
  .sidebar-tag-list { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidebar-tag { padding: 4px 10px; font-size: 12px; }
  .sidebar-tag .tag-count { display: none; }

  .works-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .work-card .card-info { padding: 10px; }
  .work-card .card-title { font-size: 13px; }

  .work-gallery { flex-direction: column; }
  .gallery-main { height: 300px; }
  .gallery-side { flex-direction: row; width: 100%; height: auto; }
  .gallery-thumbs { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 0 4px; }
  .gallery-thumb { width: 60px; height: 45px; }
  .gallery-scroll-btn { width: 24px; height: 45px; }

  .work-detail { padding: 20px 16px; }
  .work-title { font-size: 22px; }
}
