/* Simon Johnson Maths Site Kit */

body.sjm-global-styles {
  --sjm-navy: #14213D;
  --sjm-blue: #2563EB;
  --sjm-pink: #CC3467;
  --sjm-soft: #F5F7FA;
  --sjm-text: #1F2937;
  --sjm-white: #FFFFFF;
  color: var(--sjm-text);
  font-family: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.sjm-global-styles .elementor,
body.sjm-global-styles .elementor-widget-text-editor,
body.sjm-global-styles .elementor-widget-icon-list,
body.sjm-global-styles .elementor-widget-accordion,
body.sjm-global-styles .elementor-widget-toggle {
  font-family: inherit;
}

body.sjm-global-styles .elementor h1,
body.sjm-global-styles .elementor h2,
body.sjm-global-styles .elementor h3,
body.sjm-global-styles .elementor h4,
body.sjm-global-styles .elementor h5,
body.sjm-global-styles .elementor h6 {
  color: var(--sjm-navy);
  font-family: inherit;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

body.sjm-global-styles .elementor p,
body.sjm-global-styles .elementor li {
  line-height: 1.7;
}

body.sjm-global-styles .elementor a:not(.elementor-button) {
  text-underline-offset: 3px;
}

body.sjm-global-styles .elementor a:not(.elementor-button):hover,
body.sjm-global-styles .elementor a:not(.elementor-button):focus-visible {
  color: var(--sjm-pink);
}

body.sjm-global-styles .elementor-button,
body.sjm-global-styles .wp-element-button,
body.sjm-global-styles .wp-block-button__link {
  background: var(--sjm-blue) !important;
  color: var(--sjm-white) !important;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 14px 24px !important;
  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  box-shadow: 0 8px 22px rgba(20,33,61,.12);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

body.sjm-global-styles .elementor-button:hover,
body.sjm-global-styles .elementor-button:focus-visible,
body.sjm-global-styles .wp-element-button:hover,
body.sjm-global-styles .wp-block-button__link:hover {
  background: var(--sjm-pink) !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(20,33,61,.18);
}

body.sjm-global-styles .elementor-button:focus-visible,
.sjm-site-header a:focus-visible,
.sjm-menu-toggle:focus-visible,
.sjm-site-footer a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--sjm-pink) 38%, transparent);
  outline-offset: 3px;
}

body.sjm-global-styles .elementor img {
  max-width: 100%;
}

body.sjm-global-styles .elementor input[type="text"],
body.sjm-global-styles .elementor input[type="email"],
body.sjm-global-styles .elementor input[type="tel"],
body.sjm-global-styles .elementor textarea,
body.sjm-global-styles .elementor select {
  min-height: 48px;
  border: 1px solid #CBD5E1;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--sjm-text);
  font-family: inherit;
}

body.sjm-global-styles .elementor textarea { min-height: 140px; }

/* Decorative maths — injected by JS into selected Elementor sections. */
.sjm-math-host {
  position: relative !important;
  isolation: isolate;
  overflow: hidden;
}

.sjm-math-host > .sjm-math-decor {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  color: var(--sjm-blue, #2563EB);
  opacity: .055;
  font-family: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -.04em;
}

.sjm-math-host > :not(.sjm-math-decor) {
  position: relative;
  z-index: 1;
}

.sjm-math-decor.sjm-math-a {
  top: 8%;
  right: 2.5%;
  font-size: clamp(72px, 8vw, 128px);
  transform: rotate(5deg);
}

.sjm-math-decor.sjm-math-b {
  color: var(--sjm-pink, #CC3467);
  bottom: 8%;
  left: 2.5%;
  font-size: clamp(26px, 3.5vw, 48px);
  transform: rotate(-3deg);
}

.sjm-math-decor.sjm-math-c {
  color: var(--sjm-pink, #CC3467);
  top: 16%;
  left: 3%;
  font-size: clamp(58px, 6vw, 94px);
  transform: rotate(-6deg);
}


/* Pink-forward brand accents. Primary CTAs stay blue; hover and secondary actions use pink. */
body.sjm-global-styles .elementor-widget-icon-list .elementor-icon-list-icon i,
body.sjm-global-styles .elementor-widget-icon-list .elementor-icon-list-icon svg,
body.sjm-global-styles .elementor-widget-icon .elementor-icon,
body.sjm-global-styles .elementor-widget-icon-box .elementor-icon {
  color: var(--sjm-pink) !important;
  fill: var(--sjm-pink) !important;
}

body.sjm-global-styles .elementor-widget-icon-list .elementor-icon-list-icon svg path,
body.sjm-global-styles .elementor-widget-icon .elementor-icon svg path,
body.sjm-global-styles .elementor-widget-icon-box .elementor-icon svg path {
  fill: var(--sjm-pink) !important;
}

/* Secondary/Info Elementor buttons automatically become pink. A custom class of
   sjm-secondary-button can also be added to any button widget/container. */
body.sjm-global-styles .elementor-button-info,
body.sjm-global-styles .elementor-button-secondary,
body.sjm-global-styles .sjm-secondary-button .elementor-button,
body.sjm-global-styles .elementor-button.sjm-secondary-button {
  background: var(--sjm-pink) !important;
  color: var(--sjm-white) !important;
}

body.sjm-global-styles .elementor-button-info:hover,
body.sjm-global-styles .elementor-button-secondary:hover,
body.sjm-global-styles .sjm-secondary-button .elementor-button:hover,
body.sjm-global-styles .elementor-button.sjm-secondary-button:hover {
  background: var(--sjm-navy) !important;
}

/* Decorative maths: deliberately more visible and more often pink, while still
   remaining background decoration rather than competing with the copy. */
.sjm-math-host > .sjm-math-decor {
  opacity: .095;
}

.sjm-math-decor.sjm-math-a {
  color: var(--sjm-pink, #CC3467);
}

.sjm-math-decor.sjm-math-b {
  opacity: .12;
}

.sjm-math-decor.sjm-math-c {
  opacity: .09;
}

.sjm-math-decor.sjm-math-d {
  color: var(--sjm-pink, #CC3467);
  top: 10%;
  left: 1.5%;
  font-size: clamp(32px, 4vw, 62px);
  transform: rotate(-4deg);
  opacity: .085;
}

.sjm-math-decor.sjm-math-e {
  color: var(--sjm-pink, #CC3467);
  right: 2%;
  bottom: 11%;
  font-size: clamp(48px, 5.5vw, 86px);
  transform: rotate(7deg);
  opacity: .10;
}

.sjm-math-decor.sjm-math-f {
  color: var(--sjm-blue, #2563EB);
  left: 4%;
  bottom: 7%;
  font-size: clamp(24px, 3vw, 42px);
  transform: rotate(-2deg);
  opacity: .065;
}

.sjm-math-decor.sjm-math-long {
  font-size: clamp(22px, 2.6vw, 38px);
  letter-spacing: -.02em;
}

/* Optional custom header */
body.sjm-custom-header-enabled #masthead,
body.sjm-custom-header-enabled .site-header:not(.sjm-site-header),
body.sjm-custom-header-enabled header.elementor-location-header,
body.sjm-custom-header-enabled .elementor-location-header,
body.sjm-custom-header-enabled [data-elementor-type="header"] {
  display: none !important;
}

.sjm-site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid rgba(20,33,61,.08);
  backdrop-filter: blur(10px);
}


body.admin-bar .sjm-site-header { top: 32px; }

/* Keep the desktop header visible even when the active theme has strong nav rules. */
@media (min-width: 781px) {
  .sjm-site-header .sjm-primary-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .sjm-site-header .sjm-menu-toggle { display: none !important; }
}

.sjm-header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.sjm-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #14213D;
  text-decoration: none;
  flex: 0 0 auto;
}

.sjm-header-logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 190px;
  max-height: 68px;
  object-fit: contain;
}

.sjm-brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: #14213D;
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.sjm-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.sjm-brand-text strong { font-size: 17px; letter-spacing: -.02em; }
.sjm-brand-text span { font-size: 14px; color: var(--sjm-pink, #CC3467); font-weight: 700; margin-top: 3px; }

.sjm-primary-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.sjm-menu-list,
.sjm-menu-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sjm-menu-list {
  display: flex;
  align-items: center;
  gap: 24px;
}

.sjm-menu-list > li {
  position: relative;
}

.sjm-menu-list > li > a,
.sjm-menu-list .sub-menu a {
  color: #14213D;
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

.sjm-menu-list > li > a {
  display: block;
  padding: 26px 0;
}

.sjm-menu-list a:hover,
.sjm-menu-list a:focus-visible,
.sjm-menu-list .current-menu-item > a,
.sjm-menu-list .current-menu-ancestor > a {
  color: var(--sjm-pink, #CC3467);
}

.sjm-menu-list .menu-item-has-children > a::after {
  content: "⌄";
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  transform: translateY(-1px);
}

.sjm-menu-list .sub-menu {
  position: absolute;
  top: calc(100% - 8px);
  left: -16px;
  min-width: 235px;
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(20,33,61,.09);
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(20,33,61,.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(7px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 1001;
}

.sjm-menu-list .sub-menu li {
  position: relative;
}

.sjm-menu-list .sub-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  white-space: normal;
  line-height: 1.35;
}

.sjm-menu-list .sub-menu a:hover,
.sjm-menu-list .sub-menu a:focus-visible {
  background: #FFF5F8;
  color: var(--sjm-pink, #CC3467);
}

.sjm-menu-list li:hover > .sub-menu,
.sjm-menu-list li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sjm-primary-nav .sjm-header-cta {
  background: #2563EB;
  color: #fff;
  border-radius: 9px;
  padding: 12px 17px;
  box-shadow: 0 7px 18px rgba(37,99,235,.18);
}
.sjm-primary-nav .sjm-header-cta:hover { background: var(--sjm-pink, #CC3467); color: #fff; }

.sjm-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: #F5F7FA;
  cursor: pointer;
}
.sjm-menu-toggle span:not(.screen-reader-text) {
  display: block;
  height: 2px;
  width: 23px;
  margin: 4px auto;
  border-radius: 2px;
  background: #14213D;
  transition: transform .2s ease, opacity .2s ease;
}
.sjm-menu-toggle[aria-expanded="true"] span:nth-of-type(2) { transform: translateY(6px) rotate(45deg); }
.sjm-menu-toggle[aria-expanded="true"] span:nth-of-type(3) { opacity: 0; }
.sjm-menu-toggle[aria-expanded="true"] span:nth-of-type(4) { transform: translateY(-6px) rotate(-45deg); }

/* Optional custom footer */
body.sjm-custom-footer-enabled #colophon,
body.sjm-custom-footer-enabled .site-footer:not(.sjm-site-footer),
body.sjm-custom-footer-enabled footer.elementor-location-footer,
body.sjm-custom-footer-enabled .elementor-location-footer,
body.sjm-custom-footer-enabled [data-elementor-type="footer"] {
  display: none !important;
}

.sjm-site-footer {
  background: #14213D;
  color: rgba(255,255,255,.82);
  padding: 48px 20px 0;
}
.sjm-footer-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  align-items: start;
  gap: 36px;
}
.sjm-footer-brand { display: flex; flex-direction: column; gap: 7px; }
.sjm-footer-brand strong { color: #fff; font-size: 21px; }
.sjm-footer-brand span { font-size: 14px; }
.sjm-footer-menu-list,
.sjm-footer-menu-list ul { list-style: none; margin: 0; padding: 0; }
.sjm-footer-menu-list { display: flex; flex-wrap: wrap; gap: 12px 19px; }
.sjm-footer-menu-list .sub-menu { display: none; }
.sjm-footer-nav a,
.sjm-footer-email { color: rgba(255,255,255,.9); text-decoration: none; font-size: 14px; }
.sjm-footer-nav a:hover,
.sjm-footer-email:hover { color: var(--sjm-pink, #CC3467); }
.sjm-footer-email { justify-self: end; }
.sjm-footer-bottom {
  width: min(1180px, 100%);
  margin: 34px auto 0;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 13px;
  color: rgba(255,255,255,.58);
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

@media (max-width: 1024px) {
  .sjm-header-inner { width: min(100% - 30px, 1180px); }
  .sjm-primary-nav { gap: 16px; }
  .sjm-menu-list > li > a, .sjm-menu-list .sub-menu a { font-size: 14px; }
  .sjm-primary-nav .sjm-header-cta { padding: 11px 13px; }
  .sjm-math-decor.sjm-math-a { font-size: clamp(60px, 8vw, 92px); }
  .sjm-math-decor.sjm-math-b { font-size: clamp(24px, 3.4vw, 34px); }
  .sjm-footer-inner { grid-template-columns: 1fr 1fr; }
  .sjm-footer-email { justify-self: start; }
}

@media (max-width: 782px) {
  body.admin-bar .sjm-site-header { top: 46px; }
}

@media (max-width: 780px) {
  .sjm-header-inner { min-height: 68px; }
  .sjm-header-logo-img { max-width: 150px; max-height: 56px; }
  .sjm-menu-toggle { display: block; }
  .sjm-primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 20px;
    background: #fff;
    border-top: 1px solid rgba(20,33,61,.07);
    border-bottom: 1px solid rgba(20,33,61,.1);
    box-shadow: 0 14px 28px rgba(20,33,61,.09);
  }
  .sjm-primary-nav.sjm-nav-open { display: flex; }
  .sjm-menu-list { display: block; width: 100%; }
  .sjm-menu-list > li { border-bottom: 1px solid #EEF2F7; }
  .sjm-menu-list > li > a { padding: 13px 4px; font-size: 16px; }
  .sjm-menu-list .menu-item-has-children > a::after { content: ""; margin: 0; }
  .sjm-menu-list .sub-menu {
    position: static;
    min-width: 0;
    padding: 0 0 10px 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
  }
  .sjm-menu-list .sub-menu a {
    padding: 9px 4px;
    font-size: 14px;
    color: #475569;
    white-space: normal;
  }
  .sjm-primary-nav .sjm-header-cta { margin-top: 12px; padding: 14px 16px; text-align: center; border-bottom: 0; }

  .sjm-math-decor.sjm-math-a { right: 2%; font-size: 52px; opacity: .07; }
  .sjm-math-decor.sjm-math-b,
  .sjm-math-decor.sjm-math-long { display: none; }
  .sjm-math-decor.sjm-math-c { font-size: 46px; opacity: .065; }
  .sjm-math-decor.sjm-math-d { font-size: 34px; opacity: .055; }
  .sjm-math-decor.sjm-math-e { font-size: 42px; opacity: .06; }
  .sjm-math-decor.sjm-math-f { display: none; }

  body.sjm-global-styles .elementor-button,
  body.sjm-global-styles .wp-element-button,
  body.sjm-global-styles .wp-block-button__link {
    padding: 13px 20px !important;
    font-size: 15px !important;
  }

  .sjm-site-footer { padding-top: 38px; }
  .sjm-footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .sjm-footer-menu-list { gap: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sjm-site-kit *, .sjm-site-kit *::before, .sjm-site-kit *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
