/**
 * @file
 * Layout styles for Forttech Theme.
 */

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Projects grid: cap width; center with margin (avoid 100vw + translate centering — both cause horizontal scroll) */
.container .projects-view__content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 3rem;
  position: relative;
  left: auto;
  transform: none;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container .projects-view__content {
    max-width: none;
    width: 100%;
    margin: 0 auto 2.5rem;
  }
}

@media (max-width: 480px) {
  .container .projects-view__content {
    margin-bottom: 2rem;
  }
}

/* Header */
.header {
  background-color: rgb(13,38,38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1000;
}

/* Header with banner behind (on node pages) */
body.node-type-page .header {
  background-color: rgb(13,38,38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Fixed header on scroll */
.header.is-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 0;
  background-color: rgb(13,38,38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Add padding to body when header is fixed to prevent content jump */
body.header-fixed {
  padding-top: 0;
}

body.header-fixed .header.is-fixed ~ * {
  margin-top: 0;
}

.header-wrapper {
  width: 100%;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  /* Never wrap — logo + menu stay on one row on all screen sizes */
  flex-wrap: nowrap;
}

.header-logo {
  flex-shrink: 0;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.logo-link:hover {
  opacity: 0.8;
}

.logo-image {
  height: 50px;
  width: auto;
  display: block;
}

.header-content {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  /* Shared with expanding search: menu margin clears the overlay without moving search down */
  --search-open-width: min(300px, calc(100vw - 2rem));
  --search-toggle-slot: 40px;
}

@media (max-width: 768px) {
  .header-content {
    --search-open-width: min(280px, calc(100vw - 1.5rem));
    --search-toggle-slot: 36px;
  }
}

@media (max-width: 480px) {
  .header-content {
    --search-open-width: min(260px, calc(100vw - 1rem));
  }
}

/* When search is open, reserve space to the right of the menu so the field does not cover links */
.header-content:has(.search-form-inline[aria-hidden="false"]) .main-menu-navbar {
  margin-inline-end: max(0px, calc(var(--search-open-width) - var(--search-toggle-slot)));
}

/* Let the main menu shrink when the search reserves width (no overlay). */
.header-content .main-menu-navbar {
  flex: 1 1 auto;
  min-width: 0;
  transition: margin-inline-end 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.header-content .site-branding {
  min-width: 0;
}

/* Navigation */
.navigation {
  background-color: rgb(255, 255, 255);
  margin-top: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  z-index: 999;
}
body.path-services .navigation,  
body.node-type-article .navigation,
body.node-type-portfolio .navigation {
  background-color: transparent;
  position: absolute;
  z-index: 999;
  width: 100%;
  backdrop-filter: none;
  .forttech-breadcrumb-wrapper {
    background-color: transparent;
    .forttech-breadcrumb-box {
      background-color: transparent;
    }
  }
}

/* Navigation with banner behind (on node pages) */
body.node-type-page .navigation {
  background-color: rgb(13, 38, 38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Elements inside navigation - set to white */
.navigation * {
  color: #ffffff;
}

/* Breadcrumb block: white box + dark text (must beat .navigation * above) */
.navigation .forttech-breadcrumb-box,
.navigation .forttech-breadcrumb-box * {
  color: #3a3a3a;
}

.navigation .forttech-breadcrumb-box a {
  color: #3a3a3a;
}

.navigation a {
  color: #ffffff;
}

.navigation .main-menu-navbar .navbar-nav-wrapper ul li a,
.navigation .main-menu-navbar .navbar-nav .nav-link {
  color: #ffffff;
}

.navigation .main-menu-navbar .navbar-nav-wrapper ul li a::after,
.navigation .main-menu-navbar .navbar-nav .nav-link::after {
  background-color: #ffffff;
}

.navigation .main-menu-navbar .navbar-nav-wrapper ul li a.is-active::after,
.navigation .main-menu-navbar .navbar-nav-wrapper ul li a.active::after,
.navigation .main-menu-navbar .navbar-nav .nav-link.is-active::after,
.navigation .main-menu-navbar .navbar-nav .nav-link.active::after {
  background-color: #ffffff;
}

.navigation .main-menu-navbar .navbar-toggler-icon-line {
  background-color: #ffffff;
}

.navigation .main-menu-navbar .navbar-nav-wrapper ul li a:hover,
.navigation .main-menu-navbar .navbar-nav-wrapper ul li a:focus,
.navigation .main-menu-navbar .navbar-nav .nav-link:hover,
.navigation .main-menu-navbar .navbar-nav .nav-link:focus {
  color: #ffffff;
}

.navigation .main-menu-navbar .navbar-nav-wrapper ul li a.is-active,
.navigation .main-menu-navbar .navbar-nav-wrapper ul li a.active,
.navigation .main-menu-navbar .navbar-nav .nav-link.is-active,
.navigation .main-menu-navbar .navbar-nav .nav-link.active {
  color: #ffffff;
}

.navigation .main-menu-navbar .navbar-nav-wrapper ul li a:focus-visible,
.navigation .main-menu-navbar .navbar-nav .nav-link:focus-visible {
  outline-color: #ffffff;
}

/* Sidebar */
.sidebar {
  padding: 2rem 1rem;
}

/* Footer */
.footer {
  background-color: #333;
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 3rem;
}

.footer__content {
  width: 100%;
}

.footer__columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer__column {
  display: flex;
  flex-direction: column;
}

.footer__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1.5rem 0;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer__text {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 1rem 0;
  text-align: justify;
}

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__links li {
  margin: 0 0 0.75rem 0;
}

.footer__links a {
  font-family: 'Inter', sans-serif;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
  display: inline-block;
}

.footer__links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer__social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer__social-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.footer__social-link svg {
  width: 20px;
  height: 20px;
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.footer__contact-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.footer__contact-text {
  font-family: 'Inter', sans-serif;
  flex: 1;
  line-height: 1.6;
}

.footer__contact-link {
  font-family: 'Inter', sans-serif;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer__contact-link:hover {
  color: #fff;
  text-decoration: underline;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive Footer */
@media (max-width: 992px) {
  .footer__columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .footer__column:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .footer {
    padding: 2rem 0 1.5rem;
  }
  
  .footer__columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer__column:last-child {
    grid-column: 1;
  }
  
  .footer__title {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .footer__social {
    justify-content: flex-start;
  }
}

/* Grid system */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -1rem;
}

.col {
  flex: 1;
  padding: 0 1rem;
}

.col-1 { flex: 0 0 8.333%; }
.col-2 { flex: 0 0 16.666%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333%; }
.col-6 { flex: 0 0 50%; }
.col-8 { flex: 0 0 66.666%; }
.col-9 { flex: 0 0 75%; }
.col-12 { flex: 0 0 100%; }

/* Responsive */
@media (max-width: 768px) {
  .col {
    flex: 0 0 100%;
  }

  .hero h1 {
    font-size: 2rem;
  }

  /* Keep header as a single flex row on mobile */
  .header-container {
    flex-wrap: nowrap;
    padding: 0 0.75rem;
  }

  .header-content {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
  }

  .logo-image {
    height: 36px;
  }
}

