/* ------------------- */
/* Custom properties   */
/* ------------------- */
:root {
  --clr-blue-400: hsl(240, 73%, 65%);
  --clr-blue-500: hsl(238, 29%, 16%);
  --clr-red-400: hsl(14, 88%, 65%);
  --clr-violet-400: hsl(273, 75%, 66%);
  --clr-neutral-100: hsl(0 0% 100%);
  --clr-neutral-200: hsl(240, 5%, 91%);
  --clr-neutral-300: hsl(240, 6%, 50%);
  --clr-neutral-400: hsl(237, 12%, 33%);

  --lg-blue-to-violet: linear-gradient(
    180deg,
    var(--clr-violet-400) 0%,
    var(--clr-blue-400) 100%
  );

  --ff-sans: "Kumbh Sans", sans-serif;

  --fs-400: 0.75rem;
  --fs-500: 0.8125rem;
  --fs-900: 2rem;

  --lh-400: 1.5;
  --lh-500: 1.25;
  --lh-900: 1.25;

  --fw-400: 400;
  --fw-700: 700;
}

@media (min-width: 60em) {
  :root {
    --fs-500: 0.875rem;
  }
}

/* ------------------- */
/* Reset               */
/* ------------------- */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: var(--lh-400);
  font-family: var(--ff-sans);
  font-size: var(--fs-400);
  font-weight: var(--fw-400);
  background: var(--lg-blue-to-violet);
  color: var(--clr-neutral-400);
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------- */
/* Composition         */
/* ------------------- */
.flex {
  display: flex;
  gap: var(--flex-gap, 1rem);
}

.grid {
  display: grid;
  gap: var(--grid-gap, 1rem);
}

/* ------------------- */
/* Utility             */
/* ------------------- */
.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;
}

.bg-neutral-100 {
  background-color: var(--clr-neutral-100);
}

.text-blue-500 {
  color: var(--clr-blue-500);
}
.text-neutral-200 {
  color: var(--clr-neutral-200);
}
.text-neutral-300 {
  color: var(--clr-neutral-300);
}
.text-neutral-400 {
  color: var(--clr-neutral-400);
}

.fs-500 {
  font-size: var(--fs-500);
  line-height: var(--lh-500);
}
.fs-900 {
  font-size: var(--fs-900);
  line-height: var(--lh-900);
}

.fw-700 {
  font-weight: var(--fw-700);
}

.text-center {
  text-align: center;
}

/* ------------------- */
/* Block               */
/* ------------------- */
.layout {
  grid-template-rows: 1fr auto 1fr;
  grid-template-areas:
    "header"
    "main"
    "footer";
  min-height: 100vh;
  padding: 1rem 1.5rem;
}

.layout > main {
  grid-area: main;
}

.layout > footer {
  grid-area: footer;
  align-self: end;
}

.card {
  --grid-gap: 0;
  box-shadow: 0px 50px 50px -20px hsl(260 74% 27% / 0.5);
  border-radius: 23px;
  max-width: 21rem;
  margin-inline: auto;
  margin-top: 6.75rem;
}

.illustration {
  min-height: 13.25rem;
  width: 100%;
  margin-inline: auto;
  margin-top: -6.75rem;
  background-image: url(/assets/illustration-woman-online-mobile.svg),
    url(/assets/bg-pattern-mobile.svg);
  background-repeat: no-repeat;
  /* rem width to scale with font size change */
  background-size: 14.8125rem auto;
  background-position: center top, center bottom;
}

.faq-section {
  padding: 1.75rem 1.5rem 3rem;
}

.faq-section > h1 {
  text-align: center;
  margin-bottom: 1.125rem;
}

.faq-section > details {
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--clr-neutral-200);
}

.faq-section > details summary {
  /* remove marker for browsers */
  list-style: none;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: color 200ms ease-in-out;
}

/* remove marker for browsers */
.faq-sections > details summary::marker,
/* remove marker for webkit-based browsers such as Safari */
.faq-section > details summary::-webkit-details-marker {
  display: none;
}

.faq-section > details summary img {
  transition: transform 200ms ease-in-out;
}

.faq-section > details summary:hover {
  color: var(--clr-red-400);
}

.faq-section > details[open] summary {
  color: var(--clr-blue-500);
  font-weight: var(--fw-700);
  margin-bottom: 0.75rem;
}

.faq-section > details[open] summary img {
  transform: rotateZ(180deg);
}

@media (min-width: 60em) {
  .layout {
    padding: 1rem 4rem;
  }

  .layout > main {
    margin-left: 2.8125rem;
  }

  .card {
    grid-template-columns: 24.25rem auto;
    margin-top: unset;
    max-width: 57.5rem;
  }

  .illustration {
    max-width: 24.25rem;
    margin-top: unset;
    background-image: url(/assets/illustration-woman-online-desktop.svg),
      url(/assets/bg-pattern-desktop.svg);
    background-repeat: no-repeat;
    /* rem width to scale with font size change */
    background-size: 29.5rem auto, 60rem auto;
    /* calc to prevent image shift when accordion opens */
    background-position: right 0% center, right 0% top calc(50% - 4.5rem);
    position: relative;
  }

  .illustration::before {
    content: "";
    width: 11.25rem;
    height: 100%;
    position: absolute;
    left: -5.625rem;
    background-image: url(/assets/illustration-box-desktop.svg);
    background-repeat: no-repeat;
    background-size: contain;
    /* calc to prevent image shift when accordion opens */
    background-position: center top calc(50% + 3rem);
  }

  .faq-section {
    padding: 4rem 6rem 4rem 5.375rem;
  }

  .faq-section > h1 {
    text-align: start;
    margin-bottom: 1.5rem;
  }
}
