/* ---------- MAIN CSS ---------- */
:root {
  --color-bg: hsl(0, 0%, 100%);
  --color-top-bg-pattern: hsl(225, 100%, 98%);
  --color-card-bg: hsl(227, 47%, 96%);
  --font-color1: hsl(228, 12%, 44%);
  --font-color2: hsl(230, 17%, 14%);
  --toggle-color-bg: hsl(230, 22%, 74%);
  --toggle-color-button: hsl(0, 0%, 100%);
  --color-hover: hsla(229, 22%, 75%, 0.678);
}

.dark-mode {
  --color-bg: hsl(230, 17%, 14%);
  --color-top-bg-pattern: hsl(232, 19%, 15%);
  --color-card-bg: hsl(228, 28%, 20%);
  --font-color1: hsl(228, 34%, 66%);
  --font-color2: hsl(0, 0%, 100%);
  --toggle-color-bg: linear-gradient(to right, #378fe6, #3eda82);
  --toggle-color-button: hsl(230, 17%, 14%);
  --color-hover: hsl(230, 24%, 25%);
}

* {
  font-size: 14px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100vh;
}

body {
  background-color: var(--color-bg);
  min-width: 250px;
}

.main-container {
  max-width: 340px;
  min-width: 250px;
  padding: 2rem;
  margin: auto;
}

header {
  max-width: 350px;
  margin: auto;
}

.title-div {
  margin-bottom: 1.5rem;
  letter-spacing: 0.05rem;
}

h1 {
  color: var(--font-color2);
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

h2 {
  color: var(--font-color1);
}

h3 {
  color: var(--font-color2);
}
h4 {
  color: var(--font-color1);
  letter-spacing: 0.4rem;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 1.2rem;
}

.up {
  color: hsl(163, 72%, 41%);
}

.up::before {
  content: url(../images/icon-up.svg);
  vertical-align: text-top;
  margin-right: 0.3rem;
}

.down {
  color: hsl(356, 69%, 56%);
}

.down::before {
  content: url(../images/icon-down.svg);
  vertical-align: middle;
  margin-right: 0.3rem;
}

.card {
  background-color: var(--color-card-bg);
  border-radius: 5px;
  margin: 1rem auto;
}

.card:hover {
  background-color: var(--color-hover);
  cursor: pointer;
}

/* ---------- FIRST PART ---------- */

.top {
  margin: auto auto 2rem auto;
}

.large {
  text-align: center;
  border-top-style: solid;
  border-top-width: 4px;
  padding: 1.5rem;
}

.large img {
  margin-right: 0.5rem;
}

.large h2 {
  display: flex;
  justify-content: center;
}

.large h3 {
  font-size: 4rem;
  margin-top: 1.3rem;
}

.large h5 {
  display: flex;
  justify-content: center;
  align-items: center;
}

.facebook {
  border-top-color: hsl(208, 92%, 53%);
}
.twitter {
  border-top-color: hsl(203, 89%, 53%);
}

.instagram {
  border-top-color: hsl(37, 97%, 70%);
}
.youtube {
  border-top-color: hsl(348, 97%, 39%);
}

/* ---------- SECOND PART ---------- */

.small {
  position: relative;
  height: 8rem;
}

.small h2 {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
}

.small h3 {
  font-size: 2rem;
  position: absolute;
  bottom: 1.2rem;
  left: 1.2rem;
}

.sml-cd-icon {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
}

.small h5 {
  position: absolute;
  bottom: 1.2rem;
  right: 1.2rem;
}

/* ---------- SWITCH BTN ---------- */

.dark-mode-div {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  border-top-style: solid;
  border-top-width: 2px;
  border-color: var(--font-color1);
  padding: 20px 0px 10px 0px;
  width: 100%;
}

#btn-label {
  color: var(--font-color1);
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 20px;
  background: var(--toggle-color-bg);
  border-radius: 20px;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--toggle-color-button);
  transition: all 0.3s;
}

.switch:hover {
  background: linear-gradient(to right, #378fe6, #3eda82);
  cursor: pointer;
}

.checkbox:checked + .switch::after {
  right: 23px;
}

.checkbox {
  display: none;
}

/* ---------- FOOTER ---------- */

.attribution {
  font-size: 9px;
  text-align: center;
  height: 15px;
  margin-top: -10px;
  color: var(--color-hover);
}
.attribution a {
  font-size: 9px;
  font-weight: 100;
  color: var(--color-hover);
}

/* ---------- TABLET SCREEN ----------*/

@media only screen and (min-width: 600px) {
  .main-container {
    max-width: 100%;
    min-height: 90vh;
  }

  header {
    display: flex;
    justify-content: space-between;
    max-width: 100vw;
    margin: auto;
  }

  .dark-mode-div {
    justify-content: flex-end;
    border-top-style: none;
    padding: 0px;
    width: 30vw;
  }

  .title-div {
    margin-bottom: 1.5rem;
    letter-spacing: 0.05rem;
  }

  #btn-label {
    padding-right: 1rem;
  }

  .container {
    display: grid;
    column-gap: 2rem;
    grid-template-columns: repeat(2, 48%);
  }

  .card {
    min-width: 100%;
  }
}

/* ---------- DESKTOP SCREEN ----------*/

@media only screen and (min-width: 1000px) {
  .main-container {
    padding: 2rem 8rem;
  }

  .container {
    grid-template-columns: repeat(4, 23%);
  }
}
