/* ============================================
   TechPulse Reviews - Shared Styles
   Last updated: 2026-09-30
   ============================================ */

/* === CSS Custom Properties === */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

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

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 8px;
    font-weight: 600; font-size: 14px;
    cursor: pointer; border: none; transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

/* === Top Bar === */
.top-bar { background: var(--bg-dark); color: #cbd5e1; padding: 8px 0; font-size: 12px; position: sticky; top: 0; z-index: 101; }
.top-bar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: #93c5fd; }

/* === Header === */
header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 34px; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 24px; font-weight: 800; color: var(--text); }
.logo span { color: var(--primary); }
.main-nav { display: flex; gap: 24px; align-items: center; }
.main-nav a { color: var(--text-light); font-weight: 500; font-size: 14px; }
.main-nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* === Search === */
.search-toggle { background: none; border: none; cursor: pointer; color: var(--text-light); font-size: 20px; }
.search-bar { background: #fff; border-bottom: 1px solid var(--border); padding: 16px 0; display: none; }
.search-bar.open { display: block; }
.search-bar .container { display: flex; gap: 12px; }
.search-bar input { flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; }

/* Search Results Modal */
.search-results-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; padding-top: 60px; }
.search-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,0.6); z-index: 9998; backdrop-filter: blur(4px); }
.search-results-inner { background: #fff; border-radius: 16px; box-shadow: 0 25px 60px rgba(0,0,0,0.3); width: 90%; max-width: 700px; max-height: 75vh; overflow: hidden; display: flex; flex-direction: column; position: relative; z-index: 9999; }
.search-results-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
.search-results-header h3 { font-size: 18px; font-weight: 700; color: var(--text); }
.search-close-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text-light); padding: 4px 8px; line-height: 1; }
.search-close-btn:hover { color: var(--text); }
.search-results-list { overflow-y: auto; flex: 1; padding: 8px 0; }
.search-result-item { display: block; padding: 16px 24px; text-decoration: none; color: inherit; transition: background .15s; border-bottom: 1px solid #f1f5f9; }
.search-result-item:hover { background: #f8fafc; }
.search-result-category { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--primary); background: #eff6ff; padding: 2px 8px; border-radius: 4px; margin-bottom: 6px; letter-spacing: .5px; }
.search-result-item h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); line-height: 1.4; }
.search-result-item p { font-size: 14px; color: var(--text-light); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-result-date { font-size: 12px; color: var(--text-light); margin-top: 6px; display: block; }
.search-highlight { background: #fef08a; padding: 1px 2px; border-radius: 2px; }
.search-result-count { padding: 16px 24px; font-size: 14px; color: var(--text-light); border-bottom: 1px solid var(--border); background: #f8fafc; }
.no-results { padding: 40px 24px; text-align: center; color: var(--text-light); }

/* === Breadcrumb === */
.breadcrumb { max-width: 1200px; margin: 0 auto; padding: 16px 24px 0; font-size: 13px; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

/* === Category Hero (shared across category pages) === */
.cat-hero { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); color: #fff; padding: 48px 0; text-align: center; }
.cat-hero h1 { font-size: 40px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.cat-hero h1 span { color: #60a5fa; }
.cat-hero p { color: #94a3b8; font-size: 17px; max-width: 600px; margin: 0 auto; }

/* === Section & Cards (shared) === */
.section { padding: 56px 0; }
.section-title { font-size: 30px; font-weight: 800; margin-bottom: 8px; text-align: center; }
.section-sub { color: var(--text-light); text-align: center; margin-bottom: 36px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .2s; }
.card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-img { height: 140px; background: linear-gradient(135deg, #eef2ff, #dbeafe); display: flex; align-items: center; justify-content: center; font-size: 56px; }
.card-body { padding: 20px; }
.card-category { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--primary); letter-spacing: .5px; margin-bottom: 8px; }
.card-title { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 10px; color: var(--text); }
.card:hover .card-title { color: var(--primary); }
.card-excerpt { font-size: 14px; color: var(--text-light); line-height: 1.6; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-light); }
.card-rating { color: var(--primary); font-weight: 700; }

/* === Newsletter === */
.newsletter-section { background: linear-gradient(135deg, var(--primary), #1e3a8a); color: #fff; padding: 56px 0; text-align: center; }
.newsletter-section h2 { font-size: 30px; font-weight: 800; margin-bottom: 12px; }
.newsletter-section p { color: #dbeafe; margin-bottom: 24px; }
.newsletter-form { max-width: 480px; margin: 0 auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.newsletter-form input { flex: 1; min-width: 220px; padding: 12px 16px; border: none; border-radius: 8px; font-size: 15px; font-family: inherit; }

/* === Footer === */
footer { background: var(--bg-dark); color: #94a3b8; padding: 48px 0 24px; }
.footer-grid { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 14px; line-height: 1.6; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 600; text-transform: uppercase; margin-bottom: 16px; }
.footer-col a { display: block; color: #94a3b8; font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { max-width: 1200px; margin: 32px auto 0; padding: 24px 24px 0; border-top: 1px solid #1e293b; display: flex; justify-content: space-between; font-size: 13px; }
.footer-bottom a { color: #94a3b8; }

/* === Responsive === */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .cat-hero h1 { font-size: 30px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
/* === Dark Mode (prefers-color-scheme: dark) === */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --bg-alt: #1e293b;
        --text: #e2e8f0;
        --text-light: #94a3b8;
        --border: #334155;
    }
    header { background: #1e293b; }
    .card { background: #1e293b; }
    .search-bar { background: #1e293b; }
    .search-bar input { background: #0f172a; color: #e2e8f0; }
    .search-results-inner { background: #1e293b; }
    .search-results-header { background: #0f172a; }
    .search-result-item:hover { background: #334155; }
    .card:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
}

/* === Tablet responsive === */
@media (max-width: 1024px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* === Small mobile === */
@media (max-width: 480px) {
    .cards-grid { grid-template-columns: 1fr; }
    .cat-hero h1 { font-size: 24px; }
    .section-title { font-size: 24px; }
    .newsletter-form { flex-direction: column; }
    .newsletter-form input { min-width: auto; width: 100%; }
}

/* === Print styles === */
@media print {
    header, footer, .top-bar, .search-bar, .newsletter-section { display: none !important; }
    body { color: #000; background: #fff; font-size: 12pt; }
    a { color: #000; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
}