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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    background: #f8f9fa;
    line-height: 1.8;
}

/* ── Header ───────────────────────────────────────────────────── */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: black;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: #e63848;
    transition: width 0.3s;
    border-radius: 10px;
}

nav a:hover::after {
    width: 100%;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

#imgLogo {
    height: 40px;
    vertical-align: middle;
}

/* ── Loader ───────────────────────────────────────────────────── */
#article-loader {
    text-align: center;
    padding: 6rem 0;
    color: #764ba2;
    font-size: 1.1rem;
    font-weight: 600;
}

.loader-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(118, 75, 162, 0.2);
    border-top-color: #764ba2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Error ────────────────────────────────────────────────────── */
#article-error {
    display: none;
    text-align: center;
    padding: 6rem 2rem;
}

#article-error p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* ── Article wrapper ──────────────────────────────────────────── */
#article-wrapper {
    display: none;
}

/* ── Hero image ───────────────────────────────────────────────── */
.article-hero {
    width: 100%;
    aspect-ratio: 680 / 200;
    max-height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0ebff 0%, #e8f4ff 100%);
}

.article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-hero-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    font-size: 5rem;
}

/* ── Article layout ───────────────────────────────────────────── */
.article-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.5rem 2rem 5rem;
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #888;
    flex-wrap: wrap;
}

.article-breadcrumb a {
    color: #764ba2;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.article-breadcrumb a:hover {
    color: #e63848;
}

/* ── Meta ─────────────────────────────────────────────────────── */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.article-category {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-date {
    font-size: 0.9rem;
    color: #888;
}

.article-author {
    font-size: 0.9rem;
    color: #888;
}

.article-author::before {
    content: '·';
    margin-right: 0.5rem;
}

/* ── Title ────────────────────────────────────────────────────── */
.article-title {
    font-family: 'Bangers', cursive;
    font-size: 2.8rem;
    color: #1a1a2e;
    letter-spacing: 1px;
    line-height: 1.2;
    margin-bottom: 2rem;
}

/* ── Content ──────────────────────────────────────────────────── */
.article-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
    border: 2px solid #f0ebff;
}

.article-content p {
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    color: #333;
    line-height: 1.9;
}

.article-content h2 {
    font-family: 'Bangers', cursive;
    font-size: 1.9rem;
    color: #764ba2;
    letter-spacing: 1px;
    margin: 2rem 0 0.8rem;
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0063a3;
    margin: 1.5rem 0 0.5rem;
}

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

.article-content li {
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
    color: #333;
    line-height: 1.7;
}

.article-content strong {
    color: #1a1a2e;
    font-weight: 700;
}

.article-content a {
    color: #764ba2;
    text-decoration: underline;
    transition: color 0.2s;
}

.article-content a:hover {
    color: #e63848;
}

.article-content blockquote {
    border-left: 4px solid #764ba2;
    padding: 0.8rem 1.5rem;
    margin: 1.5rem 0;
    background: #f0ebff;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #555;
}

.article-content code {
    background: #f4f4f8;
    padding: 0.15rem 0.4rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e63848;
}

.article-content pre {
    background: #1a1a2e;
    color: #f0f0f0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 1.2rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── Back link ────────────────────────────────────────────────── */
.back-link {
    display: inline-block;
    margin-top: 2.5rem;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    border-radius: 25px;
    font-weight: 700;
    padding: 0.9rem 2rem;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
}

.back-link:hover {
    background: linear-gradient(135deg, #e63848 0%, #764ba2 100%);
    transform: translateY(-2px) scale(1.03);
}

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
    background: linear-gradient(135deg, #4a7fd6 0%, #5e8eea 100%);
    color: #fff;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

/* ── Hamburger ────────────────────────────────────────────────── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #764ba2;
    padding: 0.3rem 0.5rem;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: rgba(118, 75, 162, 0.1);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header {
        padding: 1rem 1.2rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .hamburger-btn {
        display: block;
    }

    nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 1rem 0;
        border-top: 1px solid #eee;
        margin-top: 0.3rem;
    }

    nav.nav-open {
        display: flex;
    }

    nav a {
        width: 100%;
        padding: 0.3rem 0;
    }

    .article-container {
        padding: 1.5rem 1rem 3rem;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-content {
        padding: 1.5rem;
    }

    .article-hero-placeholder {
        height: 160px;
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.7rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    #imgLogo {
        height: 30px;
    }
}

@keyframes pulse {
    0%   { transform: scale(1);    filter: brightness(1); }
    50%  { transform: scale(1.08); filter: brightness(1.2); }
    100% { transform: scale(1);    filter: brightness(1); }
}
