/* Base */
html { scroll-behavior: smooth; }
body, html { font-family: 'Roboto', system-ui, sans-serif; font-weight: 300; color: #828282; }
a { color: #F15E2A; text-decoration: none; }
a:hover { color: #D44F1C; }

/* Admin bar offset — push header below WP toolbar when logged in */
.admin-bar header { top: 32px; }
@media (max-width: 782px) { .admin-bar header { top: 46px; } }

/* Light header — white nav on dark hero backgrounds */
.header-light header a:not([aria-current="page"]) { color: #fff; }
.header-light header a:not([aria-current="page"]):hover { color: #F15E2A; }
.header-light header button.text-es-dark { color: #fff; }
.header-light header #mobile-menu-toggle { color: #fff; }
/* Keep dropdown items dark on their white background */
.header-light header .desktop-dropdown-panel a { color: #02000F; }
.header-light header .desktop-dropdown-panel a:hover { color: #F15E2A; }
.header-light .header-logo-dark { display: none; }
.header-light .header-logo-light { display: block !important; }
.x-motif-dark { display: none; }
.header-light .x-motif-mint { display: none; }
.header-light .x-motif-dark { display: block; }
.header-light h1 { color: #fff; }
.header-light .text-es-slate { color: #fff; }

/* Contained header — constrain right side to match left */
.header-contained header > div:first-child,
.header-plain header > div:first-child {
  padding-right: max(1.5rem, calc((100vw - 80rem) / 2 + 1.5rem));
}

/* Plain header — no X motif, black nav links, contained layout */
.header-plain .x-motif-mint { display: none; }
.header-plain header a { color: #02000F; }
.header-plain header a:hover { color: #F15E2A; }
.header-plain header button.desktop-dropdown-toggle { color: #02000F; }
.header-plain header button.desktop-dropdown-toggle:hover { color: #F15E2A; }
.header-plain header #mobile-menu-toggle { color: #02000F; }
.header-plain header a.ml-\[30px\] { margin-left: 0; }

/* Headings — body font, bold */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto', system-ui, sans-serif;
  font-weight: 700;
  color: #02000F;
  letter-spacing: normal;
  text-transform: none;
}

/* Orbitron only in hero sections */
.hero-fade-in h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Script accent (hero "better") — Source Serif 4 Bold Italic per CI guide */
.font-script {
  font-family: 'Source Serif 4', 'Source Serif Variable', Georgia, serif;
  font-weight: 700;
  font-style: italic;
  text-transform: none;
  letter-spacing: normal;
}

/* Buttons — shared base */
.btn,
.btn-primary,
.btn-outline {
  display: inline-block;
  border-radius: 4px;
  padding: 1rem 2.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background-color: #F15E2A; color: #fff; border: none;
}
.btn-primary:hover { background-color: #D44F1C; color: #fff; }

.btn-outline {
  background-color: transparent; border: 2px solid #F15E2A; color: #F15E2A !important;
}
.btn-outline:hover { background-color: #F15E2A; color: #fff; }

/* ── Flex-strip carousel (shared by key-features, recruitment, ESG) ── */
.fc-card {
  flex: 0 0 calc((50% - 48px) / 3);
  min-width: 0;
  margin-bottom: 20px;
  transition: flex 0.5s ease, transform 0.5s ease, opacity 0.5s ease, margin 0.5s ease;
}
.fc-card.fc-active {
  flex: 0 0 50%;
  margin-bottom: 0;
}
.fc-card .fc-card-inner {
  transition: border-color 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}
.fc-card.fc-exiting-left,
.fc-card.fc-entering-left {
  flex: 0 0 0%;
  transform: translateX(-60px);
  opacity: 0;
  overflow: hidden;
  margin: 0;
  gap: 0;
}
.fc-spacer {
  flex: 0 0 0px;
  transition: flex 0.5s ease;
}
.fc-spacer.fc-spacer-open {
  flex: 0 0 calc((50% - 48px) / 3);
}

/* X motif positioning */
/* left/right use % (container-relative) so the X tracks with the logo at all viewport widths */
.x-motif-header { width: 55vw; max-width: 900px; top: calc(-10vw - 105px); left: calc(-20% - 55px); }
.x-motif-contact { width: 58vw; max-width: 880px; top: calc(-12rem + 20px); right: calc(-13rem - 60px); }
@media (max-width: 767px) {
  .x-motif-header { width: 80vw; top: -5vw; left: -30%; }
}

/* ── Landscape / short-viewport fixes ── */
@media (max-height: 500px) {
  /* Break out of min-h-screen so content can scroll naturally */
  .landscape-safe {
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
  .landscape-safe > section[class*="flex-1"] {
    min-height: 70vh;
  }
  /* Compact hero text */
  .hero-fade-in { padding-top: 4.5rem; padding-bottom: 1rem; }
  .hero-fade-in h1 { font-size: 1.25rem; margin-bottom: 0.15rem; }
  .hero-fade-in h1 span[style*="font-size"] { font-size: clamp(2rem, 8vw, 3.5rem) !important; margin-bottom: 0.15rem; }
  .hero-fade-in p:not([style]) { font-size: 0.8rem; margin-bottom: 0.5rem; max-width: 28rem; }
  .scroll-bounce { display: none; }
  /* Compact stats + services bars */
  #stats { padding-top: 0.75rem; padding-bottom: 0.75rem; }
  #services { padding-top: 0.75rem; padding-bottom: 0.75rem; }
  #services h2 { font-size: 1rem; margin-bottom: 0.75rem; }
}

/* Form inputs */
input:not([type="checkbox"]):not([type="submit"]), textarea, select {
  background: #E4E4E4; color: #02000F; border: 1px solid #E4E4E4;
  padding: 0.75rem 1rem; width: 100%; border-radius: 0.5rem;
}
input::placeholder, textarea::placeholder { color: #999; }

/* Accordion */
.accordion-item { border-bottom: 1px solid #E0E0E0; }
.accordion-trigger {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0; text-align: left; font-size: 1.125rem; color: #02000F;
  cursor: pointer; transition: color 0.2s; background: none; border: none;
}
.accordion-trigger:hover { color: #F15E2A; }
.accordion-content { overflow: hidden; transition: all 0.3s; }

/* Lucide icons */
[data-lucide] {
  display: inline-block; position: relative; top: -2px;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none;
}
/* Nav chevrons — vertically centre with uppercase text */
nav [data-lucide="chevron-down"],
.mobile-dropdown-toggle [data-lucide="chevron-down"] { top: 1px; }

/* Scroll-down bounce */
.scroll-bounce {
  animation: scrollBounce 2.4s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50%      { transform: translateY(18px); opacity: 1; }
}

/* Section headings with decorative line */
.section-heading {
  text-align: center; font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.25em; text-transform: uppercase; color: #02000F;
  padding-bottom: 1rem; border-bottom: 2px solid #F15E2A; display: inline-block;
}

/* ── Scroll-reveal animations ── */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1.6s cubic-bezier(.16,1,.3,1), transform 1.6s cubic-bezier(.16,1,.3,1);
}
.reveal.reveal-left {
  transform: translateX(-80px);
}
.reveal.reveal-right {
  transform: translateX(80px);
}
.reveal.reveal-scale {
  transform: scale(0.85);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger children — add .stagger to a grid/container */
.stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.stagger > .reveal:nth-child(2) { transition-delay: 0.2s; }
.stagger > .reveal:nth-child(3) { transition-delay: 0.4s; }
.stagger > .reveal:nth-child(4) { transition-delay: 0.6s; }
.stagger > .reveal:nth-child(5) { transition-delay: 0.8s; }
.stagger > .reveal:nth-child(6) { transition-delay: 1.0s; }
.stagger > .reveal:nth-child(7) { transition-delay: 1.2s; }
.stagger > .reveal:nth-child(8) { transition-delay: 1.4s; }
.stagger > .reveal:nth-child(9) { transition-delay: 1.6s; }

/* Card hover lift */
.hover-lift {
  transition: transform 0.4s cubic-bezier(.16,1,.3,1), box-shadow 0.4s ease;
}
.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.14);
}

/* Hero fade-in on load — staggered per line */
.hero-fade-in > * {
  opacity: 0;
  transform: translateY(40px);
  animation: heroLineIn 1.4s cubic-bezier(.16,1,.3,1) both;
}
.hero-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.hero-fade-in > *:nth-child(2) { animation-delay: 0.4s; }
.hero-fade-in > *:nth-child(3) { animation-delay: 0.7s; }
@keyframes heroLineIn {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger individual spans within the h1 */
.hero-fade-in h1 > span {
  opacity: 0;
  transform: translateY(30px);
  animation: heroLineIn 1.2s cubic-bezier(.16,1,.3,1) both;
}
.hero-fade-in h1 > span:nth-child(1) { animation-delay: 0.2s; }
.hero-fade-in h1 > span:nth-child(2) { animation-delay: 0.5s; }
.hero-fade-in h1 > span:nth-child(3) { animation-delay: 0.8s; }

/* Hero crossfade slider */
.hero-slide {
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.hero-slide.active {
  opacity: 1;
}

/* Slider dots */
.hero-dot {
  background-color: rgba(241, 94, 42, 0.4);
  border: 2px solid #F15E2A;
}
.hero-dot.active {
  background-color: #F15E2A;
  transform: scale(1.25);
}

/* ── Sustainability card — Join Our Team hover reveal ── */
.sus-x-wrapper {
  z-index: 15;
  transition: transform 0.75s cubic-bezier(.16,1,.3,1);
}
.sus-left {
  transition: opacity 0.4s ease;
}
.sus-reveal {
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease 0.35s;
  z-index: 20;
}
@media (min-width: 1024px) {
  .sus-reveal {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
.sustainability-card.sus-revealed .sus-x-wrapper {
  transform: translateX(-100%);
}
.sustainability-card.sus-revealed .sus-left {
  opacity: 0;
}
.sustainability-card.sus-revealed .sus-reveal {
  opacity: 1;
  pointer-events: auto;
}

/* ── Team card flip ── */
.team-flip {
  perspective: 800px;
  width: 14rem; height: 14rem;
  cursor: pointer;
}
.team-flip-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(.4,0,.2,1);
}
.team-flip:hover .team-flip-inner {
  transform: rotateY(180deg);
}
.team-flip-front,
.team-flip-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: 50%;
  overflow: hidden;
}
.team-flip-front img,
.team-flip-front .team-flip-placeholder {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  border-radius: 50%;
}
.team-flip-back {
  background-color: #F15E2A;
  transform: rotateY(180deg);
  display: flex; flex-direction: row;
  align-items: center; justify-content: center;
  gap: 1.25rem;
}
.team-flip-back a {
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  transition: background-color 0.2s, border-color 0.2s;
}
.team-flip-back a:hover {
  background-color: rgba(255,255,255,0.2);
  border-color: #fff;
}
.team-flip-back a svg {
  width: 1.25rem; height: 1.25rem;
  stroke: #fff;
}

/* ── Article content (single.php) ── */
.article-content {
  column-count: 2;
  column-gap: 3rem;
}
@media (max-width: 767px) {
  .article-content {
    column-count: 1;
  }
}
.article-content h2,
.article-content h3,
.article-content h4,
.article-content blockquote,
.article-content .wp-block-columns,
.article-content .wp-block-image {
  column-span: all;
}
.article-content p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}
.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #02000F;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.article-content h3,
.article-content h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #F15E2A;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.article-content ul,
.article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.25rem;
}
.article-content ul { list-style-type: disc; }
.article-content ol { list-style-type: decimal; }
.article-content li {
  margin-bottom: 0.35rem;
  line-height: 1.7;
}
.article-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}
.article-content blockquote {
  border-left: 4px solid #F15E2A;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #33434D;
  background: #f9f9f9;
}
/* Gutenberg two-column blocks */
.article-content .wp-block-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .article-content .wp-block-columns {
    grid-template-columns: 1fr 1fr;
  }
}
.article-content .wp-block-column {
  min-width: 0;
}
/* Orange CTA paragraph */
.article-content .has-es-orange-color,
.article-content p em:only-child {
  color: #F15E2A;
}
/* Images inside columns */
.article-content .wp-block-image {
  margin: 1rem 0;
}
.article-content .wp-block-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

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

  /* Scroll-reveal */
  .reveal { opacity: 1; transform: none; transition: none !important; }
  .stagger > .reveal { transition-delay: 0s !important; }

  /* Card hover lift */
  .hover-lift { transition: none !important; }
  .hover-lift:hover { transform: none; }

  /* Scroll-down bounce */
  .scroll-bounce { animation: none !important; }

  /* Hero fade-in */
  .hero-fade-in > *,
  .hero-fade-in h1 > span { animation: none !important; opacity: 1; transform: none; }

  /* Hero crossfade slider */
  .hero-slide { transition: none !important; }

  /* Hero dots */
  .hero-dot { transition: none !important; }

  /* Team card flip */
  .team-flip-inner { transition: none !important; }
  .team-flip-back a { transition: none !important; }

  /* Flex-strip carousel (key-features, recruitment, ESG) */
  .fc-card { transition: none !important; }
  .fc-card .fc-card-inner { transition: none !important; }
  .fc-spacer { transition: none !important; }

  /* Simple carousel tracks (clients, reviews) */
  .clients-track,
  .reviews-track { transition: none !important; }

  /* Sustainability card transitions */
  .sus-x-wrapper { transition: none !important; }
  .sus-left { transition: none !important; }
  .sus-reveal { transition: none !important; }

  /* Accordion */
  .accordion-trigger { transition: none !important; }
  .accordion-content { transition: none !important; }

  /* Buttons */
  .btn,
  .btn-primary,
  .btn-outline { transition: none !important; }

  /* Animated counters — disable JS counting via data attribute */
  [data-count] { transition: none !important; }
}
