/* AL RYUM — Header theme: light ivory (default) and the ink-and-gold option.
   Rules under html.ar-theme-dark style the ink header; the ivory rules at the end apply otherwise.
   Ivory is the default; index.html adds .ar-theme-dark before first paint only when chosen.

   The pill nav ships as mint #c8a86e on some routes and #c8a86e on others, with dark text and dark logo
   artwork — so the dark variant restates background, text and the logo treatment together. */

html.ar-theme-dark header nav {
  background: linear-gradient(180deg, #0f2124 0%, #0b1618 100%) !important;
  border: 1px solid rgba(200, 168, 110, 0.30);
  /* the site paints a mint glow via shadow-2xl; on ink it reads as a green halo, so it is replaced */
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(200, 168, 110, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
}

html.ar-theme-dark header nav a,
html.ar-theme-dark header nav span,
html.ar-theme-dark header nav button,
html.ar-theme-dark header nav p,
html.ar-theme-dark header nav div {
  color: #F7F2E9 !important;
}
html.ar-theme-dark header nav a:hover,
html.ar-theme-dark header nav button:hover,
html.ar-theme-dark header nav a:hover span {
  color: #C8A86E !important;
}

/* The logo is dark artwork: green-cyan (rgb 29,40,42 / 59,89,98 / 64,109,99) with a red element
   (rgb 140,34,39), all at value 0.16–0.55 — invisible on ink. Lift its own colours rather than
   flattening it to white, so it stays coloured in the dark theme. */
html.ar-theme-dark header nav img[src*="arc-logo"] {
  filter: brightness(2.05) saturate(3);
  opacity: 1;
}
html.ar-theme-dark header nav a:hover img[src*="arc-logo"] { opacity: 1; }

html.ar-theme-dark header nav svg { color: #F7F2E9 !important; stroke: currentColor; }

/* active item: a gold wash reads better than a light chip on ink */
html.ar-theme-dark header nav [class*="bg-"][class*="rounded-full"] {
  background: rgba(200, 168, 110, 0.14) !important;
}

/* ---------- the toggle: an icon, pinned to the far right of the pill ---------- */
.ar-theme-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(18, 32, 35, 0.35);
  background: rgba(255, 255, 255, 0.5);
  color: #122023;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  z-index: 2;
}
.ar-theme-toggle:hover { background: rgba(255, 255, 255, 0.85); }
.ar-theme-toggle svg { width: 16px; height: 16px; display: block; stroke: currentColor; fill: none; stroke-width: 1.7; }
.ar-theme-toggle .ar-tt-sun { display: none; }
html.ar-theme-dark .ar-theme-toggle {
  background: rgba(200, 168, 110, 0.16);
  border-color: rgba(200, 168, 110, 0.5);
  color: #F7F2E9;
}
html.ar-theme-dark .ar-theme-toggle:hover { background: rgba(200, 168, 110, 0.3); }
/* in dark mode show the sun (the way back to light) */
html.ar-theme-dark .ar-theme-toggle .ar-tt-sun { display: block; }
html.ar-theme-dark .ar-theme-toggle .ar-tt-moon { display: none; }

/* the header nav needs to anchor it */
header nav { position: relative; }

/* small screens: sit left of the menu button rather than over it */
@media (max-width: 1279px) {
  /* sits 8px left of the menu button: nav padding (48px) + button (40px) + 8px */
  .ar-theme-toggle { right: 96px; width: 30px; height: 30px; }
  .ar-theme-toggle svg { width: 15px; height: 15px; }
}
@media (max-width: 767px) {
  /* nav padding is 24-32px here: 32px + button (40px) + 8px */
  .ar-theme-toggle { right: 80px; }
  /* the wordmark was wider than the bar, pushing the menu button off-screen
     and sitting under the toggle; let it shrink and size it for phones */
  header nav > div > a.flex-shrink-0 { flex-shrink: 1; min-width: 0; padding-right: 40px; }
}

/* ---------- search control: nudged 1cm (≈38px) to the left ---------- */
header nav button[class*="w-12"][class*="h-12"][class*="rounded-full"]:not(.ar-theme-toggle) {
  transform: translateX(-38px);
}
/* hover: the site scales this button, so keep the shift while it does */
header nav button[class*="w-12"][class*="h-12"][class*="rounded-full"]:not(.ar-theme-toggle):hover {
  transform: translateX(-38px) scale(1.05);
}

/* ---------- top bar typography: the nav links read too small at 15px ----------
   The links carry inline font-size, so an override needs !important. Applies to the header in both
   themes (it is the same bar), never to the footer or any other nav. */
header nav a,
header nav > div > div > a {
  font-size: 17px !important;
  letter-spacing: 0.01em !important;
}
/* the wordmark gets a matching step up from 30px — on tablet and up only;
   at 33px it is wider than a phone's header bar */
header nav a span[style*="font-weight: 700"],
header nav a span.text-2xl,
header nav a span.text-3xl {
  font-size: 33px !important;
}
@media (max-width: 767px) {
  header nav a span[style*="font-weight: 700"],
  header nav a span.text-2xl,
  header nav a span.text-3xl {
    font-size: 19px !important;
    white-space: nowrap;
  }
}
/* the round search button's icon scales with the type, so lift it a touch too */
header nav button svg.w-5 { width: 21px !important; height: 21px !important; }

/* laptops: a 33px wordmark and 17px links crowd a short screen, so scale them with the
   viewport and keep the full sizes for large monitors */
@media (min-width: 768px) {
  header nav a span[style*="font-weight: 700"],
  header nav a span.text-2xl,
  header nav a span.text-3xl {
    font-size: clamp(24px, min(2.2vw, 4.2vh), 33px) !important;
  }
  header nav a,
  header nav > div > div > a {
    font-size: clamp(14.5px, min(1.15vw, 2.3vh), 17px) !important;
  }
}

/* keep the bar on one line — if the bigger type would wrap, tighten the gaps instead */
@media (min-width: 1280px) and (max-width: 1600px) {
  header nav > div { gap: 1.6rem !important; }
}

/* narrow phones: the pill header leaves ~200px for the wordmark once the toggle and
   menu button are placed, so step it down a size and give the toggle its own room */
@media (max-width: 420px) {
  header nav a span[style*="font-weight: 700"],
  header nav a span.text-2xl,
  header nav a span.text-3xl {
    font-size: 16px !important;
    letter-spacing: 0 !important;
  }
  header nav > div > a.flex-shrink-0 { padding-right: 48px; }
}

/* ---------- light option: Al Ryum ivory with ink type and a gold hairline ---------- */
html:not(.ar-theme-dark) header nav {
  background: #F7F2E9 !important;
  border: 1px solid rgba(200, 168, 110, 0.45);
  box-shadow: 0 18px 40px rgba(18, 32, 35, 0.18) !important;
}
html:not(.ar-theme-dark) header nav a:hover,
html:not(.ar-theme-dark) header nav a:hover span { color: #8c6d34 !important; }

/* ---------- 1024–1279px: show the full menu instead of the hamburger ----------
   The app switches its links on at 1280px (Tailwind xl), so laptops running Windows display
   scaling at 110–125% (a 1366 screen is then ~1093–1242 CSS px) got an empty-looking pill
   with only the logo and a menu icon. In this range the links, search and theme switch sit
   in the bar as on desktop, at the smallest desktop type sizes. */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  header nav .hidden.xl\:flex { display: flex !important; gap: 1.6rem !important; }
  header nav button.hidden.xl\:flex { display: flex !important; }
  header nav button.xl\:hidden { display: none !important; }
  header nav a,
  header nav > div > div > a { font-size: 14.5px !important; }
  header nav a span[style*="font-weight: 700"],
  header nav a span.text-2xl,
  header nav a span.text-3xl { font-size: 23px !important; }
  .ar-theme-toggle { right: 14px; width: 34px; height: 34px; }
}

/* ---------- the open phone/tablet menu ----------
   The menu opens inside the round pill, so it became an oval that cut the links off and let
   "Contact Us" spill over the page; the theme switch, centred on the whole bar, landed in the
   middle of the list; and the current page was gold on gold. While the menu is open the pill
   becomes a rounded panel, the switch stays on the top row and the current page reads in ink. */
@media (max-width: 1279.98px) {
  header nav.rounded-full:has(> div.pt-6) { border-radius: 28px !important; }
  header nav:has(> div.pt-6) .ar-theme-toggle { top: 36px; }
  header nav.rounded-full:has(> div.pt-6) .ar-theme-toggle { top: 40px; }
  header nav div.pt-6 a[class*="bg-[#c8a86e]"] {
    color: #122023 !important;
    background: rgba(200, 168, 110, 0.24) !important;
  }
  html.ar-theme-dark header nav div.pt-6 a[class*="bg-[#c8a86e]"] {
    color: #F7F2E9 !important;
    background: rgba(200, 168, 110, 0.2) !important;
  }
}
@media (min-width: 768px) and (max-width: 1279.98px) {
  header nav.rounded-full:has(> div.pt-6) .ar-theme-toggle { top: 44px; }
}



/* ---------- LOCAL OVERRIDE: full menu on foldables and tablets ----------
   The app reveals its links only at 1280px (Tailwind xl), with a 1024px patch above,
   so foldable inner screens (~686 CSS px) and tablets still got a hamburger and a pill
   with an empty middle. This shows the same five links the desktop bar shows, from
   686px up, with the bar brought to one type scale.

   Measured structure of <nav>:
     <div class="flex items-center justify-between gap-8 md:gap-12">
       <a  class="flex items-center gap-3 flex-shrink-0 group">      the brand  (an <A>, 210px)
       <div class="hidden xl:flex ... flex-1 justify-center">        the five links
       <button class="hidden xl:flex ... w-12 h-12 rounded-full">    search roundel
       <button class="xl:hidden ...">                                hamburger
     </div>

   Two things caused visible collisions at 686px, both measured:
     1. the brand <a> is `flex-shrink-0`, so at 210px it would not yield and the first
        link overlapped it (Home started 16px before the brand ended);
     2. .ar-theme-toggle is absolutely positioned, so it sat on top of the last link
        (Contact Us ended at 655 while the toggle began at 621).
   So the brand is allowed to shrink here and the links reserve room for the toggle. */
@media (min-width: 686px) and (max-width: 1023.98px) {
  header nav > div { gap: 14px !important; }

  /* 1. let the brand yield instead of holding 210px */
  header nav > div > a:first-child {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    gap: 6px !important;
    overflow: hidden !important;
  }
  header nav > div > a:first-child span { font-size: 13.5px !important; white-space: nowrap !important; }
  header nav > div > a:first-child img,
  header nav > div > a:first-child svg,
  header nav > div > a:first-child > div { width: 24px !important; height: 24px !important; }

  /* 2. the links: one scale, and a reserved gap so the toggle cannot sit on them */
  header nav div.hidden.xl\:flex {
    display: flex !important;
    gap: 0.6rem !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    justify-content: center !important;
    padding-right: 42px !important;
  }
  header nav div.hidden.xl\:flex a {
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  /* 3. hamburger, its dropdown panel, and the search roundel stay off */
  header nav button.xl\:hidden,
  header nav div.xl\:hidden.pt-6,
  header nav button.hidden.xl\:flex { display: none !important; }

  .ar-theme-toggle { right: 8px !important; width: 28px !important; height: 28px !important; }
}

/* ---------- LOCAL OVERRIDE 2: brand vs theme toggle on small phones ----------
   Measured with CDP over the real device metrics: the brand link and the
   absolutely-positioned .ar-theme-toggle collide by exactly 6px in two bands,
   382-410px and 421-~428px. Cause: the <=420px rule pads the brand 48px and
   steps the wordmark to 16px, which is wider than the gap the toggle leaves.
   The Honor Magic V3 OUTER screen is ~393 CSS px, so it sits inside the first
   band. Let the brand yield instead of holding that width, and step the
   wordmark back down so it always clears the toggle. */
@media (min-width: 382px) and (max-width: 430px) {
  header nav > div { gap: 10px !important; }
  header nav > div > a.flex-shrink-0 {
    padding-right: 0 !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
    overflow: hidden !important;
  }
  header nav > div > a.flex-shrink-0 span {
    font-size: 15px !important;
    white-space: nowrap !important;
  }
}
