/*
Theme Name: MangaPress
Theme URI: https://kingseo.live/
Author: Gemini
Author URI: https://google.com
Description: A fresh, modern, and SEO-optimized theme for manga reading websites. Fast, readable, and focused on content.
Version: 7.1 (Button Redesign)
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: dark, one-column, custom-background, manga, reading, seo, responsive
Text Domain: mangapress
*/

/* --- CSS Variables --- */
:root {
	--bg-color: #121212;
	--surface-color: #1e1e1e;
	--primary-text-color: #e0e0e0;
	--secondary-text-color: #b0b0b0;
	--accent-color: #c63a28;
	--border-color: #2a2a2a;
	--font-main: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Base & Accessibility --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	background-color: var(--bg-color); color: var(--primary-text-color);
	font-family: var(--font-main); line-height: 1.7; font-size: 16px;
	overflow-x: hidden;
}
a:focus, button:focus, input:focus { outline: 2px dashed var(--accent-color); outline-offset: 2px; }

/* --- Layout --- */
.site-container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* --- Full-Width Header & Footer --- */
.site-header, .site-footer {
	background-color: var(--surface-color);
}
.site-header {
	padding: 1.5rem 0;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	min-height: 120px;
}
.header-content {
	margin: 0 auto; display: flex; flex-direction: column;
	align-items: center; gap: 1.25rem;
}
.site-branding { text-align: center; }
.site-title { font-size: 1.75rem; font-weight: 700; margin: 0; }
.site-title a { text-decoration: none; background-image: linear-gradient(45deg, var(--accent-color), #cf7c7c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-description { font-size: 0.9rem; color: var(--secondary-text-color); margin: 0.25rem 0 0; }
.main-navigation .nav-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.main-navigation li { list-style-type: none; }
.main-navigation li a { color: var(--primary-text-color); text-decoration: none; font-weight: 600; padding: 0.5rem 0; position: relative; }
.main-navigation li a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 50%; background-color: var(--accent-color); transition: all 0.3s ease; }
.main-navigation li a:hover::after, .main-navigation .current-menu-item a::after { width: 100%; left: 0; }

.menu-toggle-checkbox, .menu-toggle { display: none; }

/* --- Mobile Menu --- */
@media screen and (max-width: 768px) {
	.site-header { min-height: auto; padding: 1rem 0; }
	.header-content { gap: 1rem; }
	.main-navigation { width: 100%; overflow: hidden; max-height: 0; transition: max-height 0.4s ease-out; }
	.main-navigation .nav-menu { flex-direction: column; gap: 0; margin-top: 1rem; }
	.main-navigation li a { display: block; padding: 1rem 0; border-top: 1px solid var(--border-color); }
	.menu-toggle { display: block; cursor: pointer; width: 30px; height: 22px; position: relative; order: -1; margin-bottom: 0.5rem; }
	.menu-toggle .line { display: block; width: 100%; height: 2px; background-color: var(--primary-text-color); position: absolute; left: 0; transition: all 0.3s ease; }
	.menu-toggle .line:nth-child(1) { top: 0; }
	.menu-toggle .line:nth-child(2) { top: 50%; transform: translateY(-50%); }
	.menu-toggle .line:nth-child(3) { bottom: 0; }
	.menu-toggle-checkbox:checked ~ .main-navigation { max-height: 100vh; }
	.menu-toggle-checkbox:checked ~ .menu-toggle .line:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
	.menu-toggle-checkbox:checked ~ .menu-toggle .line:nth-child(2) { opacity: 0; }
	.menu-toggle-checkbox:checked ~ .menu-toggle .line:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }
}

/* --- Content & Breadcrumbs --- */
#page { padding-top: 1.5rem; }
.rank-math-breadcrumb { background-color: var(--surface-color); padding: 0.75rem 1.25rem; border-radius: 8px; margin-bottom: 1.5rem; font-size: 0.9rem; }
.rank-math-breadcrumb p, .rank-math-breadcrumb a { color: var(--secondary-text-color); text-decoration: none; }
.rank-math-breadcrumb a:hover { color: var(--accent-color); }
.rank-math-breadcrumb .separator { margin: 0 0.5rem; }

/* --- Homepage Hero Section --- */
.hero-section { padding: 3rem 1.5rem; text-align: center; border-radius: 12px; margin: 2.5rem 0; background-size: cover; background-position: center; position: relative; overflow: hidden; }
.hero-section::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.hero-content { position: relative; z-index: 1; }
.hero-title { font-size: 2.25rem; font-weight: 700; margin: 0 0 1rem; }
.hero-text { font-size: 1.1rem; max-width: 600px; margin: 0 auto; color: var(--primary-text-color); }

/* --- Chapter Grid Layout --- */
.page-section-title { font-size: 1.8rem; font-weight: 600; text-align: center; margin-bottom: 1.5rem; border-bottom: 2px solid var(--accent-color); display: inline-block; padding-bottom: 0.5rem; }
.center-title { display: flex; justify-content: center; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; padding: 0; list-style: none; }
.chapter-card a { display: block; padding: 1.25rem; background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: 8px; color: var(--primary-text-color); text-decoration: none; font-size: 1.1rem; font-weight: 600; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.chapter-card a:hover { transform: translateY(-5px); border-color: var(--accent-color); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); }
.chapter-grid li:first-child a { border-color: var(--accent-color); box-shadow: 0 0 20px rgba(187, 134, 252, 0.15); }

/* --- Single Post (Chapter) Styles --- */
.entry-header { margin-bottom: 1.5rem; text-align: center; }
.entry-title { font-size: 2.5rem; }
.entry-meta { color: var(--secondary-text-color); font-size: 0.9rem; margin-top: 0.5rem;}
.entry-content, .page-content { text-align: center; margin: 1.5em 0; }
.entry-content img { max-width: 100%; height: auto; display: block; margin: 0.25rem auto; border-radius: 4px; }
.entry-content a { color: #cf7c7c; }

/* --- [REDESIGNED] Chapter Navigation Bar --- */
.chapter-navigation-bar { padding: 1rem; background-color: var(--surface-color); border-radius: 8px; margin: 2rem 0; }
.chapter-navigation .nav-links { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.chapter-navigation a {
	padding: 0.75rem 1.5rem; background-color: var(--accent-color); color: #000000;
	text-decoration: none; border-radius: 5px; font-weight: bold; font-size: 1rem;
	transition: all 0.2s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
	text-align: center;
}
.chapter-navigation a:hover {
	background-color: #d8b6ff; transform: translateY(-2px) scale(1.05);
	box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}
.nav-placeholder { width: 180px; height: 1px; }

/* By default, show full text and hide shorter versions */
.chapter-navigation .long-text { display: inline; }
.chapter-navigation .short-text,
.chapter-navigation .icon-only { display: none; }

/* Tablet and mobile styles for buttons */
@media screen and (max-width: 768px) {
	.chapter-navigation .long-text { display: none; }
	.chapter-navigation .short-text { display: inline; }
	.chapter-navigation .icon-only { display: none; }
	.chapter-navigation a { padding: 0.75rem 1rem; font-size: 0.9rem; }
	.nav-placeholder { display: none; } /* Hide placeholder on mobile */
}

/* Smallest mobile styles for buttons */
@media screen and (max-width: 480px) {
	.chapter-navigation .long-text { display: none; }
	.chapter-navigation .short-text { display: none; }
	.chapter-navigation .icon-only { display: inline; font-size: 1.5rem; line-height: 1; }
	.chapter-navigation a { padding: 0.6rem 1rem; }
}

/* --- Footer --- */
.site-footer {
	border-top: 1px solid var(--border-color);
	padding: 1.5rem 0;
	margin-top: 2.5rem;
	color: var(--secondary-text-color);
	font-size: 0.9rem;
}
.site-info { text-align: center; }

.rank-math-breadcrumb {
    text-align: center;
}

/* --- [NEW] Category & Archive Pagination --- */
.pagination {
	margin: 2.5rem 0; /* Adds spacing above and below the pagination */
	display: flex;
	justify-content: center;
	align-items: center;
}

.pagination .nav-links {
	display: flex;
	gap: 0.5rem; /* Space between the buttons */
}

/* General style for all pagination links (1, 2, Next, Previous) */
.pagination .page-numbers {
	display: inline-block;
	padding: 0.65rem 1.1rem;
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--primary-text-color);
	background-color: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: 5px;
	transition: all 0.2s ease;
}

/* Style for the 'Next' and 'Previous' text links */
.pagination .next,
.pagination .prev {
	font-weight: bold;
}

/* Hover effect for all pagination links */
.pagination .page-numbers:hover {
	background-color: var(--accent-color);
	border-color: var(--accent-color);
	color: #000000; /* Dark text for better contrast on accent background */
	transform: translateY(-2px);
}

/* Style for the current, active page number */
.pagination .page-numbers.current {
	background-color: var(--accent-color);
	border-color: var(--accent-color);
	color: #000000; /* Dark text on accent background */
	cursor: default;
}

/* Style for the dots (...) separator */
.pagination .page-numbers.dots {
	background-color: transparent;
	border-color: transparent;
	padding: 0.65rem 0.5rem;
}

/* Remove hover effect from the dots */
.pagination .page-numbers.dots:hover {
	background-color: transparent;
	color: var(--primary-text-color);
	transform: none;
}


/* --- [REUSABLE] Legal Page Template Styles --- */
.page-template-page-legal .entry-content {
    text-align: left;       /* Aligns all text to the left */
    max-width: 800px;       /* Constrains the width for easier reading */
    margin-left: auto;
    margin-right: auto;
}

.page-template-page-legal .entry-content p {
    line-height: 1.8;       /* Sets a comfortable line height for paragraphs */
}

.page-template-page-legal .entry-content h1,
.page-template-page-legal .entry-content h2,
.page-template-page-legal .entry-content h3 {
    text-align: left;       /* Ensures all headings are left-aligned */
    margin-top: 2em;
}

.page-template-page-legal .entry-content ul {
    list-style-type: disc;  /* Use standard bullet points */
    padding-left: 20px;     /* Add indentation */
}

.page-template-page-legal .entry-content li {
    margin-bottom: 0.75em;  /* Space out list items */
}