/*
Theme Name: RawMangaZips
Theme URI: https://rawmangazips.com
Author: RawMangaZips
Author URI: https://rawmangazips.com
Description: Dark manga download theme. Series = standard Posts (ThemaPoster compatible). Volumes with multi-host mirrors shown inline on the series page. List front + detailed download layout.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: raw-manga-zips
Tags: dark-mode, manga, download
*/

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1c1c1c;
  --bg-input: #1a1a1a;
  --border: #2a2a2a;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #ff3b3b;
  --accent-orange: #ff7a00;
  --accent-gradient: linear-gradient(135deg, #ff3b3b 0%, #ff7a00 100%);
  --success: #22c55e;
  --blue: #3b82f6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --content-max-width: 1280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-orange); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* Layout */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-header {
  background: rgba(17,17,17,0.95);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.site-logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.25rem; color: var(--text-primary); }
.site-logo img { height: 34px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.main-nav a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.main-nav a:hover, .main-nav a.active { color: var(--accent); }
.header-search {
  display: flex; align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  min-width: 200px; max-width: 260px;
}
.header-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,59,59,0.15); }
.header-search input {
  background: transparent; border: none; outline: none;
  color: var(--text-primary); width: 100%; font-size: 0.875rem;
}
.header-search input::placeholder { color: var(--text-muted); }

.site-main {
  flex: 1;
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Content area + sidebars */
.content-area { display: grid; gap: 1.75rem; width: 100%; }
.layout-none .content-area { grid-template-columns: 1fr; }
.layout-right .content-area { grid-template-columns: 1fr 280px; }
.layout-left .content-area { grid-template-columns: 280px 1fr; }
.layout-both .content-area { grid-template-columns: 250px 1fr 250px; }
@media (max-width: 1024px) {
  .layout-right .content-area,
  .layout-left .content-area,
  .layout-both .content-area { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .primary-content { order: 1; }
}
.primary-content { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 1.15rem; }
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.widget-title {
  font-size: 0.9rem; font-weight: 600;
  margin-bottom: 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.4rem;
}
.widget-title::before {
  content: ""; width: 3px; height: 1em;
  background: var(--accent-gradient); border-radius: 2px;
}
.widget ul li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text-secondary); }
.widget ul li a:hover { color: var(--accent); }

/* ========== FRONT LIST (like second image) ========== */
.page-title {
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 1.35rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.manga-list { display: flex; flex-direction: column; gap: 0; }
.manga-list-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.manga-list-item:first-child { padding-top: 0; }
.manga-list-cover {
  width: 140px; aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.manga-list-cover img { width: 100%; height: 100%; object-fit: cover; }
.manga-list-cover .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 2rem;
  background: linear-gradient(145deg,#1a1a1a,#111);
}
.manga-list-body { min-width: 0; }
.manga-list-title {
  font-size: 1.05rem; font-weight: 600;
  line-height: 1.35; margin-bottom: 0.4rem;
  color: var(--accent-orange);
}
.manga-list-title a { color: inherit; }
.manga-list-title a:hover { color: var(--accent); }
.manga-list-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.manga-list-excerpt {
  font-size: 0.875rem; color: var(--text-secondary);
  line-height: 1.5; margin-bottom: 0.75rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.manga-list-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.5rem; font-size: 0.7rem; font-weight: 700;
  border-radius: 4px; letter-spacing: 0.02em;
}
.badge-status-ongoing { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-status-completed { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-status-hiatus { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-recommended {
  background: var(--accent-gradient); color: #fff;
  box-shadow: 0 2px 6px rgba(255,59,59,0.3);
}
.badge-format {
  background: var(--bg-input); color: var(--text-secondary);
  border: 1px solid var(--border); font-size: 0.65rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.45rem 0.95rem; font-size: 0.85rem; font-weight: 600;
  border-radius: var(--radius-sm); border: none; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
}
.btn-primary {
  background: var(--accent-gradient); color: #fff;
  box-shadow: 0 2px 8px rgba(255,59,59,0.25);
}
.btn-primary:hover { filter: brightness(1.1); color: #fff; transform: translateY(-1px); }
.btn-outline {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.75rem; }

/* ========== SINGLE POST – detailed download layout (image 1) ========== */
.series-header {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 600px) {
  .series-header { grid-template-columns: 1fr; text-align: center; }
  .series-cover { max-width: 140px; margin: 0 auto; }
}
.series-cover {
  border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 2/3; background: var(--bg-secondary);
}
.series-cover img { width: 100%; height: 100%; object-fit: cover; }
.series-info h1 {
  font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.25;
}
.series-meta {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1rem;
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem;
}
.series-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.series-desc {
  font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6;
}

/* Download section */
.download-block { margin-top: 0.5rem; }
.download-block-title {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.download-block-title::before { content: "⬇"; }

/* Volume row */
.vol-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.vol-row:hover { border-color: rgba(255,59,59,0.35); }
.vol-row-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.vol-row-left { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.vol-num {
  font-weight: 700; font-size: 1rem; color: var(--text-primary);
}
.vol-size { font-size: 0.8rem; color: var(--text-muted); }
.vol-mirrors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.mirror-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem; font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  min-height: 36px;
  text-align: center;
}
.mirror-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,59,59,0.08);
}
.mirror-btn.is-recommended {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,59,59,0.3);
}
.mirror-btn.is-recommended:hover {
  filter: brightness(1.1);
  color: #fff;
}
.mirror-btn .host-label { font-weight: 700; }
.mirror-btn .fmt { opacity: 0.85; font-size: 0.7rem; }

/* Empty / tips */
.download-empty {
  text-align: center; padding: 2.5rem 1.25rem;
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--text-muted);
}
.download-tips {
  font-size: 0.8rem; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.55rem 0.9rem;
  margin-bottom: 1.15rem;
}

/* Pagination */
.navigation.pagination { margin-top: 2rem; text-align: center; }
.navigation.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 0.5rem; margin: 0 0.15rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
}
.navigation.pagination .page-numbers.current,
.navigation.pagination .page-numbers:hover {
  background: var(--accent-gradient); border-color: transparent; color: #fff;
}

/* Volume single (fallback simple page) */
.volume-header { margin-bottom: 1.5rem; }
.volume-header h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.4rem; }
.volume-breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.volume-breadcrumb a { color: var(--text-secondary); }

/* Responsive */
@media (max-width: 768px) {
  .header-inner { height: auto; padding: 0.65rem 1rem; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; justify-content: center; padding-top: 0.4rem; gap: 1.1rem; }
  .header-search { min-width: 0; flex: 1; }
  .manga-list-item { grid-template-columns: 90px 1fr; gap: 0.9rem; }
  .manga-list-cover { width: 100px; }
  .vol-row-top { flex-direction: column; align-items: flex-start; }
}

.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal !important;
}

/* ===== Responsive improvements ===== */
@media (max-width: 768px) {
  .series-header {
    grid-template-columns: 1fr !important;
    text-align: center;
  }
  .series-cover {
    width: 140px !important;
    max-width: 140px;
    margin: 0 auto;
  }
  .vol-mirrors {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
  }
  .mirror-btn {
    min-width: 0 !important;
    width: 100%;
    font-size: 0.75rem !important;
    padding: 0.4rem 0.5rem !important;
  }
  .manga-list-item {
    grid-template-columns: 100px 1fr !important;
  }
  .manga-list-cover {
    width: 100px !important;
  }
  .header-inner {
    flex-wrap: wrap;
    height: auto !important;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 1rem;
    font-size: 0.85rem;
  }
  .header-search {
    flex: 1;
    min-width: 120px;
    max-width: none;
  }
  .site-main {
    padding: 1rem 0.85rem 2.5rem;
  }
}

@media (max-width: 480px) {
  .vol-mirrors {
    grid-template-columns: 1fr 1fr !important;
  }
  .manga-list-item {
    grid-template-columns: 80px 1fr !important;
    gap: 0.75rem !important;
  }
  .manga-list-cover {
    width: 80px !important;
  }
  .manga-list-title {
    font-size: 0.95rem !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .layout-right .content-area,
  .layout-left .content-area {
    grid-template-columns: 1fr 240px;
  }
  .layout-both .content-area {
    grid-template-columns: 200px 1fr 200px;
  }
}

.single .post-body-content img.fifu-image,
.single .series-desc img.fifu-image {
  display: none !important;
}
