@font-face {
  font-family: 'Roboto';
  src: url('assets/fonts/Roboto-Regular.woff2') format('woff2'),
      url('assets/fonts/Roboto-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-color: #F9FAFB;
  --footer-header-bg-color: #0F172A;
  --button-bg-color: #14B8A6;
  --button-bg-color-hover: #0D9488;
  --font-color: #F8FAFC;
  --box-shadow-color: rgba(0, 0, 0, 0.1);
  --read-button-bg-color: #3B82F6;
  --not-read-button-bg-color: #EF4444;
}

* {
  margin: 0;
  box-sizing: border-box;
}

img, picture, video, canvas, svg {
  display: block;
}

h1, h2, p, button, input, label {
  font-family: Roboto, sans-serif;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

header, footer {
  min-height: clamp(5rem, 8dvh, 12rem);
  background-color: var(--footer-header-bg-color);
}

header {
  flex: 1;

  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;

  padding: 0 3rem;
}

header > h1 {
  font-size: clamp(1.5rem, 2.5vw, 3rem);
  color: var(--font-color);
}

header > button {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;

  padding: 0.5em 1.2em;
  font-size: clamp(0.5rem, 2vw, 1.2rem);
  color: var(--font-color);
  border-radius: 0.5em;
  min-width: clamp(3rem, 10vw, 10rem);
  height: clamp(2.5rem, 5vh, 3rem);
  background-color: var(--button-bg-color);
  border: none;
}

header > button:hover {
  background-color: var(--button-bg-color-hover);
}

button#delete-all {
  margin-right: auto;
}

button#add {
  margin-left: auto;
}

main {
  flex: 6;
  display: flex;
  flex-direction: column;

  background-color: var(--bg-color);
}

main > section {
  flex: 1;

  display: grid;
  grid-template-columns: repeat(auto-fit, clamp(5rem, 20%, 12rem));
  grid-auto-rows: auto;
  row-gap: clamp(1rem, 2vh, 2rem);
  column-gap: clamp(1rem, 3vw, 2rem);
  justify-content: center;
  align-items: start;
  align-content: start;
  padding: 1rem 2rem;
}

section > article {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;

  padding: 1rem;
  border-radius: 0.75rem;
  background-color: #fff;
  box-shadow: 0 2px 6px var(--box-shadow-color);
}

section > article > h2,
section > article > p {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

section > article > div {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: clamp(0.5rem, 1vw, 1rem);
}

section > article h2 {
  font-size: clamp(1rem, 1.8vw, 2rem);
  line-height: 1.5;
}

section > article p,
section > article button {
  font-size: clamp(0.75rem, 1.2vw, 1.5rem);
}

section > article p {
  color: #444;
}

section > article button {
  padding: 0.25em 0.5em;
  border: none;
  min-width: auto;
  border-radius: 0.5rem;
}

footer {
  flex: 1;

  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

footer p {
  font-size: clamp(1rem, 1.5vw, 2rem);
  color: var(--font-color);
}

footer a {
  text-decoration: none;
  padding-bottom: 0;
}

footer img {
  display: block;
  height: 2rem;
}

dialog {
  display: none;
  justify-content: center;
  align-items: center;

  position: fixed;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
}

dialog > form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: start;
  align-items: center;

  padding: 2rem;
  background-color: white;
  border-radius: 12px;
}

dialog > form > div {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.2rem
}

dialog > form input {
  border-radius: 12px;
  border-style: none;
  padding: 0.25rem 0.5rem;
  background-color: #EFEFEF;
}

dialog button {
  padding: 0.3rem 0;
  width: 100%;
  border-radius: 12px;
}

dialog #read,
.card-grid .actions > button:first-child {
  background-color: var(--read-button-bg-color);
}

#read.not-read,
.card-grid .actions > button:first-child.not-read {
  background-color: var(--not-read-button-bg-color);
}