/* ==========================================================================
   SmartMorangos Blog — Lightweight CSS (no framework dependencies)
   Optimized for SEO Core Web Vitals (CLS, LCP, FID)
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand-primary: #25854c;
    --brand-primary-light: #f0f9f4;
    --brand-primary-dark: #1e6b3d;
    --brand-red: #c41e3a;
    --text-primary: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --bg-white: #fff;
    --bg-light: #f8f9fa;
    --bg-dark: #343a40;
    --border-color: #e5e7eb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --max-width: 1200px;
    --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Utility ---------- */
.blog-container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.text-muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.6rem 1.5rem; border-radius: 30px; font-weight: 600;
    font-size: 0.95rem; border: 2px solid transparent;
    cursor: pointer; transition: all var(--transition);
    text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); box-shadow: 0 4px 10px rgba(37,133,76,0.2); }
.btn-primary:hover { background: var(--brand-primary-dark); border-color: var(--brand-primary-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(37,133,76,0.3); }
.btn-outline { background: transparent; color: var(--brand-primary); border-color: var(--brand-primary); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.btn-outline:hover { background: rgba(37,133,76,0.05); box-shadow: 0 3px 8px rgba(0,0,0,0.15); }
.btn-block { width: 100%; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0.8rem 0;
}
.header-container {
    max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
}
.logo-link { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-text { font-weight: 700; font-size: 1.6rem; color: var(--brand-red); }
.header-nav { display: flex; gap: 0.25rem; align-items: center; }
.nav-link {
    color: rgba(0, 0, 0, 0.75); font-weight: 500; font-size: 0.95rem;
    transition: all 0.2s ease; text-decoration: none;
    margin: 0 0.85rem; position: relative; padding-bottom: 5px;
}
.nav-link:hover { color: var(--brand-primary); transform: translateY(-1px); }
.nav-link::after {
    content: ''; position: absolute; width: 0; height: 3px;
    bottom: 0; left: 50%; transform: translateX(-50%);
    background-color: var(--brand-primary); transition: width 0.3s ease; border-radius: 1px;
}
.nav-link:hover::after { width: 80%; }
.header-actions { display: flex; gap: 0.5rem; }

/* ---------- Blog Hero ---------- */
.blog-hero {
    background: linear-gradient(120deg, #d93a54 0%, #a11830 100%);
    color: #fff; padding: 2.5rem 0 2rem; text-align: center;
    position: relative; overflow: hidden;
}
.blog-hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.blog-hero-label {
    display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; background: rgba(255,255,255,0.15); padding: 0.3rem 1rem;
    border-radius: 20px; margin-bottom: 0.75rem; backdrop-filter: blur(4px);
}
.blog-hero h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.4rem; position: relative; }
.blog-hero-subtitle { font-size: 1rem; opacity: 0.85; max-width: 560px; margin: 0 auto; line-height: 1.5; position: relative; }

/* ---------- Blog Content Area ---------- */
.blog-content-area {
    display: grid; grid-template-columns: 1fr 320px; gap: 2.5rem;
    padding-top: 2.5rem; padding-bottom: 4rem;
}
.blog-main { min-width: 0; }

/* ---------- Post Card Grid ---------- */
.post-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem;
}
.post-card {
    background: var(--bg-white); border: 1px solid var(--border-color);
    border-radius: var(--radius); overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card-image-link img {
    width: 100%; height: 200px; object-fit: cover;
    transition: transform 0.3s ease;
}
.post-card:hover .post-card-image-link img { transform: scale(1.03); }
.post-card-body { padding: 1.25rem; }
.post-card-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; font-size: 0.85rem; }
.post-category {
    background: var(--brand-primary-light); color: var(--brand-primary);
    padding: 0.15rem 0.6rem; border-radius: 20px; font-weight: 600; font-size: 0.8rem;
}
.post-date { color: var(--text-muted); }
.post-card-title { font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.5rem; }
.post-card-title a { color: var(--text-primary); }
.post-card-title a:hover { color: var(--brand-primary); }
.post-card-summary { color: var(--text-secondary); font-size: 0.93rem; line-height: 1.6; margin-bottom: 1rem; }
.post-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.read-time { color: var(--text-muted); }
.read-more { font-weight: 600; color: var(--brand-primary); }

/* ---------- Sidebar ---------- */
.blog-sidebar { position: sticky; top: 80px; align-self: start; }
.sidebar-card {
    background: var(--bg-white); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.sidebar-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.sidebar-cta { background: var(--brand-primary-light); border-color: rgba(37,133,76,0.15); }
.sidebar-cta p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; }
.category-list { list-style: none; }
.category-list li { margin-bottom: 0.5rem; }
.category-list a { color: var(--text-secondary); font-weight: 500; font-size: 0.93rem; }
.category-list a:hover, .category-list a.active { color: var(--brand-primary); font-weight: 600; }

/* ---------- Article (Post Page) ---------- */
.blog-article { max-width: 800px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.article-header { margin-bottom: 2rem; }

.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-primary); }
.breadcrumb-sep { color: var(--text-muted); }

.article-header h1 { font-size: 2rem; font-weight: 800; line-height: 1.25; margin-bottom: 1rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.meta-sep { color: var(--border-color); }
.updated-label { font-style: italic; }

.article-featured-image { margin-bottom: 2rem; border-radius: var(--radius); overflow: hidden; }
.article-featured-image img { width: 100%; border-radius: var(--radius); }
.article-featured-image figcaption { font-size: 0.85rem; color: var(--text-muted); text-align: center; padding: 0.5rem 0; }

/* Article Content */
.article-content h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; color: var(--text-primary); }
.article-content h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }
.article-content p { margin-bottom: 1rem; color: var(--text-secondary); }
.article-content ul, .article-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; color: var(--text-secondary); }
.article-content strong { color: var(--text-primary); }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.article-content th, .article-content td { padding: 0.75rem 1rem; text-align: left; border: 1px solid var(--border-color); }
.article-content th { background: var(--bg-light); font-weight: 600; }
.article-content blockquote {
    border-left: 4px solid var(--brand-primary); padding: 1rem 1.5rem; margin: 1.5rem 0;
    background: var(--brand-primary-light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* FAQ Section */
.article-faq { margin: 2.5rem 0; padding: 2rem; background: var(--bg-light); border-radius: var(--radius); }
.article-faq h2 { margin-top: 0; font-size: 1.4rem; }
.faq-list { margin-top: 1rem; }
.faq-item { margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1.5rem; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.faq-item dt { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.faq-item dd { color: var(--text-secondary); line-height: 1.7; }

/* Article Footer */
.article-footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { background: var(--bg-light); color: var(--text-muted); padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.85rem; font-weight: 500; }

/* Blog CTA */
.blog-cta-section { padding: 3rem 0; }
.blog-cta-card {
    background: var(--brand-primary-light); border: 1px solid rgba(37,133,76,0.15);
    border-radius: var(--radius); padding: 3rem; text-align: center;
}
.blog-cta-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.blog-cta-card p { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 500px; margin-left: auto; margin-right: auto; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2.5rem; }
.pagination-link {
    padding: 0.5rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    color: var(--text-secondary); font-weight: 500; font-size: 0.9rem;
}
.pagination-link:hover, .pagination-link.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state h2, .empty-state h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-dark); color: rgba(255,255,255,0.7); padding: 4rem 0 2rem; }
.footer-container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 2rem; }
.footer-brand .footer-description { font-size: 0.9rem; margin: 1rem 0; line-height: 1.6; color: rgba(255,255,255,0.6); }
.footer-contact-icon { margin-right: 0.4rem; opacity: 0.7; }
.footer-contact-item { display: flex; align-items: center; margin-bottom: 0.85rem; font-size: 0.9rem; }
.footer-contact-item a { color: var(--brand-primary); margin-bottom: 0; }
.footer-contact-item span { color: rgba(255,255,255,0.6); }
.social-links { display: flex; gap: 0.75rem; margin-top: 1rem; }
.social-links a { color: rgba(255,255,255,0.6); transition: all 0.3s ease; }
.social-links a:hover { color: #fff; transform: scale(1.1); }
.footer-links h4 { color: #fff; font-size: 1.1rem; font-weight: 600; margin-bottom: 1.5rem; }
.footer-links a, .footer-links span { display: block; color: var(--brand-primary); font-size: 0.9rem; margin-bottom: 0.85rem; transition: all 0.2s ease; text-decoration: none; }
.footer-links a:hover { color: #2d9254; transform: translateX(4px); }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1); margin-top: 2rem; padding-top: 1.5rem;
    font-size: 0.85rem; color: rgba(255,255,255,0.4);
}

/* ---------- Alerts ---------- */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-weight: 500; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ---------- Admin Login ---------- */
.admin-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
    padding: 3rem 1rem;
    background: linear-gradient(145deg, #f7fbf9 0%, #edf6f0 100%);
}

.admin-login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-white);
    border: 1px solid #dfe7e2;
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.admin-login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.admin-login-header img {
    margin: 0 auto 0.9rem;
    border-radius: 12px;
}

.admin-login-header h1 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.admin-login-header p {
    font-size: 0.93rem;
    color: var(--text-secondary);
}

.admin-login-form .form-group {
    gap: 0.45rem;
    margin-bottom: 1.05rem;
}

.admin-login-form .form-group label {
    font-weight: 600;
}

.admin-login-form .form-control {
    min-height: 44px;
}

.admin-login-form .btn {
    margin-top: 0.25rem;
}

.admin-login-footer {
    text-align: center;
    margin-top: 1.35rem;
}

.admin-login-footer a {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-login-footer a:hover {
    color: var(--brand-primary);
}

/* ---------- Admin Layout ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: #1e293b; color: #fff; flex-shrink: 0; }
.admin-sidebar-header { padding: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar-header .logo-link { gap: 0.5rem; }
.admin-sidebar-header span { color: #fff; font-weight: 600; font-size: 1rem; }
.admin-nav { list-style: none; padding: 1rem 0; }
.admin-nav li a, .admin-nav-btn {
    display: block; width: 100%; text-align: left; padding: 0.7rem 1.25rem;
    color: rgba(255,255,255,0.7); font-size: 0.93rem; border: none;
    background: none; cursor: pointer; font-family: inherit;
}
.admin-nav li a:hover, .admin-nav-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 0.5rem 1.25rem; }
.admin-main { flex: 1; background: var(--bg-light); }
.admin-header { background: var(--bg-white); padding: 1rem 2rem; border-bottom: 1px solid var(--border-color); }
.admin-header-title { font-size: 1rem; font-weight: 600; color: var(--text-secondary); }
.admin-content { padding: 2rem; }

/* ---------- Admin Pages ---------- */
.admin-page { max-width: 1100px; }
.admin-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.admin-page-header h1 { font-size: 1.5rem; font-weight: 700; }

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-dashboard-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
}

.admin-dashboard-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.admin-dashboard-value {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Admin Table */
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th, .admin-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.admin-table th { background: var(--bg-light); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.admin-table td { font-size: 0.93rem; }
.admin-actions { display: flex; gap: 0.5rem; }

.badge { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; }
.form-main, .form-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.form-control {
    padding: 0.6rem 0.75rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 0.95rem; font-family: inherit; transition: border-color var(--transition);
    width: 100%;
}
.form-control:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(37,133,76,0.1); }
textarea.form-control { resize: vertical; }
.form-textarea-lg { min-height: 400px; font-family: 'Menlo', 'Monaco', 'Consolas', monospace; font-size: 0.88rem; }
.form-help { font-size: 0.8rem; color: var(--text-muted); }
.admin-login-form .form-group { margin-bottom: 1rem; }

.admin-upload-form {
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px dashed var(--border-color);
}

.admin-upload-form .btn {
    margin-top: 0.3rem;
}

@media (max-width: 480px) {
    .header-login-btn { display: none; }
    .logo-text { font-size: 1.3rem; }
    .site-header .btn { padding: 0.4rem 0.85rem; font-size: 0.83rem; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .blog-content-area { grid-template-columns: 1fr; }
    .blog-sidebar { position: static; }
    .post-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .header-container { flex-wrap: wrap; gap: 0.5rem; }
    .logo-link { flex: 1 1 auto; }
    .header-actions { flex: 0 0 auto; }
    .header-nav {
        flex: 1 1 100%;
        order: 3;
        justify-content: flex-start;
        margin-top: 0.25rem;
        padding-top: 0.5rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .header-nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 768px) {
    .header-nav {
        justify-content: flex-start;
    }
    .nav-link { margin: 0.25rem 0.5rem; font-size: 0.9rem; }
    .header-actions { gap: 0.35rem; }
    .site-header .btn { padding: 0.45rem 0.9rem; font-size: 0.85rem; min-height: 40px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-nav { display: flex; overflow-x: auto; padding: 0.5rem; }
    .admin-nav li a, .admin-nav-btn { white-space: nowrap; padding: 0.5rem 1rem; }
    .admin-nav-divider { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 0.5rem; }
    .blog-hero h1 { font-size: 1.4rem; }
    .article-header h1 { font-size: 1.5rem; }
    .admin-table { font-size: 0.85rem; }
    .admin-table th:nth-child(3), .admin-table td:nth-child(3),
    .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
}
