/* ============================================================
 * SOTCoin marketing mega-menu
 * ------------------------------------------------------------
 * Standalone stylesheet enqueued site-wide on sotcoin.oftimor.com.
 * Renders the `primary` nav as a horizontal top row whose items
 * reveal multi-column hover panels below the header.
 *
 * Brand palette:
 *   --soc-ocean       #0A4D6E   primary brand
 *   --soc-ocean-deep  #063349   hover / dark text
 *   --soc-ocean-soft  #D3E3EC   borders / hover backgrounds
 *   --soc-forest      #1F5A36   secondary accent
 * ============================================================ */

:root {
  --soc-ocean: #0A4D6E;
  --soc-ocean-deep: #063349;
  --soc-ocean-soft: #D3E3EC;
  --soc-ocean-wash: #EAF2F7;
  --soc-forest: #1F5A36;
  /* The panel previously rendered on pure white which made the whole header
   * look very neutral. Switching the base to ocean-wash + a subtle vertical
   * gradient gives the menu a clear "brand surface" without sacrificing
   * legibility. Hover backgrounds (still ocean-soft) sit above this tint so
   * the focus/hover state still pops. */
  --soc-mm-panel-bg: linear-gradient(180deg, #F4F9FC 0%, #E3EEF4 100%);
  --soc-mm-panel-shadow: 0 18px 40px rgba(6, 51, 73, 0.18);
  --soc-mm-text: #1a2530;
  --soc-mm-muted: #5b6a76;
  --soc-mm-radius: 12px;
  --soc-mm-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                  Roboto, Helvetica, Arial, sans-serif;
}

/* ------------------------------------------------------------
 * Top row
 * ---------------------------------------------------------- */
.soc-megamenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-family: var(--soc-mm-font);
  /* Positioning context for the absolutely-positioned panel below.
   * Without this, top:100% on the panel resolves against the header
   * and may drift a few pixels below the trigger, breaking hover. */
  position: relative;
}

.soc-megamenu__item {
  position: static; /* panel uses left:0/right:0 against nearest positioned ancestor */
  list-style: none;
  margin: 0;
}

.soc-megamenu__top {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--soc-mm-text);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.soc-megamenu__top:hover,
.soc-megamenu__top:focus-visible {
  color: var(--soc-ocean);
  background-color: var(--soc-ocean-soft);
  text-decoration: none;
  outline: none;
}

.soc-megamenu__item--has-panel > .soc-megamenu__top::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.6;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.soc-megamenu__item--has-panel:hover > .soc-megamenu__top::after,
.soc-megamenu__item--has-panel:focus-within > .soc-megamenu__top::after {
  transform: rotate(-135deg) translateY(-1px);
  opacity: 1;
}

/* ------------------------------------------------------------
 * Panel — hidden by default, shown on hover/focus
 * ---------------------------------------------------------- */
.soc-megamenu__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  /* 16px top padding doubles as a hover-bridge — empty whitespace inside the
   * panel that catches the cursor as it traverses from trigger to dropdown. */
  padding: 16px;
  /* Delay-out: on close, visibility flips AFTER the opacity has finished
   * fading, giving the cursor ~250ms to enter the panel and re-establish
   * hover. On open, visibility flips instantly. */
  transition: opacity 0.18s ease, visibility 0s linear 0.25s;
}

.soc-megamenu__item--has-panel:hover .soc-megamenu__panel,
.soc-megamenu__item--has-panel:focus-within .soc-megamenu__panel {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.18s ease, visibility 0s linear 0s;
}

.soc-megamenu__panel-inner {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--soc-mm-panel-bg);
  border-radius: var(--soc-mm-radius);
  box-shadow: var(--soc-mm-panel-shadow);
  border: 1px solid var(--soc-ocean-soft);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px 32px;
}

/* ------------------------------------------------------------
 * Column
 * ---------------------------------------------------------- */
.soc-megamenu__col {
  min-width: 0;
  /* Force left alignment — the stot-main theme has centered text-align on
   * its top-row nav (.stot-header__nav-inner uses justify-content: center),
   * which cascades into our dropdown panel and centers column headings +
   * links unless we explicitly override here. */
  text-align: left;
}

.soc-megamenu__col-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soc-ocean);
  font-family: var(--soc-mm-font);
  text-align: left;
}

/* Bump specificity past the theme so padding-left:0 actually wins.
 *
 * ALSO — the theme's `.stot-nav ul` rule (system.css line 193) sets
 *   display: flex; align-items: center; justify-content: space-between;
 * which cascades into ANY <ul> nested inside .stot-nav, including this
 * column list. With align-items:center on a column-flex container the
 * <li> children get horizontally centered, which is what was creating
 * the phantom ~56px offset: ul width 201px - li intrinsic width 89px,
 * centered = (201-89)/2 = 56px of left blank space.
 * We override align-items, justify-content, and flex-wrap explicitly. */
.soc-megamenu .soc-megamenu__col-list,
.soc-megamenu__panel .soc-megamenu__col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 2px;
  text-align: left;
}

.soc-megamenu .soc-megamenu__col-list li,
.soc-megamenu__panel .soc-megamenu__col-list li {
  /* display:block (not the default display:list-item) — even with
   * list-style:none, list-item display reserves ~56px of marker-box
   * space at the start, which was indenting every link in the panel.
   * Verified via getBoundingClientRect: with list-item the li sits 56px
   * right of its ul; with block it sits flush at column-left. */
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-left: 0;
  text-align: left;
}

/* The .stot-nav a theme rule (system.css line 208) sets display:inline-flex
 * + applies padding/border-radius to every <a> inside .stot-nav. That
 * shrink-to-fit behavior is what was centering our dropdown links inside
 * each column. Bumping specificity (chained .soc-megamenu .soc-megamenu...)
 * gives us 0,3,1 over the theme's 0,1,1 so display:block wins cleanly. */
.soc-megamenu .soc-megamenu__col-list a,
.soc-megamenu__panel .soc-megamenu__col-list a {
  display: block;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--soc-mm-text);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s ease, background-color 0.15s ease;
  text-align: left;
  white-space: normal; /* theme sets nowrap on .stot-nav a; we want wrapping in the panel */
}

.soc-megamenu__col-list a:hover,
.soc-megamenu__col-list a:focus-visible {
  color: var(--soc-ocean);
  background-color: var(--soc-ocean-soft);
  text-decoration: none;
  outline: none;
}

/* ------------------------------------------------------------
 * Mobile — let the theme's hamburger drawer handle it
 * ---------------------------------------------------------- */
@media (max-width: 960px) {
  .soc-megamenu__panel {
    display: none !important;
  }
  .soc-megamenu__item--has-panel > .soc-megamenu__top::after {
    display: none;
  }
}
