/* ============================================================
   Toby Center Navbar — navbar.css
   Plugin by Nafnine
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body.tcn-menu-open,
html.tcn-menu-open {
  overflow: hidden !important;
  height: 100% !important;
}

:root {
  --tcn-bg:             #a30000;
  --tcn-btn:            #191d34;
  --tcn-white:          #ffffff;
  --tcn-hover-bg:       rgba(255,255,255,0.08);
  --tcn-dropdown-bg:    #7a0000;
  --tcn-dropdown-hover: rgba(255,255,255,0.12);
  --tcn-font:           'DM Sans', sans-serif;
  --tcn-offcanvas-bg:   #191d35;
}

/* ── NAVBAR ── */
.tcn-navbar {
  background: var(--tcn-bg);
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.tcn-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* ── LOGO ── */
.tcn-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  z-index: 2;
}

.tcn-logo img {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}

.tcn-site-name {
  color: var(--tcn-white);
  font-family: var(--tcn-font);
  font-size: 18px;
  font-weight: 600;
}

/* ── MENU WRAP (desktop default) ── */
.tcn-menu-wrap {
  display: flex;
  align-items: center;
}

/* ── MENU LIST ── */
ul.tcn-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
  flex-wrap: nowrap;
}

ul.tcn-menu > li {
  position: relative;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

ul.tcn-menu > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--tcn-white);
  text-decoration: none;
  font-family: var(--tcn-font);
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

ul.tcn-menu > li > a:hover,
ul.tcn-menu > li.current-menu-item > a,
ul.tcn-menu > li.current-menu-ancestor > a {
  background: var(--tcn-hover-bg);
}

/* ── ARROW ── */
ul.tcn-menu > li > a .arrow {
  width: 14px;
  height: 14px;
  opacity: 0.75;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

ul.tcn-menu > li.open > a .arrow {
  transform: rotate(180deg);
}

/* ── DROPDOWN ── */
ul.tcn-menu .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  background: var(--tcn-dropdown-bg);
  border-radius: 8px;
  list-style: none;
  margin: 0;
  padding: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  pointer-events: none;
  z-index: 10000;
}

ul.tcn-menu > li.open > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

ul.tcn-menu .sub-menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.tcn-menu .sub-menu li a {
  display: block;
  color: var(--tcn-white);
  text-decoration: none;
  font-family: var(--tcn-font);
  font-size: 13.5px;
  font-weight: 400;
  padding: 9px 14px;
  border-radius: 5px;
  transition: background 0.18s ease;
  white-space: nowrap;
}

ul.tcn-menu .sub-menu li a:hover {
  background: var(--tcn-dropdown-hover);
}

/* ── DONATE BUTTON ── */
ul.tcn-menu > li.nav-donate > a {
  background: var(--tcn-btn) !important;
  color: var(--tcn-white) !important;
  padding: 7px 22px !important;
  border-radius: 7px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  box-shadow: 0 4px 14px rgba(25,29,52,0.4) !important;
  transition: box-shadow 0.4s ease, transform 0.4s ease !important;
}

ul.tcn-menu > li.nav-donate > a:hover {
  background: var(--tcn-btn) !important;
  box-shadow: 0 0 0 rgba(25,29,52,0) !important;
  transform: translateY(-1px) !important;
}

/* ── HAMBURGER (hidden by default, JS shows it) ── */
.tcn-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
  background: none;
  border: none;
  outline: none;
  flex-shrink: 0;
  z-index: 2;
}

.tcn-hamburger:hover { background: var(--tcn-hover-bg); }

.tcn-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--tcn-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.tcn-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tcn-hamburger.open span:nth-child(2) { opacity: 0; }
.tcn-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── OFFCANVAS CLOSE BTN ── */
.tcn-offcanvas-close {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  width: 60px;
  height: 60px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
  z-index: 10001;
}

.tcn-offcanvas-close:hover { opacity: 0.7; }

.tcn-offcanvas-close svg {
  width: 38px;
  height: 38px;
  stroke: #ffffff;
  stroke-width: 2;
}

/* ── OVERLAY ── */
.tcn-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tcn-overlay.visible { opacity: 1; }

/* ── OFFCANVAS MODE (JS adds .tcn-is-mobile) ── */
.tcn-menu-wrap.tcn-is-mobile {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--tcn-offcanvas-bg);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
  transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 30px rgba(0,0,0,0.3);
}

.tcn-menu-wrap.tcn-is-mobile.open { right: 0; }

.tcn-menu-wrap.tcn-is-mobile .tcn-offcanvas-close { display: flex; }

.tcn-menu-wrap.tcn-is-mobile ul.tcn-menu {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: wrap;
  padding: 80px 16px 24px;
  gap: 2px;
}

.tcn-menu-wrap.tcn-is-mobile ul.tcn-menu > li > a {
  font-size: 15px;
  padding: 11px 14px;
  border-radius: 7px;
}

.tcn-menu-wrap.tcn-is-mobile ul.tcn-menu .sub-menu {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  background: rgba(0,0,0,0.15);
  box-shadow: none;
  border-radius: 6px;
  margin-top: 4px;
  padding: 4px;
  display: none;
}

.tcn-menu-wrap.tcn-is-mobile ul.tcn-menu > li.open > .sub-menu { display: block; }

.tcn-menu-wrap.tcn-is-mobile ul.tcn-menu .sub-menu li a {
  font-size: 14px;
  padding: 9px 18px;
}

.tcn-menu-wrap.tcn-is-mobile ul.tcn-menu > li.nav-donate {
  margin-top: 12px;
}

.tcn-menu-wrap.tcn-is-mobile ul.tcn-menu > li.nav-donate > a {
  display: block !important;
  text-align: center !important;
  padding: 12px 22px !important;
  background: #CC3B3F !important;
  box-shadow: none !important;
}

.tcn-menu-wrap.tcn-is-mobile ul.tcn-menu > li.nav-donate > a:hover {
  background: #b03035 !important;
  transform: none !important;
}
