/**
 * Ayman Designer — RTL-first design system.
 *
 * Scope rules:
 * - Site chrome (header/footer/back-to-top) lives under .aymn-* classes.
 * - Global polish is limited to primitives (focus, selection, scrolling)
 *   so Elementor widget styling is never fought or overridden.
 *
 * Brand palette mirrors the Elementor kit (kit id 3):
 *   primary  #18B7BD · text #3E3E3E · accent #665492 · soft #F2F2F2
 */

:root {
  --aymn-primary: #18b7bd;
  --aymn-primary-dark: #109599;
  --aymn-primary-soft: rgba(24, 183, 189, 0.09);
  --aymn-ink: #3e3e3e;
  --aymn-ink-soft: #5e5e5e;
  --aymn-accent: #665492;
  --aymn-surface: #ffffff;
  --aymn-footer-bg: #232428;
  --aymn-footer-ink: #c9cacd;
  --aymn-radius: 12px;
  --aymn-shadow: 0 10px 32px rgba(20, 25, 30, 0.09);
  --aymn-header-h: 76px;
  --aymn-font: "SalehFont", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

@media (max-width: 1024px) {
  :root {
    --aymn-header-h: 64px;
  }
}

/* ------------------------------------------------------------------ */
/* Global primitives                                                   */
/* ------------------------------------------------------------------ */

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--aymn-header-h) + 16px);
}

::selection {
  background: var(--aymn-primary);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--aymn-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

body.aymn-has-header {
  padding-top: var(--aymn-header-h);
}

.skip-link.screen-reader-text:focus {
  position: fixed;
  inset-inline-start: 16px;
  top: 12px;
  z-index: 10000;
  padding: 10px 18px;
  background: var(--aymn-ink);
  color: #fff;
  border-radius: 8px;
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  font-family: var(--aymn-font);
}

/* ------------------------------------------------------------------ */
/* Container                                                           */
/* ------------------------------------------------------------------ */

.aymn-container {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.aymn-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--aymn-radius);
  font-family: var(--aymn-font);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.6;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease, box-shadow 0.2s ease;
}

.aymn-btn--cta {
  background: var(--aymn-primary);
  color: #fff;
}

.aymn-btn--cta:hover,
.aymn-btn--cta:focus-visible {
  background: var(--aymn-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(24, 183, 189, 0.35);
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.aymn-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 9990;
  height: var(--aymn-header-h);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(62, 62, 62, 0.08);
  font-family: var(--aymn-font);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.aymn-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--aymn-shadow);
}

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

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

.aymn-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.aymn-header__brand .custom-logo-link {
  display: block;
  line-height: 0;
}

.aymn-header__brand .custom-logo {
  max-height: 46px;
  width: auto;
}

.aymn-header__brand-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--aymn-ink);
  text-decoration: none;
}

/* --- Navigation ---------------------------------------------------- */

.aymn-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.aymn-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.aymn-menu li {
  position: relative;
}

.aymn-menu a {
  display: block;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--aymn-ink);
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.aymn-menu a:hover,
.aymn-menu a:focus-visible,
.aymn-menu a[aria-current="page"],
.aymn-menu .current-menu-item > a {
  color: var(--aymn-primary-dark);
  background: var(--aymn-primary-soft);
}

/* Simple dropdown for one sub-level (if a WP menu with children is assigned) */

.aymn-menu .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  min-width: 200px;
  display: none;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--aymn-surface);
  border-radius: var(--aymn-radius);
  box-shadow: var(--aymn-shadow);
}

.aymn-menu li:hover > .sub-menu,
.aymn-menu li:focus-within > .sub-menu {
  display: flex;
}

/* --- Burger (mobile) ----------------------------------------------- */

.aymn-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.aymn-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--aymn-ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.aymn-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.aymn-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.aymn-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile panel --------------------------------------------------- */

@media (max-width: 1024px) {
  .aymn-burger {
    display: flex;
  }

  .aymn-nav {
    position: fixed;
    top: var(--aymn-header-h);
    inset-inline: 0;
    z-index: 9989;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: calc(100dvh - var(--aymn-header-h));
    overflow-y: auto;
    padding: 18px 20px 26px;
    background: var(--aymn-surface);
    border-bottom: 1px solid rgba(62, 62, 62, 0.08);
    box-shadow: var(--aymn-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }

  body.admin-bar .aymn-nav {
    top: calc(var(--aymn-header-h) + 46px);
  }

  .aymn-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .aymn-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .aymn-menu a {
    padding: 13px 16px;
    font-size: 17px;
  }

  .aymn-menu .sub-menu {
    position: static;
    display: flex;
    box-shadow: none;
    padding: 0 16px;
  }

  .aymn-nav__cta {
    justify-content: center;
    margin-top: 6px;
  }
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.aymn-footer {
  background: var(--aymn-footer-bg);
  color: var(--aymn-footer-ink);
  font-family: var(--aymn-font);
  margin-top: 0;
}

.aymn-footer a {
  color: var(--aymn-footer-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.aymn-footer a:hover,
.aymn-footer a:focus-visible {
  color: var(--aymn-primary);
}

.aymn-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 48px;
  padding: 56px 0 40px;
}

@media (max-width: 900px) {
  .aymn-footer__grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 44px 0 32px;
  }
}

.aymn-footer__logo .custom-logo {
  max-height: 52px;
  width: auto;
}

/* White-logo trick for dark background (safe for any logo color). */
.aymn-footer__logo .custom-logo-link {
  display: inline-block;
  line-height: 0;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.aymn-footer__name {
  margin: 14px 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.aymn-footer__tagline {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.9;
}

.aymn-footer__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.aymn-footer__col p {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.9;
}

.aymn-menu--footer {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.aymn-menu--footer a {
  padding: 6px 0;
  color: var(--aymn-footer-ink);
  font-size: 14.5px;
  border-radius: 0;
}

.aymn-menu--footer a:hover,
.aymn-menu--footer a:focus-visible,
.aymn-menu--footer a[aria-current="page"] {
  color: var(--aymn-primary);
  background: transparent;
}

/* --- Social icons --------------------------------------------------- */

.aymn-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.aymn-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--aymn-footer-ink);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease;
}

.aymn-social a:hover,
.aymn-social a:focus-visible {
  background: var(--aymn-primary);
  border-color: var(--aymn-primary);
  color: #fff;
  transform: translateY(-3px);
}

/* --- Bottom bar ------------------------------------------------------ */

.aymn-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
}

.aymn-footer__bottom p {
  margin: 0;
}

.aymn-footer__legal {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ------------------------------------------------------------------ */
/* Back to top                                                          */
/* ------------------------------------------------------------------ */

.aymn-totop {
  position: fixed;
  bottom: 26px;
  inset-inline-end: 26px;
  z-index: 9980;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--aymn-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(24, 183, 189, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
}

.aymn-totop.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.aymn-totop:hover {
  background: var(--aymn-primary-dark);
}

.aymn-totop[hidden] {
  display: none;
}

/* ------------------------------------------------------------------ */
/* Accessibility & misc                                                 */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .aymn-header,
  .aymn-nav,
  .aymn-btn,
  .aymn-social a,
  .aymn-totop,
  .aymn-burger span {
    transition: none;
  }
}

@media print {
  .aymn-header,
  .aymn-footer,
  .aymn-totop {
    display: none;
  }

  body.aymn-has-header {
    padding-top: 0;
  }
}
