/*
Theme Name: Cemetrix V1
Theme URI: http://example.com/cemetrix
Author: Cemetrix Team
Description: Custom WordPress theme for Cemetrix built with Secure Custom Fields.
Version: 1.0
Text Domain: cemetrix
*/

@import url('https://fonts.googleapis.com/css2?family=Asimovian&family=Qwitcher+Grypen:wght@400;700&display=swap');

.qwitcher-grypen-regular {
  font-family: "Qwitcher Grypen", cursive;
  font-weight: 400;
  font-style: normal;
}

.qwitcher-grypen-bold {
  font-family: "Qwitcher Grypen", cursive;
  font-weight: 700;
  font-style: normal;
}

/* ---------- COLOR VARIABLES ---------- */
:root {
  --ink: #0E1B2A;
  --steel: #3A4A5C;
  --steel-soft: #5C7085;
  --paper: #EDEAE2;
  --paper-dim: #E1DDD2;
  --copper: #C1652F;
  --cyan: #3FA79A;
  --line: rgba(14, 27, 42, 0.14);
  --line-dark: rgba(237, 234, 226, 0.16);
}

/* ---------- CORE LAYOUT & RELIEF ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #ececec;
  color: #0E1B2A;
  font-family: 'IBM Plex Sans', sans-serif;
  overflow-x: hidden;
}

.wrap {
  max-width: 1180px; 
  margin: 0 auto; 
  padding: 0 32px;
  width: 100%;
}

@media(max-width: 700px) {
  .wrap {
    padding: 0 20px;
  }
}

/* ---------- HEADER & NAVIGATION ---------- */
.site-header {
  background: rgba(14, 27, 42, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.site-header nav.wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 34px;
}

.navlinks ul.main-menu {
  display: flex;
  gap: 34px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navlinks ul.main-menu li a {
  font-size: 14px;
  font-weight: 500;
  color: rgba(237, 234, 226, 0.85);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  font-family: 'IBM Plex Sans', sans-serif;
}

.navlinks ul.main-menu li a:hover {
  color: #fff;
}

.navlinks ul.main-menu li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--copper);
  transition: width .25s ease;
}

.navlinks ul.main-menu li a:hover::after {
  width: 100%;
}

/* ---------- UNIFIED DROPDOWN & SUB-MENU STYLING ---------- */
.custom-dropdown-styling ul.main-menu li {
    position: relative;
}

.custom-dropdown-styling ul.main-menu li a {
    color: var(--paper);
    text-transform: uppercase;
}

/* Keeps parent highlighted when hovering over its dropdown */
.custom-dropdown-styling ul.main-menu li:hover > a,
.custom-dropdown-styling ul.main-menu li.current-menu-item > a,
.custom-dropdown-styling ul.main-menu li.current-menu-ancestor > a {
    color: var(--copper); 
}

/* LEVEL 1: First Dropdown (Opens Down) */
.navlinks .main-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--ink);
    min-width: 240px;
    border-top: 3px solid var(--copper);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    list-style: none;
    padding: 0;
    margin: 0;
    display: block !important; 
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 99;
}

/* LEVEL 2+: Sub-Sub-Menus (Opens to the Right) */
.navlinks .main-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%; /* Forces it to the right of the parent menu */
    border-top: none;
    border-left: 3px solid var(--copper); 
    transform: translateX(15px); /* Slide in from the right */
    margin-left: 1px; /* Tiny gap to prevent clipping */
}

/* Hover trigger for ALL levels */
.navlinks .main-menu li:hover > .sub-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Reset transform for Level 1 on hover */
.navlinks .main-menu > li:hover > .sub-menu {
    transform: translateY(0);
}

/* Reset transform for Level 2+ on hover */
.navlinks .main-menu .sub-menu li:hover > .sub-menu {
    transform: translateX(0);
}

/* Menu Item Styling */
.custom-dropdown-styling ul.main-menu li ul.sub-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.custom-dropdown-styling ul.main-menu li ul.sub-menu li:last-child {
    border-bottom: none;
}

.custom-dropdown-styling ul.main-menu li ul.sub-menu li a {
    display: block;
    padding: 15px 20px;
    color: rgba(237, 234, 226, 0.85); 
    text-transform: none;
    font-size: 14.5px;
    transition: background-color 0.2s, padding-left 0.2s, color 0.2s;
}

/* Sub-menu Hover Effect */
.custom-dropdown-styling ul.main-menu li ul.sub-menu li:hover > a {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding-left: 25px; /* Sleek indent effect on hover */
}

/* Mobile Header Tweak */
@media (max-width: 860px) {
  .custom-dropdown-styling ul.main-menu {
    display: none; 
    flex-direction: column;
    background: var(--ink);
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    padding: 20px;
  }
  .custom-dropdown-styling ul.main-menu li ul.sub-menu {
    position: relative;
    width: 100%;
    border-top: none;
    border-left: 2px solid var(--copper);
    padding-left: 15px;
  }
}

/* ---------- HERO SECTION ---------- */
.hero, .hero-landing {
  padding: 70px 0 240px; 
  color: var(--paper);
}

.hero-grid-single {
  display: block;
  max-width: 600px;
  margin-left: 0;
}

.hero h1 {
  line-height: 1.3; 
  margin-bottom: 24px;
  color: var(--paper);
}

.hero h1 em {
  font-style: normal;
  color: var(--copper);
}

.hero .sub {
  line-height: 1.7; 
  margin-bottom: 40px;
  font-size: 17px;
  color: rgba(237, 234, 226, 0.72);
}

.eyebrow {
  margin-bottom: 24px;
  color: var(--copper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--copper);
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn-primary {
  background: var(--copper);
  color: var(--ink);
  padding: 14px 28px;
  font-weight: 600;
  font-size: 15px;
  border-radius: 2px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #d8783f;
}

/* Hero Mobile Overrides */
@media (max-width: 860px) {
  .hero-landing { padding: 120px 20px 180px; }
}
@media (max-width: 560px) {
  .hero h1, .hero-landing h1 { font-size: 32px; }
}

/* ---------- CARDS OVERLAY EFFECT ---------- */
.features-overlap {
  position: relative;
  z-index: 10;
  margin-top: -130px; 
  padding-bottom: 100px;
}

/* ---------- STANDALONE CAROUSEL COMPONENT ---------- */
.carousel-container {
  width: 100%;
  position: relative;
}

.svc-carousel-track {
  display: flex;
  gap: 30px;
  overflow-x: auto; 
  scroll-snap-type: x mandatory; 
  padding-bottom: 30px; 
  
  scrollbar-width: none; 
  -ms-overflow-style: none; 
}

.svc-carousel-track::-webkit-scrollbar {
  display: none; 
}

.svc-carousel-track .svc-card {
  width: calc(25% - 22.5px); 
  flex: 0 0 calc(25% - 22.5px); 
  scroll-snap-align: start; 
}

@media (max-width: 900px) {
  .svc-carousel-track .svc-card {
    width: calc(50% - 15px);
    flex: 0 0 calc(50% - 15px);
  }
}

@media (max-width: 560px) {
  .svc-carousel-track .svc-card {
    width: 100%;
    flex: 0 0 100%;
  }
}

/* ---------- CARD STYLING ---------- */
.svc-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;
  text-align: left;
}

.svc-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
}

.svc-card-image {
  width: 100%;
  height: 220px;
  min-height: 220px; 
  flex: 0 0 220px; 
  background-size: cover;
  background-position: center;
  border-radius: 4px 4px 0 0;
  background-color: #f4f4f4; 
}

.svc-card-content {
  padding: 50px 30px 30px; 
  position: relative;
  flex-grow: 1;
}

.svc-card-icon {
  position: absolute;
  top: -35px; 
  left: 30px;
  width: 70px;
  height: 70px;
  background: #F4A236; 
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.svc-card-icon i {
  font-size: 32px;
  color: #ffffff;
}

.svc-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #222;
  font-weight: 400; 
}

.svc-card p {
  font-size: 14.5px;
  color: #777;
  line-height: 1.6;
  margin: 0;
}

/* ---------- FOOTER SECTION ---------- */
.site-footer {
  background: var(--ink);
  border-top: 1px solid var(--line-dark);
  padding: 60px 0 30px;
  color: rgba(237, 234, 226, 0.7);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 30px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line-dark);
}

.foot-brand .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 21px;
  color: var(--paper);
  margin-bottom: 16px;
}

.foot-brand p {
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 250px;
  color: rgba(237, 234, 226, 0.55);
}

.foot-nav h5 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--copper);
  margin-bottom: 18px;
}

.foot-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.foot-nav li {
  margin-bottom: 12px;
  font-size: 13.5px;
}

.foot-nav a {
  color: rgba(237, 234, 226, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.foot-nav a:hover {
  color: var(--paper);
}

.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 12px;
  color: rgba(237, 234, 226, 0.7);
}

.foot-bottom .mono {
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.05em;
}

@media (max-width: 960px) {
  .foot-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

@media (max-width: 560px) {
  .foot-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- FEATURE CARDS LINK STYLING ---------- */
.fc-link-wrapper {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease;
}

.fc-link-wrapper:hover h3 {
  color: #E89A6A; 
}

/* ---------- ENTRY ANIMATIONS ---------- */
.animate-card {
  opacity: 0; 
  visibility: hidden;
}

.animate-card.do-bounce {
  visibility: visible;
  animation: fadeZoomBounce 0.8s cubic-bezier(0.28, 0.84, 0.42, 1) forwards;
}

@keyframes fadeZoomBounce {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(40px);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) translateY(-10px);
  }
  80% {
    transform: scale(0.97) translateY(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.b-card-text p, 
.b-card-text ul {
  font-size: 14px;
  color: #888;
  line-height: 1.6;
  margin-bottom: 24px;
}

.b-card-text ul {
  padding-left: 20px; 
}

.b-card-text li {
  margin-bottom: 8px;
}

/* Hide toggle button on desktop */
.navtoggle {
  display: none;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 860px) {
  /* Show toggle button on mobile */
  .navtoggle {
    display: block;
  }

  /* Force menu to show when the active class is applied */
  .custom-dropdown-styling ul.main-menu.active {
    display: flex !important;
  }
}

/* ---------- MOBILE MENU SUB-MENU OVERRIDES ---------- */
@media (max-width: 860px) {
  
  /* 1. Reset the desktop animation and positioning states for ALL nested levels */
  .navlinks .main-menu .sub-menu,
  .navlinks .main-menu .sub-menu .sub-menu {
    position: relative !important;
    top: auto !important;
    left: 0 !important; /* Fixes the level-2 screen overflow */
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    
    /* Hide all sub-menus completely by default on mobile */
    display: none !important; 
    
    margin: 10px 0 10px 0 !important;
    width: 100% !important;
  }

  /* 2. Automatically show the sub-menu if the user is currently on that page */
  .navlinks .main-menu li.current-menu-item > .sub-menu,
  .navlinks .main-menu li.current-menu-ancestor > .sub-menu {
    display: block !important;
  }

  /* 3. Allow tapping to open the other non-active sub-menus */
  .navlinks .main-menu li:hover > .sub-menu,
  .navlinks .main-menu li:focus-within > .sub-menu {
    display: block !important;
  }
  
}

/* ---------- GLOBAL CONTACT MODAL ---------- */
.cemetrix-modal {
    position: fixed;
    inset: 0;
    z-index: 9999; 
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease;
}

.cemetrix-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.cemetrix-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(14, 27, 42, 0.85); 
    backdrop-filter: blur(5px);
}

.cemetrix-modal-content {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px); 
    transition: transform 0.3s ease;
    margin: 20px;
}

.cemetrix-modal.is-open .cemetrix-modal-content {
    transform: translateY(0);
}

.cemetrix-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--steel-soft);
    cursor: pointer;
    transition: color 0.2s;
}

.cemetrix-modal-close:hover {
    color: #E81A5F; 
}

.cemetrix-modal-content h3 {
    color: var(--ink);
    font-size: 28px;
    margin-bottom: 10px;
}

.cemetrix-modal-content p {
    color: var(--steel);
    font-size: 14.5px;
    margin-bottom: 25px;
}

.cemetrix-contact-form .form-group {
    margin-bottom: 20px;
}

.cemetrix-contact-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cemetrix-contact-form input,
.cemetrix-contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s;
}

.cemetrix-contact-form input:focus,
.cemetrix-contact-form textarea:focus {
    outline: none;
    border-color: var(--cyan);
}

/* ---------- CASE STUDY PAGE LAYOUT ---------- */
.cs-layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; 
    gap: 60px;
    align-items: start;
}

@media (max-width: 960px) {
    .cs-layout-grid {
        grid-template-columns: 1fr; 
        gap: 40px;
    }
}