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

:root {
  --sotedu-ocean: #0A4D6E;
  --sotedu-ocean-deep: #063349;
  --sotedu-ocean-soft: #D3E3EC;
  --sotedu-ocean-wash: #EAF2F7;
  --sotedu-forest: #1F5A36;
  --sotedu-forest-deep: #14422A;
  /* Panel uses an ocean-wash → ocean-soft gradient (same as sotcoin) so the
   * menu reads as a clear "brand surface" rather than a neutral white card.
   * Hover backgrounds (ocean-soft) sit above this tint so focus state pops. */
  --sotedu-mm-panel-bg: linear-gradient(180deg, #F4F9FC 0%, #E3EEF4 100%);
  --sotedu-mm-panel-shadow: 0 18px 40px rgba(6, 51, 73, 0.18);
  --sotedu-mm-text: #1a2530;
  --sotedu-mm-muted: #5b6a76;
  --sotedu-mm-radius: 12px;
  --sotedu-mm-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                    Roboto, Helvetica, Arial, sans-serif;
}

/* ------------------------------------------------------------
 * Top row
 * ---------------------------------------------------------- */
.sotedu-megamenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-family: var(--sotedu-mm-font);
  /* Positioning context for the absolutely-positioned panel below. */
  position: relative;
}

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

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

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

.sotedu-megamenu__item--has-panel > .sotedu-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;
}

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

/* CTA button at the right end of the top row */
.sotedu-megamenu__item--cta { margin-left: 8px; }
.sotedu-megamenu__cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff !important;
  background: var(--sotedu-ocean);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(6, 51, 73, 0.08);
}
.sotedu-megamenu__cta:hover,
.sotedu-megamenu__cta:focus-visible {
  background: var(--sotedu-ocean-deep);
  transform: translateY(-1px);
  text-decoration: none;
  outline: none;
}

/* ------------------------------------------------------------
 * Panel — hidden by default, shown on hover/focus
 * ---------------------------------------------------------- */
.sotedu-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;
  transition: opacity 0.18s ease, visibility 0s linear 0.25s;
}

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

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

/* ------------------------------------------------------------
 * Column
 * ---------------------------------------------------------- */
.sotedu-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;
}

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

/* Bump specificity past the theme so padding-left:0 actually wins.
 *
 * The theme's `.stot-nav ul` rule 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 creates a phantom offset.
 * We override align-items, justify-content, and flex-wrap explicitly. */
.sotedu-megamenu .sotedu-megamenu__col-list,
.sotedu-megamenu__panel .sotedu-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;
}

.sotedu-megamenu .sotedu-megamenu__col-list li,
.sotedu-megamenu__panel .sotedu-megamenu__col-list li {
  /* display:block (not the default display:list-item) — list-item display
   * reserves marker-box space even with list-style:none, which would indent
   * every link in the panel. */
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-left: 0;
  text-align: left;
}

/* The .stot-nav a theme rule sets display:inline-flex + applies padding to
 * every <a> inside .stot-nav. We need to override that for our panel links. */
.sotedu-megamenu .sotedu-megamenu__col-list a,
.sotedu-megamenu__panel .sotedu-megamenu__col-list a {
  display: block;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sotedu-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 */
}

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

.sotedu-megamenu__desc {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--sotedu-mm-muted);
  margin-top: 2px;
}
.sotedu-megamenu__col-list a:hover .sotedu-megamenu__desc,
.sotedu-megamenu__col-list a:focus-visible .sotedu-megamenu__desc {
  color: var(--sotedu-ocean-deep);
}

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