/* Variables for repeated values */
:root {
  --header-logo-color: #f9faf8; /* Defines the logo color based on design guidelines */
  --header-hover-color: #f9faf8cc; /* Defines color when hovering over navbar's items */
  --hero-h1-font-size: 3rem; /* Defines the heading font size (48px) based on design guidelines */
  --hero-p-color: #e5e7eb; /* Sets the paragraph text color based on design guidelines */
  --hero-p-font-size: 1.125rem; /* Sets the paragraph font size (18px) based on design guidelines */
  --featprod-title-color: #1f2937; /*Feature products section title color based on design guidelines*/
  --featprod-title-font-size: 2.25rem; /*Feature products section title size (36px) based on design guidelines*/
  --button-color: #3882f6; /* Accent color used for buttons and backgrounds based on design guidelines */
  --button-hover-color: #2b6cb0; /* Accent color used when hovering over button */
}

/* Global styles */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* smooth scroll for anchor links */
}

body {
  font-family: "Roboto", sans-serif;
  margin: 0 auto;
}

/* === Styles for smallest screens (Mobile-First Defaults) === */

/* Header here*/

.navbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background-color: var(--featprod-title-color);
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
}

.nav-links {
  display: flex;
  list-style-type: none;
  margin-right: 0;
  padding: 0;
  justify-content: flex-end;
  gap: 1rem;
}

.nav-links a {
  color: var(--hero-p-color);
  text-decoration: none;
  font-size: var(--hero-p-font-size);
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--header-logo-color);
  margin-left: 0;
  padding: 0;
}

.navbar a:hover {
  color: var(--header-hover-color);
}

.logo a {
  color: inherit;
  text-decoration: none;
}

/* Hero here*/

.hero {
  background-color: var(--featprod-title-color); /* From guidelines */
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  padding: 4rem 1rem;
  overflow: hidden;
}

.hero div.title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  word-break: break-word;
  width: 100%;
  max-width: 600px;
  padding: 0 1rem;
}

.hero h1 {
  color: var(--header-logo-color); /* From guidelines */
  font-size: 2rem; /* Smaller font for mobile (approx 32px) */
  margin: 0;
  line-height: 1.2;
  font-weight: 800; /* Extra bold (from guidelines) */
}

.hero p {
  color: var(--hero-p-color); /* From guidelines */
  font-size: 1rem; /* Default font for mobile (approx 16px) */
  width: 100%;
  line-height: 1.5;
}

.hero button {
  display: inline-block;
  background-color: var(--button-color); /* From guidelines */
  color: var(
    --hero-p-color
  ); /* The same text color as the paragraph has been used for consistency */
  font-weight: 600; /* A font weight for the button wasn't provided in the guidelines but it looked somewhat bold in the design file */
  padding: 0.5rem 0.75rem;
  min-width: 120px;
  width: fit-content;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  font-size: 1rem; /* Same font size as the hero paragraph */
  transition: background-color 0.3s ease;
}

.hero button:hover,
.hero button:focus {
  background-color: var(--button-hover-color);
}

.hero img {
  width: 100%;
  max-width: 600px;
  min-width: 100px;
  border-radius: 0.5rem;
  object-fit: cover;
  height: auto;
}

/* FEATURED PRODUCTS*/

.featured-products {
  text-align: center;
  margin-top: 3.125rem;
  margin-bottom: 3.75rem;
}

.featured-products-title {
  font-size: var(--featprod-title-font-size);
  font-weight: 900;
  color: var(--featprod-title-color);
}

.cards {
  display: flex;
  gap: 1rem;
  justify-content: center;

  margin-top: 3.125rem;
  margin-bottom: 1.875rem;
}

.cards-one,
.cards-two,
.cards-three,
.cards-four {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 1.875rem;
  margin-inline: 0;

  border: solid 2px var(--button-color);
  border-radius: 0.5rem;
  height: 9.375rem;
  width: 9.375rem;
}

.cards-one a,
.cards-two a,
.cards-three a,
.cards-four a {
  width: 9.375rem;
}

.cards-bg {
  object-fit: cover;
  transition: filter 0.4s ease;
  height: 9.375rem;
  width: 9.375rem;
}

.cards-subtext {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--hero-p-color);
  font-size: 1.3rem;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 2;
}

.cards-one:active .cards-bg,
.cards-two:active .cards-bg,
.cards-three:active .cards-bg,
.cards-four:active .cards-bg {
  filter: blur(4px);
  background-color: var(--button-color);
  opacity: 0.5;
  cursor: pointer;
}

.cards-one:active .cards-subtext,
.cards-two:active .cards-subtext,
.cards-three:active .cards-subtext,
.cards-four:active .cards-subtext {
  opacity: 1;
}

/* TESTIMONIAL */

.testimonial-quote {
  width: 100%;
  margin: 2.5rem auto; /* 40px */
  padding: 2.75rem 2rem 2rem 2rem; /* 44px 32px 32px 32px */
  background: var(--hero-p-color);
  box-sizing: border-box;
}

.testimonial-text {
  font-size: 2.25rem; /* 36px */
  font-style: italic;
  font-weight: 300;
  color: var(--featprod-title-color);
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-align: center;
  margin-bottom: 2.25rem; /* 36px */
}

.testimonial-author {
  color: var(--featprod-title-color);
  font-size: 1.375rem; /* 22px */
  font-weight: 700;
  text-align: right;
  width: 100%;
}

/* CALL TO ACTION */

.cta-container {
  display: flex;
  flex-direction: column;
  background-color: var(--button-color);
  padding: 0.625rem;
}

.cta-info h2 {
  margin-top: 0.625rem;
  margin-bottom: 0.5rem;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
}

.cta-info p {
  text-align: center;
  color: var(--hero-p-color);
  font-size: 0.9rem;
}

.cta-signup-btn {
  padding: 0.625rem 2.25rem;
  border: 0.125rem solid #fff;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.375rem;
  border-color: #fff;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  text-decoration: none;
  text-align: center;
}

.cta-signup-btn:hover {
  background: var(--header-logo-color);
  color: var(--button-color);
}

/* FOOTER */

footer {
  background-color: var(--featprod-title-color);
  color: var(--hero-p-color);
  padding: 1rem;
  text-align: center;
}

footer a {
  color: var(--hero-p-color);
  text-decoration: none;
}

.top-button {
  display: inline-block;
  background-color: var(--button-color);
  color: var(--hero-p-color);
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  min-width: 120px;
  width: fit-content;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  margin-top: 1rem;
}

.top-button:hover,
.top-button:focus {
  background-color: var(--button-hover-color);
}
.icons {
  margin-top: 2rem;
}
.icons img {
  width: 3rem;
  height: 3rem;
  color: var(--featprod-title-color);
  object-fit: cover;
  display: inline-block;
  margin-left: 1rem;
  margin-right: 1rem;
}

/* ===== MEDIA QUERIES ===== */

/* Tablet-specific styles (screens from 601px up to 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
  /* HEADER */

  .navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    color: var(--featprod-title-color);
  }

  .logo {
    margin-left: 10%;
    margin-bottom: 0;
  }

  .nav-links {
    flex-direction: row;
    gap: 2rem;
    margin-right: 10%;
  }

  /* HERO SECTION */

  .hero h1 {
    font-size: var(--hero-h1-font-size); /* From guidelines */
  }

  .hero p {
    font-size: var(--hero-p-font-size); /* From guidelines */
  }

  .hero button {
    font-size: var(
      --hero-p-font-size
    ); /* Sets button font size to 18px, matching the paragraph font size */
  }

  /* FEATURED PRODUCTS SECTION */

  .cards {
    gap: 2rem;
  }

  .cards-bg {
    height: 12.5rem;
    width: 12.5rem;
  }

  .cards-one,
  .cards-two,
  .cards-three,
  .cards-four {
    height: 12.5rem;
    width: 12.5rem;
  }

  .cards-one a,
  .cards-two a,
  .cards-three a,
  .cards-four a {
    width: 12.5rem;
  }

  .cards-subtext {
    font-size: 1.7rem;
  }

  /* TESTIMONIAL SECTION */

  .testimonial-quote {
    margin-block: 5rem;
    padding: 3.75rem;
    background: var(--hero-p-color);
    box-sizing: border-box;
  }

  /* CALL TO ACTION SECTION */

  .cta {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cta-container {
    flex-direction: row;
    border-radius: 0.5rem;
    width: 80%;

    padding: 1.563rem;

    margin-bottom: 3.125rem;
  }

  .cta-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-inline: 0.625rem;

    margin-right: 0.625rem;
  }

  .cta-signup-btn {
    align-self: center;
    font-size: 0.92rem;
    padding-inline: 2rem;
    padding-block: 0.875rem;
  }

  .cta-info h2 {
    margin-bottom: 0.125rem;
  }

  .cta-info p {
    text-align: left;
    font-size: 0.9rem;
    margin-top: 0;
  }
}

/* Desktop-specific styles (screens 1025px and wider) */
@media (min-width: 1025px) {
  /* HEADER */

  .navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0;
  }

  .logo {
    margin-left: 7%;
    margin-bottom: 0;
  }

  .nav-links {
    flex-direction: row;
    gap: 2rem;
    margin-right: 7%;
  }

  /* HERO SECTION */

  .hero {
    flex-direction: row;
    padding: 6rem 4rem;
    gap: 4rem;
  }

  .hero div.title-container {
    text-align: left;
    align-items: flex-start;
    word-break: normal;
  }

  .hero h1 {
    font-size: var(
      --hero-h1-font-size
    ); /* Confirms 48px heading font size for desktop, inheriting from variable */
  }

  .hero p {
    font-size: var(
      --hero-p-font-size
    ); /* Confirms 18px paragraph font size for desktop, inheriting from variable */
  }

  .hero button {
    font-size: var(
      --hero-p-font-size
    ); /* Confirms 18px button font size for desktop, matching paragraph */
  }

  /* FEATURED PRODUCTS SECTION */

  .cards {
    gap: 2rem;
  }

  .cards-column-one,
  .cards-column-two {
    display: flex;
    flex-direction: row;
    gap: 2rem;
  }

  .cards-bg {
    height: 12.5rem;
    width: 12.5rem;
  }

  .cards-one,
  .cards-two,
  .cards-three,
  .cards-four {
    height: 12.5rem;
    width: 12.5rem;
  }

  .cards-one a,
  .cards-two a,
  .cards-three a,
  .cards-four a {
    width: 12.5rem;
  }

  .cards-subtext {
    font-size: 1.75rem;
  }

  .cards-one:hover .cards-bg,
  .cards-two:hover .cards-bg,
  .cards-three:hover .cards-bg,
  .cards-four:hover .cards-bg {
    filter: blur(4px);
    background-color: var(--button-color);
    opacity: 0.5;
    cursor: pointer;
  }

  .cards-one:hover .cards-subtext,
  .cards-two:hover .cards-subtext,
  .cards-three:hover .cards-subtext,
  .cards-four:hover .cards-subtext {
    opacity: 1;
  }

  /* TESTIMONIAL SECTION */

  .testimonial-quote {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    height: 25rem;
    margin-block: 7.5rem;
    padding-inline: 12.5rem;
    padding-block: 3.125rem;
  }

  /* CALL TO ACTION SECTION*/

  .cta {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3.75rem;
  }

  .cta-container {
    flex-direction: row;
    justify-content: center;
    border-radius: 0.5rem;
    width: 80%;

    padding: 1.563rem;

    margin-bottom: 3.125rem;
  }

  .cta-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-inline: 0.625rem;

    margin-right: 0.625rem;
  }

  .cta-signup-btn {
    align-self: center;
    font-size: 0.92rem;
    padding-block: 0.875rem;
    margin-left: 3.125rem;
  }

  .cta-info h2 {
    font-size: 1.375rem;
    margin-bottom: 0.125rem;
  }

  .cta-info p {
    text-align: left;
    font-size: 0.9rem;
    margin-top: 0;
  }
}
