:root {
  --fs-300: 0.9375rem;
  --fs-400: 1.0625rem;
  --fs-500: 1.375rem;
  --fs-600: 1.875rem;
  --fs-700: 2rem;

  --ff-body: "Roboto", sans-serif;
  --ff-heading: ;

  --fw-400: 400;
  --fw-700: 700;
  --fw-900: 900;

  --primary: hsl(325, 100%, 72%);

  --clr-primary-200: hsla(160, 44%, 95%, 1);
  --clr-primary-300: hsl(160, 44%, 69%);
  --clr-primary-400: hsla(160, 44%, 56%, 1);
  --clr-primary-500: hsla(160, 44%, 46%, 1);

  --clr-neutral-100: hsla(0, 0%, 100%, 1);
  --clr-neutral-300: hsla(0, 0%, 50%, 1);
  --clr-neutral-400: hsla(0, 0%, 40%, 1);
  --clr-neutral-500: hsla(0, 0%, 60%, 1);
  --clr-neutral-900: hsla(0, 0%, 10%, 1);
}

@media (min-width: 35em) {
  :root {
    --fs-300: 1rem;
    --fs-400: 1.125rem;
    --fs-500: 1.5rem;
    --fs-600: 2.25rem;
    --fs-700: 3rem;
  }
}

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

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  font-size: inherit;
  margin: 0;
  padding: 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: 1.5;
}

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

/* ACCESSIBILITY */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ----------------- 404 PAGE ----------------- */
header.error :is(h1) {
  font-size: 2rem;
}

header.error {
  margin-left: 5rem;
}

/* ------------------ STYLING ----------------- */

body {
  font-family: var(--ff-body);
  font-size: var(--fs-400);
  color: var(--clr-neutral-900);
}

main.index h1 {
  font-size: 1.5rem;
}

h1,
h2,
h3 {
  font-family: var(--ff-heading);
  font-weight: var(--fw-900);
  line-height: 1.1;
}

.page-container {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

#logo {
  font-weight: bold;
  font-size: 2rem;
  margin-right: auto;
}

header.topbar {
  margin-bottom: 3rem;
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 1rem;
  background-color: #afe0d0;
  color: #faeeea;
}

.article__list h3 {
  font-size: 1.2rem;
}

.article__list a {
  text-decoration: none;
}

.snippet__body {
  margin-block: 1rem;
}

.btn {
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
  padding: 0.75em 1.75em;
  border-radius: 0.25em;
  align-self: start;
  justify-self: start;
}

.btn:focus {
  outline: 0.125em solid var(--clr-primary-400);
  outline-offset: 0.25em;
}

.btn--primary {
  background: var(--clr-primary-300);
  color: #faeeea;
  font-weight: var(--fw-700);
  border: 2px solid var(--clr-primary-300);
}
.btn--primary:hover,
.btn--primary:focus {
  background: var(--clr-primary-400);
  border-color: var(--clr-primary-400);
}

.article__list p {
  text-align: justify;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 350px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr));
  gap: 3rem 2rem;
  padding: 3rem 1rem;
}

footer {
  text-align: center;
  padding-block: 1rem;
}

