/*
Theme Name: English Topics
Theme URI: https://englishtopics.net
Author: English Topics Team
Description: Modern educational theme for English language learning website. Clean, readable design with academic feel.
Version: 1.0.0
Text Domain: englishtopics
Tags: education, one-column, two-columns, right-sidebar, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, threaded-comments, translation-ready
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

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

:root {
    --primary: #1a365d;
    --primary-light: #2b6cb0;
    --primary-dark: #0f2440;
    --accent: #e53e3e;
    --accent-light: #fc8181;
    --bg: #f7fafc;
    --bg-white: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
    --content-width: 780px;
    --sidebar-width: 320px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Merriweather', Georgia, 'Times New Roman', serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s;
}

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

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

/* Header */
.site-header {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

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

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

.site-logo {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
}

.site-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.site-title a {
    color: #fff;
}

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

.site-description {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    display: none;
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.main-navigation a {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a,
.main-navigation .current_page_item a {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

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

/* Hero / Featured area */
.site-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 3rem 1.5rem;
    text-align: center;
}

.site-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.site-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Layout */
.site-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 2.5rem;
}

.content-area {
    min-width: 0;
}

/* Cards */
.post-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid var(--border-light);
}

.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.post-card .entry-header {
    margin-bottom: 1rem;
}

.post-card .entry-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.post-card .entry-title a {
    color: var(--text);
}

.post-card .entry-title a:hover {
    color: var(--primary-light);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-card .entry-content {
    color: var(--text);
    line-height: 1.75;
}

.post-card .entry-content p {
    margin-bottom: 0.75rem;
}

.post-card .read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.post-card .read-more:hover {
    color: var(--accent);
}

/* Category badge */
.category-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Single post */
.single-post .content-area {
    max-width: var(--content-width);
}

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

.entry-header-single .entry-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.entry-content {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.85;
}

.entry-content h2 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--primary-dark);
}

.entry-content h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--primary);
}

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

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.4rem;
}

.entry-content blockquote {
    border-left: 4px solid var(--accent);
    background: #fff5f5;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text);
}

.entry-content code {
    background: var(--border-light);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

.entry-content pre {
    background: var(--primary-dark);
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.6;
}

.entry-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.entry-content th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.entry-content tr:nth-child(even) {
    background: var(--border-light);
}

/* Sidebar */
.widget-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.widget ul {
    list-style: none;
}

.widget ul li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--text);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget ul li a:hover {
    color: var(--primary-light);
}

.widget ul li .count {
    background: var(--border-light);
    color: var(--text-light);
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Search widget */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
    outline: none;
}

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

.search-form button {
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-sans);
}

.search-form button:hover {
    background: var(--primary-light);
}

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

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Footer */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 3rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.footer-section ul li a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* Page layout */
.page-template .content-area {
    max-width: var(--content-width);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header .page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.archive-header {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.archive-header .archive-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.archive-header .archive-description {
    color: var(--text-light);
    margin-top: 0.5rem;
}

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

.error-404 .error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.3;
    line-height: 1;
}

.error-404 h1 {
    font-size: 1.75rem;
    margin: 1rem 0 0.5rem;
    color: var(--primary-dark);
}

.error-404 p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Search results */
.search-results .post-card .entry-title {
    font-size: 1.2rem;
}

.highlight {
    background: #fefcbf;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--text-light);
}

.breadcrumbs a:hover {
    color: var(--primary-light);
}

.breadcrumbs .separator {
    margin: 0 0.4rem;
    opacity: 0.5;
}

/* Accessibility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 1024px) {
    .site-content {
        grid-template-columns: 1fr;
    }

    .sidebar-widget-area {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
        width: 100%;
        order: 3;
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        padding: 0.5rem 0;
    }

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

    .site-hero h1 {
        font-size: 1.6rem;
    }

    .entry-header-single .entry-title {
        font-size: 1.5rem;
    }

    .post-card {
        padding: 1.25rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .site-content {
        padding: 1rem;
    }

    .site-hero {
        padding: 2rem 1rem;
    }

    .level-filter__buttons {
        flex-wrap: wrap;
    }
}

/* Level Filter */
.level-filter {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.level-filter__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.level-filter__buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.level-filter__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--bg);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.level-filter__btn:hover {
    background: var(--primary-light);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.level-filter__btn.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.level-filter__btn--A2 {
    border-color: #48bb78;
}

.level-filter__btn--A2.is-active,
.level-filter__btn--A2:hover {
    background: #48bb78;
    border-color: #48bb78;
}

.level-filter__btn--B1 {
    border-color: #4299e1;
}

.level-filter__btn--B1.is-active,
.level-filter__btn--B1:hover {
    background: #4299e1;
    border-color: #4299e1;
}

.level-filter__btn--B2 {
    border-color: #ed8936;
}

.level-filter__btn--B2.is-active,
.level-filter__btn--B2:hover {
    background: #ed8936;
    border-color: #ed8936;
}

.level-filter__btn--C1 {
    border-color: #e53e3e;
}

.level-filter__btn--C1.is-active,
.level-filter__btn--C1:hover {
    background: #e53e3e;
    border-color: #e53e3e;
}

/* Level Badge in Post Card */
.level-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.level-badge--A2 {
    background: #c6f6d5;
    color: #22543d;
}

.level-badge--B1 {
    background: #bee3f8;
    color: #2a4365;
}

.level-badge--B2 {
    background: #feebc8;
    color: #7b341e;
}

.level-badge--C1 {
    background: #fed7d7;
    color: #742a2a;
}
