/* ================================
   GCSE LearnWorlds-style Header
================================ */

.gcse-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gcse-header-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.gcse-header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.gcse-header-logo img {
  display: block;
  max-height: 46px;
  width: auto;
}

.gcse-header-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.gcse-nav-list {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gcse-nav-item {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gcse-nav-link,
.gcse-submenu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: #050522;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.gcse-nav-link:hover,
.gcse-nav-link.is-active,
.gcse-submenu-toggle:hover {
  color: #3434ff;
}

.gcse-chevron {
  font-size: 20px;
  line-height: 0.2;
  margin-left: -2px;
}

.gcse-submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 170px;
  margin: 0;
  padding: 12px 0;
  list-style: none;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s ease;
}

.gcse-has-submenu:hover .gcse-submenu,
.gcse-has-submenu.is-open .gcse-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gcse-submenu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gcse-submenu a {
  display: block;
  padding: 6px 22px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #050522;
  text-decoration: none;
  white-space: nowrap;
}

.gcse-submenu a:hover {
  color: #3434ff;
}

.gcse-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 7.5px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.gcse-auth-outline {
  border: 2px solid #3434ff;
  color: #3434ff;
  background: #fff;
}

.gcse-auth-solid {
  border: 2px solid #3434ff;
  color: #fff;
  background: #3434ff;
}

/* .gcse-auth-outline:hover {
  background: #3434ff;
  color: #fff;
} */

.gcse-auth-solid:hover {
  background: #ff486a;
  border-color: #ff486a;
  color: #fff;
}

/* Search of header */
.gcse-header-actions {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.gcse-search-button {
  background: transparent;
  border: none;
  margin-top: 4px;
  cursor: pointer;
}
.gcse-search-button.for-mobile {
  display: none;
}
.gcse-search-button.for-desktop {
  display: inline-flex;
}

/* Hamburger */
.gcse-menu-button {
  display: none;
  width: 44px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gcse-menu-button span {
  display: block;
  width: 34px;
  height: 3px;
  margin: 6px 0;
  background: #aaa;
}

/* Mobile overlay */
.gcse-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s ease;
}

.gcse-mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gcse-menu-close {
  position: absolute;
  top: 24px;
  right: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
  color: #aaa;
  cursor: pointer;
}

.gcse-mobile-nav .gcse-nav-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.gcse-mobile-nav .gcse-nav-link,
.gcse-mobile-nav .gcse-submenu-toggle {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: #694eff;
}

.gcse-mobile-nav .gcse-auth-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: #694eff;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.gcse-mobile-nav .gcse-submenu {
  position: static;
  transform: none;
  min-width: 0;
  margin-top: 8px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: none;
  text-align: center;
}

.gcse-mobile-nav .gcse-has-submenu.is-open .gcse-submenu {
  display: block;
}

.gcse-mobile-nav .gcse-submenu li {
  margin: 8px 0;
}

.gcse-mobile-nav .gcse-submenu a {
  padding: 0;
  font-size: 20px;
  font-weight: 400;
  color: #050522;
}

.hero-section {
  margin-top: 70px;
}
.post-header {
  margin-top: 50px;
}

/* ================================
   Desktop dropdown hover gap fix
================================ */

@media (min-width: 992px) {
  .gcse-header-nav .gcse-submenu-toggle {
    position: relative;
  }

  /* Invisible bridge between parent and submenu */
  .gcse-header-nav .gcse-submenu-toggle::after {
    content: "";
    position: absolute;
    left: -10px;
    right: -10px;
    top: 50%;
    height: 24px;
    background: transparent;
  }

  .gcse-header-nav .gcse-submenu {
    top: calc(100% + 8px);
  }

  .gcse-header-nav .gcse-submenu-toggle:hover .gcse-submenu,
  .gcse-header-nav .gcse-submenu-toggle:focus-within .gcse-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* Mobile dropdown smooth transition */
@media (max-width: 991px) {
  .gcse-mobile-nav .gcse-submenu {
    display: block !important;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      margin-top 0.25s ease,
      transform 0.25s ease;
  }

  .gcse-mobile-nav .gcse-has-submenu.is-open .gcse-submenu {
    max-height: 260px;
    opacity: 1;
    margin-top: 10px;
    transform: translateY(0);
    pointer-events: auto;
  }

  .gcse-mobile-nav .gcse-chevron {
    display: inline-block;
    transition: transform 0.25s ease;
  }

  .gcse-mobile-nav .gcse-has-submenu.is-open .gcse-chevron {
    transform: rotate(180deg);
  }
}

/* Responsive */
@media (max-width: 991px) {
  .gcse-header-actions {
    display: inline-flex;
  }
  .gcse-header-wrap {
    max-width: none;
    padding: 20px 26px;
  }

  .gcse-header-logo img {
    max-height: 42px;
  }

  .gcse-header-nav {
    display: none;
  }

  .gcse-menu-button {
    display: block;
  }

  .gcse-search-button.for-desktop {
    display: none;
  }
  .gcse-search-button.for-mobile {
    display: block;
  }
  .hero-section {
    margin-top: 40px;
  }
  .post-header {
    margin-top: 30px;
  }
}

/* Hide Ghost dropdown child items before JS moves them */
.gcse-nav-item[data-label^="--"] {
  display: none;
}

/* After JS creates submenu children, show them normally */
.gcse-submenu li {
  display: block;
}

/* Parent dropdown button should not look like normal browser button */
.gcse-submenu-toggle {
  appearance: none;
  -webkit-appearance: none;
}

/* Desktop: parent opens only on hover */
@media (min-width: 992px) {
  .gcse-header-nav .gcse-has-submenu:hover .gcse-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .gcse-header-nav .gcse-submenu-toggle {
    cursor: pointer;
  }
}

/* Mobile: parent opens only after JS adds .is-open */
@media (max-width: 991px) {
  .gcse-mobile-nav .gcse-has-submenu:hover .gcse-submenu {
    display: none;
  }

  .gcse-mobile-nav .gcse-has-submenu.is-open .gcse-submenu {
    display: block;
  }

  .gcse-mobile-nav .gcse-submenu-toggle {
    cursor: pointer;
  }
}

/* Footer fix because footer navigation now uses li */
.gcse-footer-links {
  list-style: none;
  padding-left: 0;
}

.gcse-footer-links li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gcse-footer-links li:not(:last-child) a::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%);
}

.gcse-footer-links a:not(:last-child)::after {
  display: none;
}

@media (max-width: 767px) {
  .gcse-footer-links li:not(:last-child) a::after {
    display: none;
  }
}

/* ================================
   GCSE LearnWorlds-style Footer
================================ */

.gcse-footer {
  background: #050522;
  color: #fff;
  text-align: center;
  padding: 58px 24px 46px;
}

.gcse-footer-inner {
  max-width: 760px;
  margin: 0 auto;
}

.gcse-footer-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.gcse-footer-logo img {
  display: block;
  max-width: 171px;
  max-height: 44px;
  width: auto;
  height: auto;
}

.gcse-footer-tagline {
  margin: 0 0 46px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: #fff;
  letter-spacing: 0.01em;
}

.gcse-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 54px;
}

.gcse-footer-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 36px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.gcse-footer-links a:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%);
}

.gcse-footer-links a:hover {
  color: #ff486a;
}

.gcse-footer-form {
  max-width: 704px;
  margin: 0 auto 45px;
}

.gcse-footer-form-row {
  display: flex;
  width: 100%;
  height: 46px;
  background: #eef7fb;
  border-radius: 14px;
  overflow: hidden;
}

.gcse-footer-input {
  flex: 1;
  width: auto;
  height: 100%;
  border: 0;
  outline: 0;
  background: #eef7fb;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 400;
  color: #050522;
  letter-spacing: 0.03em;
}

.gcse-footer-input::placeholder {
  color: #9ca5b4;
}

.gcse-footer-button {
  width: 176px;
  height: 100%;
  border: 1px solid #ff426d;
  outline: 0;
  border-radius: 12px;
  background: #ff426d;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gcse-footer-button:hover {
  background: #ff486a;
}

.gcse-footer-message {
  display: none;
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.4;
}

.gcse-footer-success {
  color: #fff;
}

.gcse-footer-error {
  color: #ff426d;
}

.gcse-footer-form.success .gcse-footer-success,
.gcse-footer-form.error .gcse-footer-error {
  display: block;
}

.gcse-footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.gcse-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  background: #fff;
  color: #3434ff;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gcse-footer-social a:hover {
  background: #ff426d;
  color: #fff;
}

.gcse-footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.gcse-footer-mastodon {
  margin: 0 0 42px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  color: #fff;
}

.gcse-footer-mastodon a {
  color: #fff;
  text-decoration: none;
}

.gcse-footer-mastodon a:hover {
  color: #ff426d;
}

.gcse-footer-copyright {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #fff;
  letter-spacing: 0.02em;
  margin-top: 40px;
}

.gcse-created-with {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  background: #eef7fb;
  color: #050522;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.gcse-created-with img {
  display: block;
  height: 24px;
  width: auto;
}

/* Remove old Reiro footer spacing if needed */
.footer-section.global-footer {
  display: none;
}

/* Responsive */
@media (max-width: 767px) {
  .gcse-footer {
    padding: 48px 22px 40px;
  }

  .gcse-footer-tagline {
    margin-bottom: 36px;
    font-size: 18px;
  }

  .gcse-footer-links {
    flex-direction: column;
    gap: 18px;
    margin-bottom: 42px;
  }

  .gcse-footer-links a {
    padding: 0;
    font-size: 16px;
  }

  .gcse-footer-links a:not(:last-child)::after {
    display: none;
  }

  .gcse-footer-form {
    margin-bottom: 48px;
  }

  .gcse-footer-form-row {
    flex-direction: column;
    height: auto;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    gap: 12px;
  }

  .gcse-footer-input {
    flex: unset;
    height: 48px;
    border-radius: 10px;
    text-align: center;
  }

  .gcse-footer-button {
    width: 100%;
    height: 48px;
    border-radius: 10px;
  }

  .gcse-footer-mastodon {
    margin-bottom: 34px;
    font-size: 16px;
  }

  .gcse-footer-copyright {
    font-size: 16px;
  }

  .gcse-created-with {
    font-size: 14px;
  }
}
