/* ==========================================================================
   CeiService website styles.
   The site is statically rendered (no interactive Blazor): every visual
   behaviour here is pure CSS. MudBlazor is used for icons and the theme reset.
   Breakpoints follow MudBlazor: sm 600px, md 960px, lg 1280px.
   ========================================================================== */

/* ---- Font: self-hosted Sora variable font (no third-party requests) ---- */
@font-face {
    font-family: 'Sora';
    src: url('Fonts/Sora.ttf') format('truetype');
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

/* ---- Design tokens ---- */
:root {
    --c-brand: #2c5c8f;          /* theme Secondary */
    --c-brand-dark: #1d3f63;
    --c-brand-darker: #132c47;
    --c-accent: #4a95e1;         /* theme Primary: decoration/icons only (3:1 on white) */
    --c-soft: #81b5e9;           /* theme Tertiary */
    --c-tint: #e8f1fb;
    --c-bg: #f5f8fc;
    --c-surface: #ffffff;
    --c-text: #1b2733;
    --c-muted: #50606f;
    --c-border: #dbe4ee;
    --c-on-dark: #ffffff;
    --c-on-dark-muted: #c9d8e8;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(19, 44, 71, .06), 0 1px 3px rgba(19, 44, 71, .08);
    --shadow: 0 6px 24px rgba(19, 44, 71, .10);
    --shadow-lg: 0 16px 40px rgba(19, 44, 71, .16);

    --header-h: 72px;
    --container: 1200px;
    --gutter: 20px;
    --font: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (min-width: 600px) { :root { --gutter: 32px; } }

/* ---- Base ---- */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font); color: inherit; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.12; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 1.25rem; line-height: 1.35; font-weight: 600; }
h4 { font-size: 1.05rem; line-height: 1.4; font-weight: 600; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--c-brand); text-underline-offset: 3px; }
a:hover { color: var(--c-brand-dark); }
img { max-width: 100%; height: auto; }
strong { font-weight: 600; }

/* Visible focus for keyboard users everywhere */
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
/* The router focuses the page <h1> after navigation; don't draw an outline for that. */
h1:focus { outline: none; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute;
    left: 16px; top: -100px;
    z-index: 3000;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--c-brand);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---- Layout primitives ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.container-narrow { max-width: 820px; }
main { display: block; min-height: 50vh; }
main:focus { outline: none; }

.section { padding-block: 56px; }
@media (min-width: 960px) { .section { padding-block: 88px; } }
.section-white { background: var(--c-surface); }
.section-tint { background: var(--c-tint); }
.section-brand { background: var(--c-brand); color: var(--c-on-dark); }
.section-brand a { color: inherit; }

.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--c-muted); font-size: 1.075rem; }
.section-brand .section-head p { color: var(--c-on-dark-muted); }
.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c-brand);
}
.on-dark .eyebrow, .section-brand .eyebrow, .page-header .eyebrow { color: #b8d6f5; } /* 4.5:1 on the brand blue */
.lead { font-size: 1.125rem; color: var(--c-muted); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
@media (min-width: 960px) { .grid { gap: 32px; } }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 24px;
    border: 2px solid transparent;
    border-radius: 999px;
    font: 600 1rem/1.2 var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
    box-sizing: border-box;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--c-brand); color: #fff; }
.btn-primary:hover { background: var(--c-brand-dark); color: #fff; }
.btn-light { background: #fff; color: var(--c-brand); }
.btn-light:hover { background: var(--c-tint); color: var(--c-brand-dark); }
.btn-outline { border-color: var(--c-brand); color: var(--c-brand); background: transparent; }
.btn-outline:hover { background: var(--c-brand); color: #fff; }
.btn-outline-light { border-color: rgba(255, 255, 255, .8); color: #fff; background: transparent; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn .mud-icon-root { font-size: 1.25rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-decoration: none;
}
.link-arrow .mud-icon-root { font-size: 1.15rem; transition: transform .15s ease; }
.link-arrow:hover .mud-icon-root { transform: translateX(3px); }

/* ---- Header ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--c-border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { display: block; height: 30px; width: auto; }
@media (min-width: 600px) { .brand img { height: 34px; } }
.main-nav { align-items: center; gap: 4px; margin-left: 24px; }
.nav-link {
    position: relative;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--c-text);
    font-weight: 500;
    text-decoration: none;
}
.nav-link:hover { background: var(--c-tint); color: var(--c-brand); }
.nav-link.active { color: var(--c-brand); }
.nav-link.active::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--c-brand);
}
.header-spacer { flex: 1; }

/* Mobile menu: native <details>, closed by a tiny script on navigation/outside click/Escape */
.mobile-menu { position: relative; }
.mobile-menu > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: var(--c-brand);
}
.mobile-menu > summary:hover { background: var(--c-tint); }
.mobile-menu > summary::-webkit-details-marker { display: none; }
.mobile-menu .icon-close { display: none; }
.mobile-menu[open] .icon-open { display: none; }
.mobile-menu[open] .icon-close { display: inline-block; }
.mobile-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    min-width: 240px;
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.mobile-menu-panel a {
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--c-text);
    font-weight: 500;
    text-decoration: none;
}
.mobile-menu-panel a:hover, .mobile-menu-panel a.active { background: var(--c-tint); color: var(--c-brand); }
.mobile-menu-panel .btn { margin-top: 6px; }

/* ---- Page header (inner pages) ---- */
.page-header {
    position: relative;
    overflow: hidden;
    padding-block: 56px 48px;
    color: var(--c-on-dark);
    background:
        radial-gradient(1200px 400px at 85% -10%, rgba(129, 181, 233, .35), transparent 60%),
        linear-gradient(135deg, var(--c-brand-darker), var(--c-brand));
}
@media (min-width: 960px) { .page-header { padding-block: 80px 72px; } }
.page-header h1 { margin-bottom: 16px; max-width: 18ch; }
.page-header .lead { color: var(--c-on-dark-muted); max-width: 70ch; margin: 0; }

/* ---- Home hero: big centred logo on a light background ---- */
.hero {
    position: relative;
    text-align: center;
    padding-block: clamp(56px, 10vw, 128px) clamp(48px, 8vw, 104px);
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, var(--c-tint) 0%, rgba(232, 241, 251, 0) 100%),
        var(--c-surface);
}
.hero-logo { display: block; width: min(100%, 780px); height: auto; margin: 0 auto clamp(32px, 5vw, 56px); }
.hero h1 {
    font-size: clamp(1.45rem, 3.2vw, 2.35rem);
    font-weight: 600;
    line-height: 1.25;
    color: var(--c-brand-dark);
    max-width: 30ch;
    margin: 0 auto 16px;
}
.hero .lead { max-width: 60ch; margin: 0 auto 36px; }
.hero .btn-row { justify-content: center; }

/* Brand logos right below the hero */
.brands-band { background: var(--c-surface); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); padding-block: 36px 40px; }

/* ---- Cards ---- */
.card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 28px;
    box-sizing: border-box;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
    min-width: 0;
    overflow-wrap: break-word; /* long slash-joined words, e.g. "Turbines/Generators/Pumps/Compressor" */
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--c-muted); }
.card .link-arrow { margin-top: auto; padding-top: 16px; }
.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    border-radius: 16px;
    background: var(--c-tint);
    color: var(--c-brand);
    flex-shrink: 0;
}
.icon-badge .mud-icon-root { font-size: 1.9rem; }

/* Industry cards (image on top) */
.media-card { padding: 0; overflow: hidden; }
.media-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.media-card .media-card-body { padding: 24px 28px 28px; }

/* ---- Stats band ---- */
.stats { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.stat-value { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 700; line-height: 1; letter-spacing: -.02em; margin-bottom: 10px; }
.stat-label { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
.stat-text { color: var(--c-on-dark-muted); margin: 0; font-size: .95rem; }

/* ---- Logo strip (CSS-only rotation of 3 brand strips) ---- */
.logos-label { text-align: center; color: var(--c-muted); font-weight: 600; font-size: .9rem; letter-spacing: .04em; margin-bottom: 20px; }
.logo-rotator { position: relative; width: 100%; height: 56px; }
@media (min-width: 600px) { .logo-rotator { height: 80px; } }
.logo-rotator img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    animation: logo-fade 15s infinite;
}
.logo-rotator img:nth-child(2) { animation-delay: 5s; }
.logo-rotator img:nth-child(3) { animation-delay: 10s; }
@keyframes logo-fade {
    0% { opacity: 0; }
    4% { opacity: 1; }
    30% { opacity: 1; }
    34% { opacity: 0; }
    100% { opacity: 0; }
}

/* ---- CTA band ---- */
.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 40px;
    border-radius: var(--radius-lg);
    color: var(--c-on-dark);
    background:
        radial-gradient(600px 240px at 100% 0%, rgba(129, 181, 233, .35), transparent 60%),
        linear-gradient(135deg, var(--c-brand-darker), var(--c-brand));
}
.cta-band h2 { margin-bottom: 8px; }
.cta-band p { color: var(--c-on-dark-muted); margin: 0; max-width: 60ch; }

/* ---- Split sections (About Us): image + text, alternating ---- */
.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) {
    .split { grid-template-columns: 5fr 7fr; gap: 64px; }
    .split.reverse { grid-template-columns: 7fr 5fr; }
    .split.reverse .split-media { order: 2; }
}
.split-media img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.split-body h3 { margin-top: 1.4em; }

/* ---- Services ---- */
.service-card .icon-badge { background: var(--c-tint); }

/* ---- Manufacturers: category menu ---- */
.category-menu { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.category-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-surface);
    color: var(--c-text);
    font-weight: 500;
    font-size: .95rem;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.category-link .mud-icon-root { font-size: 1.2rem; color: var(--c-brand); }
.category-link:hover { border-color: var(--c-brand); color: var(--c-brand); }
.category-link.selected { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.category-link.selected .mud-icon-root { color: #fff; }

.product-list { display: grid; gap: 24px; }
.product-card { display: grid; gap: 24px; }
@media (min-width: 760px) { .product-card { grid-template-columns: 220px 1fr; align-items: start; } }
.product-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--c-tint);
    box-sizing: border-box;
}
.product-media img { max-height: 100%; width: auto; object-fit: contain; }
.product-columns { display: grid; gap: 24px; }
@media (min-width: 600px) { .product-columns { grid-template-columns: 1fr 1fr; } }
.product-columns h4 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 10px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.check-list li { position: relative; padding-left: 22px; }
.check-list li::before {
    content: "";
    position: absolute;
    left: 2px; top: .62em;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-accent);
}
.chip-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--c-tint);
    color: var(--c-brand-dark);
    font-size: .9rem;
    font-weight: 500;
}

/* ---- Customers ---- */
.customers-count { font-size: 1.05rem; font-weight: 600; color: var(--c-muted); letter-spacing: .02em; margin-bottom: 20px; }
.customer-list { list-style: none; padding: 0; margin: 0; columns: 1; column-gap: 48px; }
@media (min-width: 600px) { .customer-list { columns: 2; } }
@media (min-width: 1280px) { .customer-list { columns: 3; } }
.customer-list li {
    break-inside: avoid;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 12px 0 12px 22px;
    border-bottom: 1px solid var(--c-border);
}
.customer-list li::before {
    content: "";
    position: absolute;
    left: 4px; top: 1.3em;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-accent);
}
.customer-name { font-weight: 500; }
.customer-country { font-size: .875rem; color: var(--c-muted); }

/* ---- Contact ---- */
.contact-layout { display: grid; gap: 32px; }
@media (min-width: 960px) { .contact-layout { grid-template-columns: 5fr 7fr; gap: 48px; align-items: start; } }
.contact-info dl { margin: 0; display: grid; gap: 20px; }
.contact-info dt { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 4px; }
.contact-info dt .mud-icon-root { color: var(--c-brand); font-size: 1.3rem; }
.contact-info dd { margin: 0 0 0 32px; color: var(--c-muted); }

.contact-form .form-field { display: flex; flex-direction: column; margin-bottom: 20px; }
.contact-form label { font-weight: 600; margin-bottom: 6px; }
.contact-form .required { color: #b3261e; }
.contact-form input:not([type=checkbox]),
.contact-form textarea {
    font: inherit;
    padding: 12px 14px;
    border: 1px solid #7a8ca0; /* >= 3:1 against white for form-control boundaries */
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text);
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus-visible,
.contact-form textarea:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 1px; border-color: var(--c-brand); }
.contact-form .invalid { border-color: #b3261e; }
.contact-form .validation-message { color: #b3261e; font-size: .9rem; margin-top: 6px; }
.contact-form .checkbox-field { flex-direction: row; align-items: flex-start; gap: 12px; }
.contact-form .checkbox-field input { width: 20px; height: 20px; margin: 3px 0 0; flex-shrink: 0; accent-color: var(--c-brand); }
.contact-form .checkbox-field label { font-weight: 400; margin: 0; }
.contact-form .form-note { font-size: .875rem; color: var(--c-muted); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-weight: 500;
}
.alert .mud-icon-root { flex-shrink: 0; font-size: 1.5rem; }
.alert-success { background: #e6f4ea; color: #14532d; border: 1px solid #b7dfc3; }
.alert-error { background: #fdecea; color: #7f1d1d; border: 1px solid #f5c2bd; }

/* Map: loaded only on request (no third-party request before the visitor opts in) */
.map-consent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 320px;
    padding: 32px;
    box-sizing: border-box;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px dashed #7a8ca0;
    background: var(--c-tint);
}
.map-consent p { color: var(--c-muted); max-width: 52ch; margin: 0; }
.contact-map { display: block; width: 100%; height: 360px; border: 0; border-radius: var(--radius-lg); }
@media (min-width: 960px) { .contact-map { height: 460px; } }

/* ---- Legal pages ---- */
.prose { max-width: 75ch; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose h3 { margin-top: 1.5em; }
.prose ul { padding-left: 1.25em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose table { border-collapse: collapse; width: 100%; min-width: 560px; margin-bottom: 1em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.prose th { background: var(--c-tint); }
.table-scroll { overflow-x: auto; }

/* ---- Footer ---- */
.site-footer { background: var(--c-brand-darker); color: var(--c-on-dark-muted); font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-main { display: grid; gap: 40px; padding-block: 56px; }
@media (min-width: 760px) { .footer-main { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand img { height: 36px; width: auto; margin-bottom: 16px; }
.footer-brand p { max-width: 36ch; }
.footer-title { color: #fff; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    justify-content: space-between;
    padding-block: 20px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .875rem;
}
.footer-bottom nav { display: flex; gap: 20px; }

/* ---- Not found / error ---- */
.status-page { text-align: center; padding-block: 96px; }
.status-code { font-size: clamp(4rem, 12vw, 7rem); font-weight: 700; line-height: 1; color: var(--c-brand); letter-spacing: -.04em; margin-bottom: 16px; }
.status-page .btn-row { justify-content: center; margin-top: 28px; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .logo-rotator img:first-child { opacity: 1; }
}

/* ---- Blazor error bar (only shown on unexpected client errors) ---- */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    padding: .6rem 1.25rem .7rem 1.25rem;
    background: lightyellow;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    z-index: 2000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
