*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --light-color: #fff;
  --dark-color: #393e46;
  --primary-color: #6d9886;
  --secondary-color: #f2e7d5;
  --tertiary-color: #d3e0db;
}

/* Basic Styling */
html,
body {
  font-family: "Lato", sans-serif;
  line-height: 1.6;
  background-color: var(--light-color);
  color: var(--dark-color);
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: var(--dark-color);
}

a:hover {
  color: var(--primary-color);
  cursor: pointer;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
}

figcaption {
  font-size: 14px;
}

figcaption a {
  font-weight: bold;
}

/* Utility Classes */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 2rem;
}

.container-sm {
  max-width: 1040px;
  margin-bottom: 2.5rem;
}

.btn {
  background-color: var(--primary-color);
  color: var(--light-color);
  padding: 0.5rem 1.5rem;
  margin-top: 20px;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
  transition: background-color 0.3s ease-in-out;
}

.btn:hover {
  background-color: transparent;
}

.btn-reverse {
  background-color: transparent;
  color: var(--primary-color);
}

.btn-reverse:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.section-title {
  margin: 3rem auto 0.5rem;
}

.divider-line {
  width: 5rem;
  height: 0.1rem;
  background-color: var(--dark-color);
  margin-bottom: 1rem;
}

.external-link a {
  font-weight: 700;
  color: var(--primary-color);
}

.external-link a:hover {
  color: var(--dark-color);
}

/* Navbar */
.navbar {
  position: relative;
  top: 0;
  right: 0;
  left: 0;
}

.navbar h3 {
  font-weight: 800px;
  text-transform: uppercase;
}

.navbar .navbar-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar .main-menu-list {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  color: var(--dark-color);
}

/* Mobile */
.navbar .mobile-menu {
  display: none;
}

.navbar .mobile-menu-toggle {
  color: var(--dark-color);
  cursor: pointer;
}

.navbar .mobile-menu-items {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--light-color);
  opacity: 0.95;
  padding: 3rem 2rem;
  text-align: center;
  transition: transform 0.3s ease, visibility 0.3s ease;
  transform: translateX(-100%);
  visibility: hidden;
}

.navbar .mobile-menu-items.active {
  transform: translateX(0);
  visibility: visible;
}

.navbar .mobile-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  font-size: 1.2rem;
}

/* Hero */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)),
    url(../images/background-hero.jpg) top center/cover;
  height: 585px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero .hero-content {
  text-align: center;
  padding: 2rem 2rem;
}

.hero .hero-content h1 {
  margin-bottom: 0.2rem;
  font-size: 3rem;
}

.hero .hero-content p {
  margin-bottom: 1.3rem;
  font-size: 1.4rem;
}

/* About */
.about {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  padding: 5rem 7rem;
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.about-content .divider-line {
  background-color: var(--primary-color);
}

.about-content h3 {
  font-size: 2.1rem;
  margin-bottom: 1rem;
}

.about-content p {
  margin-bottom: 1.2rem;
}

/* Recipes */
#recipes {
  text-align: left;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 300px;
  justify-content: center;
  align-items: start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.recipe-card-item {
  display: flex;
  flex-direction: column;
}

.recipe-card-item .image-wrapper {
  width: 100%;
  height: 240px;
}

.recipe-card-item .image-wrapper img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.recipe-card-item .recipe-card-description h4 {
  font-size: 1rem;
  margin: 0.3rem 0;
}

.recipe-card-item p,
.recipe-card-item i {
  font-size: 0.9rem;
  color: #242424bb;
}

.recipe-card-item a:hover {
  img {
    opacity: 0.9;
  }

  .recipe-card-description {
    color: var(--primary-color);
  }
}

/* Footer */
footer {
  height: 265px;
  background-color: var(--primary-color);
  color: var(--light-color);
}

.footer-grid .logo {
  grid-area: logo;
}
.footer-grid .quick-links {
  grid-area: quick-links;
}
.footer-grid .newsletter {
  grid-area: newsletter;
}
.footer-grid .copyright {
  grid-area: copyright;
}

.footer-grid {
  font-size: 0.8rem;
  display: grid;
  grid-template-areas:
    "logo quick-links newsletter"
    "copyright copyright copyright";
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto-fit);
  column-gap: 4rem;
  row-gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 2rem;
}

.footer-grid .social-icons {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  color: var(--light-color);
  font-size: 1.2rem;
}

.footer-grid .footer-title {
  color: var(--secondary-color);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.footer-grid p,
.footer-grid .quick-links ul {
  margin: 1rem auto;
}

.footer-grid a,
.footer-grid .social-icons i {
  color: var(--light-color);
}

.footer-grid a:hover,
.footer-grid .social-icons i:hover {
  color: var(--secondary-color);
}

/* Newsletter */
.footer-grid .newsletter input,
.footer-grid .newsletter-button {
  padding: 0.5rem;
  border-radius: 3px;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
}

.footer-grid .newsletter input {
  background-color: var(--tertiary-color);
  border: 1px solid var(--tertiary-color);
  color: var(--primary-color);
  width: 75%;
}

.footer-grid .newsletter input::placeholder {
  color: var(--primary-color);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
}

.footer-grid .newsletter input:focus {
  outline: none;
}

.footer-grid .newsletter-button {
  background-color: var(--dark-color);
  color: var(--light-color);
  border: 1px solid var(--dark-color);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.footer-grid .newsletter-button:hover {
  background-color: transparent;
  border: 1px solid var(--tertiary-color);
}

/* Copyright */
.footer-grid .copyright {
  border-top: 1px solid var(--light-color);
  text-align: right;
}

i.fa-heart {
  color: red;
  margin-left: 0.3rem;
  margin-right: 0.3rem;
}

/* -------------- */
/* Recipe Pages*/
.horizontal-line {
  height: 3px;
  background-color: var(--secondary-color);
}

.hero-recipe {
  height: 440px;
  margin-bottom: 2.5rem;
}

.hero-recipe .hero-header {
  margin: 1rem 0;
  border-bottom: 2px solid var(--secondary-color);
  text-transform: uppercase;
}

.hero-recipe .hero-figure {
  height: 300px;
  width: 100%;
  margin-bottom: 1.6rem;
}

.hero-recipe .hero-figure img {
  height: 90%;
  width: 100%;
  object-fit: cover;
}

.hero-recipe .preview {
  border-bottom: 2px solid var(--secondary-color);
}

.hero-recipe .preview i {
  margin-right: 0.2rem;
  margin-bottom: 1rem;
}

.hero-recipe .preview i:nth-of-type(2) {
  margin-left: 1rem;
}

/* Recipe Details*/
.recipe-details {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.recipe-details h2 {
  margin-bottom: 1.5rem;
}

.recipe-details li {
  margin-bottom: 0.7rem;
}

.recipe-details .ingredients,
.recipe-details .instructions {
  margin-bottom: 2.5rem;
  flex: 1;
}

/* Instructions */
.recipe-details ol {
  padding-left: 0.6rem;
}

.recipe-details ol li {
  padding-left: 1.5rem;
}

.recipe-details ol li::marker {
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: bold;
  content: counter(list-item);
  margin-left: 2rem;
}

/* Tag Recipe */
.tag-recipe {
  background-color: var(--dark-color);
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-radius: 3px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.tag-recipe i {
  font-size: 6rem;
  color: var(--secondary-color);
}

.tag-content {
  width: 40%;
  color: var(--secondary-color);
}

.tag-content h2 {
  text-transform: uppercase;
  margin: 0.2rem auto 0.5rem;
}

/* Comment */
.comment {
  border: 2px solid var(--secondary-color);
}

.comment-body {
  width: 70%;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.comment h2 {
  margin-bottom: 0.7rem;
}

.comment p {
  margin-bottom: 1rem;
  font-size: small;
}

.comment textarea,
.comment input {
  width: 100%;
  outline: none;
  font-family: inherit;
  font-size: 0.8;
  border: none;
  border-radius: 3px;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: var(--secondary-color);
  opacity: 0.7;
}

.comment textarea::placeholder,
.comment input::placeholder {
  color: var(--dark-color);
}

.comment button {
  border: 2px solid var(--dark-color);
  background-color: var(--dark-color);
  color: var(--light-color);
  cursor: pointer;
}

.comment button:hover {
  border: 2px solid var(--dark-color);
  background-color: transparent;
  color: var(--dark-color);
}

/* Recipe Page Navigation */
.pages-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.pages-nav a {
  color: var(--primary-color);
}
.pages-nav a:hover {
  opacity: 0.6;
}

.pages-nav .next-page {
  text-align: right;
}

/* -------------- */
/* Media Queries */
@media (max-width: 768px) {
  /* Navbar */
  .navbar .main-menu {
    display: none;
  }

  .navbar .mobile-menu {
    display: block;
  }

  /* Hero */
  .hero .hero-content h3 {
    font-size: 2rem;
  }

  /* About */
  .about {
    height: 400px;
    padding: 1rem 1.8rem;
  }

  .about-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  /* Recipe Grid */
  .recipes-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 200px);
    gap: 1rem;
  }

  .recipe-card-item .image-wrapper {
    height: 140px;
  }

  .recipe-card-item .recipe-card-description h4 {
    font-size: 1rem;
  }

  .recipe-card-item .recipe-card-preview {
    display: none;
  }

  /* Footer */
  footer {
    height: 530px;
  }

  .footer-grid {
    grid-template-areas:
      "logo quick-links"
      "newsletter newsletter"
      "copyright copyright";
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto-fit);
    column-gap: 4rem;
    row-gap: 2rem;
    text-align: left;
  }

  .footer-grid .copyright {
    justify-content: center;
    text-align: center;
  }

  .footer-grid .newsletter {
    padding-top: 1rem;
    border-top: 1px solid var(--light-color);
  }

  .footer-grid .newsletter input {
    width: 80%;
  }

  /* Recipe Page */
  .hero-recipe {
    height: 460px;
    margin-bottom: 1.4rem;
  }

  .hero-recipe .hero-image {
    height: 230px;
  }

  .hero-recipe .preview p {
    font-size: 0.9rem;
  }

  .recipe-details {
    flex-direction: column;
  }

  .container-sm {
    margin-bottom: 1.5rem;
  }

  /* Tag Recipe */
  .tag-recipe {
    padding-top: 1rem;
    padding-bottom: 1rem;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 0;
  }

  .tag-recipe i {
    font-size: 3rem;
  }

  .tag-content {
    width: 100%;
    text-align: center;
  }

  .tag-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 0rem;
  }

  /* Comment */
  .comment {
    border: none;
  }

  .comment .comment-body {
    width: 100%;
  }

  .pages-nav p {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .hero {
    height: 370px;
  }

  .hero .hero-content h3 {
    font-size: 1.4rem;
  }

  #recipes {
    margin: 0;
  }

  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 290px);
  }

  .recipe-card-item .image-wrapper {
    height: 230px;
  }
}

@media (max-width: 430px) {
  .hero .hero-content h1 {
    font-weight: bold;
    font-size: 1.7rem;
  }

  .hero .hero-content p {
    font-size: 0.9rem;
  }

  .about-content h3 {
    font-size: 1.4rem;
  }

  .hero-recipe {
    height: 430px;
  }

  .hero-recipe .hero-header {
    font-size: 1.3rem;
  }
}
