/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg-deep:    #020617;
    --bg-card:    #0f172a;
    --bg-hover:   #1e293b;
    --primary:    #3b82f6;
    --primary-dk: #2563eb;
    --accent:     #60a5fa;
    --text-main:  #f8fafc;
    --text-muted: #94a3b8;
    --border:     rgba(255, 255, 255, 0.07);
    --glass:      rgba(2, 6, 23, 0.92);
    --radius:     12px;
    --radius-lg:  20px;
    --shadow:     0 4px 24px rgba(0, 0, 0, 0.4);
    --trans:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background:  var(--bg-deep);
    color:       var(--text-main);
    line-height: 1.6;
    min-height:  100vh;
}
img  { max-width: 100%; height: auto; display: block; }
a    { color: inherit; text-decoration: none; }

/* ── Container ─────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}
.logo span { color: var(--primary); }

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}
.main-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.main-nav a:hover { color: var(--text-main); }

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.2rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

/* ── Page hero ─────────────────────────────────────────────── */
.page-hero {
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}
.page-hero h1 {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 10px;
}
.page-hero h1 .accent { color: var(--primary); }
.page-hero p { color: var(--text-muted); font-size: 1.05rem; }

/* ── Articles grid ─────────────────────────────────────────── */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 28px;
    padding-bottom: 72px;
}

/* ── Article card ──────────────────────────────────────────── */
.article-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--trans);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.article-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.12);
}
.article-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.article-card__placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #0f1f3d 0%, #0a1628 50%, #0d1f2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.article-card__placeholder::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.08);
}
.article-card__placeholder::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.06);
}
.article-card__placeholder-title {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(248, 250, 252, 0.75);
    line-height: 1.45;
    text-align: center;
    position: relative;
    z-index: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card__body {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.article-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.article-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text-main);
    transition: color 0.2s;
}
.article-card:hover .article-card__title { color: var(--accent); }
.article-card__excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card__meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Tag badge ─────────────────────────────────────────────── */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: var(--trans);
}
.tag-badge:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: var(--primary);
}

/* ── Single article ────────────────────────────────────────── */
.article-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}
.article-page__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.article-page__title {
    font-size: clamp(1.85rem, 4.5vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-main);
}
.article-page__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}
.article-page__featured {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin: 32px 0;
    box-shadow: var(--shadow);
}

/* ── Article prose ─────────────────────────────────────────── */
.article-content {
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.85;
    margin-top: 32px;
}
.article-content p   { margin-bottom: 1.5em; }
.article-content h2  {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 2.5em 0 0.7em;
    letter-spacing: -0.5px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.article-content h3  {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 2em 0 0.6em;
}
.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-content a:hover { color: var(--text-main); }
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 2em auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.article-content ul,
.article-content ol  { padding-left: 1.75rem; margin-bottom: 1.5em; }
.article-content li  { margin-bottom: 0.5em; }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 2em 0;
    background: rgba(59,130,246,0.07);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
    font-style: italic;
}
.article-content code {
    background: rgba(255,255,255,0.1);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, 'Courier New', monospace;
    font-size: 0.88em;
}
.article-content pre {
    background: #0a0e1a;
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5em 0;
}
.article-content pre code { background: none; padding: 0; font-size: 0.875rem; }

/* ── Video embed (responsivo 16:9) ────────────────────────── */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin: 32px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Ads ───────────────────────────────────────────────────── */
.ad-block { margin: 2.5rem 0; }
.ad-inner {
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(37,99,235,0.06));
    border: 1px solid rgba(59,130,246,0.22);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    text-align: center;
}
.ad-text {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.65;
}
.ad-text strong { color: var(--text-main); }
.ad-btn {
    display: inline-block;
    padding: 10px 26px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dk));
    color: #fff !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--trans);
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
    text-decoration: none !important;
}
.ad-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59,130,246,0.5);
    color: #fff !important;
}

/* ── Related articles ──────────────────────────────────────── */
.newsletter-inline {
    margin-top: 56px;
    padding: 48px 40px;
    background: linear-gradient(135deg, #0f172a 0%, #1e2d4a 100%);
    border: 1px solid rgba(59,130,246,.25);
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.newsletter-inline::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(59,130,246,.15) 0%, transparent 70%);
    pointer-events: none;
}
.newsletter-inline__icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: block;
}
.newsletter-inline h3 {
    font-size: 1.4rem; font-weight: 800;
    margin: 0 0 10px; color: #f8fafc;
    letter-spacing: -.02em;
}
.newsletter-inline p {
    color: #94a3b8; font-size: .92rem;
    margin: 0 0 28px; line-height: 1.65;
    max-width: 380px; margin-left: auto; margin-right: auto;
}
.newsletter-inline__form {
    display: flex; gap: 10px;
    max-width: 440px; margin: 0 auto;
}
.newsletter-inline__form input[type=email] {
    flex: 1; padding: 13px 16px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.06);
    color: #f8fafc; font-size: .92rem; outline: none;
    transition: border-color .2s;
}
.newsletter-inline__form input[type=email]::placeholder { color: #64748b; }
.newsletter-inline__form input[type=email]:focus { border-color: var(--primary); }
.newsletter-inline__form button {
    padding: 13px 22px;
    background: var(--primary);
    color: #fff; border: none; border-radius: 10px;
    font-size: .92rem; font-weight: 700;
    cursor: pointer; white-space: nowrap;
    transition: background .2s;
}
.newsletter-inline__form button:hover { background: var(--primary-dk); }
.newsletter-inline__form button:disabled { opacity: .6; cursor: default; }
#nl-msg { margin-top: 14px; font-size: .85rem; min-height: 20px; }
.newsletter-inline__fine {
    margin-top: 14px; font-size: .75rem; color: #475569;
}
@media (max-width: 520px) {
    .newsletter-inline { padding: 36px 20px; }
    .newsletter-inline__form { flex-direction: column; }
    .newsletter-inline__form button { width: 100%; }
}
.related-section {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.related-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.related-grid .article-card__image,
.related-grid .article-card__placeholder {
    height: 180px;
}

/* ── Tag page ──────────────────────────────────────────────── */
.tag-page-hero {
    padding: 48px 0 32px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
}
.tag-page-hero h1 { font-size: 2rem; font-weight: 800; }
.tag-page-hero h1 span { color: var(--primary); }
.tag-page-hero p { color: var(--text-muted); margin-top: 8px; }

.all-tags-section {
    padding: 48px 0;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}
.all-tags-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.all-tags-list { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 48px 0 40px;
    text-align: center;
    margin-top: 0;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-brand { font-size: 1.25rem; font-weight: 800; }
.footer-brand span { color: var(--primary); }
.footer-nav { display: flex; gap: 24px; }
.footer-nav a { color: var(--text-muted); font-size: 0.875rem; transition: color 0.2s; }
.footer-nav a:hover { color: var(--text-main); }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 0;
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 64px; left: 0; right: 0;
        background: rgba(2, 6, 23, 0.98);
        padding: 20px 24px 28px;
        border-bottom: 1px solid var(--border);
        gap: 18px;
        z-index: 999;
    }
    .main-nav.open a { font-size: 1.05rem; }
    .menu-toggle { display: block; }
    .articles-grid { grid-template-columns: 1fr; gap: 20px; }
    .article-page { padding: 32px 16px 56px; }
    .ad-inner { padding: 22px 18px; }
    .related-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 480px) {
    .article-page__title { font-size: 1.65rem; }
    .related-grid { grid-template-columns: 1fr; }
    .page-hero { padding: 36px 0 28px; }
}
