/**
.-----------------------------------------------------------------------.
|  @version: v1.0 (26 September 2026)
|  @author:  Matteo Montanari <matteo@italinux.com>
|  @link:    https://sovereigncarehome.co.uk
'-----------------------------------------------------------------------'
.-----------------------------------------------------------------------------.
|  @license: FREE BSD License                                                 |
|            https://www.freebsd.org/copyright/freebsd-license                |
|                                                                             |
|  This program is distributed in the hope that it will be useful - WITHOUT   |
|  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      |
|  FITNESS FOR A PARTICULAR PURPOSE.                                          |
'-----------------------------------------------------------------------------'
 */

.my-theme-topnav-inner {
  max-width: 1600px;
  margin: 0 auto;
  min-height: 96px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.my-theme-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Hamburger toggle — hidden above the mobile breakpoint */
.my-theme-topnav-toggle {
  padding: 24px 14px 24px 20px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0px;
  background-color: transparent;
  cursor: pointer;
  display: none;
}

.my-theme-topnav-toggle-bar {
  width: 22px;
  height: 2px;
  display: block;
}

.my-theme-topnav-toggle-label {
  display: none;
}

.my-theme-topnav-collapse {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Desktop / default: horizontal nav */
.my-theme-topnav {
  display: flex;
  align-items: center;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.my-theme-topnav li {
  position: relative;
}

.my-theme-topnav > li:first-child {
    display: none;
}

.my-theme-topnav > li > a {
  padding: 6px 0px;
  letter-spacing: 0.3px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  display: inline-block;
}

.my-theme-topnav > li.has-subnav > a {
  position: relative;
  padding-right: 18px;
}

.my-theme-topnav > li.has-subnav > a::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transform: translateY(-50%);
  opacity: 0.8;
}

.my-theme-topnav-subtoggle {
  display: none;
}

.my-theme-topnav-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0px;
}

/* One level of dropdown — this block only ever gives us one level of children */
.my-theme-topnav-sub {
  position: absolute;
  left: 0;
  min-width: 220px;
  margin: 0px;
  padding: 12px 0px 20px 0px;
  list-style: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  display: none;
  z-index: 20;
}

.my-theme-topnav li:hover > .my-theme-topnav-sub,
.my-theme-topnav li:focus-within > .my-theme-topnav-sub {
  display: block;
}

.my-theme-topnav-sub > li > a {
  display: block;
  padding: 10px 18px;
  text-decoration: none;
  white-space: nowrap;
}

/* Search input */
.my-theme-topnav-search {
  display: flex;
  align-items: center;
}

.my-theme-topnav-search input {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 10px;
  border-radius: 4px 0 0 4px;
}

.my-theme-topnav-search input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.my-theme-topnav-search button {
  padding: 6px 12px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

/* Language switcher */
.my-theme-topnav-lang {
  position: relative;
}

.my-theme-topnav-lang-toggle {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background-color: transparent;
  cursor: pointer;
}

.my-theme-topnav-lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  margin: 4px 0 0;
  padding: 6px 0;
  list-style: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  z-index: 20;
  display: none;
}

.my-theme-topnav-lang.is-open .my-theme-topnav-lang-menu {
  display: block;
}

.my-theme-topnav-lang-menu a {
  padding: 8px 16px;
  display: block;
}

.my-theme-topnav-lang-menu a.is-active,
.my-theme-topnav-lang-menu a:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

  /* Media: Large Tablets
--------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  .my-theme-topnav-inner {
    min-height: 72px;
    padding: 4px;
  }

  .my-theme-topnav-toggle {
    display: flex;
  }

  .my-theme-topnav-collapse {
    position: fixed;
    top: 74px;
    right: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 72px);
    margin: 0px auto;
    padding: 8px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25);
    z-index: 30;
    overflow-y: auto;
    display: none;
  }

  .my-theme-topnav-bar.is-open .my-theme-topnav-collapse {
    display: flex;
  }

  .my-theme-topnav {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .my-theme-topnav li {
    width: 100%;
    margin-bottom: 2px;
  }

  .my-theme-topnav > li {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: transparent;
  }

  .my-theme-topnav > li.has-subnav.is-open:not(.nav-selected):hover {
    border-bottom-color: transparent !important;
  }

  .my-theme-topnav > li > a,
  .my-theme-topnav-sub > li > a {
    padding: 12px 24px;
    border-bottom: 0px solid transparent !important;
    white-space: normal;
    display: block;
  }

  .my-theme-topnav > li > a:hover,
  .my-theme-topnav > li.nav-selected > a,
  .my-theme-topnav > li.nav-path-selected > a {
    border-bottom-color: transparent;
  }

  .my-theme-topnav li:hover > .my-theme-topnav-sub {
    display: none;
  }

  .my-theme-topnav li.is-open > .my-theme-topnav-sub {
    display: block;
  }

  .my-theme-topnav > li > a {
    margin-right: 75px;
  }

  .my-theme-topnav > li.has-subnav > a {
    width: 50%;
    margin-right: 0px;
  }

  .my-theme-topnav > li.has-subnav > a::after {
    display: none;
  }

  .my-theme-topnav-sub > li > a {
    margin-right: 15px;
  }

  .my-theme-topnav-sub > li > a:hover,
  .my-theme-topnav-sub > li.nav-selected > a,
  .my-theme-topnav-sub > li.nav-path-selected > a {
    background-color: rgba(0, 0, 0, 0.8);
  }

  .my-theme-topnav-subtoggle {
    position: absolute;
    top: 2px;
    right: 15px;
    width: 48%;
    height: 32px;
    padding: 24px;
    background-color: transparent;
    border: 0px;
    transform: scaleX(-1);
    display: block;
    z-index: 1;

    /* Removes the browser's ~300ms tap-delay/double-tap-to-zoom
           handling on this button, which is what leaves a window for a
           delayed synthetic click to land on the submenu link revealed
           underneath it. Paired with the preventDefault()/stopPropagation()
           in view.js. */

    touch-action: manipulation;
  }

  .my-theme-topnav-subtoggle::before,
  .my-theme-topnav-subtoggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 20px;
  }

  .my-theme-topnav-subtoggle::before {
    width: 12px;
    height: 2px;
    transform: translate(-50%, -50%);
  }

  .my-theme-topnav-subtoggle::after {
    width: 2px;
    height: 12px;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease;
  }

  li.is-open > .my-theme-topnav-subtoggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
  }

  .my-theme-topnav-sub {
    position: static;
    min-width: 0;
    padding: 0 0 10px 12px;
    border: 0;
    box-shadow: none;
  }

  .my-theme-topnav-collapse {
    padding: 8px 16px;
  }

  .my-theme-topnav-search,
  .my-theme-topnav-lang {
    margin-top: 12px;
    width: 100%;
  }

  .my-theme-topnav-search input {
    flex: 1;
  }

  .my-theme-topnav-lang-menu {
    position: static;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.05);
    display: none;
  }

  .my-theme-topnav-lang.is-open .my-theme-topnav-lang-menu {
    display: block;
  }
}
