/*
Theme Name: MangaWorld
Theme URI: https://example.com/
Author: Your Name
Author URI: https://example.com/
Description: A world-class UI/UX theme for showcasing manga with dynamic JSON import and affiliate features.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mangaworld
*/

/* === 1. Variables & Reset === */
:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #bb86fc;
    --primary-variant-color: #3700b3;
    --secondary-color: #03dac6;
    --text-color: rgba(255, 255, 255, 0.87);
    --text-color-secondary: rgba(255, 255, 255, 0.6);
    --border-color: rgba(255, 255, 255, 0.12);
    --font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

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

/* === 2. Global Styles === */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--primary-color);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    line-height: 1.2;
}

/* === 3. Header Styles === */
.site-header {
    background-color: var(--surface-color);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.site-branding {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: var(--text-color);
    text-decoration: none;
}

.header-ad {
    max-width: 1200px;
    margin: 1rem auto 0;
    padding: 0 1rem;
    text-align: center;
}

.header-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* === 4. Main Content === */
.site-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* === 5. Page Header === */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* === 6. Products Grid === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* === 7. Product Card === */
.product-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.product-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.product-card__thumbnail {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

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

.product-card__placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-secondary);
}

.product-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.9), rgba(3, 218, 198, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card__overlay-text {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.product-card__title-wrapper {
    padding: 1rem;
}

.product-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
    .product-card__title {
        font-size: 0.8rem;
    }
    
    .product-card__title-wrapper {
        padding: 0.5rem;
    }
}

/* === 8. Single Product Details === */
.product-details__grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .product-details__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.product-details__thumbnail {
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--surface-color);
}

.product-details__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-secondary);
    background-color: var(--bg-color);
}

.product-details__series-title {
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.product-details__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.product-details__affiliate-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
}

.product-details__affiliate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(187, 134, 252, 0.4);
    color: white;
}

.product-details__meta {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.product-details__meta dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
}

.product-details__meta dt {
    font-weight: 600;
    color: var(--text-color-secondary);
}

.product-details__meta dd {
    color: var(--text-color);
}

.product-details__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.genre-tag {
    background-color: var(--primary-variant-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.product-details__content {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.content-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.product-details__reviews {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
}

.reviews-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.review-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.review-item__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.review-item__meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.review-item__text {
    line-height: 1.6;
    color: var(--text-color);
}

/* === 9. Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--surface-color);
    color: var(--text-color);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
}

.pagination .current {
    background-color: var(--primary-color);
    color: white;
}

/* === 10. Footer === */
.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.site-info {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
    color: var(--text-color-secondary);
}

/* === 11. Responsive Design === */
@media (max-width: 480px) {
    .site-content {
        padding: 1rem 0.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .product-details__title {
        font-size: 1.5rem;
    }
    
    .product-details__content,
    .product-details__reviews {
        padding: 1rem;
    }
}

