/* ==========================================================================
   ATPCH chrome: the ONE header + footer of the whole site (template-parts/chrome/{header,footer}.php, Core\Chrome\Chrome).
   Loaded on every front-end page, so it must work with the older pages' Tailwind preflight AND with the modern departments' dept.css:
   everything is scoped to .dp-header / .dp-footer / .dp-skip / .dp-totop and brings its own resets. RTL-first (logical properties).
   The department's colour comes from --dp-accent / --dp-accent-2 (set inline on <body> by the header).
   ========================================================================== */

.dp-header, .dp-footer, .dp-skip, .dp-totop {
    --c-ink: var(--dp-ink, #0b1220);
    --c-ink-2: var(--dp-ink-2, #1e293b);
    --c-muted: var(--dp-muted, #64748b);
    --c-line: var(--dp-line, #e2e8f0);
    --c-soft: var(--dp-soft, #f1f5f9);
    --c-accent: var(--dp-accent, #2563eb);
    --c-accent-2: var(--dp-accent-2, #7c3aed);
    --c-ease: cubic-bezier(.2, .8, .2, 1);
    font-family: inherit;
    line-height: 1.8;
    text-align: start;
}
.dp-header *, .dp-header *::before, .dp-header *::after, .dp-footer *, .dp-footer *::before, .dp-footer *::after { box-sizing: border-box; }
.dp-header ul, .dp-footer ul { list-style: none; margin: 0; padding: 0; }
.dp-header a, .dp-footer a { color: inherit; text-decoration: none; }
.dp-header button { font: inherit; color: inherit; }

/* the header is sticky: an anchor jump / scrollIntoView must stop BELOW it, not under it */
html { scroll-padding-top: calc(var(--dp-header-h, 72px) + 16px); }
html:has(.admin-bar), body.admin-bar { scroll-padding-top: calc(var(--dp-header-h, 72px) + 48px); }

/* ---------- skip link ---------- */
.dp-skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--c-ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 1000; transition: top .2s; }
.dp-skip:focus { top: 12px; }

/* ---------- header ---------- */
.dp-header { position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--c-line); transition: box-shadow .25s var(--c-ease); }
.dp-header::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c-accent), var(--c-accent-2)); }
.dp-header.is-scrolled { box-shadow: 0 12px 28px -18px rgba(15, 23, 42, .45); }
.admin-bar .dp-header { top: 32px; }
.dp-header__in { width: min(1280px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: 18px; min-height: var(--dp-header-h, 72px); padding-top: 3px; }

.dp-brand { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.dp-brand a { display: inline-flex; align-items: center; }
.dp-brand img { max-height: 46px; width: auto; display: block; }
.dp-brand__name { font-weight: 800; color: var(--c-ink); }
.dp-brand__tag { display: inline-flex !important; align-items: center; gap: 7px; font-size: .8rem; font-weight: 800; line-height: 1.5; color: var(--c-accent) !important; background: color-mix(in srgb, var(--c-accent) 9%, white); border: 1px solid color-mix(in srgb, var(--c-accent) 24%, white); padding: 4px 12px; border-radius: 999px; white-space: nowrap; transition: background .2s, box-shadow .2s; }
.dp-brand__tag i { font-size: .8rem; }
.dp-brand__tag:hover, .dp-brand__tag:focus-visible { background: color-mix(in srgb, var(--c-accent) 16%, white); box-shadow: 0 6px 14px -8px var(--c-accent); }

.dp-nav { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.dp-menu { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.dp-menu > li { position: relative; display: flex; align-items: center; margin: 0; }
.dp-menu a { display: block; padding: 8px 13px; border-radius: 999px; font-weight: 600; font-size: .92rem; line-height: 1.7; color: var(--c-ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.dp-menu a:hover, .dp-menu a:focus-visible, .dp-menu .current-menu-item > a, .dp-menu .current-menu-ancestor > a, .dp-menu a[aria-current="page"], .dp-menu li.is-open > a { background: color-mix(in srgb, var(--c-accent) 10%, white); color: var(--c-accent); }
.dp-menu__toggle { width: 24px; height: 24px; margin-inline-start: -8px; padding: 0 !important; border: 0; border-radius: 50%; background: transparent; color: var(--c-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .65rem; transition: transform .2s var(--c-ease), color .2s; }
.dp-menu li.is-open > .dp-menu__toggle, .dp-menu li:hover > .dp-menu__toggle { color: var(--c-accent); }
.dp-menu li.is-open > .dp-menu__toggle { transform: rotate(180deg); }
.dp-menu .sub-menu { position: absolute; inset-inline-start: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px; background: #fff; border: 1px solid var(--c-line); border-radius: 16px; box-shadow: 0 24px 44px -20px rgba(15, 23, 42, .4); display: none; z-index: 5; }
.dp-menu .sub-menu::before { content: ""; position: absolute; inset: -9px 0 auto 0; height: 9px; } /* keeps the hover alive across the gap */
.dp-menu li:hover > .sub-menu, .dp-menu li:focus-within > .sub-menu, .dp-menu li.is-open > .sub-menu { display: block; animation: dp-drop .18s var(--c-ease); }
.dp-menu .sub-menu li { display: block; }
.dp-menu .sub-menu a { border-radius: 10px; padding: 9px 12px; white-space: normal; }
@keyframes dp-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.dp-header__actions { display: flex; align-items: center; gap: 10px; flex: none; }
.dp-account { display: inline-flex !important; align-items: center; gap: 8px; max-width: 190px; padding: 7px 15px; border: 1px solid var(--c-line); border-radius: 999px; background: #fff; font-size: .86rem; font-weight: 700; line-height: 1.7; color: var(--c-ink-2) !important; transition: border-color .2s, color .2s, box-shadow .2s; }
.dp-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-account i { color: var(--c-accent); font-size: 1.05rem; }
.dp-account:hover, .dp-account:focus-visible { border-color: var(--c-accent); color: var(--c-accent) !important; box-shadow: 0 8px 18px -12px var(--c-accent); }
.dp-cta-btn { display: inline-flex !important; align-items: center; padding: 8px 18px; border-radius: 999px; font-size: .88rem; font-weight: 800; line-height: 1.7; color: #fff !important; white-space: nowrap; background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2)); box-shadow: 0 12px 22px -12px var(--c-accent); transition: transform .25s var(--c-ease), box-shadow .25s var(--c-ease); }
.dp-cta-btn:hover, .dp-cta-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 26px -12px var(--c-accent); }
.dp-iconbtn { position: relative; width: 42px; height: 42px; display: inline-flex !important; align-items: center; justify-content: center; border: 1px solid var(--c-line); border-radius: 50%; background: #fff; color: var(--c-ink-2) !important; transition: border-color .2s, color .2s; }
.dp-iconbtn:hover, .dp-iconbtn:focus-visible { border-color: var(--c-accent); color: var(--c-accent) !important; }
.dp-iconbtn__count { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .7rem; font-weight: 800; line-height: 20px; text-align: center; }

.dp-burger { display: none; width: 44px; height: 44px; padding: 0 !important; border-radius: 12px; border: 1px solid var(--c-line); background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.dp-burger__bars { position: relative; width: 20px; height: 14px; display: block; }
.dp-burger__bars i { position: absolute; inset-inline: 0; height: 2px; border-radius: 2px; background: var(--c-ink-2); transition: transform .25s var(--c-ease), opacity .2s, top .25s var(--c-ease); }
.dp-burger__bars i:nth-child(1) { top: 0; }
.dp-burger__bars i:nth-child(2) { top: 6px; }
.dp-burger__bars i:nth-child(3) { top: 12px; }
.dp-burger[aria-expanded="true"] .dp-burger__bars i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.dp-burger[aria-expanded="true"] .dp-burger__bars i:nth-child(2) { opacity: 0; }
.dp-burger[aria-expanded="true"] .dp-burger__bars i:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 1080px) {
    .dp-burger { display: inline-flex; }
    .dp-header__in { gap: 12px; }
    .dp-nav { position: absolute; inset: 100% 0 auto 0; display: none; justify-content: stretch; background: #fff; border-bottom: 1px solid var(--c-line); padding: 10px 16px 20px; max-height: calc(100vh - var(--dp-header-h, 72px) - 8px); overflow-y: auto; box-shadow: 0 24px 40px -24px rgba(15, 23, 42, .45); }
    .dp-nav.is-open { display: block; }
    .dp-header__actions { margin-inline-start: auto; }
    .dp-menu { flex-direction: column; align-items: stretch; gap: 2px; }
    .dp-menu > li { flex-wrap: wrap; justify-content: space-between; }
    .dp-menu > li > a { flex: 1 1 0; padding: 12px 14px; border-radius: 12px; }
    .dp-menu__toggle { width: 40px; height: 40px; margin: 0; font-size: .8rem; }
    .dp-menu .sub-menu { position: static; display: none; flex: 0 0 100%; min-width: 0; margin: 2px 0 8px; box-shadow: none; border-radius: 12px; background: var(--c-soft); border-color: transparent; }
    .dp-menu .sub-menu::before { display: none; }
    .dp-menu li:hover > .sub-menu, .dp-menu li:focus-within > .sub-menu { display: none; }
    .dp-menu li.is-open > .sub-menu { display: block; }
}
@media (max-width: 640px) {
    .dp-header__in { width: calc(100% - 24px); }
    .dp-account span, .dp-cta-btn { display: none !important; }
    .dp-account { width: 42px; height: 42px; padding: 0; justify-content: center; }
    .dp-brand img { max-height: 38px; }
    .dp-brand__tag { font-size: .74rem; padding: 3px 10px; }
}
@media (max-width: 420px) { .dp-brand__tag span { max-width: 96px; overflow: hidden; text-overflow: ellipsis; } }
.admin-bar .dp-nav { max-height: calc(100vh - var(--dp-header-h, 72px) - 40px); }
@media (max-width: 782px) { .admin-bar .dp-header { top: 46px; } }

/* ---------- footer ---------- */
.dp-footer { position: relative; overflow: hidden; background: var(--c-ink); color: #94a3b8; font-size: .94rem; margin: 0; }
.dp-footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c-accent), var(--c-accent-2)); }
.dp-footer::after { content: ""; position: absolute; top: -140px; inset-inline-end: -120px; width: 440px; height: 440px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c-accent) 26%, transparent), transparent); pointer-events: none; }
.dp-footer__in { position: relative; z-index: 1; width: min(1280px, 100% - 32px); margin-inline: auto; }
.dp-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px 48px; padding-block: 60px 36px; }
@media (min-width: 1081px) {
    .dp-footer__grid { grid-template-columns: 1.3fr 1.8fr 1fr 1.3fr; }
    .dp-footer__grid--3 { grid-template-columns: 1.3fr 1.8fr 1fr; }
}
.dp-footer__logo img { max-height: 54px; width: auto; display: block; filter: brightness(0) invert(1); opacity: .92; }
.dp-footer__logo a { color: #fff; font-weight: 800; font-size: 1.2rem; }
.dp-footer__text { margin: 14px 0 0; line-height: 2; color: #94a3b8; }
.dp-footer__text .footer-widget { margin: 0; }
.dp-footer__here { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #fff !important; font-weight: 700; font-size: .88rem; transition: background .2s; }
.dp-footer__here:hover { background: rgba(255, 255, 255, .14); }
.dp-footer__here i:first-child { color: var(--c-accent-2); filter: brightness(1.6); }
.dp-footer__title, .dp-footer h4.widget-title, .dp-footer .footer-widget > h4 { position: relative; margin: 0 0 18px; padding-inline-start: 14px; color: #fff; font-size: 1rem; font-weight: 800; line-height: 1.6; }
.dp-footer__title::before, .dp-footer h4.widget-title::before, .dp-footer .footer-widget > h4::before { content: ""; position: absolute; inset-inline-start: 0; top: 5px; bottom: 5px; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--c-accent), var(--c-accent-2)); }
.dp-footer__list li { margin: 0 0 9px; }
.dp-footer__list a { display: inline-block; color: #94a3b8; transition: color .2s, transform .2s var(--c-ease); }
.dp-footer__list a:hover, .dp-footer__list a:focus-visible { color: #fff; transform: translateX(-4px); }
.dp-footer__list--2col { columns: 2; column-gap: 32px; }
.dp-footer__list--2col li { break-inside: avoid; }
.dp-footer__list--row { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.dp-footer__list--row li { margin: 0; }
.dp-footer__col .footer-widget, .dp-footer__col .widget { color: #94a3b8; line-height: 2; }
.dp-footer__col .footer-widget p, .dp-footer__col .widget p { margin: 0 0 8px; }
.dp-footer__col .footer-widget a, .dp-footer__col .widget a { color: #cbd5e1; }
.dp-footer__col .footer-widget p a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, .25); }
.dp-footer__col .footer-widget a:hover, .dp-footer__text a:hover { color: #fff; }
.dp-footer__col .footer-widget ul { list-style: none; margin: 0; padding: 0; }
.dp-footer__col .footer-widget img { max-width: 100%; height: auto; }
.dp-footer__col .footer-widget li { margin-bottom: 8px; }
.dp-footer__text .footer-widget, .dp-footer__text p { color: #94a3b8; }

/* The footer texts are widgets the editors wrote with Tailwind utility classes (logo row, social icons, address lines, trust badges). The modern
   departments do not load Tailwind, so the handful of utilities those widgets use are mirrored here, scoped to the footer. */
.dp-footer .flex { display: flex; }
.dp-footer .flex-wrap { flex-wrap: wrap; }
.dp-footer .items-center { align-items: center; }
.dp-footer .items-start { align-items: flex-start; }
.dp-footer .gap-4 { gap: 1rem; }
.dp-footer .mb-6 { margin-bottom: 1.5rem; }
.dp-footer .mt-1 { margin-top: .25rem; }
.dp-footer .ml-3 { margin-left: .75rem; }
.dp-footer .ml-4 { margin-left: 1rem; }
.dp-footer .space-y-4 > * + * { margin-top: 1rem; }
.dp-footer .space-x-4.space-x-reverse > * + * { margin-right: 1rem; margin-left: 0; }
.dp-footer .text-2xl { font-size: 1.5rem; line-height: 2rem; }
.dp-footer .text-gray-400 { color: #94a3b8; }
.dp-footer .hover\:text-yellow-500:hover { color: #eab308; }
.dp-footer .h-16 { height: 4rem; width: auto; }
.dp-footer .bg-white { background: #fff; }
.dp-footer .p-2 { padding: .5rem; }
.dp-footer .rounded { border-radius: .25rem; }
.dp-footer .fab, .dp-footer .fas { flex: none; }

.dp-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 20px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .86rem; color: #7c8aa0; }
.dp-footer__legal { margin: 0; }
@media (max-width: 760px) {
    .dp-footer__grid { padding-block: 44px 24px; gap: 32px; }
    .dp-footer__bottom { flex-direction: column; align-items: flex-start; padding-bottom: 84px; } /* room for the back-to-top button */
}

/* ---------- back to top ---------- */
.dp-totop { position: fixed; inset-inline-start: 22px; bottom: 22px; z-index: 55; width: 46px; height: 46px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2)); box-shadow: 0 14px 28px -12px var(--c-accent); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s var(--c-ease); }
.dp-totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.dp-totop:hover { transform: translateY(-3px); }
.dp-totop[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    .dp-header, .dp-header *, .dp-footer *, .dp-totop { transition: none !important; animation: none !important; }
}
@media print { .dp-header, .dp-footer, .dp-skip, .dp-totop { display: none !important; } }
