* {
  box-sizing: border-box;
}

/* FONTS */
@font-face {
  font-family: 'latobold';
  src: url('../fonts/lato/Lato-Bold.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'impact';
  src: url('../fonts/impact/impact.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'comix';
  src: url('../fonts/comix/Comix-Bold.ttf') format('truetype');
}

/***** BASE *****/
html {
  color: #626262;
}
body {
  margin: 0;
  padding: 0;
  background-color: #dddddd;
  color: #000;
  height: 100vh;
  width: 100wh;
  font-family: latobold;
}
.rtl {
  direction: rtl;
  font-family: comix;
}
body.rtl .meme-text {
  text-align: right;
}
body.rtl .download a span {
  font-size: 1.2rem;
  font-family: comix;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 400;
  margin: 0;
}
.images-menu img {
  width: 100%;
}
button > img,
.download-txt {
  width: 30px;
}
button {
  padding: 0px;
}
canvas {
  border: 4px solid #fe6e20;
  width: 80%;
  height: 80%;
}

/* LAYOUT */
.main-layout {
  max-width: 480px;
  margin: 0 auto;
}

.about-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #9e9e9e;
  border: 4px solid #5d737e;
  height: 300px;
  width: 400px;
  text-align: center;
  z-index: 5;
}
.about-modal .close img {
  width: 20px;
}
.about-modal .close {
  background-color: transparent;
  border: none;
  color: #000000;
  position: absolute;
  top: 25px;
  right: 25px;
}
.about-modal .social-list {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.about-modal .social-list a img {
  width: 40px;
}

/*************** HEADER ***************/
header {
  background-color: #9e9e9e;
  border-bottom: 4px solid #5d737e;
  margin-bottom: 60px;
}
.logo {
  height: 40px;
  margin: 30px 0px;
}
header li a {
  display: inline-block;
  text-decoration: none;
  font-size: 1.3rem;
  color: #fe6e20;
  text-shadow: 0px 0px 4px black, 0px 0px 4px black, 0px 0px 4px black,
    0px 0px 4px black;
}
header li a.about {
  color: #fb9623;
}
.main-nav {
  gap: 40px;
}
.btn-menu-toggle,
.close-menu {
  background-color: transparent;
  display: inline-block;
  border: none;
  margin-inline-end: 10px;
}
.menu-icon,
.close-menu-img {
  display: inline-block;
  width: 50px;
  color: #fe6e20;
}
.close-menu-img {
  position: fixed;
  top: 10px;
  right: 10px;
}
.select-lang {
  background-color: #fe6e20;
}
.select-lang,
.select-lang option {
  color: #ffffff;
  padding: 8px 16px;
  border: 1px solid transparent;
  cursor: pointer;
}

/*************** MAIN CONTENT ***************/
main {
  position: relative;
}

/****** GALLERY ******/
.grid-container {
  column-count: 6;
  gap: 10px;
  margin: 0 auto;
  justify-content: center;
}
.meme {
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 5px;
  transition: opacity 0.4s linear, transform 0.5s linear;
}
.meme:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

/********** EDITOR **********/

/****** CANVAS ******/
.canvas-container-container {
  flex-basis: 50%;
  display: grid;
  align-items: center;
}

/**** TOOLS ****/
.tools-container {
  flex-basis: 50%;
}
.tools {
  align-items: stretch;
  justify-content: space-evenly;
  height: 80%;
  width: 80%;
  padding: 10px;
  background-color: #fb9623;
  border: 4px solid #5d737e;
}
.tools input,
select {
  border-radius: 10px;
  height: 40px;
  padding: 0 10px;
}

.tool-btn {
  height: 40px;
  width: 40px;
  border-radius: 10px;
  border: transparent;
  opacity: 1;
  transition: border 0.5s, transform 0.5s;
}
.tool-btn:hover {
  opacity: 0.8;
}
.tool-btn:active {
  border: 4px solid #626262;
  opacity: 0.6;
  transform: scale(2);
}
.trash {
  background-color: red;
}
.add {
  background-color: green;
}
.move-down,
.move-up {
  background-color: lightblue;
}
.switch {
  background-color: #5c76eb;
}
.color-change,
.stroke {
  padding: 0;
  border: 3px solid black;
  background-color: transparent;
}
.color-change input,
.stroke input {
  background-color: transparent;
  position: absolute;
  color: #ffffff;
  margin: 0;
  opacity: 0;
  border: none;
  padding: 0;
}
.color-select {
  color: #ffffff;
}
.download {
  flex-basis: 60%;
  background-color: #00d400;
}
.download-link {
  height: 100%;
  width: 100%;
  text-decoration: none;
}
.download a span {
  margin-inline-start: 1.2rem;
  font-size: 1rem;
  font-family: 'impact';
  text-transform: uppercase;
  color: #000000;
}
.share {
  background-color: #1e7cd3;
}

/****** MEMES ******/

/***** HELPERS *****/
.btn {
  cursor: pointer;
}

/* flex helpers */
.flex {
  display: flex;
}
.flex.space-between {
  justify-content: space-between;
}
.flex.space-around {
  justify-content: space-around;
}
.flex.align-center {
  align-items: center;
}
.flex.align-stretch {
  align-items: stretch;
}
.flex.direction-col {
  flex-direction: column;
}
.flex.row-reverse {
  flex-direction: row-reverse;
}
.flex.justify-center {
  justify-content: center;
}
.flex.justify-evenly {
  justify-content: space-evenly;
}

/* list-helpers */
.clean-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
}
.hide {
  display: none;
}
.radius {
  border-radius: 20px;
}

/******** MOBILE LARGE ********/
@media (max-width: 780px) {
  header li a {
    font-size: 1.3rem;
  }
  .logo {
    height: 30px;
    margin-inline-start: 10px;
  }
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    flex-direction: column;
    min-width: 250px;
    background-color: #9e9e9e;
    height: 100vh;
    box-shadow: 0px 0px 0px transparent;
    transform: translateX(100%);
    transition: transform 0.6s;
    z-index: 5;
    gap: 75px;
  }
  .screen {
    position: fixed;
    inset: 0;
    background-color: rgb(0 0 0 / 50%);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.6s;
  }
  body.menu-open .main-nav {
    transform: translateX(0);
    box-shadow: -8px 0px 20px rgb(0 0 0 / 20%);
  }
  body.rtl .main-nav {
    transform: translateX(-100%);
  }
  body.menu-open.rtl .main-nav {
    transform: translateX(0);
    box-shadow: 8px 0px 20px rgb(0 0 0 / 20%);
  }
  .tools {
    height: 100%;
    width: 90%;
  }
  .editor-container {
    flex-direction: column;
    height: 80vh;
  }
  .grid-container {
    column-count: 3;
  }
  body.menu-open .screen,
  body.about-open .screen {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
  }
  body.rtl .close-menu-img,
  body.rtl .main-nav {
    right: auto;
    left: 0;
  }
}

/******** MOBILE ONLY ********/
@media (max-width: 500px) {
  .grid-container {
    column-count: 2;
  }
  .editor-container {
    flex-direction: column;
  }
  .btn-menu-toggle {
    background-color: transparent;
    display: inline-block;
    border: none;
  }
}

/******** LARGE ********/
@media (min-width: 780px) {
  body.rtl .download a span {
    font-size: 1.5rem;
  }
  .download a span {
    font-size: 1.2rem;
  }
  .main-layout {
    max-width: 740px;
  }
  header li a {
    font-size: 1.5rem;
  }
  .tools input,
  select {
    height: 40px;
  }
  .tool-btn {
    height: 40px;
    width: 40px;
  }
  .editor-container {
    background-color: #9e9e9e;
    border: 4px solid #5d737e;
    height: 402px;
  }
  .grid-container {
    column-count: 4;
  }
  .btn-menu-toggle,
  .close-menu {
    display: none;
  }
}

/******** EXTRA LARGE ********/
@media (min-width: 1100px) {
  body.rtl .download a span {
    font-size: 2.4rem;
  }
  .download a span {
    font-size: 2rem;
  }
  header li a {
    font-size: 2rem;
  }
  .main-layout {
    max-width: 1060px;
  }
  .editor-container {
    height: 600px;
  }
  .tool-btn {
    height: 60px;
    width: 60px;
  }
  button > img,
  .download-txt {
    width: 40px;
  }
  .logo {
    margin: 40px 0px;
  }

  .grid-container {
    column-count: 6;
  }
}
