/* ==========================================================================
   eachm.com — shared site UI (navigation, footer, mobile menu)
   Single source of truth for the site chrome. Self-contained: does not
   depend on Tailwind, so it renders identically on every page.
   Palette is fixed (independent of each page's accent colour) so text
   always stays readable on every background.
   ========================================================================== */

:root {
    --em-blue: #2563eb;
    --em-blue-700: #1d4ed8;
    --em-blue-50: #eff6ff;
    --em-blue-100: #dbeafe;
    --em-ink: #0f172a;
    --em-ink-2: #475569;
    --em-ink-3: #64748b;
    --em-line: #e7eaf0;
    --em-foot: #0d1524;
    --em-foot-line: rgba(255, 255, 255, .10);
    --em-foot-text: #aab7ca;
    --em-foot-head: #eef2f9;
    --em-foot-accent: #7cbcff;
    --em-shadow: 0 10px 34px -14px rgba(15, 23, 42, .22);
    --em-nav-h: 60px;
    --em-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.em-nav,
.em-nav *,
.em-foot,
.em-foot *,
.em-mobile,
.em-mobile * {
    box-sizing: border-box;
}

/* ------------------------------------------------------------------ Nav */
.em-nav {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--em-line);
    font-family: var(--em-font);
}

.em-nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    height: var(--em-nav-h);
    display: flex;
    align-items: center;
    gap: 14px;
}

.em-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.em-brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .65);
}

.em-brand__text {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -.02em;
    color: var(--em-ink);
    line-height: 1;
    white-space: nowrap;
}

.em-brand__accent {
    color: var(--em-blue);
}

.em-nav__badge {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--em-blue);
    background: var(--em-blue-50);
    border: 1px solid var(--em-blue-100);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .em-nav__badge { display: inline-flex; }
}

.em-nav__links {
    display: none;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

@media (min-width: 1024px) {
    .em-nav__links { display: flex; }
}

.em-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    color: var(--em-ink-2);
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 10px;
    white-space: nowrap;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color .18s ease, background .18s ease;
}

.em-nav__link:hover {
    color: var(--em-blue);
    background: var(--em-blue-50);
}

.em-nav__link.is-active {
    color: var(--em-blue);
    background: var(--em-blue-50);
}

.em-nav__item { position: relative; }

.em-caret {
    font-size: 10px;
    transition: transform .2s ease;
}

.em-nav__trigger { cursor: pointer; }

.em-nav__item.is-open .em-caret { transform: rotate(180deg); }

.em-nav__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--em-line);
    border-radius: 14px;
    box-shadow: var(--em-shadow);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 30;
}

.em-nav__item:hover .em-nav__dropdown,
.em-nav__item:focus-within .em-nav__dropdown,
.em-nav__item.is-open .em-nav__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.em-nav__dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--em-ink-2);
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.em-nav__dropdown a i {
    width: 16px;
    text-align: center;
    color: var(--em-blue);
}

.em-nav__dropdown a:hover,
.em-nav__dropdown a.is-active {
    background: var(--em-blue-50);
    color: var(--em-blue);
}

.em-nav__burger {
    display: inline-flex;
    margin-left: auto;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--em-line);
    border-radius: 12px;
    background: #fff;
    color: var(--em-ink);
    font-size: 17px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.em-nav__burger:hover { background: var(--em-blue-50); border-color: var(--em-blue-100); }

@media (min-width: 1024px) {
    .em-nav__burger { display: none; }
}

/* ------------------------------------------------------- Mobile menu */
.em-mobile {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #fff;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .3s cubic-bezier(.22, .7, .2, 1), visibility .3s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-family: var(--em-font);
}

.em-mobile.is-open {
    transform: translateX(0);
    visibility: visible;
}

.em-mobile__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--em-line);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.em-mobile__close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--em-line);
    background: #fff;
    color: var(--em-ink);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.em-mobile__links {
    display: flex;
    flex-direction: column;
    padding: 10px 14px 44px;
    gap: 3px;
}

.em-mobile__group {
    margin: 14px 0 4px;
    padding: 0 12px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--em-ink-3);
}

.em-mobile__links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--em-ink-2);
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.em-mobile__links a i {
    width: 18px;
    text-align: center;
    color: var(--em-ink-3);
    font-size: 15px;
}

.em-mobile__links a:hover,
.em-mobile__links a.is-active {
    background: var(--em-blue-50);
    color: var(--em-blue);
}

.em-mobile__links a.is-active i { color: var(--em-blue); }

body.em-noscroll { overflow: hidden; }

/* --------------------------------------------------------------- Footer */
.em-foot {
    background: var(--em-foot);
    color: var(--em-foot-text);
    margin-top: 56px;
    font-family: var(--em-font);
}

.em-foot__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.em-foot__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 52px 0 34px;
}

@media (min-width: 640px) {
    .em-foot__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .em-foot__grid { grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 44px; }
}

.em-foot__brand .em-brand__text { color: #fff; }
.em-foot__brand .em-brand__accent { color: var(--em-foot-accent); }
.em-foot__brand .em-brand__mark { box-shadow: none; }

@media (min-width: 640px) and (max-width: 1023px) {
    .em-foot__brand { grid-column: 1 / -1; }
}

.em-foot__lead {
    margin: 16px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--em-foot-text);
    max-width: 340px;
}

.em-foot__social {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.em-foot__social a {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .06);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.em-foot__social a:hover {
    background: var(--em-blue);
    color: #fff;
    transform: translateY(-2px);
}

.em-foot__col { min-width: 0; }

.em-foot h4 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--em-foot-head);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--em-foot-line);
}

.em-foot ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.em-foot ul a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--em-foot-text);
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}

.em-foot ul a i {
    font-size: 10px;
    color: #5b7091;
    transition: color .18s ease;
}

.em-foot ul a:hover {
    color: #fff;
    transform: translateX(3px);
}

.em-foot ul a:hover i { color: var(--em-foot-accent); }

.em-foot__bottom {
    border-top: 1px solid var(--em-foot-line);
    padding: 22px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.em-foot__bottom p {
    margin: 0;
    font-size: 13px;
    color: #8b9ab1;
}

.em-foot__legal {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.em-foot__legal a {
    font-size: 13px;
    color: #8b9ab1;
    text-decoration: none;
    transition: color .18s ease;
}

.em-foot__legal a:hover { color: #fff; }

/* ------------------------------------------------------------ Back-top */
.em-backtop {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 0;
    background: var(--em-blue);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 14px 30px -10px rgba(37, 99, 235, .7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease, background .2s ease;
    z-index: 850;
}

.em-backtop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.em-backtop:hover { background: var(--em-blue-700); }

/* ------------------------------------------------------ Accessibility */
.em-nav a:focus-visible,
.em-nav button:focus-visible,
.em-foot a:focus-visible,
.em-mobile a:focus-visible,
.em-mobile button:focus-visible,
.em-backtop:focus-visible {
    outline: 2px solid var(--em-blue);
    outline-offset: 2px;
    border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
    .em-nav *,
    .em-mobile,
    .em-backtop,
    .em-foot * {
        transition: none !important;
        animation: none !important;
    }
}

/* Utility: make sure long content never forces a horizontal scrollbar */
.em-nav img,
.em-foot img { max-width: 100%; height: auto; }
