/* =============================================================================
   Concept Machining — light/white theme.

   COLORS TO SWAP FROM THE LOGO are grouped first. Change these few values and
   the whole site recolors. Everything below uses these variables.
   ============================================================================= */
:root {
    /* --- brand colors (sampled from the Concept Metal Machining logo) --- */
    --accent:        #456f7c;   /* teal of the logo mark */
    --accent-hover:  #345560;   /* deeper teal for hover/active */
    --accent-weak:   #eaf1f3;   /* light teal tint (focus rings, fills) */

    /* --- neutral palette (white-based, logo-tinted) --- */
    --bg:       #ffffff;        /* page background (clean white) */
    --surface:  #ffffff;        /* cards / inputs — white, separated by border+shadow */
    --text:     #243035;        /* dark slate body text */
    --heading:  #1d3136;        /* dark teal wordmark color */
    --muted:    #65718a;        /* slate ("MACHINING" in the logo) */
    --border:   #e1e6e8;        /* hairlines, card borders */

    --danger:   #b00020;
    --success:  #137333;

    --maxw: 1040px;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(13,27,42,.06), 0 4px 16px rgba(13,27,42,.05);
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;   /* don't let mobile Safari inflate text */
    scroll-padding-top: 84px;         /* keep anchors clear of the sticky header */
}

/* Sticky-footer layout: page is a full-height column; main grows to fill,
   so the footer always rests at the bottom of the viewport on short pages. */
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;               /* accounts for mobile browser chrome */
    display: flex;
    flex-direction: column;
    font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: rgba(69,111,124,.18);  /* tidy touch feedback */
    overflow-wrap: break-word;        /* no horizontal overflow from long words */
}

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

h1, h2, h3 { color: var(--heading); line-height: 1.2; }

.skip-link {
    position: absolute; left: -999px; top: 0; background: var(--accent);
    color: #fff; padding: .5rem 1rem; z-index: 10; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---- Header ---------------------------------------------------------------- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky; top: 0; z-index: 5;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1rem; }

/* Brand: supports a logo image and/or text. */
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--heading); }
.brand img { height: 52px; width: auto; display: block; }

.site-header nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.site-header nav a { color: var(--muted); font-weight: 500; }
.site-header nav a:hover, .site-header nav a:focus { color: var(--accent); text-decoration: none; }

main { flex: 1 0 auto; padding: 3.5rem 0; }   /* grows to push footer down */

/* ---- Buttons -------------------------------------------------------------- */
.btn {
    display: inline-block; background: var(--accent); color: #fff;
    padding: .8rem 1.5rem; border-radius: var(--radius); border: 0;
    font: inherit; font-weight: 600; cursor: pointer; transition: background .15s ease;
}
.btn:hover, .btn:focus { background: var(--accent-hover); text-decoration: none; color: #fff; }

/* ---- Hero (home) ---------------------------------------------------------- */
.hero {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    background-color: var(--heading);          /* fallback before photo loads */
    background-image:
        linear-gradient(115deg, rgba(20,38,46,.88) 0%, rgba(52,85,96,.66) 55%, rgba(69,111,124,.48) 100%),
        url('/assets/hero.jpg');
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
}
.hero-content {
    position: relative;
    padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem);
    text-align: center;
    color: #fff;
}
.hero-logo {
    display: block;
    width: min(440px, 82%);
    height: auto;
    margin: 0 auto 1.25rem;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,.4));
}
.hero-tagline {
    font-size: clamp(1.05rem, 2.4vw, 1.4rem);
    color: #eaf1f3;
    font-weight: 500;
    margin: 0 0 1.75rem;
}
.btn-lg { padding: .95rem 2rem; font-size: 1.05rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 60ch; margin: 0 0 1.5rem; }

/* ---- Feature cards -------------------------------------------------------- */
.features { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 3rem; }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card p { margin-bottom: 0; color: var(--muted); }

/* ---- Prose ---------------------------------------------------------------- */
.prose { max-width: 70ch; }
.prose h1 { font-size: clamp(1.8rem, 3vw, 2.25rem); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }

/* ---- Forms ---------------------------------------------------------------- */
.field { margin-bottom: 1.1rem; display: flex; flex-direction: column; }
.field label { margin-bottom: .4rem; color: var(--heading); font-weight: 500; }
input, textarea {
    font: inherit; color: var(--text); background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .85rem;
}
input:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-weak);
}

/* Honeypot — visually hidden, kept from assistive tech. */
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ---- Alerts --------------------------------------------------------------- */
.alert { border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1.5rem; }
.alert-error   { background: #fdecee; border: 1px solid var(--danger); color: #7a0016; }
.alert-success { background: #e7f4ec; border: 1px solid var(--success); color: #0c5226; }
.alert ul { margin: 0; padding-left: 1.2rem; }

.error-page h1 { font-size: 4rem; margin-bottom: 0; color: var(--accent); }

/* ---- Gallery (About page) ------------------------------------------------- */
.gallery-section { max-width: var(--maxw); margin: 3rem auto 0; }
.gallery-section h2 { margin-bottom: .25rem; }
.gallery-sub { color: var(--muted); margin-top: 0; }
.gallery {
    display: grid; gap: 1rem; margin-top: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.gallery-item {
    margin: 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.gallery-item img {
    display: block; width: 100%; height: 230px; object-fit: cover;
    transition: transform .35s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ---- Contact: phone + map ------------------------------------------------- */
.contact-phone { font-size: 1.15rem; margin-top: -.5rem; }
.contact-phone a { font-weight: 600; }
.map-section { max-width: var(--maxw); margin: 2.5rem auto 0; }
.map-frame {
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); box-shadow: var(--shadow);
}
.map-embed { display: block; width: 100%; height: 360px; border: 0; }
.map-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.btn-secondary {
    background: #fff; color: var(--accent); border: 1px solid var(--accent);
}
.btn-secondary:hover, .btn-secondary:focus { background: var(--accent-weak); color: var(--accent); }
.footer-phone { margin: 0 0 .35rem; }
.footer-phone a { color: var(--text); font-weight: 600; }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--border); color: var(--muted); padding: 2rem 0; }
.site-footer p { margin: 0; }

/* ===========================================================================
   Mobile / responsive — layout AND touch interaction
   =========================================================================== */

/* Comfortable tap targets everywhere (>=44px), text vertically centered. */
.btn { min-height: 44px; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 680px) {
    .wrap { padding: 0 1.1rem; }
    main { padding: 2.25rem 0; }

    /* Header: logo on top, nav wraps to a full-width, evenly spaced row. */
    .site-header .wrap { flex-wrap: wrap; gap: .25rem 1rem; min-height: 0; padding-top: .65rem; padding-bottom: .35rem; }
    .brand img { height: 40px; }
    .site-header nav {
        width: 100%;
        justify-content: space-between;
        gap: 0;
        border-top: 1px solid var(--border);
    }
    .site-header nav a { flex: 1; display: flex; align-items: center; justify-content: center; padding: .6rem .25rem; }

    /* Typography / spacing breathe a little less on small screens. */
    .hero { padding-top: .25rem; }
    .lead { font-size: 1.08rem; }
    .features { margin-top: 2rem; gap: 1rem; }
    .card { padding: 1.3rem; }

    /* Full-width, thumb-friendly buttons. */
    .btn { display: block; width: 100%; text-align: center; }

    /* Hero scales down on small screens */
    .hero-content { padding: 2.25rem 1.25rem; }
    .hero-logo { width: min(340px, 90%); }
    .hero-tagline { font-size: 1.05rem; }
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
