/* ====================================
   GhanaMarketer - Frontend Styles
   Carbon Design principles inspired
   ==================================== */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1800ad;
    --primary-dark: #120082;
    --text: #161616;
    --text-secondary: #525252;
    --bg: #ffffff;
    --bg-alt: #f4f4f4;
    --border: #e0e0e0;
    --max-width: 1200px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); line-height: 1.6; background: var(--bg); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Typography */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 600; }
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }

/* Header */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}

.nav { display: flex; align-items: center; height: 64px; gap: 2rem; }

.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.4rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.logo:hover { text-decoration: none; opacity: 0.88; }
.logo-img { height: 40px; width: auto; display: block; }

.nav-menu { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }

.nav-link { color: var(--text-secondary); font-weight: 500; font-size: 0.9375rem; padding: 0.5rem 0; position: relative; }
.nav-link:hover { color: var(--primary); text-decoration: none; }
.nav-link-accent { color: var(--primary); font-weight: 600; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 4px 0; }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 200px; padding: 0.5rem 0; z-index: 200; }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-link { display: block; padding: 0.5rem 1rem; color: var(--text-secondary); font-size: 0.875rem; }
.dropdown-link:hover { background: var(--bg-alt); text-decoration: none; }

/* Flash Messages */
.flash-messages { margin: 1rem auto; }
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 0.5rem; font-size: 0.875rem; display: flex; justify-content: space-between; align-items: center; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; opacity: 0.7; }
.alert-close:hover { opacity: 1; }

/* Hero */
.hero { background: var(--bg-alt); padding: 4rem 0; text-align: center; }
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.125rem; max-width: 600px; margin: 0 auto; }

/* Posts Grid */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 2rem; padding: 3rem 0; }

.post-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.2s; background: var(--bg); }
.post-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.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-body { padding: 1.25rem; }
.post-card-meta { display: flex; gap: 1rem; font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.post-card-categories a { color: var(--primary); font-weight: 500; }
.post-card-categories a::after { content: ', '; }
.post-card-categories a:last-child::after { content: ''; }
.post-card-title { font-size: 1.25rem; margin-bottom: 0.5rem; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary); text-decoration: none; }
.post-card-excerpt { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { font-size: 0.875rem; font-weight: 600; color: var(--primary); }

/* Single Post */
.single-post { max-width: 800px; margin: 2rem auto; padding: 0 20px; }
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: 2rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.post-author { font-weight: 600; color: var(--text); }
.post-categories a { color: var(--primary); font-weight: 500; }
.post-featured-image { margin-bottom: 2rem; border-radius: var(--radius); overflow: hidden; }
.post-content { font-size: 1.0625rem; line-height: 1.8; }
.post-content p { margin-bottom: 1.25rem; }
.post-content h2 { margin-top: 2rem; }
.post-content h3 { margin-top: 1.5rem; }
.post-content img { border-radius: var(--radius); margin: 1rem 0; }
.post-content blockquote { border-left: 4px solid var(--primary); padding-left: 1rem; margin: 1rem 0; font-style: italic; color: var(--text-secondary); }
.post-content ul, .post-content ol { margin-bottom: 1rem; padding-left: 2rem; }
.post-tags { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.tag-link { display: inline-block; padding: 0.25rem 0.75rem; background: var(--bg-alt); border-radius: 20px; font-size: 0.8125rem; color: var(--text-secondary); margin: 0.25rem; }
.tag-link:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* Ad units */
.ad-container { margin: 2rem 0; min-height: 90px; text-align: center; overflow: hidden; }

/* Static pages (About, Contact, Privacy) */
.page-static .post-content h2 { margin-top: 1.75rem; }
.page-static .post-content ul { margin-bottom: 1rem; padding-left: 1.5rem; }

/* Archive header */
.archive-header { padding: 2rem 0; }
.archive-header h1 { margin-bottom: 0.5rem; }

/* Search */
.search-header { padding: 2rem 0; }
.search-form { display: flex; gap: 0.5rem; margin: 1rem 0; }
.search-input { flex: 1; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: 1rem; }
.search-input:focus { outline: none; border-color: var(--primary); }

/* Contact form */
.contact-form { max-width: 640px; margin-top: 1.5rem; }
.contact-form .form-field { margin-bottom: 1rem; }
.contact-form label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--text); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea { width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: 1rem; color: var(--text); background: #fff; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(24,0,173,0.15); }
.contact-form textarea { resize: vertical; min-height: 140px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Buttons */
.btn { display: inline-block; padding: 0.625rem 1.25rem; border-radius: var(--radius); font-family: var(--font); font-size: 0.875rem; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

/* Load more (infinite scroll) */
.load-more { display: flex; justify-content: center; padding: 0.5rem 0 3.5rem; }
.load-more .btn { min-width: 220px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.5rem; padding: 2rem 0; }
.page-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; color: var(--text); text-decoration: none; }
.page-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Footer */
.site-footer { background: var(--primary); color: #fff; padding: 3rem 0 1.5rem; margin-top: 4rem; }
.site-footer h4 { color: #fff; margin-bottom: 1rem; }
.site-footer p { color: rgba(255,255,255,0.75); }
.site-footer a { color: rgba(255,255,255,0.75); display: block; margin-bottom: 0.5rem; font-size: 0.875rem; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.2); padding-top: 1.5rem; text-align: center; }
.footer-bottom p { margin-bottom: 0; font-size: 0.8125rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem; color: var(--text-secondary); }
.empty-state h2 { color: var(--text); }

/* Error page */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: 2rem; }
.error-page h1 { font-size: 6rem; color: var(--primary); margin-bottom: 0; }
.error-page h2 { margin-bottom: 1rem; }
.error-page p { margin-bottom: 2rem; }

/* Responsive */
@media (max-width: 768px) {
    .nav-menu { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 1rem; gap: 0.75rem; }
    .nav-menu.active { display: flex; }
    .nav-toggle { display: block; }
    .posts-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    h1 { font-size: 1.75rem; }
    .hero h1 { font-size: 1.75rem; }
    .post-header h1 { font-size: 1.5rem; }
}