/*
Theme Name: MangaVerse
Theme URI: https://example.com/mangaverse
Author: Grok
Author URI: https://x.ai
Description: Theme simple y atractivo para sitios de manga. Diseño oscuro, tarjetas de portadas, lector cómodo y navegación entre capítulos.
Version: 1.0.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: mangaverse
Tags: blog, custom-logo, custom-menu, featured-images, one-column, two-columns, translation-ready, dark
*/

/* =========================================================
   VARIABLES
   ========================================================= */
:root {
  --bg-primary: #0b0b0f;
  --bg-secondary: #14141c;
  --bg-card: #1a1a24;
  --bg-hover: #22222e;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7a;
  --accent: #ff2d6a;
  --accent-hover: #ff4d82;
  --accent-secondary: #00d4ff;
  --accent-purple: #a855f7;
  --border: #2a2a38;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 32px rgba(255, 45, 106, 0.15);
  --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Outfit", "Inter", system-ui, sans-serif;
  --transition: 0.25s ease;
  --max-width: 1200px;
  --header-height: 70px;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* =========================================================
   LAYOUT
   ========================================================= */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  background: rgba(11, 11, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

.site-title a {
  color: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-title a:hover {
  opacity: 0.9;
}

.custom-logo-link img {
  max-height: 42px;
  width: auto;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.main-navigation ul {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.main-navigation a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
}

/* =========================================================
   MANGA GRID (Home / Archive)
   ========================================================= */
.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 1.4em;
  background: linear-gradient(180deg, var(--accent), var(--accent-purple));
  border-radius: 2px;
}

.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .manga-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (min-width: 1024px) {
  .manga-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.75rem;
  }
}

/* Manga Card */
.manga-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}

.manga-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 45, 106, 0.4);
}

.manga-card__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-secondary);
}

.manga-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.manga-card:hover .manga-card__cover img {
  transform: scale(1.06);
}

.manga-card__cover .no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: var(--text-muted);
  font-size: 2.5rem;
}

.manga-card__badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 2;
}

.manga-card__body {
  padding: 0.9rem 1rem 1.1rem;
}

.manga-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.manga-card__title a {
  color: var(--text-primary);
}

.manga-card__title a:hover {
  color: var(--accent);
}

.manga-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =========================================================
   SINGLE POST / READER
   ========================================================= */
.single-header {
  margin-bottom: 2rem;
  text-align: center;
}

.single-header .entry-title {
  margin-bottom: 0.75rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.entry-meta a {
  color: var(--text-secondary);
}

.entry-meta a:hover {
  color: var(--accent);
}

.entry-content {
  max-width: 900px;
  margin: 0 auto 2.5rem;
}

.entry-content img {
  border-radius: var(--radius-sm);
  margin: 1rem auto;
  box-shadow: var(--shadow);
}

/* Manga reader style: images full width and stacked */
.entry-content.manga-reader img {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 0.5rem;
  border-radius: 0;
  box-shadow: none;
  display: block;
}

.entry-content p {
  margin-bottom: 1.25rem;
}

.entry-content h2,
.entry-content h3 {
  margin: 2rem 0 1rem;
}

/* Chapter navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.chapter-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.chapter-nav a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.chapter-nav .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* =========================================================
   PAGE
   ========================================================= */
.page-header {
  margin-bottom: 2rem;
}

/* =========================================================
   ARCHIVE / SEARCH
   ========================================================= */
.archive-header {
  margin-bottom: 2rem;
}

.archive-header .page-title {
  margin-bottom: 0.5rem;
}

.archive-description {
  color: var(--text-secondary);
  max-width: 600px;
}

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 2rem 1.25rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-info a {
  color: var(--text-secondary);
}

.footer-menu ul {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-menu a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-menu a:hover {
  color: var(--accent);
}

/* =========================================================
   404
   ========================================================= */
.error-404 {
  text-align: center;
  padding: 4rem 1rem;
}

.error-404 h1 {
  font-size: 4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.error-404 p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: var(--accent);
  color: white;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-2px);
}

/* =========================================================
   SEARCH FORM
   ========================================================= */
.search-form {
  display: flex;
  max-width: 400px;
  margin: 0 auto;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-primary);
  outline: none;
}

.search-form input[type="search"]:focus {
  border-color: var(--accent);
}

.search-form button {
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

/* =========================================================
   COMMENTS (simple)
   ========================================================= */
.comments-area {
  max-width: 800px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comment-list {
  margin-bottom: 2rem;
}

.comment {
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

/* =========================================================
   UTILITIES
   ========================================================= */
.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;
}

.no-posts {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-navigation ul {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
  }

  .main-navigation.toggled ul {
    display: flex;
  }

  .main-navigation a {
    display: block;
    padding: 0.75rem 1rem;
  }

  .manga-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  .chapter-nav {
    flex-direction: column;
  }

  .chapter-nav a {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   WORDPRESS CORE ALIGNMENTS
   ========================================================= */
.alignwide {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.wp-block-image {
  margin-bottom: 1.5rem;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}
