/* --- 1. Variables & Themes --- */
:root {
    /* Light Mode Palette */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb; /* Professional Blue */
    --accent-hover: #1d4ed8;
    --border: #e2e8f0;
    --success: #16a34a;
    --warning: #ca8a04;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

html.dark {
    /* Dark Mode Palette - Deep Navy/Slate (Premium feel) */
    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #38bdf8; /* Brighter blue for dark mode visibility */
    --accent-hover: #7dd3fc;
    --border: #334155;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.4);
}

/* --- 2. Base Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* --- 3. Calculator UI --- */
.calc-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 2rem auto;
}

h2 { margin-bottom: 0.5rem; font-weight: 800; }
.calc-container p { color: var(--text-muted); margin-bottom: 1.5rem; }

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 480px) {
    .input-grid { grid-template-columns: 1fr; }
}

label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 0.9rem;
    gap: 0.5rem;
}

input {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-page);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* --- 4. Results Styling --- */
.results-box {
    background: var(--bg-page);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    text-align: center;
}

#months-output {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    display: block;
}

#verdict {
    font-weight: 600;
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* --- 5. AdSense Placeholders --- */
.ad-container {
    background: rgba(0,0,0,0.02);
    border: 1px dashed var(--border);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Navigation & Menu Fix --- */
header {
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

nav {
    display: flex;
    justify-content: space-between; /* Logo on left, links on right */
    align-items: center;
    max-width: 1000px; /* Adjust to match your content width */
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none; /* Removes bullets */
    padding: 0;
    margin: 0;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

/* Theme Toggle Button Styling */
#theme-toggle {
    background: var(--bg-page);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

#theme-toggle:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Logo Styling */
.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
}

footer {
    display: flex;
    flex-direction: column; /* Stacks text vertically if you have multiple lines */
    align-items: center;    /* Centers items horizontally in flex */
    justify-content: center;
    text-align: center;     /* Centers the text lines themselves */
    padding: 3rem 1.5rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

footer p {
    margin: 0.5rem 0;
}

/* --- Legal & Blog Content Styling --- */
.prose {
    max-width: 700px; /* Standard reading width for comfort */
    margin: 2rem auto;
    line-height: 1.8;
    color: var(--text-main);
}

.prose h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

.prose h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose strong {
    color: var(--text-main);
}

/* Adds a subtle "official document" look */
.legal-box {
    background: var(--bg-card);
    padding: 3rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.prose ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    list-style-type: disc;
}

.prose li {
    margin-bottom: 0.5rem;
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: white !important;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--accent-hover);
}

.post-list-section {
    margin-top: 4rem;
    max-width: 1000px; /* Limits the width so it doesn't stretch too far */
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;   /* Prevents touching edges on mobile */
}

.post-list-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.post-grid {
    display: grid;
    /* This creates a responsive grid that stays centered */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center; 
}

.post-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.post-card h3 a {
    text-decoration: none;
    color: var(--accent);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.post-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1; /* Pushes the "Read More" link to the bottom */
    margin-bottom: 1rem;
}

.read-more {
    font-weight: bold;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-main);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -5px rgb(0 0 0 / 0.15);
    border-color: var(--accent);
}