/* ==========================================================================
   danatech — new header, nav & footer (ADO 69110)
   Ported from the approved design (danatech-header-nav-footer-showcase.html).
   EVERYTHING here is scoped under .dtx-h (header) or .dtx-f (footer) so it can
   never affect ADCES pages or the legacy danatech header/footer.
   Markup: Mvc/Views/DanatechHeader/Index.cshtml, Mvc/Views/DanatechFooter/Index.cshtml
   Level convention: tier-2 surfaces light grey (--rail), tier-3 surfaces white (--paper).
   ========================================================================== */

/* ---------- Header tokens + resets ---------- */
.dtx-h {
    --ink: #0E2A2E; --teal: #0F5F66; --logo-teal: #0098A0; --accent: #8A5A0C;
    --amber: #C8891B; --amber-deep: #B7791A; --coral: #E76F51; --cream: #FBFAF6;
    --paper: #fff; --line: #E4E7E3; --line-2: #D3D8D2; --muted: #5A6B69; --rail: #F2F5F3;
    /* Shared container: matches the danatech body .container (1400px max, 15px side padding) so header, footer and content share the same left/right edges. */
    --dtx-container: 1400px; --dtx-gutter: 15px;
    /* Horizontal padding on each primary tab (the gap between tabs is twice this). */
    --p-pad: 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
    background: var(--paper);
    font-family: 'Montserrat', system-ui, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.3;
    font-size-adjust: none; /* legacy body sets font-size-adjust: .5 */
    text-align: left;
}
.dtx-h *, .dtx-h *::before, .dtx-h *::after { box-sizing: border-box; }
.dtx-h a { text-decoration: none; color: inherit; }
.dtx-h a:hover { text-decoration: none; }
.dtx-h button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; padding: 0; margin: 0; }
.dtx-h ul { list-style: none; margin: 0; padding: 0; }
.dtx-h p { margin: 0; }
.dtx-h nav { display: block; }
.dtx-h img { margin: 0; max-width: none; }
.dtx-h a:focus-visible, .dtx-h button:focus-visible, .dtx-h input:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.dtx-h .wrap { max-width: var(--dtx-container); margin: 0 auto; padding: 0 var(--dtx-gutter); }

/* ---------- Universal row ---------- */
.dtx-h .uni { border-bottom: 1px solid var(--line); }
.dtx-h .uni .wrap { display: flex; align-items: center; height: 44px; gap: 0; }
.dtx-h .uni .u-spacer { flex: 1; }
.dtx-h .u-link { font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 0 13px; height: 44px; display: inline-flex; align-items: center; transition: color .12s; }
.dtx-h .u-link:hover { color: var(--logo-teal); }
.dtx-h .u-sep { width: 1px; height: 15px; background: var(--line-2); margin: 0 8px; }
.dtx-h .u-adces { font-family: 'Montserrat'; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; color: var(--ink); }
.dtx-h .u-search { display: flex; align-items: center; margin: 0 0 0 12px; }
.dtx-h .u-search input { border: 1px solid var(--line-2); border-radius: 2px; height: 30px; padding: 0 32px 0 12px; font-family: 'Montserrat'; font-size: 12.5px; width: 180px; outline: none; color: var(--ink); background: var(--paper); margin: 0; }
.dtx-h .u-search input:focus { border-color: var(--logo-teal); }
.dtx-h .u-search .mag { width: 14px; height: 14px; border: 1.6px solid var(--muted); border-radius: 50%; margin-left: -26px; position: relative; pointer-events: none; }
.dtx-h .u-search .mag::after { content: ""; position: absolute; width: 6px; height: 1.6px; background: var(--muted); transform: rotate(45deg); right: -4px; bottom: 0; }

/* ---------- Main bar ---------- */
.dtx-h .main { background: var(--paper); position: relative; }
.dtx-h .main .wrap { display: flex; align-items: flex-end; gap: 0; padding-top: 22px; }
.dtx-h .brand { display: flex; align-items: center; padding-bottom: 16px; margin-right: 56px; flex-shrink: 0; }
.dtx-h .brand-logo { height: 60px; width: auto; display: block; } /* +15% (was 52px) per client */
.dtx-h .p-list { list-style: none; display: flex; flex-wrap: nowrap; margin: 0; padding: 0; align-items: flex-end; }
.dtx-h .p-item { position: relative; }
.dtx-h .p-top { display: flex; align-items: center; gap: 7px; padding: 0 var(--p-pad) 16px; font-family: 'Montserrat'; font-weight: 600; font-size: 14.5px; color: var(--ink); position: relative; white-space: nowrap; }
.dtx-h .p-caret { width: 11px; height: 11px; display: inline-block; flex-shrink: 0; transition: transform .18s ease; color: var(--muted); }
.dtx-h .p-caret svg, .dtx-h .rc svg, .dtx-h .dchev svg { width: 100%; height: 100%; display: block; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dtx-h .p-item:hover .p-caret, .dtx-h .p-item:focus-within .p-caret, .dtx-h .p-item.is-open .p-caret { transform: rotate(180deg); color: var(--amber-deep); }
.dtx-h .p-item:hover .p-top, .dtx-h .p-item:focus-within .p-top, .dtx-h .p-item.is-open .p-top, .dtx-h .p-top[aria-current="page"] { color: var(--amber-deep); }
.dtx-h .p-top::after { content: ""; position: absolute; left: var(--p-pad); right: var(--p-pad); bottom: -1px; height: 3px; background: var(--amber); transform: scaleX(0); transform-origin: center; transition: transform .18s cubic-bezier(.4,0,.2,1); z-index: 2; }
.dtx-h .p-item:hover .p-top::after, .dtx-h .p-item:focus-within .p-top::after, .dtx-h .p-item.is-open .p-top::after, .dtx-h .p-top[aria-current="page"]::after { transform: scaleX(1); }
.dtx-h .main::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-2); }
/* Narrow desktops: tighten tab spacing so the grouped tabs stay on one row inside the container until the hamburger takes over. */
@media (min-width: 1025px) and (max-width: 1199px) {
    .dtx-h { --p-pad: 12px; }
    .dtx-h .brand { margin-right: 32px; }
}

/* ---------- Dropdown panels ---------- */
.dtx-h .panel { position: absolute; top: 100%; left: 0; background: var(--paper); border: 1px solid var(--line-2); box-shadow: 0 20px 44px -24px rgba(14,42,46,.4); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .14s, transform .14s, visibility .14s; z-index: 20; text-align: left; }
.dtx-h .p-item:hover .panel, .dtx-h .p-item:focus-within .panel, .dtx-h .p-item.is-open .panel { opacity: 1; visibility: visible; transform: translateY(0); }
/* Escape closes a panel even while the mouse is over it (set by danatech-menu.js). */
.dtx-h .p-item.is-closed .panel { opacity: 0 !important; visibility: hidden !important; }
/* Panels near the right edge open leftwards (class set by danatech-menu.js). */
.dtx-h .p-item.open-left .panel { left: auto; right: 0; }

/* Simple dropdown (tier 2 = light grey) */
.dtx-h .panel.simple { min-width: 260px; max-width: 360px; padding: 10px 0; background: var(--rail); }
.dtx-h .panel.simple a { display: block; padding: 9px 22px; font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.25; }
.dtx-h .panel.simple a .sub, .dtx-h .m-railitem .sub, .dtx-h .m-detail a .sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); margin-top: 1px; line-height: 1.3; }
.dtx-h .panel.simple a:hover { background: var(--paper); color: var(--logo-teal); }

/* Mega-menu: tier-2 rail (grey) -> tier-3 panel (white) */
.dtx-h .panel.mega { display: grid; grid-template-columns: 236px 1fr; min-width: 700px; width: max-content; max-width: min(840px, calc(100vw - 48px)); }
.dtx-h .m-rail { background: var(--rail); padding: 8px 0; border-right: 1px solid var(--line); }
.dtx-h .m-railitem { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 22px; font-family: 'Montserrat'; font-weight: 600; font-size: 13.5px; color: var(--ink); cursor: pointer; border-left: 3px solid transparent; text-align: left; line-height: 1.3; }
.dtx-h .m-railitem .rc { width: 11px; height: 11px; display: inline-block; flex-shrink: 0; opacity: 0; transition: opacity .12s; color: var(--amber-deep); transform: rotate(-90deg); }
.dtx-h .m-railitem:hover, .dtx-h .m-railitem.active { background: var(--paper); border-left-color: var(--amber); color: var(--amber-deep); }
.dtx-h .m-railitem:hover .rc, .dtx-h .m-railitem.active .rc { opacity: 1; }
.dtx-h .m-detail { padding: 22px 28px; min-width: 0; }
.dtx-h .m-detail .d-head { display: block; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 16px; color: var(--ink); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); line-height: 1.3; }
.dtx-h .m-detail a.d-head:hover { color: var(--logo-teal); }
.dtx-h .m-detail .d-head-go { color: var(--amber-deep); font-family: 'Montserrat'; font-size: 14px; }
.dtx-h .m-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.dtx-h .m-cols a { display: block; padding: 7px 0; font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.3; border-bottom: 1px solid var(--line); }
.dtx-h .m-cols a:hover { color: var(--logo-teal); }
.dtx-h .m-pane { display: none; }
.dtx-h .m-pane.active { display: block; }

/* ---------- Hamburger + drawer (hidden on desktop) ---------- */
.dtx-h .hamburger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; margin-left: auto; flex-direction: column; gap: 5px; width: 44px; height: 44px; align-items: center; justify-content: center; }
.dtx-h .hamburger span { display: block; width: 24px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.dtx-h .drawer { display: none; }
.dtx-h .drawer-scrim { display: none; }

/* Collapse BEFORE the tabs can wrap or truncate */
@media (max-width: 1024px) {
    .dtx-h .p-list, .dtx-h nav[aria-label="Main"] { display: none; }
    .dtx-h .uni { display: none; }
    .dtx-h .hamburger { display: flex; }
    .dtx-h .main .wrap { padding-top: 12px; align-items: center; }
    .dtx-h .brand { padding-bottom: 12px; margin-right: 0; }
    .dtx-h .brand-logo { height: 60px; }
    .dtx-h .main::after { display: none; }
    .dtx-h .main { border-bottom: 1px solid var(--line-2); }

    .dtx-h .drawer-scrim { position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0; background: rgba(14,42,46,.5); z-index: 90; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
    .dtx-h.menu-open .drawer-scrim { display: block; opacity: 1; visibility: visible; }
    .dtx-h .drawer { display: block; position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: min(88vw, 380px); background: var(--paper); z-index: 100; transform: translateX(100%); visibility: hidden; transition: transform .24s ease, visibility .24s; overflow-y: auto; -webkit-overflow-scrolling: touch; box-shadow: -8px 0 30px -12px rgba(14,42,46,.4); }
    .dtx-h.menu-open .drawer { transform: translateX(0); visibility: visible; }
    .dtx-h.menu-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .dtx-h.menu-open .hamburger span:nth-child(2) { opacity: 0; }
    .dtx-h.menu-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .dtx-h .d-top { padding: 20px; border-bottom: 1px solid var(--line); position: relative; }
    .dtx-h .d-close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; font-size: 26px; line-height: 1; color: var(--muted); }
    .dtx-h .d-search { display: flex; border: 1px solid var(--line-2); border-radius: 2px; overflow: hidden; margin: 28px 0 16px; }
    .dtx-h .d-search input { flex: 1; border: 0; padding: 11px 13px; font-family: 'Montserrat'; font-size: 16px; outline: none; min-width: 0; margin: 0; }
    .dtx-h .d-util { display: flex; flex-wrap: wrap; gap: 14px; }
    .dtx-h .d-util a { font-size: 12.5px; font-weight: 600; color: var(--muted); }
    .dtx-h .d-util a.adces { color: var(--ink); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }

    /* Tier 1 */
    .dtx-h .d-acc-item { border-bottom: 1px solid var(--line); }
    .dtx-h .d-acc-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: none; border: 0; font-family: 'Montserrat'; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer; text-align: left; }
    .dtx-h .d-acc-top .dchev { width: 12px; height: 12px; transition: transform .2s; color: var(--muted); flex-shrink: 0; }
    .dtx-h .d-acc-item.open > .d-acc-top { color: var(--amber-deep); }
    .dtx-h .d-acc-item.open > .d-acc-top .dchev { transform: rotate(180deg); color: var(--amber-deep); }
    /* Tier 2 = light grey */
    .dtx-h .d-acc-panel { display: none; background: var(--rail); padding: 4px 0 12px; }
    .dtx-h .d-acc-item.open > .d-acc-panel { display: block; }
    .dtx-h .d-l2 { display: block; padding: 11px 20px 11px 28px; font-size: 14px; font-weight: 500; color: var(--ink); }
    .dtx-h .d-l2:hover { color: var(--logo-teal); }
    .dtx-h .d-l2 .l2sub, .dtx-h .d-l3 .l2sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 1px; }
    .dtx-h .d-overview { font-weight: 600; }
    .dtx-h .d-sub { border-top: 1px solid var(--line); }
    .dtx-h .d-sub-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 20px 11px 28px; background: none; border: 0; font-family: 'Montserrat'; font-weight: 600; font-size: 13.5px; color: var(--ink); cursor: pointer; text-align: left; }
    .dtx-h .d-sub-top .dchev { width: 11px; height: 11px; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
    .dtx-h .d-sub.open .d-sub-top { color: var(--amber-deep); }
    .dtx-h .d-sub.open .d-sub-top .dchev { transform: rotate(180deg); }
    /* Tier 3 = white */
    .dtx-h .d-l3wrap { display: none; background: var(--paper); }
    .dtx-h .d-sub.open .d-l3wrap { display: block; }
    .dtx-h .d-l3 { display: block; padding: 9px 20px 9px 40px; font-size: 13px; font-weight: 500; color: var(--ink); }
    .dtx-h .d-l3:hover { color: var(--logo-teal); }
}
@media (max-width: 480px) {
    .dtx-h .drawer { width: 100vw; }
    .dtx-h .main .wrap { padding-left: var(--dtx-gutter); padding-right: var(--dtx-gutter); }
    .dtx-h .brand-logo { height: 51px; } /* +15% (was 44px) */
}
/* Stop the page scrolling behind the open drawer (class set on <html> by danatech-menu.js). */
html.dtx-menu-open, html.dtx-menu-open body { overflow: hidden; }

/* ---------- Footer ---------- */
.dtx-f {
    --ink: #0E2A2E; --teal: #0F5F66; --logo-teal: #0098A0; --accent: #8A5A0C;
    --amber: #C8891B; --amber-deep: #B7791A; --coral: #E76F51; --cream: #FBFAF6;
    --paper: #fff; --line: #C9CFC9; --line-2: #D3D8D2; --muted: #5A6B69;
    --dtx-container: 1400px; --dtx-gutter: 15px; /* keep in sync with .dtx-h */
    box-sizing: border-box;
    font-family: 'Montserrat', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size-adjust: none;
    text-align: left;
}
.dtx-f *, .dtx-f *::before, .dtx-f *::after { box-sizing: border-box; }
.dtx-f a { text-decoration: none; color: inherit; }
.dtx-f a:hover { text-decoration: none; }
.dtx-f p { margin: 0; }
.dtx-f img { margin: 0; max-width: 100%; }
.dtx-f h4 { position: static; }
.dtx-f a:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.dtx-f .f-wrap { max-width: var(--dtx-container); margin: 0 auto; padding: 0 var(--dtx-gutter); }
/* 1 brand column + as many link columns as the editor creates */
.dtx-f .f-top { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(auto-fit, minmax(140px, 1fr)); gap: 40px; padding: 52px 0 40px; }
.dtx-f .f-brand-logo { height: 58px; width: auto; display: block; margin-bottom: 16px; }
.dtx-f .f-blurb { font-size: 13px; line-height: 1.55; max-width: 34ch; }
.dtx-f .f-col h4 { font-family: 'Montserrat'; font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 16px; line-height: 1.3; }
.dtx-f .f-col a { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.3; padding: 6px 0; }
.dtx-f .f-legal { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 0; font-size: 12px; }
.dtx-f .f-legal .social { display: flex; gap: 12px; margin-right: auto; }
.dtx-f .f-legal .social a { width: 30px; height: 30px; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.dtx-f .f-legal .social svg { width: 15px; height: 15px; fill: currentColor; }
.dtx-f .f-legal .llink { font-weight: 500; }
.dtx-f .f-copy { padding: 16px 0 28px; font-size: 11.5px; line-height: 1.6; }
.dtx-f .f-copy .made { display: block; margin-bottom: 6px; }

/* Cream variant (approved design "B") */
.dtx-f .fB { background: var(--cream); color: var(--ink); position: relative; border-top: 1px solid var(--line); display: block; }
.dtx-f .fB::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--amber); }
.dtx-f .fB::after { content: ""; position: absolute; top: 0; left: 0; width: 96px; height: 4px; background: var(--coral); }
.dtx-f .fB .f-blurb { color: var(--muted); }
.dtx-f .fB .f-col h4 { color: var(--accent); }
.dtx-f .fB .f-col a { color: var(--ink); }
.dtx-f .fB .f-col a:hover { color: var(--logo-teal); }
.dtx-f .fB .f-top { border-bottom: 1px solid var(--line); }
.dtx-f .fB .f-legal { border-bottom: 1px solid var(--line); color: var(--muted); }
.dtx-f .fB .f-legal .social a { background: var(--paper); border: 1px solid var(--line-2); color: var(--teal); }
.dtx-f .fB .f-legal .social a:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.dtx-f .fB .f-legal .llink { color: var(--muted); }
.dtx-f .fB .f-legal .llink:hover { color: var(--logo-teal); }
.dtx-f .fB .f-copy { color: var(--muted); }

@media (max-width: 900px) {
    .dtx-f .f-top { grid-template-columns: 1fr 1fr; gap: 30px; }
    .dtx-f .f-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .dtx-f .f-wrap { padding: 0 var(--dtx-gutter); }
    .dtx-f .f-top { grid-template-columns: 1fr; }
    .dtx-f .f-legal .social { width: 100%; }
}
