/*
Theme Name: Hentai Wisdom
Theme URI: https://hentai-wisdom.com
Description: Custom minimal theme for Hentai Wisdom - no framework dependencies.
Version: 1.0.0
Author: Hentai Wisdom
Author URI: https://hentai-wisdom.com
Text Domain: hentai-wisdom
*/

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  background: #f7f2ea;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #9543d5; text-decoration: none; transition: color 0.2s; }
a:hover { color: #7123ae; }

ul, ol { padding-left: 1.5em; }
blockquote { margin: 1em 0; padding: 0.5em 1em; border-left: 3px solid #9543d5; }

h1, h2, h3, h4, h5, h6 { line-height: 1.4; margin-bottom: 0.5em; color: #333; }
h1 { font-size: 23px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
h4 { font-size: 17px; }
h5 { font-size: 14px; }
h6 { font-size: 15px; }

p { margin-bottom: 1em; }

table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 12px; border: 1px solid #e0e0e0; text-align: left; }
th { background: #f5f5f5; font-weight: 600; }

figure { margin: 1.5em 0; }
figcaption { font-size: 0.85rem; color: #666; text-align: center; margin-top: 0.5em; }

hr, .wp-block-separator { border: none; border-top: 1px solid #e0e0e0; margin: 2em 0; }

/* Forms */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: 1px solid #eee;
  border-radius: 3px;
  background: #f9f9f9;
  padding: 8px 12px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #9543d5;
}

/* ==========================================================================
   2. LAYOUT
   ========================================================================== */

.site-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.content-wrap {
  display: flex;
  gap: 30px;
  padding-top: 30px;
  padding-bottom: 40px;
}

.content-area { flex: 1; min-width: 0; background: #fff; padding: 30px; border-radius: 4px; }
.sidebar-area { width: 250px; flex-shrink: 0; }

/* Full-width for single posts */
.single .content-wrap { display: block; max-width: 780px; margin: 0 auto; }
.single .content-area { background: #fff; padding: 30px; border-radius: 4px; }
.single .sidebar-area { display: none; }

@media (max-width: 768px) {
  .content-wrap { flex-direction: column; }
  .sidebar-area { width: 100%; }
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */

.site-header {
  background: #f7f2ea;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: height 0.3s, box-shadow 0.3s;
}

.site-header.is-sticky {
  height: 45px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.site-logo a {
  display: flex;
  align-items: center;
  color: #333;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}
.site-logo img { max-height: 60px; width: auto; }
.is-sticky .site-logo img { max-height: 40px; }

/* Desktop Nav */
.main-nav { display: flex; list-style: none; gap: 0; padding: 0; margin: 0; }
.main-nav li { position: relative; }
.main-nav > li > a {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 14px;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: #333;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.2s;
}
.is-sticky .main-nav > li > a { height: 45px; }
.main-nav > li > a:hover { color: #9543d5; }

/* Dropdown */
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 0 0 4px 4px;
  list-style: none;
  padding: 8px 0;
  z-index: 100;
}
.main-nav li:hover > .sub-menu { display: block; }
.main-nav .sub-menu a {
  display: block;
  padding: 6px 16px;
  font-size: 12px;
  color: #333;
}
.main-nav .sub-menu a:hover { color: #9543d5; background: #f9f6fc; }

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #333;
}
.menu-toggle svg { width: 24px; height: 24px; }

.nav-wrap { display: flex; align-items: center; }

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav-wrap {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 16px 0;
  }
  .nav-wrap.is-open { display: block; }
  .main-nav { flex-direction: column; }
  .main-nav > li > a { height: auto; padding: 10px 20px; }
  .main-nav .sub-menu {
    position: static;
    box-shadow: none;
    background: #f9f9f9;
  }
  .main-nav .sub-menu a { padding-left: 32px; }
}

/* ==========================================================================
   4. BLOG LISTING (Homepage & Archive)
   ========================================================================== */

.blog-entry {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #f0f0f0;
}

.blog-entry:last-child { border-bottom: none; }

.entry-thumbnail { margin-bottom: 16px; border-radius: 4px; overflow: hidden; }
.entry-thumbnail img { width: 100%; height: auto; }

.entry-title {
  font-size: 24px;
  line-height: 1.4;
  margin-bottom: 8px;
}
.entry-title a { color: #333; }
.entry-title a:hover { color: #9543d5; }

.entry-meta {
  font-size: 13px;
  color: #999;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.entry-meta a { color: #999; }
.entry-meta a:hover { color: #9543d5; }

.entry-excerpt { color: #555; }

.read-more {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  color: #9543d5;
}

/* Archive header */
.archive-header { margin-bottom: 24px; }
.archive-title { font-size: 28px; margin-bottom: 4px; }
.archive-description { color: #666; }

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
}
.pagination a { background: #fff; color: #333; border: 1px solid #e0e0e0; }
.pagination a:hover { border-color: #9543d5; color: #9543d5; }
.pagination .current { background: #9543d5; color: #fff; border: 1px solid #9543d5; }

/* ==========================================================================
   5. SINGLE POST
   ========================================================================== */

.single-post-title {
  font-size: 34px;
  line-height: 1.4;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.post-meta {
  font-size: 13px;
  color: #999;
  letter-spacing: 0.6px;
  margin-bottom: 24px;
}
.post-meta a { color: #999; }
.post-meta a:hover { color: #9543d5; }

.post-content h2 {
  font-size: 20px;
  margin-top: 2em;
  margin-bottom: 0.8em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid #f0f0f0;
}

.post-content h3 {
  font-size: 18px;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}

.post-content ul, .post-content ol { margin-bottom: 1em; }
.post-content li { margin-bottom: 0.3em; }
.post-content strong { font-weight: 600; }
.post-content em { font-style: italic; }

/* Post navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}
.post-navigation a { font-size: 13px; color: #9543d5; }

/* Related posts */
.related-posts { margin-top: 40px; }
.related-posts h3 { font-size: 18px; margin-bottom: 16px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.related-card img { border-radius: 4px; margin-bottom: 8px; }
.related-card .related-title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.related-card .related-date { font-size: 12px; color: #999; margin-top: 4px; }

@media (max-width: 768px) {
  .single-post-title { font-size: 24px; }
  .related-grid { grid-template-columns: 1fr; }
}

/* Social sharing */
.social-share { margin-top: 30px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.social-share-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #999; margin-bottom: 10px; }
.social-share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.social-share-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #666;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}
.social-share-links a:hover { background: #9543d5; color: #fff; }

/* ==========================================================================
   6. SIDEBAR
   ========================================================================== */

.widget { margin-bottom: 30px; }
.widget-title {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}
.widget img { border-radius: 4px; }
.widget p { font-size: 13px; }

/* ==========================================================================
   7. FOOTER
   ========================================================================== */

.site-footer {
  background: #1b1b1b;
  color: #a3a3a3;
  padding: 30px 0;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.footer-menu { list-style: none; display: flex; gap: 16px; padding: 0; }
.footer-menu a {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  color: #d3d3d3;
}
.footer-menu a:hover { color: #fff; }

@media (max-width: 768px) {
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

/* ==========================================================================
   8. DLSITE CUSTOM COMPONENTS
   ========================================================================== */

/* Genre Tags */
.dlsite-genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 12px 0;
}
.dlsite-genre-tag {
  background: #f0e6f6;
  color: #5a2d82;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* CTA Button */
.dlsite-cta-wrap { margin: 24px 0; }
a.dlsite-cta, a.dlsite-cta:visited {
  display: block;
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, #ff6a00, #ff8c00);
  color: #fff;
  font-size: 1.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}
a.dlsite-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 106, 0, 0.45);
  color: #fff;
}
a.dlsite-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
}
.dlsite-cta-sub {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 4px;
}

/* Floating Mobile CTA */
.dlsite-float-cta { display: none; }
@media (max-width: 768px) {
  .dlsite-float-cta {
    display: block;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.97);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .dlsite-float-cta.is-visible { transform: translateY(0); opacity: 1; }
  .dlsite-float-cta a {
    display: block; width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #ff6a00, #ff8c00);
    color: #fff; font-size: 1.3rem; font-weight: 700;
    text-align: center; text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(255,106,0,0.35);
  }
  .dlsite-float-cta a:active { transform: scale(0.98); }
  body.has-float-cta { padding-bottom: 72px; }
}

/* Review Cards */
.dlsite-reviews-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 12px;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.dlsite-reviews-scroll::-webkit-scrollbar { height: 4px; }
.dlsite-reviews-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.dlsite-review-card {
  flex: 0 0 85%;
  min-width: 0;
  scroll-snap-align: start;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin: 0;
  background: #fafafa;
  max-height: 300px;
  overflow-y: auto;
}
.dlsite-review-card p { margin-top: 0; }
@media (min-width: 769px) {
  .dlsite-review-card { flex: 0 0 48%; max-height: 350px; }
}

/* Work Entry (Listicle) */
.dlsite-work-entry { margin-bottom: 40px; }
h2.dlsite-work-title, h3.dlsite-work-title {
  font-size: clamp(1.1rem, 4vw, 1.75rem);
  line-height: 1.3;
}

/* Pay Box */
.dlsite-pay-box {
  border-radius: 16px;
  overflow: hidden;
  margin: 28px 0 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #e0e0e0;
}
.dlsite-pay-header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  padding: 18px 24px;
  text-align: center;
}
.dlsite-pay-header h3 {
  margin: 0; padding: 0;
  font-size: 1.15rem; font-weight: 700;
  color: #fff; letter-spacing: 0.02em;
}
.dlsite-pay-option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
}
.dlsite-pay-rank {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}
.dlsite-pay-rank.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 2px 8px rgba(245,158,11,0.4); }
.dlsite-pay-rank.rank-2 { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.dlsite-pay-rank.rank-3 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* ==========================================================================
   9. WORDPRESS BLOCK STYLES
   ========================================================================== */

.wp-block-heading.has-large-font-size { font-size: 36px; }
.wp-block-heading.has-medium-font-size { font-size: 20px; }
.has-text-align-center { text-align: center; }

.wp-block-image { margin: 1.5em 0; }
.wp-block-image.size-full img { width: 100%; }
.wp-block-image figcaption { font-size: 0.85rem; color: #666; text-align: center; margin-top: 0.5em; }

.wp-block-table { margin: 1.5em 0; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: #f9f9f9; }
.wp-block-table.has-fixed-layout table { table-layout: fixed; }

.wp-block-quote {
  margin: 1em 0;
  padding: 0.8em 1.2em;
  border-left: 3px solid #9543d5;
  background: #fafafa;
}
.wp-block-quote cite { display: block; font-size: 0.85rem; color: #666; margin-top: 0.5em; }

.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0; }
.wp-block-button__link {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.wp-block-button__link:hover { opacity: 0.9; }
.wp-block-button.is-style-fill .wp-block-button__link { background: #9543d5; color: #fff; }
.wp-block-button__width-100 { width: 100%; }
.has-luminous-vivid-orange-background-color { background-color: #ff6900; }

.wp-block-separator { border: none; border-top: 1px solid #e0e0e0; margin: 2em 0; }

/* Block layout utilities */
.is-layout-flex { display: flex; }
.is-layout-flex.is-vertical { flex-direction: column; }
.is-content-justification-center { justify-content: center; }

/* ==========================================================================
   10. METASLIDER COMPAT
   ========================================================================== */

.metaslider { margin: 1.5em 0; }
.metaslider .flexslider { border: none; border-radius: 4px; overflow: hidden; box-shadow: none; margin: 0; }

/* ==========================================================================
   11. UTILITY
   ========================================================================== */

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
}
