/* ------------- MECA - DTU 12-2025 ------------- */

:root {
  --meca-dark-green: #0D5E30;
  --meca-logo-green: #52B944;
  --meca-light-green: #8DB93D;
  --logo-height: 4rem;
  --navbar-height: calc(var(--logo-height) + 1rem);
}

/* ------------- Global Layout ------------- */

html,
body {
  height: 100%;
}

html {
  font-size: 105%;
  scroll-behavior: smooth;
}

body {
  font-family: "pt-sans", Arial, Helvetica, sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding-top: var(--navbar-height);
}

header {
  background-color: var(--bs-white);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  z-index: 1;
}

section[id] {
  scroll-margin-top: calc(var(--navbar-height) + 1rem);
}

#logo {
  max-height: var(--logo-height);
  max-width: 100%;
  height: auto;
}

#maincontent {
  flex: 1 auto;
}

footer {
  width: 100%;
  flex-shrink: 0;
}

/* ------------- Typography ------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--bs-gray-700);
}

/* ------------- Utilities ------------- */

.meca-bg-dark-green {
  background-color: var(--meca-dark-green) !important;
}

.meca-bg-logo-green {
  background-color: var(--meca-logo-green) !important;
}

.meca-bg-light-green {
  background-color: var(--meca-light-green) !important;
}

/* ------------- Cards ------------- */

.hover-card:hover {
  background-color: var(--bs-white) !important;
}

.hover-card:hover .card-title {
  color: var(--bs-gray-800);
}

.hover-card:has(a:focus-visible) {
  outline: 4px solid var(--bs-gray-800);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .hover-card,
  .hover-card img {
    transition: all 0.3s ease;
  }

  .hover-card:hover img {
    transform: scale(1.05);
  }
}

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

.btn-meca {
  background-color: var(--meca-dark-green);
  border-color: var(--meca-dark-green);
  color: var(--bs-white);
}

.btn-meca:hover,
.btn-meca:focus,
.btn-meca:active {
  background-color: var(--meca-light-green);
  border-color: var(--meca-light-green);
  color: var(--bs-gray-800);
}

.btn-meca-secondary {
  background-color: var(--bs-white);
  border-color: var(--meca-dark-green);
  color: var(--meca-dark-green);
}

.btn-meca-secondary:hover,
.btn-meca-secondary:focus,
.btn-meca-secondary:active {
  background-color: var(--meca-light-green);
  border-color: var(--meca-dark-green);
  color: var(--meca-dark-green);
}

.btn-link,
.btn-link:hover {
  color: #333;
  white-space: normal;
}

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

.navbar a.nav-link {
  font-size: large;
  color: var(--bs-gray-800);
  font-weight: 500;
}

@media (max-width: 991.98px) {
  .navbar .navbar-brand {
    flex-basis: 50%;
  }
}

@media (min-width: 992px) {
  .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
  }
}

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

section {
  padding-bottom: 2rem;
}

@media (max-width: 991.98px) {
  #sideNav {
    display: none;
  }
}

@media (min-width: 992px) {
  section {
    padding-top: 5rem !important;
    margin-top: -5rem !important;
  }

  #sideNav li a {
    border-left: 1rem solid transparent;
    border-radius: 0;
    padding: 1rem;
    margin-bottom: 2px;
    color: var(--bs-navbar-color);
  }

  #sideNav li a:hover {
    background-color: var(--bs-gray-100);
  }

  #sideNav li a.active {
    background-color: var(--bs-gray-100);
    border-left: 1rem solid var(--meca-logo-green);
    color: var(--bs-navbar-hover-color);
  }
}

/* ------------- Animations ------------- */

@media (prefers-reduced-motion: no-preference) {
  @keyframes fade-up {
    from {
      transform: translateY(5%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes slideIn {
    from {
      transform: translateY(-1rem);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @media (min-width: 768px) {
    .animate {
      animation: 0.3s both;
    }

    .slideIn {
      animation-name: slideIn;
    }
  }
}

/* ------------- Home Page ------------- */

.home-hero {
  width: 100%;
  min-height: calc(100vh - 80px);
  background: center / cover no-repeat;
}

.home-hero-overlay {
  min-height: calc(100vh - 80px);
  background: rgba(0, 0, 0, 0.5);
}

.utility-pages-section .card-image {
  height: 120px;
  object-fit: contain;
  padding: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .fade-up {
    animation: 1s fade-up;
  }

  .homepage img,
  .homepage .img {
    animation: linear fade-in forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

/* ------------------------ ACCORDIONS ----------------------- */

.accordion-button {
    font-size: 1.0em;
}

.accordion-button.collapsed,
.accordion-button:not(.collapsed) {
    color: var(--bs-navbar-color);
    background-color: var(--bs-gray-100);
}

.accordion-header .accordion-button::after {
    display: none;
}

.accordion-header .accordion-button::before {
    font-family: "Font Awesome 7 Pro";
    font-size: 1rem;
    width: 2rem;
    text-align: center;
}

.accordion-header .accordion-button:not(.collapsed)::before {
    content: "\f068";
}

.accordion-header .accordion-button.collapsed::before {
    content: "\f067 ";
}


/* ------------------------ DOWNLOADS ----------------------- */

.meca-file-download {
  border-radius: calc(0.375rem - 1px);
}

.meca-file-download .meca-file {
  background-color: var(--bs-gray-100);
}

.meca-file-download .meca-file:hover,
.meca-file-download .meca-file a:focus {
  background-color: var(--bs-gray-200);
}

.meca-file-download .meca-file:first-child {
  border-top-left-radius: calc(0.375rem - 1px);
  border-top-right-radius: calc(0.375rem - 1px);
}

.meca-file-download .meca-file:last-child {
  border-bottom-left-radius: calc(0.375rem - 1px);
  border-bottom-right-radius: calc(0.375rem - 1px);
}

.meca-file-download .meca-file:not(:first-child) {
  border-top: 1px solid var(--bs-border-color);
}

.meca-file-download .meca-file .btn {
  color: var(--bs-navbar-color);
  text-decoration: none;
  padding: 1rem 1.25rem;
  width: 100%;
  text-align: left;
}

.meca-file-download .meca-file .btn::before {
  display: inline-block;
  font-family: "Font Awesome 7 Pro";
  font-size: 1.8rem;
  color: var(--meca-dark-green);
  text-align: center;
  padding-right: 1rem;
}

.meca-file-download .meca-file .btn.pdf::before {
  content: "\f1c1";
}

.meca-file-download .meca-file .btn.word::before {
  content: "\f1c2";
}

.meca-file-download .meca-file .btn.excel::before {
  content: "\f1c3";
}

.meca-file-download .meca-file .btn.download::before {
  content: "\f15b";
}

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

.footer {
  z-index: 1;
  background-color: var(--bs-gray-200);
  font-size: smaller;
}

.footer a {
  font-weight: 500;
  color: var(--bs-gray-800);
  text-decoration: none;
}

.footer .footer-links a:not(:last-child)::after {
  content: "|";
  padding: 0 0.5rem;
}