html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  min-height: 100%;
}
body.subpage .content p {
  color: #333 !important;
}

body.subpage .content {
  display: block !important;
}

body {
  font-family: 'Agrandir', sans-serif; /* Updated to use Agrandir */
  color: #333;
  background: linear-gradient(
    to bottom,
    #031273 0%,
    #031273 100%
  );
  font-size: 18px;      /* Updated global font size */
  line-height: 1.75;    /* Updated global line height */
}

/* Style for subpages */
body.subpage {
  background: #eeeeee !important;
}

/* 1) Ensure the parent doesn’t force a full‐width flex layout */
body.subpage .content {
  display: block !important;      /* you already have this */
}

/* 2) Make the “in-progress” box shrink to fit its contents */
body.subpage .content .in-progress {
  display: inline-block;          /* width auto, just big enough for text+padding */
  margin: 1rem auto;              /* vertical spacing + auto horizontal center */
}

/* Subpage header adjustments */
body.subpage .site-name a {
  color: #fff !important;  /* Cambiado a blanco */
}

body.subpage nav ul li a {
  color: #fff !important;  /* Cambiado a blanco */
}

.contact-wrapper {
  display: flex;
  flex-wrap: wrap;         /* allow wrapping on narrow screens */
  align-items: flex-start; /* align tops of both blocks */
  gap: 2rem;               /* space between the two blocks */
  justify-content: center; /* center them in the page */
  margin: 0 auto;          /* center within parent */
  max-width: 1200px;       /* optional: constrain overall width */
  padding: 20px;
}

/* Let each block grow equally (or adjust the flex-basis as needed) */
#contact,
#contact-form {
  flex: 1 1 400px;  /* grow, shrink, base width 400px */
  box-sizing: border-box;
  
}

/* Optional: override your existing #contact width rule */
#contact {
  width: auto !important;
}




/* Eliminamos la línea horizontal y el espacio debajo del nav en todas las subpáginas */
body.subpage nav {
  border-bottom: none !important;
  margin-bottom: 0 !important;
}

/* Navigation Bar */
nav {
  background: transparent;
  padding: 0 20px;
  display: flex;
  align-items: center;
}

/* Website Name */
.site-name {
  font-family: 'Agrandir', sans-serif; /* Update global texts to use Agrandir; header inline already uses Agrandir Grand */
  font-size: 2rem; /* Increased font size for the logo */
  font-weight: normal; /* removed bold, set to normal */
  color: #fff; /* White for main page */
  padding: 14px 20px;
}

.site-name a {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  margin-left: auto;
}
nav ul li {
  position: relative;
}
nav ul li a {
  display: block;
  padding: 14px 20px;
  text-decoration: none;
  color: #fff;
  font-weight: 0;
}
nav ul li a:hover {
  background-color: transparent;
}
/* New rule: Prevent text color change on hover for items with dropdown menus */
nav ul li:hover > a {
  color: #fff !important;
}
nav ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 180px;
  z-index: 999;
  list-style: none;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  margin: 0;
  padding: 0;
}
nav ul li:hover > ul {
  display: block;
}
nav ul li ul li {
  margin: 0;
  padding: 0;
}
nav ul li ul li a {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 20px;
  color: #333;
  background: #fff;
  font-weight: normal;
  position: relative;
  border-bottom: none;
}
nav ul li ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background-color: #ddd;
}
nav ul li ul li:last-child a::after {
  content: none;
}

/* Hero Section */
.hero {
  background: transparent;
  padding: 80px 20px;
  text-align: center;
  color: #fff;
}
.hero-content {
  max-width: 900px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  line-height: 1.2;
  font-weight: normal;
}
.hero-subtext {
  font-size: 1.2rem;
  line-height: 1.5;
  opacity: 0.9;
}

/* Add fade-in animation */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-content h1,
.hero-content .hero-subtext ,
.content .in-progress {
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
}

.hero-content h1 {
    animation-delay: 0.5s;
}

.hero-content .hero-subtext {
    animation-delay: 1s;
}

/* NEW: Apply fade-in animation to images within content sections */
.content img {
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
    animation-delay: 1s;
}

.notice-content {
  /* show the page background instead of white */
  background: transparent !important;
  /* drop any shadows or borders that .content applies */
  box-shadow: none !important;
  /* you can adjust padding/margins here if you want more separation */
}

.in-progress-block {
  background-color: #eeeeee;      /* same as body.subpage */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* match your other cards */
  border-radius: 12px;            /* or whatever radius you use */
  text-align: center;    /* center the icons + text inside */
}

body.subpage .in-progress {
  color: #333 !important;                    /* dark text */
  border-color: rgba(0,0,0,0.5) !important;   /* dark dashed border */
}



/* Main Content */
.content {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

footer {
  text-align: center;
}

/* Aplicar solo en la página principal */
body:not(.subpage) footer {
  color: #fff; /* Ajusta el color de la letra a blanco */
}

/* Updated Contact Section Styling */
#contact {
  background: #fff;
  margin: 0 auto 20px auto;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  text-align: left;  /* Center the text */
  width: fit-content;
}

/* Here I override the padding left and right which couldn't be overriden in #contact */
#contact ul {
  list-style: none;
  padding: 20px 30px !important;
}

#contact h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

#contact li {
    margin-bottom: 10px;
}

#contact a {
    color: #0066cc;
    text-decoration: none;
}

#contact a:hover {
    text-decoration: underline;
}

/* Subpage overrides */
body.subpage .site-name a {
  color: #fff !important;  /* Cambiado a blanco */
}

body.subpage .content.in-progress-block {
  background-color: transparent !important;
  box-shadow: none !important;
}

/* Override nav background for subpages */
body.subpage nav {
  background: #031273;
}

/* Forzar color oscuro en los subitems del menú en subpáginas */
body.subpage nav ul li ul li a {
  color: #333 !important; /* Revertido al color original para mejorar la legibilidad */
}

/* Forzar fondo azul en todas las subpáginas */
body.subpage header,
body.subpage .hero {
  background: #eeeeee !important;
  color: #031273;
}

/* Change the color of the content in the homepage to white*/
.content p {
  color: #fff;
}

/* ensure the content area fills enough vertical space */
.content {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* styling for the “in progress” message */
.content .in-progress {
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 1rem 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.content .in-progress {
  margin: 0 0.5rem;
  animation: fadeIn 1.5s ease forwards;
  animation-delay: 1.75s;
}


/* Override all heading weights to be normal */
h1, h2, h3, h4, h5, h6 {
    font-weight: normal !important;
}

.blog-posts-big-container {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background-color: #fff;
  padding: 20px;
  margin: 50px auto;
  width: fit-content;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  
}

.blog-post-small-container {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background-color: #fff;
  padding: 0px 20px;
  margin: 20px;
  border-radius: 4px;  
  width: 500px;
  display: flex;
  flex-direction: column;
}

.images-case-studies {
  width: 100%;        /* never exceed the container */
  height: 300px;      /* keep your visual height cap */
  object-fit: contain;/* letterbox if necessary, no cropping/distortion */
  display: block;
  max-width: 100%;
}


/* Make nav itmes with links be turn on hover*/
.hover-bold:hover {
  font-weight: bold;
}

/* Make nav sub-itmes bold and blue on hover (the ones with white background) */
.hover-bold-blue:hover {
  color: #031273 !important;
  font-weight: bold;
}

.subitem-and-arrow-container {
  width: 100%;
  margin-bottom: 10px;  
}

/* Hamburger nav styling */
nav.hamburger-nav {
  position: absolute;
  top: 10px;
  right: 20px;
}
button.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
}
button.hamburger:focus { outline: none; }
button.hamburger .bar {
  width: 25px;
  height: 3px;
  background-color: #fff;
}
/* Mobile sidebar styling */
#mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 200px;
  height: 100vh;
  background-color: #031273;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
}
#mobile-menu.active {
  transform: translateX(0);
  background-color: #0d1c7d;
}
/* Close button styling */
#mobile-menu .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
/* Modified mobile menu list to be vertical and left aligned */
#mobile-menu ul {
  list-style: none;
  margin: 40px 0 0; /* add top margin to avoid close button */
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* added for left alignment */
}
#mobile-menu li {
  margin-bottom: 10px;
}
#mobile-menu li:last-child {
  margin-bottom: 0;
}
#mobile-menu a {
  display: block;
  padding: 10px;
  color: #fff;
  text-decoration: none;
  text-align: left; /* ensure link text is left aligned */
}

/* For mobile or smaller screens */
@media screen and (max-width: 768px) { /* Adjust width as needed */
  .nav-list {
      display: none !important;
      
      /* Fix displaying of the contact page */
      #contact {
        width: auto;
        padding: 10px;
    }
  }  
  /* New: Adjust container to prevent overflow on mobile */
  .blog-posts-big-container {
    width: auto;
    margin: 20px 10px;
    padding: 10px;
  }
  .blog-post-small-container {
    width: 90%;
    margin: 20px auto;
  }
}

/* For desktop */
@media screen and (min-width: 768px) { /* Adjust width as needed */
  .hamburger {
      display: none !important;
  }
  /* Removed invalid toggleMenu() call */
}


/* ------------------------------------------------- */


/* This is used in the "Case Studies" page, in order to be able to switch between images */

/* --- minimal overlay controls for image slider --- */
.image-rotator {
  position: relative;
  display: block;
  width: 100%;        /* take the card’s width */
  touch-action: pan-y;
}
.image-rotator .rotator-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: #031273; font-size: 20px;
  line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center; z-index: 1;
  opacity: 0; transition: opacity .15s ease;
}
.image-rotator .rotator-btn.prev { left: 6px; }
.image-rotator .rotator-btn.next { right: 6px; }
.image-rotator:focus-within .rotator-btn,
.image-rotator:hover .rotator-btn { opacity: 1; }
.image-rotator .rotator-btn:focus { outline: 2px solid rgba(3,18,115,0.35); }

/* On touch devices (no hover), keep arrows visible */
@media (hover: none) {
  .image-rotator .rotator-btn { opacity: .95; }
}

/* --- pager dots --- */
.image-rotator + .rotator-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 0; /* a little space under the image */
}
.rotator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #031273;   /* visible on white cards */
  background: transparent;     /* “not colored white” */
  opacity: .55;
  padding: 0;                  /* kill default button padding */
  cursor: pointer;
}
.rotator-dot.active {
  background: #031273;            /* the current one = white */
  opacity: 1;
}
.rotator-dot:focus {
  outline: 2px solid rgba(3,18,115,.35);
  outline-offset: 2px;
}

/* --- lightbox overlay --- */
#rotator-lightbox{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  display: none;               /* hidden by default */
  align-items: center; justify-content: center;
  z-index: 10000;
}
#rotator-lightbox.open{ display:flex; }
#rotator-lightbox .lb-media{
  max-width: 95vw; max-height: 95vh;
  object-fit: contain; display:block;
}
#rotator-lightbox .lb-close{
  position: absolute; top: 12px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.95); color:#031273;
  border:0; cursor:pointer; font-size:22px;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 6px rgba(0,0,0,.2);
}


/* ------------------------------------------------- */


/* Make the Footer be always at the bottom*/

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;   /* fallback */
  min-height: 100dvh;  /* fixes mobile browser UI issues */
}

/* The placeholder that receives your fetched footer */
#footer-placeholder {
  margin-top: auto;    /* pushes footer to the bottom on short pages */
}


/* ------------------------------------------------- */