/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== VARIABLES ===== */
:root {
  /* Colors */
  --white: hsl(0, 100%, 100%);
  --purple-100: hsl(275, 100%, 97%);
  --purple-600: hsl(292, 16%, 49%);
  --purple-950: hsl(292, 42%, 14%);
  --purple-950-op: hsla(292, 42%, 14%, 0.2);

  /* Spacing */
  --space-common: 1.5rem; /* 24px */

  /* Fluid typography */
  --h1: clamp(2rem, 8vw, 3.5rem);
  --h2: clamp(1rem, 3vw, 1.125rem);
  --paragraph: clamp(0.9rem, 2.5vw, 1rem);
}

/* ===== GLOBALS ===== */
/* Fonts */
html {
  font-family: "Work Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
}

ul {
  list-style: none;
}

/* ===== LAYOUT ===== */
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: var(--space-common);
  background: var(--purple-100) url("./assets/images/background-pattern-mobile.svg") no-repeat top center / contain;
  text-align: left;
  font-size: var(--paragraph);
}

/* ===== MAIN ===== */
main {
  max-width: 600px;
  padding: var(--space-common);
  border-radius: 0.5rem;
  box-shadow: var(--purple-950-op) 2px 2px 60px 5px;
  background-color: var(--white);
}

/* ===== HEADER ===== */
header {
  display: flex;
  gap: var(--space-common);
  margin-bottom: var(--space-common);
}

header img {
  width: 25px;
  height: auto;
}

/* ===== LIST ITEM ===== */
.faq-item {
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--purple-100);
}

.faq-item:first-of-type {
  padding-top: 0;
}

.faq-item:last-of-type {
  padding-bottom: 0;
  border-bottom: none;
}

h1 {
  font-size: var(--h1);
}

h2 {
  font-size: var(--h2);
}

h1, h2 {
  color: var(--purple-950);
}

button {
  /* Reset */
  border: none;
  background: none;
  /* Layout */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.875rem;
  width: 100%;
  border-radius: 1px;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s;
}

button:hover {
  color: rgb(131, 25, 173);
}

button:focus {
  outline: 2px solid rgb(131, 25, 173);
}

.answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.answer p {
  overflow: hidden;
}

.answer.open {
  grid-template-rows: 1fr;
  margin-top: 1.25rem;
}

p {
  color: var(--purple-600);
  letter-spacing: -0.2px;
  line-height: 1.5;
}

@media (width >= 1024px) {
  body {
    background-image: url("./assets/images/background-pattern-desktop.svg");
  }

  main {
    padding: 2.5rem;
    border-radius: 0.9375rem;
  }

  header {
    margin-bottom: 2rem;
  }

  header img {
    width: 40px;
  }

  .faq-item {
    padding: var(--space-common) 0;
  }

  p {
    letter-spacing: 0;
  }
}