/* ══════════════════════════════════════════════════════════════
   ACCOUNTCHI MEGA MENU
   Header navigation, the two mega panels (IP types, categories)
   and the mobile drawer. Uses the theme tokens from style.css so
   it inherits light/dark.

   Panel structure is a rail beside a pane: the rail lists the
   choices down one edge, the pane fills the rest with the
   selected choice's contents. Moving from a rail item into its
   pane never crosses a sibling, which is what made the earlier
   side-by-side columns unusable.
   ══════════════════════════════════════════════════════════════ */

/* ─── Top-level nav bar ─────────────────────────────────────── */
.akch-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
  font-weight: 500;
}
.akch-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}
.akch-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  transition: color .18s, background .18s;
}
.akch-nav-link:hover,
.akch-nav-item:hover > .akch-nav-link,
.akch-nav-item.is-open > .akch-nav-link {
  color: var(--text);
  background: var(--surface);
}
.akch-nav-caret {
  opacity: .65;
  transition: transform .22s ease;
}
.akch-nav-item.is-open .akch-nav-caret {
  transform: rotate(180deg);
}
.akch-nav .current-menu-item > .akch-nav-link,
.akch-nav .current_page_item > .akch-nav-link {
  color: var(--text);
  font-weight: 700;
}

/* Plain (non-mega) dropdowns, e.g. a 2-level menu item */
.akch-subnav {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  min-width: 208px;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 120;
}
.akch-nav-item:hover > .akch-subnav,
.akch-nav-item.is-open > .akch-subnav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.akch-subnav a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
}
.akch-subnav a:hover {
  background: var(--surface);
  color: var(--text);
}

/* ─── Panel shell ───────────────────────────────────────────── */
.akch-mega {
  position: fixed;
  inset-inline: 0;
  top: 68px;
  padding: 0 clamp(16px, 4vw, 32px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 110;
  pointer-events: none;
}
.akch-nav-item.is-open > .akch-mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.akch-mega-inner,
.akch-mega-foot {
  max-width: 1240px;
  margin-inline: auto;
  background: var(--card);
  border: 1px solid var(--border);
}
.akch-mega-inner {
  display: grid;
  grid-template-columns: minmax(232px, 268px) minmax(0, 1fr);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  border-bottom: 0;
}
/* A panel with no footer closes off its own bottom corners. */
.akch-mega-inner:last-child {
  border-radius: 22px;
  border-bottom: 1px solid var(--border);
}

/* ─── The rail ──────────────────────────────────────────────── */
.akch-mega-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  background: var(--bg2);
  border-inline-end: 1px solid var(--border);
}
.akch-mega-rail-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 13px;
  color: var(--text);
  border: 1px solid transparent;
  transition: background .16s, border-color .16s, color .16s;
}
.akch-mega-rail-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--t, var(--accent-text));
  background: color-mix(in srgb, var(--t, var(--accent)) 13%, transparent);
  transition: background .16s, color .16s;
}
.akch-mega-rail-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.akch-mega-rail-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
}
.akch-mega-rail-meta {
  font-size: 11.5px;
  color: var(--muted2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.akch-mega-rail-chevron {
  display: grid;
  place-items: center;
  color: var(--muted2);
  opacity: 0;
  transform: translateX(4px);
  transition: opacity .16s, transform .16s;
}
/* Chevron points along the reading direction. */
[dir="ltr"] .akch-mega-rail-chevron { transform: translateX(-4px) scaleX(-1); }

.akch-mega-rail-item:hover,
.akch-mega-rail-item.is-active {
  background: var(--card);
  border-color: var(--border);
}
.akch-mega-rail-item.is-active {
  border-color: color-mix(in srgb, var(--t, var(--accent)) 45%, var(--border));
}
.akch-mega-rail-item.is-active .akch-mega-rail-icon {
  background: var(--t, var(--accent));
  color: #fff;
}
.akch-mega-rail-item.is-active .akch-mega-rail-chevron,
.akch-mega-rail-item:hover .akch-mega-rail-chevron {
  opacity: 1;
  transform: translateX(0);
}
[dir="ltr"] .akch-mega-rail-item.is-active .akch-mega-rail-chevron,
[dir="ltr"] .akch-mega-rail-item:hover .akch-mega-rail-chevron { transform: scaleX(-1); }

.akch-mega-rail-item:focus-visible {
  outline: 2px solid var(--t, var(--accent));
  outline-offset: -2px;
}
.akch-mega-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  color: var(--t, var(--accent-text));
  background: color-mix(in srgb, var(--t, var(--accent)) 15%, transparent);
}

/* ─── The pane ──────────────────────────────────────────────── */
.akch-mega-panes {
  position: relative;
  padding: clamp(18px, 2.2vw, 26px);
  min-height: 292px;
}
.akch-mega-pane { display: none; }
.akch-mega-pane.is-active {
  display: block;
  animation: akchPaneIn .18s ease both;
}
@keyframes akchPaneIn {
  from { opacity: 0; transform: translateY(4px); }
}
.akch-mega-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.akch-mega-pane-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.akch-mega-eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--muted2);
  margin-bottom: 10px;
}
.akch-mega-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-text);
  white-space: nowrap;
}
.akch-mega-more:hover { text-decoration: underline; }
.akch-mega-empty {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted2);
  line-height: 1.9;
}

/* Country grid, IP panel */
.akch-mega-countries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 2px;
}
.akch-mega-countries a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  transition: background .16s, color .16s;
}
.akch-mega-countries a:hover {
  background: var(--surface);
  color: var(--text);
}
.akch-mega-flag { font-size: 15px; line-height: 1; flex-shrink: 0; }
.akch-mega-country-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.akch-mega-country-price {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--muted2);
  white-space: nowrap;
}

/* Card grid, categories panel and the IP family pane */
.akch-mega-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 8px;
}
.akch-mega-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg2);
  color: var(--text);
  transition: border-color .16s, background .16s, transform .16s;
}
.akch-mega-card:hover {
  border-color: color-mix(in srgb, var(--t, var(--accent)) 50%, var(--border));
  background: color-mix(in srgb, var(--t, var(--accent)) 6%, var(--bg2));
  transform: translateY(-1px);
}
.akch-mega-card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--t, var(--accent-text));
  background: color-mix(in srgb, var(--t, var(--accent)) 12%, transparent);
}
.akch-mega-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.akch-mega-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
.akch-mega-card-meta { font-size: 11.5px; color: var(--muted2); }

/* ISP and datacenter are two flavours of static IP, not separate families. */
.akch-mega-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  vertical-align: middle;
}

/* ─── Footer strip ──────────────────────────────────────────── */
.akch-mega-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 11px clamp(14px, 2vw, 20px);
  background: var(--bg2);
  border-radius: 0 0 22px 22px;
  box-shadow: var(--card-shadow);
}
.akch-mega-foot-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background .16s, color .16s;
}
.akch-mega-foot-link:hover { background: var(--card); color: var(--text); }
.akch-mega-foot-link svg { width: 15px; height: 15px; }
.akch-mega-foot-support {
  margin-inline-start: auto;
  color: var(--accent-text);
  font-weight: 700;
}

/* ─── Narrower desktop ──────────────────────────────────────── */
@media (max-width: 1080px) {
  .akch-mega-inner { grid-template-columns: minmax(200px, 232px) minmax(0, 1fr); }
  .akch-mega-countries { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .akch-mega-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 900px) {
  .akch-nav:not(.akch-nav-mobile) { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE DRAWER
   The same panel markup becomes an accordion: the rail items are
   the accordion headers and each pane opens beneath its own header
   rather than in a column beside it.
   ══════════════════════════════════════════════════════════════ */
.akch-nav-mobile {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  font-size: 15px;
}
.akch-nav-mobile .akch-nav-item {
  flex-direction: column;
  align-items: stretch;
}
.akch-nav-mobile .akch-nav-link {
  justify-content: space-between;
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  color: var(--text);
}

/* The panel: static, full width, no card chrome of its own. */
.akch-nav-mobile .akch-mega {
  position: static;
  padding: 0;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  display: none;
}
.akch-nav-mobile .akch-nav-item.is-open > .akch-mega { display: block; }

.akch-nav-mobile .akch-mega-inner {
  display: block;
  max-width: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.akch-nav-mobile .akch-mega-rail {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
}
.akch-nav-mobile .akch-mega-panes {
  display: contents;
  padding: 0;
  min-height: 0;
}

/* Each pane is moved under its own rail item by mega-menu.js, which reparents
   them into .akch-mega-acc groups so the accordion reads in source order. */
.akch-nav-mobile .akch-mega-acc {
  border-radius: 12px;
  overflow: hidden;
}
.akch-nav-mobile .akch-mega-rail-item {
  border-radius: 12px;
  padding: 11px 12px;
  gap: 10px;
}
.akch-nav-mobile .akch-mega-rail-item.is-active {
  border-radius: 12px 12px 0 0;
}
.akch-nav-mobile .akch-mega-rail-chevron {
  opacity: 1;
  transform: rotate(-90deg);
  transition: transform .2s ease;
}
.akch-nav-mobile .akch-mega-rail-item.is-active .akch-mega-rail-chevron {
  transform: rotate(90deg);
}
.akch-nav-mobile .akch-mega-pane {
  padding: 4px 6px 12px;
  border-radius: 0 0 12px 12px;
}
.akch-nav-mobile .akch-mega-pane-head {
  /* The rail item directly above already names the section. */
  display: none;
}
.akch-nav-mobile .akch-mega-countries,
.akch-nav-mobile .akch-mega-cards {
  grid-template-columns: 1fr;
}
.akch-nav-mobile .akch-mega-foot {
  flex-direction: column;
  align-items: stretch;
  max-width: none;
  margin-top: 8px;
  padding: 8px 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}
.akch-nav-mobile .akch-mega-foot-support { margin-inline-start: 0; }

/* ─── Footer navigation menus ───
   wp_nav_menu() output replaced the hand-written <ul> in the footer fallback, so
   these rules give the generated markup the same muted-text treatment. Without
   them the items rendered as default browser links (blue and underlined). */
#colophon .menu,
footer .menu,
footer nav > ul,
footer nav > div > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 13.5px;
}
footer nav li { margin: 0; }
footer nav li a {
  color: var(--muted);
  text-decoration: none;
  transition: color .18s;
  display: inline-block;
}
footer nav li a:hover,
footer nav li a:focus-visible {
  color: var(--text);
  text-decoration: none;
}
/* Footer menus are single-level; hide any accidental nesting rather than
   letting it render as an unstyled dropdown stack. */
footer nav li .sub-menu,
footer nav li .akch-subnav,
footer nav li .akch-mega { display: none; }

/* Screen-reader-only helper */
.akch-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   NAVIGATION FEEL
   Cross-document view transitions plus a top progress bar, so moving
   between pages reads as an app rather than a series of white flashes.
   ══════════════════════════════════════════════════════════════ */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: akchFadeOut .16s ease both; }
::view-transition-new(root) { animation: akchFadeIn .22s ease both; }
@keyframes akchFadeOut { to { opacity: 0; } }
@keyframes akchFadeIn { from { opacity: 0; transform: translateY(6px); } }

/* The header should stay put across a transition instead of fading with the page. */
#site-header { view-transition-name: akch-header; }

.akch-nav-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 12px -2px var(--accent);
  z-index: 10002;
  opacity: 0;
  pointer-events: none;
  transition: width .18s ease, opacity .2s ease;
  border-radius: 0 3px 3px 0;
}
.akch-nav-progress.is-active { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .akch-nav-progress { transition: none; }
  .akch-mega,
  .akch-subnav,
  .akch-mega-card,
  .akch-mega-rail-item,
  .akch-mega-rail-chevron,
  .akch-nav-caret { transition: none; }
  .akch-mega-pane.is-active { animation: none; }
}
