/*
 * style.css - YO Free Tools
 * Production ready, responsive, fast.
 * Colour palette: soft teal (#2A9D8F) as primary, with calm neutrals.
 */

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

html {
    font-size: 100%; /* 16px base, respects user preferences */
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #1e2b37;        /* dark slate for text */
    background-color: #f8fafc; /* very light grey-blue */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* main fills space between header and footer */
main {
    flex: 1 0 auto;
}

/* --- TYPOGRAPHY & READABILITY --- */
h1, h2, h3 {
    line-height: 1.2;
    font-weight: 600;
    color: #0b1a24;
    margin-bottom: 1rem;
}

h1 { font-size: 2.2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

p { margin-bottom: 1.2rem; }

/* small screens adjustments */
@media (max-width: 640px) {
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
    body { font-size: 0.95rem; }
}

/* --- CONTAINER & LAYOUT --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container.narrow {
    max-width: 800px;
}

/* --- HEADER & NAVIGATION (mobile-first, toggle-friendly) --- */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 20, 30, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 0.5rem 1.5rem;
    position: relative;
}

.site-branding {
    font-weight: 700;
    font-size: 1.6rem;
    text-decoration: none;
    color: #1e2b37;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #2A9D8F 0%, #21867a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.site-name {
    display: inline-block;
}

/* mobile menu toggle button */
.menu-toggle {
    display: none; /* hidden on large screens, block on mobile via media query */
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 55;
}

.menu-toggle span {
    width: 2rem;
    height: 0.22rem;
    background: #1e2b37;
    border-radius: 10px;
    transition: all 0.25s linear;
    transform-origin: 1px;
}

/* site nav (desktop default) */
.site-nav {
    display: flex;
}

.site-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.site-nav a {
    text-decoration: none;
    font-weight: 500;
    color: #1e2b37;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s, color 0.15s;
    font-size: 1.1rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: #2A9D8F;
    border-bottom-color: #2A9D8F;
}

/* ----- mobile nav styles (triggered by JS) ----- */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 70px; /* below header */
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 10px 20px rgba(0,0,0,0.08);
        padding: 1.5rem 0;
        border-top: 1px solid #e2e8f0;
    }

    .site-nav.active {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
    }

    .site-nav a {
        font-size: 1.2rem;
        display: inline-block;
        padding: 0.3rem 0;
    }

    /* animate toggle button to X when active */
    .menu-toggle.active span:first-child {
        transform: rotate(45deg) translate(3px, 5px);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:last-child {
        transform: rotate(-45deg) translate(3px, -5px);
    }
}

/* --- FOOTER --- */
.site-footer {
    background-color: #ffffff;
    border-top: 1px solid #e6edf2;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.footer-text p {
    margin: 0.2rem 0;
    color: #3b4e5e;
    font-size: 0.95rem;
}

.footer-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    flex-wrap: wrap;
}

.footer-nav a {
    text-decoration: none;
    color: #1e2b37;
    font-weight: 500;
    transition: color 0.1s;
}

.footer-nav a:hover {
    color: #2A9D8F;
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .footer-nav ul {
        justify-content: center;
        gap: 1.5rem;
    }
}

/* --- HERO SECTIONS --- */
.hero,
.page-hero {
    background: linear-gradient(145deg, #eaf4f2 0%, #d9e9e5 100%);
    padding: 3rem 0;
    border-bottom: 1px solid #cbd9d4;
}

.hero-inner {
    display: flex;
    align-items: center;
}

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

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.page-hero {
    background: #deefe9;
    padding: 2rem 0;
    text-align: center;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    background-color: transparent;
    text-align: center;
}

.btn-primary {
    background-color: #2A9D8F;
    color: white;
    box-shadow: 0 4px 8px rgba(42, 157, 143, 0.2);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: #21867a;
    transform: translateY(-2px);
    box-shadow: 0 8px 14px rgba(42, 157, 143, 0.25);
}

.btn-secondary {
    background-color: white;
    color: #1e2b37;
    border: 2px solid #2A9D8F;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background-color: #f0f7f5;
    border-color: #1b6b61;
}

/* --- TOOL CARDS & GRID --- */
.tools-section {
    padding: 3rem 0;
}

.section-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: white;
    padding: 2rem 1.8rem;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(0, 40, 40, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0edeb;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 28px rgba(42, 157, 143, 0.12);
}

.tool-card h3 {
    margin-bottom: 0.7rem;
    color: #1e2b37;
}

.tool-link {
    display: inline-block;
    margin-top: 1.2rem;
    font-weight: 600;
    color: #2A9D8F;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.tool-link:hover {
    border-bottom-color: #2A9D8F;
}

/* --- CONTENT SECTIONS (alternating) --- */
.content-section {
    padding: 3rem 0;
}

.alt-section {
    background-color: #ecf6f3;
}

/* --- FORMS (contact page) --- */
.calculator-section {
    padding: 2rem 0 3rem;
}

.calculator-card {
    background: white;
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0, 30, 30, 0.05);
}

.calculator-form .form-group {
    margin-bottom: 1.6rem;
}

.calculator-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #1e2b37;
}

.calculator-form input,
.calculator-form textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #dae8e4;
    border-radius: 40px;
    font-family: inherit;
    font-size: 1rem;
    transition: border 0.2s, box-shadow 0.2s;
    background-color: white;
}

.calculator-form textarea {
    border-radius: 28px;
    resize: vertical;
}

.calculator-form input:focus,
.calculator-form textarea:focus {
    outline: none;
    border-color: #2A9D8F;
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15);
}

.contact-note {
    margin-top: 2.5rem;
    text-align: center;
    border-top: 1px solid #e0edeb;
    padding-top: 2rem;
}

.contact-note a {
    color: #2A9D8F;
    font-weight: 600;
    text-decoration: none;
}

.contact-note a:hover {
    text-decoration: underline;
}

/* status messages */
.result-box,
.error-box {
    padding: 1.2rem 1.8rem;
    border-radius: 60px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.result-box.normal {
    background: #dcfce7;
    border-left: 6px solid #2A9D8F;
    color: #14534b;
}

.error-box {
    background: #fee2e2;
    border-left: 6px solid #c24141;
    color: #7f2a2a;
}

/* --- MISC --- */
img {
    max-width: 100%;
    height: auto;
}

/* remove extra space from hidden honeypot */
input[style*="display:none"] {
    display: none !important;
}