@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Montserrat Variable"), url("../fonts/Montserrat/Montserrat-VariableFont_wght.woff2") format("woff2-variations"),
    url("../fonts/Montserrat/static/Montserrat-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 100 900; /* The full range of weights supported by the file */
  font-display: swap;
  src: local("Poppins Variable"), url("../fonts/Poppins/Poppins-VariableFont_wght.woff2") format("woff2-variations"),
    url("../fonts/Poppins/Poppins-Regular.woff2") format("woff2"); /* Fallback */
}

/* This single rule handles all weights for the italic style */
@font-face {
  font-family: "Poppins";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: local("Poppins Italic Variable"),
    url("../fonts/Poppins/Poppins-Italic-VariableFont_wght.woff2") format("woff2-variations"),
    url("../fonts/Poppins/Poppins-Italic.woff2") format("woff2"); /* Fallback */
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("DM Sans Variable"), url("../fonts/DM_Sans/DMSans-VariableFont_opsz,wght.woff2") format("woff2-variations"),
    url("../fonts/DM_Sans/static/DMSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Work Sans Variable"), url("../fonts/Work_Sans/WorkSans-VariableFont_wght.woff2") format("woff2-variations"),
    url("../fonts/Work_Sans/static/WorkSans-Regular.woff2") format("woff2");
}

/*------------------------- Global Styles & Variables ---------------------------- */
:root {
  font-size: 62.5%;
  --impact-color: rgb(255, 120, 0);
  --link-color: rgb(8, 95, 179);
  --imp-color: rgb(7, 121, 231);
  --btn-color: rgb(78, 94, 107);
  --subtle-white: rgb(247, 250, 252);
  --subtle-bluewhite: rgb(226, 232, 240);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.orange {
  color: var(--impact-color);
}

.red {
  color: crimson;
}

.green {
  color: rgb(0 128 0);
}

.hidden {
  display: none;
}

.small {
  font-size: 1.2rem;

  &.design {
    margin-right: 3px;
  }
}

em {
  font-weight: 500;
}

.btn {
  font-family: "DM Sans", sans-serif;
  background-color: var(--btn-color);
  color: white;
  text-align: center;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 7px;
  font-size: 1.7rem;
  border: none;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.btn:hover {
  background-color: rgb(235 235 235);
  color: black;
}

.btn:disabled {
  background-color: rgb(200 200 200);
  color: rgb(150 150 150);
  cursor: not-allowed;
}

.imp {
  font-family: "DM Sans", sans-serif;
  background-color: var(--imp-color);
  color: rgb(255 255 255);
  padding: 5px 10px;
  width: fit-content;
  font-size: 1.6rem;
  border-radius: 5px;
  font-weight: 500;
  z-index: 7;
}

/*------------------------- Header (Shared with index.css) ---------------------------- */
header.homepage {
  padding: 30px 20px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  line-height: normal;
  border-bottom: 1px solid var(--subtle-bluewhite);
  column-gap: 1rem;
  box-shadow: 3px 0 9px rgb(0 0 0 / 31%);
}

header a:hover {
  text-decoration: none;
}

.site-title {
  display: grid;
  align-items: center;
  gap: 6px 16px;
}

#website-title {
  grid-area: 1/2/1/3;
  font-family: "Montserrat", sans-serif;
  color: rgb(126 126 126);
  font-size: clamp(2.7rem, 1rem + 4vw, 3.1rem);
  line-height: 1.4;
  font-weight: 700;
}

.site-title .logo {
  width: 54px;
  height: auto;
  grid-area: 1 / 1 / 3 / 2;
}

.logo img {
  vertical-align: middle;
}

.tagline {
  font-family: "Poppins", sans-serif;
  font-size: 1.5rem;
  line-height: 1.6;
  color: rgb(36 36 36);
  font-style: italic;
  font-weight: 400;
}

header > nav {
  margin-left: auto;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.menu button {
  background-color: white;
  border: none;
  cursor: pointer;
  padding: 10px;
  align-items: center;
}

/*------------------------- Subscription ------------------- */

.subscription {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 40px;
  gap: 30px;
  margin: 0 auto;
  align-items: center;
  width: min(100%, 1040px);

  #subscription-form {
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: min(90%, 650px);
    row-gap: 25px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    border-radius: 7px;
    align-items: center;
    background-color: white;
    color: black;

    label {
      text-align: center;
      font-family: "DM Sans";
      font-size: 1.6rem;
      line-height: 1.6;
    }

    span.icon svg {
      fill: var(--impact-color);
      transform: rotateZ(-45deg);
      margin-left: 2px;
    }

    #email {
      border: none;
      border-bottom: 1px solid rgb(195 195 195);
      width: 100%;
      font-size: 1.6rem;
      font-family: "DM Sans", sans-serif;
    }

    #email:focus,
    #email:focus-visible {
      outline: none;
    }

    #subscription-form-button {
      width: 100%;
      background-color: var(--impact-color);
    }
  }
}

/*------------------------- Footer ---------------------------- */

#site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background-color: rgb(61 61 61);
  color: rgb(235 235 235);
  margin-top: 3rem;
  font-size: 1.5rem;
  line-height: 1.7;
  font-family: "Poppins", sans-serif;

  & > * {
    padding: 27px 20px 0;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style-type: none;
    justify-content: center;

    li {
      font-family: "DM Sans", sans-serif;
      text-decoration: none;
    }

    a:hover,
    a:focus {
      text-decoration: underline;
    }
  }

  .footer-title,
  .profile {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 10px 15px;

    .logo,
    .profile-picture {
      grid-area: 1 / 1 / 3 / 2;
      align-self: center;
    }

    .profile-picture img {
      display: block;
      border-radius: 50%;
      object-fit: cover;
      object-position: top;
      border: 5px solid var(--btn-color);
    }

    h3 {
      grid-area: 1 / 2 / 2 / 3;
      font-family: "Montserrat", sans-serif;
      align-self: self-end;
      font-size: 2.1rem;
    }

    .footer-description {
      grid-area: 2/2/3/3;
    }
  }

  .copyright {
    font-family: "DM Sans", sans-serif;
    text-align: center;
    margin-bottom: 12px;
  }
}

/* ---------------------------------- Cookie Preferences ------------------------------- */
.js.cookie-banner {
  opacity: 0;
  transform: translateY(100%);
  visibility: hidden;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  font-size: 1.4rem;
  background-color: var(--subtle-white);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  z-index: 16;
  margin: 0 auto;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition: transform 1s ease-out, opacity 1s ease-out;

  .cookie-banner-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;

    .cookie-buttons {
      display: flex;
      gap: 2.1rem;
      margin-top: 0.3rem;

      .btn {
        font-size: 1.4rem;
      }

      #decline-cookies,
      #learn-more-btn {
        background-color: inherit;
        color: inherit;
        outline: 1px solid black;
        outline-offset: -5px;
        box-shadow: none;
      }

      #learn-more-btn {
        margin-left: auto;
      }
    }
  }
}

@media only screen and (min-width: 800px) {
  #site-footer {
    display: grid;
    grid-template-columns: 120px 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding: 10px 5px;

    .footer-links {
      grid-area: 1/1/3/2;
      justify-content: start;
      align-self: baseline;
    }

    .copyright {
      grid-column: 1 / -1;
    }
  }
}

@media only screen and (min-width: 1300px) {
  #site-footer {
    grid-template-columns: 120px auto 1fr;
    grid-template-rows: auto auto;

    .footer-links {
      grid-area: 1/1/2/2;
    }

    .copyright {
      grid-column: 2 / 3;
    }
  }
}
