/**
 * TechPulse Theme - Fast, Responsive, Clean Editorial Styling
 * Designed for 100/100 Core Web Vitals & AdSense Optimization
 */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;
    --white:     #ffffff;
    --radius:    10px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow:    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: "Georgia", Cambria, "Times New Roman", Times, serif;
}

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

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

body {
    font-family: var(--font-sans);
    color: var(--slate-800);
    background-color: var(--slate-50);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--primary-hover);
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

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

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}
.brand-logo .brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}
.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--slate-700);
    padding: 0.5rem 0.25rem;
    position: relative;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--slate-700);
}
.mobile-menu-btn svg {
    width: 28px;
    height: 28px;
}

/* Mobile Nav Drawer */
.mobile-drawer {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--white);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 40;
    border-top: 1px solid var(--slate-200);
}
.mobile-drawer.open {
    display: block;
}
.mobile-drawer .nav-link {
    display: block;
    padding: 0.85rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--slate-100);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(180deg, var(--white) 0%, var(--slate-100) 100%);
    padding: 3.5rem 0 3rem;
    border-bottom: 1px solid var(--slate-200);
    text-align: center;
}
.hero-badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
}
.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--slate-900);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--slate-600);
    max-width: 750px;
    margin: 0 auto 1.5rem;
}

/* Category Pills Bar */
.category-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.cat-pill {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    background-color: var(--white);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
    transition: all 0.2s ease;
}
.cat-pill:hover, .cat-pill.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Main Content Layout */
.main-wrapper {
    flex: 1;
    padding: 3rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
}
.content-grid.single-col {
    grid-template-columns: 1fr;
    max-width: 820px;
    margin: 0 auto;
}

/* Article Cards Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

.article-card {
    background-color: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-header-gradient {
    height: 120px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}
.gradient-1 { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.gradient-2 { background: linear-gradient(135deg, #065f46, #10b981); }
.gradient-3 { background: linear-gradient(135deg, #581c87, #a855f7); }
.gradient-4 { background: linear-gradient(135deg, #9a3412, #f97316); }

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--slate-500);
    margin-bottom: 0.75rem;
}
.card-category {
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--slate-900);
    margin-bottom: 0.75rem;
}
.card-title a {
    color: inherit;
}
.card-title a:hover {
    color: var(--primary);
}

.card-excerpt {
    font-size: 0.925rem;
    color: var(--slate-600);
    margin-bottom: 1.25rem;
    flex: 1;
    line-height: 1.55;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--slate-100);
    font-size: 0.8rem;
    color: var(--slate-500);
}
.read-more-link {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Sidebar Widgets */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background-color: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
    position: relative;
}
.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 35px;
    height: 2px;
    background-color: var(--primary);
}

.widget-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.widget-list-item {
    font-size: 0.9rem;
}
.widget-list-item a {
    color: var(--slate-700);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.15s ease;
}
.widget-list-item a:hover {
    color: var(--primary);
}
.badge-count {
    background-color: var(--slate-100);
    color: var(--slate-600);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
}

/* Single Article Styling */
.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--slate-200);
}
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--slate-500);
    margin-bottom: 1rem;
}
.breadcrumbs a {
    color: var(--slate-600);
}
.breadcrumbs span {
    margin: 0 0.5rem;
    color: var(--slate-400);
}

.single-title {
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--slate-900);
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}

.single-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.9rem;
    color: var(--slate-500);
    flex-wrap: wrap;
}
.author-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--slate-700);
}
.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Article Body Typography */
.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--slate-800);
}
.article-body p {
    margin-bottom: 1.5rem;
}
.article-body .lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--slate-700);
    font-weight: 400;
    margin-bottom: 1.75rem;
}
.article-body h2 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-top: 2.25rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}
.article-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--slate-900);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}
.article-body ul, .article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.75rem;
}
.article-body li {
    margin-bottom: 0.6rem;
}
.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    background-color: var(--primary-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.75rem 0;
    font-style: italic;
    color: var(--slate-800);
}
.article-body code {
    background-color: var(--slate-100);
    color: #be185d;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: monospace;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.95rem;
}
.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    border: 1px solid var(--slate-200);
    text-align: left;
}
.data-table th {
    background-color: var(--slate-100);
    font-weight: 700;
    color: var(--slate-900);
}

/* Author Box */
.author-box {
    background-color: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin: 2.5rem 0;
    display: flex;
    gap: 1.25rem;
    align-items: center;
}
.author-box-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.author-box-content h4 {
    font-size: 1.15rem;
    color: var(--slate-900);
    margin-bottom: 0.35rem;
}
.author-box-content p {
    font-size: 0.9rem;
    color: var(--slate-600);
    line-height: 1.5;
}

/* Related Articles */
.related-section {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--slate-200);
}
.related-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 1.5rem;
}

/* AdSense Slot Placeholder */
.ad-slot-placeholder {
    background-color: var(--slate-100);
    border: 1px dashed var(--slate-300);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    color: var(--slate-500);
    font-size: 0.85rem;
    margin: 2rem 0;
    letter-spacing: 0.02em;
}

/* Static Pages (About, Privacy, Contact, etc.) */
.page-container {
    background-color: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--slate-200);
}
.page-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: 0.5rem;
}
.page-header p {
    color: var(--slate-500);
    font-size: 0.95rem;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 650px;
    margin-top: 1.5rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--slate-700);
}
.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--slate-300);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
textarea.form-control {
    min-height: 140px;
    resize: vertical;
}
.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    align-self: flex-start;
    transition: background-color 0.15s ease;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}
.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

/* Footer */
.site-footer {
    background-color: var(--slate-900);
    color: var(--slate-400);
    padding: 4rem 0 2rem;
    margin-top: auto;
    font-size: 0.925rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.footer-logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--white);
}
.footer-col h5 {
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.footer-links a {
    color: var(--slate-400);
    transition: color 0.15s ease;
}
.footer-links a:hover {
    color: var(--white);
}
.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--slate-800);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    max-width: 500px;
    background-color: var(--slate-900);
    color: var(--white);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: none;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid var(--slate-700);
}
.cookie-banner.show {
    display: block;
}
.cookie-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}
.btn-cookie-accept {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}
.btn-cookie-decline {
    background: transparent;
    color: var(--slate-300);
    border: 1px solid var(--slate-600);
    padding: 0.45rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}
@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .hero-title {
        font-size: 2rem;
    }
    .single-title {
        font-size: 1.85rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .page-container {
        padding: 1.5rem;
    }
}
