@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  width: 100vw;
  background-color: hsl(36, 100%, 99%); /* Off-white */
  font-size: 15px;
  color: hsl(236, 13%, 42%); /* Dark grayish blue - default text */
}

/* Accessibility Styles */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: hsl(240, 100%, 5%);
  color: hsl(36, 100%, 99%);
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for better accessibility */
a:focus,
button:focus {
  outline: 2px solid hsl(5, 85%, 63%);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .questionbox {
    border: 2px solid hsl(233, 8%, 79%);
  }

  .card {
    border: 1px solid hsl(236, 13%, 42%);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Mobile Layout */
header {
  width: 100%;
  padding: 1.5rem;
}

.navbar {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.main-container {
  width: 100%;
  min-width: 375px;
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
}

/* Mobile Hero Section */
.hero-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 3rem;
  width: 100%;
  align-items: flex-start;
}

.img-container {
  margin-bottom: 1.5rem;
  width: 100%;
}

.img-container img {
  width: 100%;
  height: auto;
  display: block;
}

.main-title h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: hsl(240, 100%, 5%);
  line-height: 1.3;
  margin: 0;
  padding: 0;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  align-items: flex-start;
}
.img-container img {
  width: 100%;
}
.img-container {
  margin-bottom: 1rem;
}

.main-title {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 0;
}

.hero-content {
  display: flex;
  flex-direction: column;
}
.hero-content button {
  width: fit-content;
  min-width: 180px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 1rem 2rem;
  outline: none;
  border: none;
  letter-spacing: 3px;
  background-color: hsl(5, 85%, 63%); /* Soft red */
  color: hsl(240, 100%, 5%); /* Off-white */
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-radius: 0;
  align-self: flex-start;
}
.questionbox {
  padding: 1.5rem;
  margin-bottom: 3rem;
  background-color: hsl(240, 100%, 5%); /* Very dark blue */
}
.questionbox h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: hsl(35, 77%, 62%); /* Soft orange */
}
.questionbox h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.questionbox h3 a {
  color: hsl(36, 100%, 99%); /* Off-white */
  text-decoration: none;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.questionbox h3 a:hover,
.questionbox h3 a:focus {
  color: hsl(35, 77%, 62%); /* Soft orange */
}
.questionbox p {
  font-size: 15px;
  font-weight: 400;
  color: hsl(233, 8%, 79%); /* Grayish blue */
  line-height: 1.6;
  margin-bottom: 2rem;
}
.border {
  margin-bottom: 1.5rem;
  width: 100%;
  border: 0.025rem solid hsl(233, 8%, 79%); /* Grayish blue */
}
.questionbox:last-child p {
  margin-bottom: 0rem;
}

.collection-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.card {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.card img {
  height: 8.5rem;
  width: 6rem;
  object-fit: cover;
}

.card-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.card-number {
  font-size: 2rem;
  font-weight: 800;
  color: hsl(5, 85%, 63%); /* Soft red */
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card h3 a {
  color: hsl(240, 100%, 5%); /* Very dark blue */
  text-decoration: none;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.card h3 a:hover,
.card h3 a:focus {
  color: hsl(5, 85%, 63%); /* Soft red */
}

.card p {
  font-size: 15px;
  font-weight: 400;
  color: hsl(236, 13%, 42%); /* Dark grayish blue */
  line-height: 1.6;
}

/* Hover states */
.hero-content button:hover,
.main-title button:hover {
  background-color: hsl(240, 100%, 5%); /* Very dark blue */
  color: hsl(36, 100%, 99%); /* Off-white */
}

.questionbox h3:hover {
  color: hsl(35, 77%, 62%); /* Soft orange */
}

.card h4:hover {
  color: hsl(5, 85%, 63%); /* Soft red */
}

/* Typography */

.hero-content p {
  font-size: 15px;
  font-weight: 400;
  color: hsl(236, 13%, 42%); /* Dark grayish blue */
  line-height: 1.6;
  margin: 0;
  text-align: left;
  width: 100%;
}

/* Mobile Menu Styling */
.menu-toggle {
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
}

.menu-toggle:focus {
  outline: 2px solid hsl(5, 85%, 63%);
  outline-offset: 2px;
}

.popup {
  position: fixed;
  top: 0;
  right: 0;
  width: 70%;
  height: 100vh;
  background-color: hsl(36, 100%, 99%);
  z-index: 1000;
  padding: 6rem 2rem 2rem;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.popup.show {
  transform: translateX(0);
}

.popup ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.popup a {
  display: block;
  margin-bottom: 2rem;
  font-size: 1.2rem;
  font-weight: 400;
  color: hsl(240, 100%, 5%); /* Very dark blue */
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.popup a:hover,
.popup a:focus {
  color: hsl(5, 85%, 63%); /* Soft red */
}

.popup li {
  list-style: none;
}

/* Overlay for mobile menu */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Desktop Navigation */
.desktop-nav {
  display: none;
}

.desktop-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.desktop-nav a {
  color: hsl(236, 13%, 42%); /* Dark grayish blue */
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus {
  color: hsl(5, 85%, 63%); /* Soft red */
}

.desktop-nav li {
  list-style: none;
}

/* Desktop Layout with CSS Grid */
@media (min-width: 768px) {
  body {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100vh;
  }

  header {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 3rem 0;
  }

  .main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 3rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: minmax(380px, 48vh) auto;
    gap: 2rem 2rem;
    grid-template-areas:
      "hero sidebar"
      "cards cards";
    height: calc(100vh - 80px);
  }
  .hero-section {
    margin-bottom: 5rem;
  }
  .hero-section button {
    color: hsl(240, 100%, 5%);
    outline: none;
    border: none;
    width: 50%;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 1rem;
    background-color: hsl(5, 85%, 63%);
    margin-bottom: 3rem;
  }
  /* Grid Area Assignments */
  .navbar {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
  }

  .hero-section {
    grid-area: hero;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 220px 1fr;
    gap: 1.2rem;
    grid-template-areas:
      "hero-img hero-img"
      "hero-title hero-content";
    height: 100%;
  }

  .img-container {
    grid-area: hero-img;
    margin-bottom: 0;
    height: 220px;
    overflow: hidden;
  }

  .img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .main-title {
    grid-area: hero-title;
    margin-bottom: 0;
    height: auto;
  }

  .hero-content {
    grid-area: hero-content;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }

  .questionbox {
    grid-area: sidebar;
    margin-bottom: 0;
    height: 100%;
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .questionbox h2 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
  }

  .questionbox h3 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
  }

  .questionbox p {
    font-size: 13px;
    margin-bottom: 0.8rem;
    line-height: 1.3;
  }

  .border {
    margin-bottom: 0.8rem;
  }

  .collection-container {
    grid-area: cards;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-top: 2rem;
  }

  /* Desktop Navigation */
  .menu-toggle {
    display: none;
  }

  .desktop-nav {
    display: block;
  }

  .popup,
  .menu-overlay {
    display: none;
  }

  /* Desktop Typography Adjustments */
  .main-title h1 {
    font-size: 2.6rem;
    line-height: 1.3;
    margin-bottom: 0;
  }

  .main-title button {
    width: auto;
    padding: 0.7rem 1.3rem;
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    transition: background-color 0.3s ease;
  }

  .hero-content p {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 1.2rem;
  }

  .card {
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
  }

  .card img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
  }

  .card-content {
    display: flex;
    flex-direction: column;
  }

  .card-number {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
  }

  .card h4 {
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 0.3rem;
  }

  .card p {
    font-size: 13px;
    line-height: 1.4;
  }
}
