/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #e07b54;
    --primary-dark: #c4663e;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --bg: #ffffff;
    --bg-alt: #fdf8f5;
    --border: #e5e7eb;
    --radius: 8px;
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Merriweather', serif;
}

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

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

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.3; }

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

ul { list-style: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 1.2rem; }
.logo-icon { font-size: 1.4rem; }
.logo-text { font-family: var(--font-heading); }

.main-nav { display: flex; gap: 28px; }
.main-nav a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); }

/* ===== HERO ===== */
.hero {
    background: var(--bg-alt);
    padding: 80px 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.4rem; margin-bottom: 16px; color: var(--text); }
.hero p { font-size: 1.1rem; color: var(--text-muted); max-width: 520px; margin: 0 auto 32px; }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-outline {
    display: inline-block;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ===== SECTIONS ===== */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 1.6rem; margin-bottom: 32px; }
.center-link { text-align: center; margin-top: 40px; }

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

.post-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
    background: #fff;
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.post-card-body { padding: 20px; }
.post-card h3 { font-size: 1rem; margin: 10px 0 8px; line-height: 1.4; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--primary); }
.post-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ===== CATEGORY BADGE ===== */
.category-badge {
    display: inline-block;
    background: #fde8df;
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== POST META ===== */
.post-meta { display: flex; gap: 8px; color: var(--text-muted); font-size: 0.82rem; margin-top: 12px; }

/* ===== CATEGORIES GRID ===== */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.category-card {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
    color: var(--text);
}
.category-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(224,123,84,0.12); color: var(--text); }
.cat-icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.category-card h3 { font-size: 1rem; margin-bottom: 6px; }
.category-card p { font-size: 0.85rem; color: var(--text-muted); }

/* ===== PAGE HEADER ===== */
.page-header { background: var(--bg-alt); padding: 48px 0; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 2rem; margin-bottom: 8px; }
.page-header p { color: var(--text-muted); }

/* ===== BLOG LAYOUT ===== */
.blog-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }

.post-list-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 32px;
    margin-bottom: 32px;
}
.post-list-item:last-child { border-bottom: none; }
.post-list-body h2 { font-size: 1.2rem; margin: 10px 0 10px; }
.post-list-body h2 a { color: var(--text); }
.post-list-body h2 a:hover { color: var(--primary); }
.post-list-body p { color: var(--text-muted); font-size: 0.95rem; }
.read-more { display: inline-block; margin-top: 12px; font-weight: 500; font-size: 0.9rem; }

/* ===== SIDEBAR ===== */
.sidebar-widget {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.sidebar-widget h3 { font-size: 1rem; margin-bottom: 14px; }
.category-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.category-list li:last-child { border-bottom: none; }
.category-list a { color: var(--text-muted); font-size: 0.9rem; }
.category-list a:hover { color: var(--primary); }

.recent-posts li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.recent-posts li:last-child { border-bottom: none; }
.recent-posts a { display: block; color: var(--text); font-size: 0.88rem; line-height: 1.4; margin-bottom: 4px; }
.recent-posts a:hover { color: var(--primary); }
.recent-posts span { color: var(--text-muted); font-size: 0.78rem; }

/* ===== SINGLE POST ===== */
.single-post { padding: 40px 0 60px; }
.post-layout { display: grid; grid-template-columns: 1fr 280px; gap: 40px; align-items: start; margin-top: 32px; }
.post-header { max-width: 760px; }
.post-header h1 { font-size: 1.9rem; margin: 12px 0 14px; }

.article-body { line-height: 1.85; font-size: 1.02rem; }
.article-body h2 { font-size: 1.3rem; margin: 32px 0 14px; color: var(--text); }
.article-body p { margin-bottom: 18px; }
.article-body strong { color: var(--text); }
.article-body ul { list-style: disc; padding-left: 24px; margin-bottom: 18px; }
.article-body li { margin-bottom: 6px; }

.post-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }

/* ===== AD CONTAINER ===== */
.ad-container { margin: 28px 0; min-height: 90px; background: var(--bg-alt); border-radius: var(--radius); }

/* ===== PROSE PAGES (privacy, about) ===== */
.prose { max-width: 740px; }
.prose h2 { font-size: 1.25rem; margin: 32px 0 12px; }
.prose p { margin-bottom: 16px; color: var(--text); }
.prose a { text-decoration: underline; }

/* ===== FOOTER ===== */
.site-footer { background: var(--text); color: #9ca3af; padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-grid h3, .footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.footer-grid p { font-size: 0.9rem; line-height: 1.6; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid ul a { color: #9ca3af; font-size: 0.9rem; }
.footer-grid ul a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #374151; padding-top: 20px; text-align: center; font-size: 0.85rem; }
.footer-bottom a { color: #9ca3af; }
.footer-bottom a:hover { color: #fff; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .blog-layout, .post-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .hero h1 { font-size: 1.7rem; }
    .sidebar { display: none; }
    .main-nav { gap: 16px; }
}

/* ===== TOOLS PAGES ===== */
.tool-layout { display: grid; grid-template-columns: 1fr 280px; gap: 40px; align-items: start; }

.calculator-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 32px;
}
.calculator-card h2 { font-size: 1.2rem; margin-bottom: 20px; }

.calc-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 16px; align-items: end; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-group select, .form-group input {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-body);
    background: white;
    color: var(--text);
}
.form-group select:focus, .form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.calc-result {
    margin-top: 24px;
    padding: 20px;
    background: white;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius);
}
.calc-result h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }
.result-number { font-size: 2rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; font-family: var(--font-heading); }
.meal-breakdown { margin-top: 12px; padding: 12px; background: var(--bg-alt); border-radius: 6px; font-size: 0.9rem; }

.info-section { margin-bottom: 40px; }
.info-section h2 { font-size: 1.3rem; margin-bottom: 20px; }
.info-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.info-card h3 { font-size: 0.95rem; margin-bottom: 8px; }
.info-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 16px; }
.data-table th { background: var(--text); color: white; padding: 10px 14px; text-align: left; font-weight: 500; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: var(--bg-alt); }
.disclaimer { font-size: 0.82rem; color: var(--text-muted); font-style: italic; margin-top: 8px; }

/* sleep schedule */
.sleep-badge { background: var(--primary); color: white; padding: 12px 20px; border-radius: var(--radius); font-weight: 500; display: inline-block; }
.schedule-timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-alt); border-radius: 6px; border-left: 3px solid var(--primary); }
.timeline-time { font-weight: 600; font-size: 0.85rem; min-width: 72px; color: var(--primary); }
.timeline-icon { font-size: 1.2rem; }
.timeline-activity { font-size: 0.9rem; }

/* meal plan */
.age-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.age-tab { padding: 8px 16px; border: 1.5px solid var(--border); background: white; border-radius: 20px; cursor: pointer; font-size: 0.85rem; font-family: var(--font-body); transition: all 0.2s; }
.age-tab:hover, .age-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.meal-header h3 { font-size: 1rem; color: var(--primary); margin-bottom: 16px; }
.meal-grid { display: flex; flex-direction: column; gap: 10px; }
.meal-card { display: flex; align-items: flex-start; gap: 14px; padding: 14px; background: var(--bg-alt); border-radius: var(--radius); border: 1px solid var(--border); }
.meal-number { background: var(--primary); color: white; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.meal-icon { font-size: 1.4rem; flex-shrink: 0; }
.meal-info { flex: 1; }
.meal-info strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.meal-time { font-size: 0.78rem; color: var(--primary); font-weight: 600; display: block; margin-bottom: 4px; }
.meal-info p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* snack cards */
.snack-card { display: flex; gap: 20px; padding: 24px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 24px; }
.snack-emoji { font-size: 2.5rem; flex-shrink: 0; }
.snack-content { flex: 1; }
.snack-content h2 { font-size: 1.15rem; margin-bottom: 10px; }
.snack-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.badge-green { background: #d1fae5; color: #065f46; font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.badge-blue { background: #dbeafe; color: #1e40af; font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.snack-tip { background: #fff7ed; border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 0.88rem; margin-top: 12px; }

/* weight result */
.weight-range-bar { margin: 16px 0; }
.range-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.range-bar { height: 12px; background: linear-gradient(to right, #fca5a5, #86efac, #fca5a5); border-radius: 6px; position: relative; }
.weight-refs { margin-top: 12px; padding: 10px; background: var(--bg-alt); border-radius: 6px; font-size: 0.9rem; }

@media (max-width: 768px) {
    .tool-layout { grid-template-columns: 1fr; }
    .calc-form { grid-template-columns: 1fr; }
    .snack-card { flex-direction: column; }
    .age-tabs { gap: 6px; }
    .age-tab { font-size: 0.8rem; padding: 6px 12px; }
}

/* ===== NAV DROPDOWN ===== */
.nav-dropdown { position: relative; }
.nav-dropdown > a { cursor: pointer; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 200;
    padding: 6px 0;
}
.dropdown-menu a { display: block; padding: 9px 16px; color: var(--text); font-size: 0.9rem; }
.dropdown-menu a:hover { background: var(--bg-alt); color: var(--primary); }
.nav-dropdown:hover .dropdown-menu { display: block; }

@media (max-width: 768px) {
    .dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 16px; }
    .nav-dropdown:hover .dropdown-menu { display: block; }
}
