/* ============================================
   BuscoSerSano - Frontend Styles
   Theme: Clean/Green Health & Wellness
   ============================================ */

:root {
    --primary: #1a8a4a;
    --primary-dark: #147039;
    --primary-light: #e8f5e9;
    --secondary: #2e7d32;
    --accent: #4caf50;
    --text: #1a1a2e;
    --text-light: #555;
    --text-muted: #888;
    --bg: #ffffff;
    --bg-light: #f8faf9;
    --bg-card: #ffffff;
    --border: #e8ece9;
    --border-light: #f0f4f1;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: Georgia, 'Times New Roman', serif;
    --max-width: 1200px;
    --max-narrow: 800px;
}

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

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: var(--max-narrow); }

.text-muted { color: var(--text-muted); }

/* ============================================
   HEADER
   ============================================ */

.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}

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

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon { font-size: 28px; }
.logo-text { color: var(--primary); }

.main-nav { display: flex; gap: 24px; }

.nav-link {
    color: var(--text-light);
    font-weight: 500;
    font-size: 15px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-switcher {
    display: flex;
    gap: 4px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.lang-switcher a {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}
.lang-switcher a.active {
    background: var(--primary);
    color: white;
}

.search-toggle, .menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
}

.search-bar {
    display: none;
    padding: 12px 0 16px;
}
.search-bar.open { display: block; }
.search-bar form {
    display: flex;
    gap: 8px;
}
.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border 0.2s;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
.search-bar button {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
}

/* ============================================
   HERO
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary-light) 0%, #d4edda 100%);
    padding: 60px 20px;
    text-align: center;
}
.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 5vw, 42px);
    color: var(--primary-dark);
    margin-bottom: 12px;
}
.hero p {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   POST GRID
   ============================================ */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    padding: 40px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.posts-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-light);
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-content { padding: 20px; }

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
}

.post-category {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.post-category:hover { background: var(--primary); color: white; }

.post-card-content h2, .post-card-content h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 8px;
}
.post-card-content h2 a, .post-card-content h3 a {
    color: var(--text);
}
.post-card-content h2 a:hover, .post-card-content h3 a:hover {
    color: var(--primary);
}

.post-card-content p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* ============================================
   SINGLE POST
   ============================================ */

.post-header {
    padding: 48px 20px 24px;
    text-align: center;
}

.post-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.3;
    margin: 12px 0;
    color: var(--text);
}

.post-meta { margin-bottom: 4px; }
.post-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
    flex-wrap: wrap;
}

.post-featured-image {
    margin: 24px 0;
}
.post-featured-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.post-body {
    padding: 32px 20px;
    font-size: 17px;
    line-height: 1.8;
}
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
    font-family: var(--font-heading);
    margin: 32px 0 16px;
    color: var(--text);
}
.post-body h2 { font-size: 24px; }
.post-body h3 { font-size: 20px; }
.post-body p { margin-bottom: 20px; }
.post-body ul, .post-body ol { margin: 16px 0; padding-left: 24px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-light);
}
.post-body code {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.post-body pre {
    background: var(--text);
    color: #e8f5e9;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 24px 0;
}
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body img { border-radius: var(--radius-sm); margin: 20px 0; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.post-body a { color: var(--primary); border-bottom: 1px solid var(--primary-light); }
.post-body a:hover { border-bottom-color: var(--primary); }

.post-tags {
    padding: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.tag {
    background: var(--bg-light);
    color: var(--text-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s;
    border: 1px solid var(--border);
}
.tag:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ============================================
   RELATED POSTS
   ============================================ */

.related-posts {
    padding: 48px 20px;
    background: var(--bg-light);
}
.related-posts h2 {
    text-align: center;
    font-family: var(--font-heading);
    margin-bottom: 24px;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar { position: sticky; top: 90px; align-self: start; }

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}
.widget h3 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    color: var(--primary-dark);
}

.widget-list { list-style: none; }
.widget-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.widget-list li a:hover { color: var(--primary); }
.widget-list .count {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.widget-post {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.widget-post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.widget-post a {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--text);
}
.widget-post a:hover { color: var(--primary); }
.widget-post-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.widget-post-title {
    font-size: 14px;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}
.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.2s;
}
.page-link:hover, .page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   ARCHIVE HEADER
   ============================================ */

.archive-header {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.archive-header h1 {
    font-family: var(--font-heading);
    font-size: 28px;
}
.archive-header small { display: block; color: var(--text-muted); margin-top: 4px; }

/* ============================================
   SEARCH
   ============================================ */

.search-page { padding: 40px 0; }
.search-page h1 { font-family: var(--font-heading); margin-bottom: 24px; }

.search-form-lg {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.search-form-lg input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
}
.search-form-lg input:focus { outline: none; border-color: var(--primary); }

.post-list-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}
.post-list-item h2 { font-family: var(--font-heading); font-size: 20px; margin-bottom: 8px; }
.post-list-item p { color: var(--text-light); font-size: 15px; }

/* ============================================
   ERROR PAGE
   ============================================ */

.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page h1 {
    font-size: 120px;
    color: var(--primary);
    font-family: var(--font-heading);
    line-height: 1;
}
.error-page p { font-size: 18px; color: var(--text-light); margin: 16px 0 24px; }

/* ============================================
   ADS
   ============================================ */

.ad-container {
    text-align: center;
    margin: 24px 0;
    opacity: 0.9;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}
.btn:hover { background: var(--bg-light); color: var(--text); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ============================================
   PAGE CONTENT
   ============================================ */

.page-content { padding: 48px 0; }
.page-content h1 {
    font-family: var(--font-heading);
    font-size: 32px;
    margin-bottom: 24px;
    color: var(--text);
}
.page-content h2 { font-size: 24px; margin: 32px 0 12px; }
.page-content p { margin-bottom: 16px; color: var(--text-light); }
.page-content ul, .page-content ol { margin: 16px 0; padding-left: 24px; }
.page-content li { margin-bottom: 8px; color: var(--text-light); }

.contact-form { max-width: 600px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    transition: border 0.2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--text);
    color: #ccc;
    padding: 48px 20px 24px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-col h3, .footer-col h4 {
    color: white;
    margin-bottom: 16px;
    font-size: 16px;
}
.footer-col p { font-size: 14px; line-height: 1.6; }
.footer-col nav { display: flex; flex-direction: column; gap: 8px; }
.footer-col nav a { color: #aaa; font-size: 14px; }
.footer-col nav a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #888;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .posts-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }
    .main-nav.open { display: flex; }
    .header-inner { height: 60px; }
    .posts-grid, .posts-grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero { padding: 40px 20px; }
    .post-body { font-size: 16px; }
}

@media (max-width: 480px) {
    .search-form-lg { flex-direction: column; }
    .post-info { flex-direction: column; gap: 4px; }
}
