/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
  --header-height: 3.5rem;

  /*========== Colors ==========*/
  --first-color: hsl(220, 68%, 54%);
  --first-color-lighten: hsl(220, 68%, 97%);
  --title-color: hsl(220, 48%, 28%);
  --text-color: hsl(220, 12%, 45%);
  --body-color: hsl(220, 100%, 99%);

  /*========== Font and typography ==========*/
  --body-font: "Poppins", sans-serif;
  --normal-font-size: 0.938rem;
  --small-font-size: 0.813rem;
  --smaller-font-size: 0.75rem;

  /*========== Font weight ==========*/
  --font-medium: 500;
  --font-semi-bold: 600;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

@media screen and (min-width: 1024px) {
  :root {
    --normal-font-size: 1rem;
    --small-font-size: 0.875rem;
    --smaller-font-size: 0.813rem;
  }
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.container {
  max-width: 1120px;
  margin-inline: 1.5rem;
}

/*=============== HEADER ===============*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 2px 8px hsla(220, 68%, 12%, 0.1);
  background-color: var(--body-color);
  z-index: var(--z-fixed);
}

/*=============== NAV ===============*/
.nav {
  height: var(--header-height);
}

.nav__data {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  column-gap: 0.5rem;
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  transition: color 0.3s;
}

.nav__logo img {
  max-height: 40px;
  width: auto;
  display: block;
}

.nav__logo:hover {
  color: var(--first-color);
}

.nav__toggle {
  position: relative;
  width: 32px;
  height: 32px;
  display: block; /* Visible by default (mobile/tablet) */
}

.nav__toggle-menu,
.nav__toggle-close {
  font-size: 1.25rem;
  color: var(--title-color);
  position: absolute;
  display: grid;
  place-items: center;
  inset: 0;
  cursor: pointer;
  transition: opacity 0.1s, transform 0.4s;
}

.nav__toggle-close {
  opacity: 0;
}

/* =======================================================
   MOBILE & TABLET MENU STYLES (< 1118px)
   ======================================================= */
/* IMPORTANT: This block defines the "Hidden" state. 
   It MUST appear before the .show-menu class so .show-menu can override it.
*/
@media screen and (max-width: 1117px) {
  .nav__menu {
    background-color: var(--body-color);
    position: absolute;
    left: 0;
    top: 2.5rem; /* Hidden position */
    width: 100%;
    height: calc(100vh - 3.5rem);
    overflow: auto;
    padding-block: 1.5rem 4rem;
    pointer-events: none; /* Can't click when hidden */
    opacity: 0; /* Invisible */
    transition: top 0.4s, opacity 0.3s;
  }

  .nav__menu::-webkit-scrollbar {
    width: 0.5rem;
  }

  .nav__menu::-webkit-scrollbar-thumb {
    background-color: hsl(220, 12%, 70%);
  }
}

/* =======================================================
   TOGGLE CLASSES (ACTIVE STATE)
   ======================================================= */
/* These classes are added by JavaScript.
   Because they are defined AFTER the media query above,
   opacity: 1 wins over opacity: 0.
*/
.show-menu {
  opacity: 1 !important; /* Force visibility */
  top: 3.5rem !important; /* Slide down to correct position */
  pointer-events: initial !important; /* Enable clicking */
}

.show-icon .nav__toggle-menu {
  opacity: 0;
  transform: rotate(90deg);
}

.show-icon .nav__toggle-close {
  opacity: 1;
  transform: rotate(90deg);
}

/*=============== NAV LINKS ===============*/
.nav__link {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
}

.nav__link:hover {
  background-color: var(--first-color-lighten);
}

/*=============== DROPDOWN (Mobile Logic) ===============*/
.dropdown__button {
  cursor: pointer;
}

.dropdown__arrow {
  font-size: 1.5rem;
  font-weight: initial;
  transition: transform 0.4s;
}

.dropdown__content,
.dropdown__group,
.dropdown__list {
  display: grid;
}

.dropdown__container {
  background-color: var(--first-color-lighten);
  height: 0;
  overflow: hidden;
  transition: height 0.4s;
}

.dropdown__content {
  row-gap: 1.75rem;
}

.dropdown__group {
  padding-left: 2.5rem;
  row-gap: 0.5rem;
}

.dropdown__group:first-child {
  margin-top: 1.25rem;
}

.dropdown__group:last-child {
  margin-bottom: 1.25rem;
}

.dropdown__icon i {
  font-size: 1.25rem;
  color: var(--first-color);
}

.dropdown__title {
  font-size: var(--small-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--title-color);
}

.dropdown__list {
  row-gap: 0.25rem;
}

.dropdown__link {
  font-size: var(--smaller-font-size);
  font-weight: var(--font-medium);
  color: var(--text-color);
  transition: color 0.3s;
}

.dropdown__link:hover {
  color: var(--title-color);
}

/* Rotate dropdown icon */
.show-dropdown .dropdown__arrow {
  transform: rotate(180deg);
}

/* =======================================================
   DESKTOP MODE (Min-width: 1118px)
   ======================================================= */
@media screen and (min-width: 1118px) {
  /* Nav */
  .nav {
    height: calc(var(--header-height) + 2rem);
    display: flex;
    justify-content: space-between;
  }

  .nav__toggle {
    display: none;
  }

  .nav__menu {
    position: static;
    height: auto;
    opacity: 1;
    pointer-events: initial;
    overflow: visible;
    padding: 0;
    background-color: transparent;
  }

  .nav__list {
    display: flex;
    column-gap: 3rem;
    height: 100%;
  }

  .nav li {
    display: flex;
  }

  .nav__link {
    padding: 0;
  }

  .nav__link:hover {
    background-color: initial;
  }

  /* Dropdown Desktop */
  .dropdown__button {
    column-gap: 0.25rem;
    pointer-events: none;
  }

  .dropdown__container {
    height: max-content;
    position: absolute;
    left: 0;
    right: 0;
    top: 6.5rem;
    background-color: var(--body-color);
    box-shadow: 0 6px 8px hsla(220, 68%, 12%, 0.05);
    pointer-events: none;
    opacity: 0;
    transition: top 0.4s, opacity 0.3s;
  }

  .dropdown__content {
    grid-template-columns: repeat(4, max-content);
    column-gap: 6rem;
    max-width: 1120px;
    margin-inline: auto;
  }

  .dropdown__group {
    padding: 4rem 0;
    align-content: baseline;
    row-gap: 1.25rem;
  }

  .dropdown__group:first-child,
  .dropdown__group:last-child {
    margin: 0;
  }

  .dropdown__list {
    row-gap: 0.75rem;
  }

  .dropdown__icon {
    width: 60px;
    height: 60px;
    background-color: var(--first-color-lighten);
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
  }

  .dropdown__icon i {
    font-size: 2rem;
  }

  .dropdown__title {
    font-size: var(--normal-font-size);
  }

  .dropdown__link {
    font-size: var(--small-font-size);
  }

  .dropdown__link:hover {
    color: var(--first-color);
  }

  .dropdown__item {
    cursor: pointer;
  }

  .dropdown__item:hover .dropdown__arrow {
    transform: rotate(180deg);
  }

  .dropdown__item:hover > .dropdown__container {
    top: 5.5rem;
    opacity: 1;
    pointer-events: initial;
    cursor: initial;
  }
  
  .container {
    margin-inline: auto;
  }
}

/* ===================== FOOTER ===================== */
.footer {
  width: 100%;
  background: hsl(220, 100%, 99%);
  padding: 40px 20px;
  border-radius: 12px 12px 0 0;
}

.footer-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: 30px;
  padding: 20px 0;
  justify-items: start;
}

.footer-col h4 {
  color: var(--title-color);
  font-size: 1rem;
  margin-bottom: 15px;
  font-weight: var(--font-semi-bold);
}

.footer-col .links {
  list-style: none;
  padding: 0;
}

.footer-col .links li {
  margin-bottom: 8px;
}

.footer-col .links li a {
  color: var(--text-color);
  font-size: 0.9rem;
}

.footer-col .links li a:hover {
  color: var(--first-color);
}

/* Desktop Footer */
@media screen and (min-width: 1118px) {
  .footer-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
    padding: 40px 60px;
  }

  .footer-col {
    flex: 1;
  }

  .footer-col h4 {
    font-size: 1.1rem;
  }

  .footer-col .links li a {
    font-size: 0.95rem;
  }
}

/* Bottom Strip */
.hrfooter {
  text-align: center;
  padding: 20px 0;
  background: #f9fafb;
}

.hrfooter hr {
  height: 1px;
  border: none;
  background: #dedede;
  width: 80%;
  margin: 10px auto;
}

.hrfooter p {
  font-size: 0.9rem;
  color: #333;
}

.hrfooter a {
  color: #0b3d91;
  text-decoration: none;
}

.hrfooter a:hover {
  text-decoration: underline;
}

/* =============LOADER============= */
.loader {
  width: 60px;
  aspect-ratio: 2;
  --_g: no-repeat radial-gradient(circle closest-side,#000 90%,#0000);
  background: 
    var(--_g) 0%   50%,
    var(--_g) 50%  50%,
    var(--_g) 100% 50%;
  background-size: calc(100%/3) 50%;
  animation: l3 1s infinite linear;
}
@keyframes l3 {
    20%{background-position:0%   0%, 50%  50%,100%  50%}
    40%{background-position:0% 100%, 50%   0%,100%  50%}
    60%{background-position:0%  50%, 50% 100%,100%   0%}
    80%{background-position:0%  50%, 50%  50%,100% 100%}
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}