/* ============================================================
   EngCalc site chrome — header & footer
   Minimal, clean, fully responsive. Simple hover dropdowns.
   ============================================================ */
.ec-chrome {
  --ec-blue:#2563EB; --ec-blue-700:#1D4ED8; --ec-blue-050:#EFF4FF;
  --ec-ink:#0F172A; --ec-body:#475569; --ec-muted:#64748B;
  --ec-line:#E8ECF2; --ec-line-soft:#F1F4F8; --ec-surface:#fff;
  --ec-canvas:#F8FAFC; --ec-r:10px;
  font-family: system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
}
.ec-chrome *, .ec-chrome *::before, .ec-chrome *::after { box-sizing: border-box; }

/* ---------- Header ---------- */
.ec-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--ec-surface);
  border-bottom: 1px solid var(--ec-line);
}
.ec-header-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 70px; display: flex; align-items: center; gap: 28px;
}
.ec-logo { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.ec-logo-img { height: 36px; width: auto; display: block; }
.ec-logo-text { font-weight: 800; font-size: 20px; color: var(--ec-ink); letter-spacing: -.03em; }

/* nav */
.ec-nav { margin-left: auto; height: 100%; }
.ec-nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; height: 100%; }
.ec-nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.ec-nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 14px; border-radius: var(--ec-r);
  color: var(--ec-body); font-size: 15px; font-weight: 500; text-decoration: none;
  transition: color .15s, background .15s;
}
.ec-nav-link:hover { color: var(--ec-blue-700); background: var(--ec-blue-050); }
.ec-caret { width: 10px; height: 6px; opacity: .55; transition: transform .2s; }
.ec-nav-item:hover .ec-caret { transform: rotate(180deg); }

/* dropdown — simple clean list */
.ec-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 250px; max-height: 70vh; overflow-y: auto;
  background: var(--ec-surface); border: 1px solid var(--ec-line);
  border-radius: 12px; box-shadow: 0 16px 40px -16px rgba(15,23,42,.25);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .16s, transform .16s, visibility .16s; z-index: 70;
}
.ec-nav-item:hover .ec-dropdown,
.ec-nav-item:focus-within .ec-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.ec-dropdown ul { list-style: none; margin: 0; padding: 0; }
.ec-dropdown a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--ec-body); font-size: 14px; text-decoration: none; line-height: 1.4;
  transition: background .12s, color .12s;
}
.ec-dropdown a:hover { background: var(--ec-blue-050); color: var(--ec-blue-700); }

/* burger (hidden on desktop) */
.ec-burger {
  display: none; margin-left: auto; width: 44px; height: 44px;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--ec-line); border-radius: var(--ec-r); cursor: pointer;
}
.ec-burger span { display: block; width: 20px; height: 2px; background: var(--ec-ink); border-radius: 2px; transition: transform .25s, opacity .2s; }
.ec-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ec-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ec-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile nav */
.ec-mobile { display: none; border-top: 1px solid var(--ec-line); background: var(--ec-surface); }
.ec-mobile.open { display: block; }
.ec-mobile-list { list-style: none; margin: 0; padding: 8px 16px 20px; max-width: 1180px; margin: 0 auto; max-height: calc(100vh - 70px); overflow-y: auto; }
.ec-mobile-group { border-bottom: 1px solid var(--ec-line-soft); }
.ec-mobile-cat {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: 0; padding: 15px 6px; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--ec-ink);
}
.ec-mobile-cat svg { width: 12px; height: 8px; opacity: .6; transition: transform .2s; }
.ec-mobile-cat.open svg { transform: rotate(180deg); }
.ec-mobile-tools { display: none; padding: 0 6px 12px; }
.ec-mobile-tools.open { display: block; }
.ec-mobile-tools li { list-style: none; }
.ec-mobile-tools a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ec-body); font-size: 15px; text-decoration: none; }
.ec-mobile-tools a:hover { background: var(--ec-blue-050); color: var(--ec-blue-700); }
.ec-mobile-link { list-style: none; }
.ec-mobile-link a { display: block; padding: 15px 6px; font-size: 16px; font-weight: 600; color: var(--ec-ink); text-decoration: none; border-bottom: 1px solid var(--ec-line-soft); }

/* responsive switch */
@media (max-width: 1024px) {
  .ec-nav { display: none; }
  .ec-burger { display: flex; }
}
@media (max-width: 480px) {
  .ec-header-inner { height: 62px; padding: 0 16px; }
  .ec-logo-img { height: 30px; }
}

/* ---------- Footer ---------- */
.ec-footer { background: var(--ec-ink); color: #94A3B8; padding: 52px 0 28px; }
.ec-footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.ec-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; margin-bottom: 34px; }
.ec-footer-brand p { font-size: 14px; line-height: 1.65; margin: 14px 0 0; max-width: 34ch; }
.ec-logo-footer .ec-logo-img { height: 34px; }
.ec-logo-footer .ec-logo-text { color: #fff; }
.ec-footer-col h4 { color: #fff; font-size: 13.5px; font-weight: 700; margin: 0 0 14px; letter-spacing: .02em; }
.ec-footer-col ul { list-style: none; margin: 0; padding: 0; }
.ec-footer-col li { margin-bottom: 9px; }
.ec-footer-col a { color: #94A3B8; font-size: 13.5px; text-decoration: none; transition: color .15s; }
.ec-footer-col a:hover { color: #fff; }
.ec-footer-bottom { border-top: 1px solid #1E293B; padding-top: 22px; font-size: 13.5px; }

@media (max-width: 900px) {
  .ec-footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .ec-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .ec-footer-grid { grid-template-columns: 1fr; }
  .ec-footer { padding: 40px 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ec-chrome *, .ec-chrome *::before, .ec-chrome *::after { transition: none !important; }
}
