* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
}

/* Header */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: #16a34a;
    transition: color 0.2s ease;
}

.logo:hover {
    color: #15803d;
}

.nav {
    display: flex;
    gap: 20px;
    font-size: 15px;
    font-weight: 600;
}

.nav a {
    color: #374151;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: #16a34a;
}

/* Hero */

.page-wrap {
    padding: 35px 0 0;
}

.hero {
    text-align: center;
    max-width: 850px;
    margin: 0 auto 30px;
}

.hero h1 {
    font-size: 44px;
    line-height: 1.1;
    margin: 0 0 15px;
    color: #111827;
}

.hero p {
    font-size: 18px;
    color: #4b5563;
    margin: 0;
}

/* Layout */

.layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 22px;
    align-items: start;
}

.calculator-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
    border: 1px solid #e5e7eb;
    scroll-margin-top: 95px;
}

.calculator-card h2 {
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 28px;
    color: #111827;
}

/* Forms */

.form-grid {
    display: grid;
    gap: 16px;
}

.two-col {
    grid-template-columns: 1fr 1fr;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
    color: #111827;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #111827;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.contact-form {
    margin-top: 25px;
}

.calculate-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 16px;
    background: #16a34a;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.calculate-btn:hover {
    background: #15803d;
    transform: translateY(-1px);
}

/* Results */

.result-box {
    margin-top: 26px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

.result-box h3 {
    margin-top: 0;
    font-size: 24px;
    color: #111827;
}

.result-box p:last-child {
    margin-bottom: 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.stat-row span {
    color: #4b5563;
}

.stat-row strong {
    color: #111827;
    text-align: right;
}

.final-result {
    margin-top: 22px;
    padding: 20px;
    border-radius: 16px;
}

.final-result h4 {
    margin: 0 0 8px;
    font-size: 22px;
}

.final-result p {
    margin: 0;
}

.deficit-result {
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #14532d;
}

.surplus-result {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #7f1d1d;
}

.maintenance-result {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e3a8a;
}

.fat-loss-estimate {
    margin-top: 16px;
    padding: 18px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px dashed #16a34a;
}

.fat-loss-estimate p {
    margin: 8px 0;
}

.error-box {
    border-left: 6px solid #dc2626;
}

/* Ads */

.ad-sidebar {
    position: sticky;
    top: 95px;
}

.ad-box {
    min-height: 300px;
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.mobile-ad {
    display: none;
}

.bottom-ad {
    margin-top: 32px;
    min-height: 120px;
}

/* Content Section */

.content-section {
    max-width: 850px;
    margin: 45px auto;
    background: #ffffff;
    border-radius: 22px;
    padding: 35px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
}

.content-section h1 {
    font-size: 40px;
    line-height: 1.15;
    margin-top: 0;
    margin-bottom: 18px;
    color: #111827;
}

.content-section h2 {
    font-size: 28px;
    margin-top: 32px;
    margin-bottom: 12px;
    color: #111827;
}

.content-section h2:first-of-type {
    margin-top: 30px;
}

.content-section p {
    color: #4b5563;
    font-size: 17px;
}

.content-section ul,
.content-section ol {
    color: #4b5563;
    font-size: 17px;
    padding-left: 24px;
}

.content-section li {
    margin-bottom: 10px;
}

/* Article Hub */

.article-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 30px;
    margin-bottom: 35px;
}

.article-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
    border-color: #bbf7d0;
}

.article-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 23px;
    line-height: 1.25;
}

.article-card h2 a {
    color: #111827;
}

.article-card h2 a:hover {
    color: #16a34a;
}

.article-card p {
    font-size: 16px;
    margin-bottom: 18px;
}

.article-link {
    display: inline-block;
    font-weight: 800;
    color: #16a34a;
}

.article-link:hover {
    color: #15803d;
}

/* Article Pages */

.article-page {
    max-width: 900px;
}

.article-category {
    display: inline-block;
    margin: 0 0 14px;
    padding: 7px 13px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #15803d !important;
    font-size: 14px !important;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.article-intro {
    font-size: 21px !important;
    color: #374151 !important;
    line-height: 1.65;
    margin-bottom: 24px;
}

.example-box {
    background: #f9fafb;
    border-left: 6px solid #16a34a;
    border-radius: 16px;
    padding: 18px 20px;
    margin: 24px 0;
}

.example-box p {
    margin: 6px 0;
}

.related-articles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 18px 0 26px;
}

.related-articles a {
    display: block;
    padding: 15px 18px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #111827;
    font-weight: 800;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.related-articles a:hover {
    color: #16a34a;
    border-color: #bbf7d0;
    transform: translateY(-1px);
}

/* 404 Page */

.error-page {
    text-align: center;
}

.error-page h1 {
    font-size: 46px;
}

.page-button {
    display: inline-block;
    margin: 18px 8px 0;
    padding: 14px 22px;
    background: #16a34a;
    color: #ffffff;
    border-radius: 12px;
    font-weight: 800;
    transition: background 0.2s ease, transform 0.2s ease;
}

.page-button:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.secondary-button {
    background: #111827;
}

.secondary-button:hover {
    background: #374151;
}

/* Footer */

.site-footer {
    background: #111827;
    color: #d1d5db;
    padding: 28px 0;
    text-align: center;
}

.site-footer p {
    margin: 0 0 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
}

.footer-links a {
    color: #d1d5db;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #86efac;
}

/* Responsive */

@media (max-width: 1050px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .ad-sidebar {
        display: none;
    }

    .mobile-ad {
        display: flex;
        min-height: 120px;
        margin-bottom: 28px;
    }
}

@media (max-width: 720px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        padding: 16px 18px;
    }

    .logo {
        font-size: 21px;
        text-align: center;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero p {
        font-size: 16px;
    }

    .calculator-card {
        padding: 22px;
        border-radius: 18px;
    }

    .calculator-card h2 {
        font-size: 24px;
    }

    .two-col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .stat-row {
        flex-direction: column;
        gap: 3px;
    }

    .stat-row strong {
        text-align: left;
    }

    .content-section {
        padding: 24px;
        border-radius: 18px;
        margin: 30px auto;
    }

    .content-section h1 {
        font-size: 32px;
    }

    .content-section h2 {
        font-size: 24px;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .article-card {
        padding: 22px;
    }

    .article-card h2 {
        font-size: 22px;
    }

    .article-intro {
        font-size: 18px !important;
    }

    .error-page h1 {
        font-size: 34px;
    }

    .page-button {
        display: block;
        width: 100%;
        margin: 14px 0 0;
        text-align: center;
    }
}

@media (max-width: 430px) {
    .container {
        padding: 0 14px;
    }

    .nav {
        gap: 10px;
        font-size: 14px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .calculator-card {
        padding: 18px;
    }

    input,
    select,
    textarea {
        font-size: 15px;
    }
}