/* ===== Global Styles ===== */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f7f9;
    color: #1a2733;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
    color: #0d2538;
}

p {
    margin: 0;
    line-height: 1.6;
}

/* ===== Hero (Landing) ===== */
.hero {
    background: radial-gradient(circle at top left, #3cc6a8 0, #0f6ad8 40%, #0b2340 100%);
    color: #f9fdff;
    padding: 64px 24px 56px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.hero-inner {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.hero-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    text-align: left;
}

.hero-icon {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.22);
    object-fit: cover;
}

.hero-text {
    max-width: 620px;
}

.disclaimer-banner {
    margin: 20px auto 0;
    max-width: 1100px;
    background: #fff4e6;
    color: #6b3e00;
    border: 1px solid rgba(107, 62, 0, 0.2);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #f9fdff;
    color: #0f6ad8;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    width: max-content;
    justify-self: start;
    margin-left: 12px;
}

.back-button:hover {
    background: #eef4ff;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

.eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    opacity: 0.9;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(2rem, 3vw + 1rem, 2.8rem);
    margin-bottom: 12px;
}

.hero-subtitle {
    max-width: 640px;
    margin: 0 auto;
    font-size: 0.98rem;
    opacity: 0.95;
}

/* ===== Layout & Sections ===== */
.page-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.tools-nav {
    max-width: 600px;
    margin: 0 auto 8px;
}

.back-link {
    font-size: 0.85rem;
    color: #0f6ad8;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.tools-section {
    margin-bottom: 40px;
}

.ad-slot {
    display: flex;
    justify-content: center;
    margin: 16px auto 20px;
}

.ad-slot-top {
    margin-top: 14px;
}

.ad-slot-mid {
    margin-bottom: 24px;
}

.ad-unit {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    text-decoration: none;
}

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

.ad-728x90 {
    width: 728px;
    height: 90px;
}

.ad-468x60 {
    width: 468px;
    height: 60px;
}

.ad-320x50 {
    width: 320px;
    height: 50px;
}

.ad-300x250 {
    width: 300px;
    height: 250px;
}

.ad-mobile {
    display: none;
}

@media (max-width: 768px) {
    .ad-desktop {
        display: none;
    }

    .ad-mobile {
        display: block;
    }

    .ad-slot {
        margin: 14px auto 18px;
    }
}

.section-heading {
    text-align: left;
    margin-bottom: 20px;
}

.section-heading h2 {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.section-heading p {
    color: #4b6072;
    font-size: 0.95rem;
}

/* ===== Tool Grid ===== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.tool-card {
    display: block;
    padding: 18px 18px 16px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 46, 79, 0.08);
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(15, 46, 79, 0.06);
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.tool-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.tool-card p {
    font-size: 0.88rem;
    color: #4b6072;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(15, 46, 79, 0.14);
    border-color: #2ca98e;
}

/* ===== SEO Text ===== */
.seo-text {
    background: #ffffff;
    padding: 24px 20px 26px;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 46, 79, 0.06);
    border: 1px solid rgba(15, 46, 79, 0.05);
}

.seo-text h2 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.seo-text h3 {
    font-size: 1.05rem;
    margin: 16px 0 8px;
    color: #223646;
}

.seo-text ul {
    margin: 8px 0 0 18px;
    color: #4b6072;
    line-height: 1.6;
}

.seo-text li + li {
    margin-top: 6px;
}

.seo-text p + p {
    margin-top: 10px;
}

/* ===== Footer ===== */
footer {
    background: #050911;
    color: #a9bac9;
    padding: 28px 16px 32px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #d1e8ff;
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* ===== Calculator Pages (Shared Styles) ===== */
.container {
    max-width: 600px;
    background: #ffffff;
    margin: 32px auto 48px;
    padding: 24px 22px 26px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 46, 79, 0.08);
}

/* Unit toggle for calculators (pill buttons) */
.unit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    margin-top: 8px;
    margin-bottom: 10px;
}

.unit-option {
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #ccd6e2;
    background: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    color: #47617a;
    cursor: pointer;
}

.unit-option.active {
    background: #0f6ad8;
    border-color: #0f6ad8;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 106, 216, 0.28);
}

.unit-group {
    margin-top: 12px;
}

.unit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

form label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
    font-size: 0.88rem;
    color: #243646;
}

form input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ccd6e2;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

form input:focus {
    outline: none;
    border-color: #2ca98e;
    box-shadow: 0 0 0 1px rgba(44, 169, 142, 0.15);
}

form select {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid #ccd6e2;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #243646;
    background-color: #ffffff;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #47617a 50%),
        linear-gradient(135deg, #47617a 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 14px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

form select:focus {
    outline: none;
    border-color: #2ca98e;
    box-shadow: 0 0 0 1px rgba(44, 169, 142, 0.15);
}

button {
    width: 100%;
    padding: 13px 14px;
    margin-top: 20px;
    font-size: 0.98rem;
    font-weight: 600;
    background: linear-gradient(135deg, #2ca98e, #0f6ad8);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

button:hover {
    filter: brightness(1.03);
    box-shadow: 0 8px 18px rgba(15, 46, 79, 0.2);
    transform: translateY(-1px);
}

/* ===== Results Box ===== */
#result-box {
    margin-top: 22px;
    padding: 18px 16px 16px;
    border-radius: 12px;
    background: #f1f8ff;
    border: 1px solid #d0e7ff;
    display: none;
}

.result-title {
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #0f6ad8;
}

.result-category {
    font-size: 0.95rem;
    color: #24435f;
}

.calorie-breakdown {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #24435f;
}
