* {
    box-sizing: border-box; 
}

/* font implementation */
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}





/* colors & variables */
html {
    --background-color: #F9FFF3;    /* mint green */
    --figure-color: #D9F4C2;        /* matcha green */
    --header-footer-color: #FFDAFE; /* bubblegum pink */
    --star-fill-color: #FFCB5C;     /* nacho yellow */
    --star-stroke-color: #C27400;   /* burnt orange */
    --text-color: #0D000D;          /* berry black */
    --button-text-color: #FFFFFF;   /* sugary white */
    --link-color: #8D318B;          /* grape purple */

    --menu-icon-color: var(--text-color);
    --nav-background-color: var(--background-color);
    --nav-a-hover-bg-color: var(--link-color);
  
    --nav-height: 75px;

    --rhythm: 1.5rem;
    --double-rhythm: 3rem;            
}

@media (prefers-color-scheme: dark) {
  :root {
      --background-color: #1F3A03;    /* seaweed green */
      --figure-color: #578530;        /* jalapeño green */
      --header-footer-color: #FF579F; /* dragonfruit pink */
      --star-fill-color: #FFCB5C;     /* nacho yellow */
      --star-stroke-color: #C27400;   /* burnt orange */
      --text-color: #FFFFFF;          /* sugary white */
      --button-text-color: #0D000D;   /* berry black */
      --link-color: #D7F75B;          /* lime green */
  }
}

/* basic styling */
body {
    font-family: 'Poppins', Helvetica, sans-serif;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0 auto;
    padding: 0 5px;
    margin-top: calc(var(--nav-height)*1.5);
}

.footer{
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
    background-color: var(--header-footer-color); 
    color: var(--text-color);
    padding: var(--rhythm) 90px;
    margin-top: var(--rhythm);
}

figure{
    background-color: var(--figure-color);
    color: var(--text-color);
    margin-left: 1.25rem;
    margin-right: 1.25rem;
    padding: var(--rhythm) 5px;
    margin-bottom: var(--double-rhythm);
}

figure.small {
    width: clamp(15rem, 20vw, 30rem);
    height: auto; 
    padding: 1rem; 
    margin: var(--rhythm) 20px;
    padding-bottom: 0.10rem; 
    text-align: center; 
}

figure.small h2, figure.small p {
    margin: 0; 
    line-height: 1.2; 
}

.button{
    text-align: center;
    text-decoration: none;
    background-color: var(--text-color); 
    color: var(--button-text-color);
    padding: 0.25rem 2rem;
    width: fit-content;
    cursor: pointer;
}

a {
    cursor: pointer;
}

input{
  border: none;
  background-color: var(--figure-color);
}

input:focus {
  outline: 2px solid var(--header-footer-color); 
  outline-offset: 2px;  
}




/* header styling */
header {
  background: var(--header-footer-color);
  height: var(--nav-height);
  width: 100%;

  position: fixed;
  left: 0;
  top: 0;

  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 0 1rem; 
  box-sizing: border-box;

     

  .logo {
      margin: 0; 
      font-size: 1.5rem; 
      font-weight: bold;
  }
  
  .logo a {
      color: var(--text-color);
      text-decoration: none; 
  }
  
    label {
      cursor: pointer;
      height: 20px;
      position: absolute;
      right: 1rem;
      width: 26px;
      z-index: 1001;
  
      span {
        background-color: var(--menu-icon-color);
        border-radius: 2px;
        display: block;
        height: 3px;
        position: absolute;
        width: 100%;
  
        transform-origin: left;
  
        &:nth-child(1) {
          top: 0;
        }
  
        &:nth-child(2) {
          top: 8px;
        }
  
        &:nth-child(3) {
          top: 16px;
        }
      }
    }
  }
  
  nav {
    background: var(--nav-background-color);
    height: 100vh;
    margin-block-start: var(--nav-height);
    width: 300px;
  
    position: fixed;
    right: -300px;
    top: 0;
    z-index: 1000;
  
    ul {
      list-style: none;
      margin: 0;
      padding: 0;
  
      li {
        padding: 0;
  
        a {
          color: var(--text-color);
          display: block;
          font-size: 1.25rem;
          padding-block: 1rem;
          padding-inline: 1rem;
          text-decoration: none;
  
          &:hover {
            background-color: var(--background-color);
            color: var(--link-color);
          }
        }
      }
    }
  }
 
  nav ul li {
    border-bottom: 1px solid black;
  }
  

label span {
  transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}

.nav-toggle:checked ~ nav {
    right: 0;
  }
  
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: rotate(45deg);
    top: -2px; 
  }
  
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: rotate(-45deg);
  }
  

/* show full menu on desktop */
@media screen and (min-width: 1024px) {
  /* make nav visible and horizontal */
  nav {
      position: static;
      height: var(--nav-height);
      width: auto;
      background: transparent;
      display: flex;
      align-items: center;
      margin-block-start: 0;
  }

  nav ul {
      display: flex;
      gap: 0.15rem; 
      padding: 0;
  }

  nav ul li {
      border-bottom: none;
  }

  /* hide the home link when in horizontal navigation */
  nav ul li:first-child {
      display: none;
  }

  nav ul li a {
      font-size: 1rem;
      padding: 0.5rem 1rem;
      text-decoration: none;
      color: var(--text-color);
      transition: color 0.3s ease-in-out;
  }

  nav ul li a:hover {
      background-color: var(--header-footer-color);
      color: var(--link-color);
  }

  /* hide the hamburger menu */
  .nav-toggle,
  .nav-toggle-label {
      display: none;
  }
}

@media screen and (max-width: 1023px) {
  nav ul li a:hover {
      color: var(--link-color);
      transition: color 0.3s ease-in-out;
  }
}

/* font styling */
h1{
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.4;
    margin-block-start: var(--rhythm);
    margin-block-end: var(--rhythm);
    padding: 0 var(--rhythm);
    text-align: center;
}

h2{
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: var(--rhythm);
}

h3{
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 1rem;
}

h4{
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: var(--rhythm);
}

.button{
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 2; 
    display: block;
    margin: 0 auto;
    border-radius: 5px;
}

.button {
  transition: transform 0.2s ease;
}

.button:hover {
  transform: scale(1.1);
}

/* back button styling*/
.back-button {
  position: fixed;
  top: 7.75rem;
  left: 1.25rem;
  width: 26px;
  height: 20px;
  z-index: 1001;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease;
}

.back-button span {
  background-color: var(--menu-icon-color);
  border-radius: 2px;
  display: block;
  height: 3px;
  width: 70%;
  transition: transform 0.3s ease;
}

/* style to resemble the "<" icon */
.back-button span:first-child {
  transform: rotate(-45deg) translate(-2px, 2px);
}

.back-button span:last-child {
  transform: rotate(45deg) translate(-2px, -2px);
}

.back-button:hover {
  transform: scale(1.1);
}

@media screen and (min-width: 1200px) {
  .back-button {
    position: fixed;
    top: 7.75rem;
    left: 4rem;
  }
}


p, li{
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.8;
    margin: 0 20px;
    margin-bottom: var(--double-rhythm);
}

li{
    margin-bottom: 0px;
}

.center{
    text-align: center;
}

figure h1, figure h2, figure h3, figure h4{
    text-align: center;
}

figure p{
    margin-bottom: 20px;
}





/* shape styling */
figure{
    border-radius: 50px;
}

figure img{
    display: block;
    margin: auto;
    margin-top: 0;
    margin-bottom: 20px;
}

img{
    border-radius: 4px;
}

.circle{
    border-radius: 1000px;
    display: block; 
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--rhythm);
}

.shadow{
        box-shadow: 0 0 30px 20px var(--figure-color); 
}



/* form styling */
.form {
  margin: 0 auto;
  max-width: 720px;
  justify-content: center;
} 

label {
  display: block;
  margin-bottom: 0.25rem;
}

input {
  width: 100%; 
  padding: 1rem;
}

.formfield {
  margin-left: 20px;
  margin-right: 20px;
  margin-bottom: 2rem; 
}





/* reordering elements - IDM 222 */
/* index.html */
@media screen and (min-width: 920px) {
  /* intro section */
  .intro {
      display: grid;
      grid-template-columns: 0.20fr 1fr 1fr 0.20fr; /* four columns: one for margin, one for image, one for text, and another for margin to center the content more */
      grid-template-rows: auto auto auto auto; /* rows adjust to content */
      gap: 1rem; /* space between elements */
      align-items: center;  /* vertically align content */
      margin: 0 1rem;
  }

  .intro img {
      grid-column: 2; 
      grid-row: 1 / span 2; /* image spans both rows */
  }

  .introtitle {
      grid-column: 3; 
      grid-row: 1; 
  }

  .introtext {
      grid-column: 3; 
      grid-row: 2; 
  }

  /* my journey section */
  .myjourney {
    display: grid;
    grid-template-columns: 0.20fr 1fr 1fr 0.20fr; 
    grid-template-rows: auto auto auto auto; 
    gap: 1rem; 
    align-items: center;  
    margin: 0 1rem;
  }

  .myjourney img {
    grid-column: 3; 
    grid-row: 1 / span 2; 
  }

  .myjourney h3 {
    grid-column: 2; 
    grid-row: 1; 
  }

  .myjourney p {
    grid-column: 2; 
    grid-row: 2; 
  }

}

/* favorites section -> wrap */
.favorites {
  display: flex;
  flex-wrap: wrap;
  row-gap: min(0rem, 5vw);   /* controls vertical spacing */
  column-gap: max(1rem, 2vw); /* controls horizontal spacing */
  justify-content: center;
  margin-bottom: 2rem;
}

.homepage-figures {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  flex-direction: row;
  gap: 0rem;
  /* flex-wrap: nowrap; */
}

.title-alignment {
  padding-top: 2rem;
}

@media screen and (min-width: 768px) {
  .homepage-figures {
    justify-content: space-evenly;
  }
}

figure.condensed{
  min-width: 290px;
  max-width: 290px;
}

/* savory.html, sweet.html, sips.html */
@media screen and (min-width: 768px) {
  .category-intro-paragraph {
    max-width: 750px;
    justify-self: center;
  }

  /* figures with images on the left */
  .image-left-figure {
    max-width: 992px;
    justify-self: center;
    display: grid;
    grid-template-columns: 1fr 1fr; /* two columns: one for image, one for text */
    grid-template-rows: auto auto; /* rows adjust to content */
    align-items: center;  /* vertically align content */
}

.image-left-figure-img {
    grid-column: 1; 
    grid-row: 1 / span 2; /* image spans both rows */
}

.image-left-figure-content {
    grid-column: 2; 
    grid-row: 1; 
}

.image-left-figure-button {
    grid-column: 2; 
    grid-row: 2; 
}

/* increase image size for screens 768px and larger */
@media screen and (min-width: 768px) {
  .image-left-figure-img img {
      width: 350px; 
  }
}

/* figures with images on the right */
.image-right-figure {
  max-width: 992px;
  justify-self: center;
  display: grid;
  grid-template-columns: 1fr 1fr; /* two columns: one for text, one for image */
  grid-template-rows: auto auto; /* rows adjust to content */
  align-items: center;  /* vertically align content */
}

.image-right-figure-img {
  grid-column: 2; 
  grid-row: 1 / span 2; 
}

.image-right-figure-content {
  grid-column: 1; 
  grid-row: 1; 
}

.image-right-figure-button {
  grid-column: 1; 
  grid-row: 2; 
}

/* increase image size for screens 768px and larger */
@media screen and (min-width: 768px) {
  .image-right-figure-img img {
      width: 350px; 
  }
}
}

/* sub pages */
@media screen and (min-width: 768px) {
  .restaurant-review-figure {
    max-width: 992px;
    justify-self: center;
    display: grid;
    grid-template-columns: 1fr 1fr; /* two columns: one for image, one for text */
    grid-template-rows: auto auto; /* rows adjust to content */
    align-items: center;  /* vertically align content */
  }

  .restaurant-review-figure-img {
    grid-column: 1; 
    grid-row: 1 / span 2; /* image spans both rows */
}

.restaurant-review-figure-title {
    grid-column: 2; 
    grid-row: 1; 
}

.restaurant-review-figure-content {
    grid-column: 2; 
    grid-row: 2; 
}

/* increase image size for screens 768px and larger */
@media screen and (min-width: 768px) {
  .restaurant-review-figure-img img {
      width: 350px; 
  }
}
}



