/*
Theme Name: WPA
Author: Dan
Version: 1.0.0
Text Domain: wpa
*/

:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #666;
    --color-border: #e0e0e0;
    --color-link: #0066cc;
    --color-link-hover: #004499;
    --color-accent: #1a73e8;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
    --max-width: 820px;
    --max-width-wide: 1200px;
}

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

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.container-wide { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container-wide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.site-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}

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

.nav-links { list-style: none; display: flex; gap: 1.5rem; }
.nav-links a {
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}
.nav-links a:hover { color: var(--color-accent); text-decoration: none; }

/* Mobile menu toggle */
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    background: var(--color-category-badge-bg);
}

/* Article */
.single-article { padding: 2rem 0 4rem; }

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.article-meta .category-badge {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
    color: var(--color-text);
}

.single-article h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.single-article h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.single-article h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    line-height: 1.4;
}

.single-article p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.single-article ul, .single-article ol {
    margin: 0 0 1.25rem 1.5rem;
}

.single-article li {
    margin-bottom: 0.5rem;
}

.single-article img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.single-article strong { font-weight: 700; }

/* Article footer */
.article-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-footer .tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.article-footer .tag {
    font-size: 0.8rem;
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

/* Homepage grid */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.home-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.home-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.home-card a { color: inherit; text-decoration: none; display: block; }

.home-card .card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #f5f5f5;
}

.home-card .card-body { padding: 1rem 1.25rem 1.5rem; }
.home-card .card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.home-card .card-title {
    font-size: 1.15rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.home-card .card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Homepage intro */
.homepage-intro {
    text-align: center;
    padding: 3rem 1rem 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.homepage-intro h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.homepage-intro p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 0;
}

.pagination .page-numbers {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
}

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

/* Category blocks */
.category-block {
    padding: 2rem 0;
}

.category-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.category-block-title {
    font-size: 1.5rem;
    margin: 0;
}

.category-block-link {
    font-size: 0.9rem;
    font-weight: 500;
}

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

@media (max-width: 768px) {
    .category-block-grid { grid-template-columns: 1fr; }
}

/* Ad slots */
.ad-incontent {
    margin: 2rem 0;
    text-align: center;
    min-height: 100px;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.site-footer .footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.site-footer .footer-links a { color: var(--color-text-muted); }

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        gap: 0;
        padding: 1rem;
    }
    .nav-links.active { display: flex; }
    .nav-links li { padding: 0.5rem 0; }

    .single-article h1 { font-size: 1.5rem; }
    .home-grid { grid-template-columns: 1fr; }
    .homepage-intro h1 { font-size: 1.75rem; }
}
