/* ============================================
   World Political Parties — English Edition Styles
   Designed for international academic audience
   Optimized for Google SEO (performance + readability)
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Typography — Serif for headings (academic feel), Sans for body */
    --font-heading: 'Noto Serif SC', 'Georgia', 'Times New Roman', serif;
    --font-body: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-mono: 'Courier New', Consolas, monospace;

    /* Color Palette — Professional, accessible */
    --color-primary: #1a2a4a;      /* Deep navy blue */
    --color-primary-light: #2c4a7a;
    --color-accent: #c9a84c;       /* Gold — academic/warm */
    --color-accent-light: #e8d9a0;
    --color-red: #8b1a1a;          /* Deep red for accents */
    --color-red-light: #b91c1c;
    --color-text: #1a1a1a;
    --color-text-light: #555555;
    --color-text-muted: #888888;
    --color-bg: #ffffff;
    --color-bg-warm: #faf9f6;
    --color-bg-light: #f5f5f0;
    --color-border: #e0ddd5;
    --color-border-light: #eeece6;

    /* Spacing — Generous whitespace for international readers */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 5rem;

    /* Layout */
    --max-width: 1200px;
    --content-width: 720px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
}

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

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

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--color-red-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: var(--space-md);
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
}

/* Accessibility: screen-reader only */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    z-index: 1000;
    transition: top var(--transition-base);
}

.skip-link:focus {
    top: 0;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Top bar: ISSN + date */
.header-top {
    background: var(--color-bg-warm);
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    padding: var(--space-xs) 0;
}

.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.journal-info {
    display: flex;
    gap: var(--space-lg);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.lang-switch {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.lang-switch:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.search-toggle {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.search-toggle:hover {
    color: var(--color-primary);
}

/* Main header: title + subscribe */
.header-main {
    padding: var(--space-md) 0;
    border-bottom: 3px solid var(--color-red);
}

.header-main-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    display: flex;
    flex-direction: column;
}

.title-main {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.title-sub {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 400;
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}

/* Subscribe button */
.btn-subscribe {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: linear-gradient(135deg, var(--color-red) 0%, #7F1D1D 100%);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-subscribe::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}

.btn-subscribe:hover {
    background: #fff;
    color: var(--color-red);
    border: 1px solid var(--color-red);
}

.btn-subscribe:hover::after {
    left: 100%;
}

/* ---------- Navigation ---------- */
.main-nav {
    background: var(--color-primary);
    position: relative;
}

.nav-list {
    display: flex;
    gap: 0;
}

.nav-list a {
    color: rgba(255, 255, 255, 0.85);
    padding: var(--space-sm) var(--space-md);
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: var(--color-accent);
}

/* Mobile toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-sm);
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    transition: all var(--transition-base);
}

/* ---------- Search Overlay ---------- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
}

.search-overlay[hidden] {
    display: none;
}

.search-inner {
    width: 90%;
    max-width: 600px;
    position: relative;
}

.search-inner form {
    display: flex;
    gap: var(--space-sm);
}

.search-inner input[type="search"] {
    flex: 1;
    padding: var(--space-md);
    font-size: 1.2rem;
    border: none;
    border-radius: 4px;
    outline: none;
}

.search-inner button {
    background: var(--color-accent);
    color: var(--color-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: 4px;
    font-weight: 600;
}

.search-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* ---------- Hero Section ---------- */
.hero-section {
    padding: var(--space-xl) 0;
    background: var(--color-bg-warm);
    border-bottom: 1px solid var(--color-border-light);
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.hero-main .hero-image {
    position: relative;
    margin-bottom: var(--space-md);
    border-radius: 6px;
    overflow: hidden;
}

.hero-main .hero-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.hero-main .article-category {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    background: var(--color-red-light);
    color: #fff;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 3px;
}

.hero-main h2 {
    font-size: 1.8rem;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.hero-main h2 a {
    color: var(--color-primary);
}

.hero-main h2 a:hover {
    color: var(--color-red-light);
}

.article-excerpt {
    color: var(--color-text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.article-meta {
    display: flex;
    gap: var(--space-md);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.article-meta .author {
    font-weight: 600;
    color: var(--color-text-light);
}

/* Sidebar articles */
.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    border-left: 1px solid var(--color-border-light);
    padding-left: var(--space-lg);
}

.sidebar-article {
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.sidebar-article:last-child {
    border-bottom: none;
}

.sidebar-article h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--space-xs);
}

.sidebar-article h3 a {
    color: var(--color-text);
}

.sidebar-article h3 a:hover {
    color: var(--color-red-light);
}

.sidebar-article .date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ---------- Section Headers ---------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-primary);
}

.section-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0;
    position: relative;
}

.section-link {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.section-link:hover {
    color: var(--color-red-light);
}

/* ---------- Latest Articles Grid ---------- */
.section-latest {
    padding: var(--space-xxl) 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

/* Article Card */
.article-card {
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    overflow: hidden;
    transition: all var(--transition-base);
    background: var(--color-bg);
}

.article-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-link {
    display: block;
    color: inherit;
}

.card-link:hover {
    color: inherit;
}

.card-image {
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.article-card:hover .card-image img {
    transform: scale(1.03);
}

.card-category {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: var(--color-primary);
    color: #fff;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 3px;
}

.card-content {
    padding: var(--space-md);
}

.card-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.card-meta .author {
    font-weight: 600;
}

/* ---------- Channel Sections ---------- */
.section-channels {
    padding: var(--space-xxl) 0;
    background: var(--color-bg-light);
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

.channel-block {
    background: var(--color-bg);
    padding: var(--space-lg);
    border-radius: 6px;
    border: 1px solid var(--color-border-light);
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-accent);
}

.channel-header h3 {
    margin-bottom: 0;
    font-size: 1.15rem;
}

.channel-header h3 a {
    color: var(--color-primary);
}

.channel-link {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.channel-link:hover {
    color: var(--color-red-light);
}

.channel-articles li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.channel-articles li:last-child {
    border-bottom: none;
}

.channel-articles a {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.5;
    display: block;
    padding: var(--space-xs) 0;
    transition: all var(--transition-fast);
}

.channel-articles a:hover {
    color: var(--color-red-light);
    padding-left: var(--space-sm);
}

/* ---------- Newsletter ---------- */
.section-newsletter {
    padding: var(--space-xxl) 0;
    background: var(--color-primary);
    color: #fff;
}

.newsletter-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xl);
}

.newsletter-content h2 {
    color: #fff;
    margin-bottom: var(--space-xs);
}

.newsletter-content p {
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0;
}

.newsletter-form {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.newsletter-form input[type="email"] {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 4px;
    font-size: 0.95rem;
    min-width: 280px;
}

.newsletter-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-primary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-primary:hover {
    background: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-xxl) 0 var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-brand h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-primary);
}

.footer-col h4 {
    color: var(--color-accent);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-col ul li {
    margin-bottom: var(--space-sm);
}

.footer-col a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35);
}

.footer-legal {
    display: flex;
    gap: var(--space-md);
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
}

.footer-legal a:hover {
    color: #fff;
}

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
    z-index: 99;
}

.back-to-top:hover {
    background: var(--color-red-light);
    transform: translateY(-2px);
}

/* ---------- Responsive ---------- */

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

    .hero-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--color-border-light);
        padding-top: var(--space-lg);
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .channels-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .newsletter-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        font-size: 15px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Navigation */
    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-primary);
        padding: var(--space-md) 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .nav-list.is-open {
        display: flex;
    }

    .nav-list a {
        padding: var(--space-md);
        border-bottom: none;
    }

    .mobile-toggle {
        display: flex;
    }

    /* Hero */
    .hero-section {
        padding: var(--space-lg) 0;
    }

    .hero-main h2 {
        font-size: 1.4rem;
    }

    /* Articles grid */
    .articles-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }

    .newsletter-form input[type="email"] {
        min-width: auto;
        width: 100%;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .title-main {
        font-size: 1.4rem;
    }

    .header-main-inner {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }

    .btn-subscribe {
        align-self: flex-start;
    }
}

/* ---------- Reading Progress Bar ---------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 101;
}

.reading-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: var(--color-accent);
    transition: width 0.1s linear;
}

/* ---------- Print Styles ---------- */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .search-overlay,
    .section-newsletter {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        color: #000;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #555;
    }
}
