/*- rem and em not depend on the html font size in media queries. 
- Instead 1rem = 1em = 16px;
- we use em instead of rem in media queries because in some browsers, 
rem shows error in case of media queries. 
- calculate em by like 1350/16 */

/*************************************/
/* Below 1344px (smaller desktops) */
/*************************************/

@media(max-width: 84em){
	.hero-section{
		max-width: 120rem;
	}

	.heading-primary{
		font-size: 4.4rem;
	}

	.gallery{
		grid-template-columns: repeat(2, 1fr);
	}
}

/**************************************/
/* Below 1200px (Landscape tablets) */
/**************************************/


@media(max-width: 75em){
	html{
		font-size: 56.25%;
	}

	.heading-secondary{
		font-size: 3.6rem;
	}

	.heading-tertiary{
		font-size: 2.4rem;
	}

	.grid{
		column-gap: 4.8rem;
		row-gap: 6.4rem;
	}

	.main-header{
		padding: 0 3.2rem;
	}

	.hero-section {
		gap: 4.8rem;
	}

	.main-nav-list{
		gap: 3.2rem;
	}

	.testimonials-container{
		padding: 9.6rem 3.2rem;
	}

}

/*****************************/
/* Below 944px (tablets) */
/*****************************/


@media(max-width: 59em){
	html{
		font-size: 50%;
	}

	.hero-section{
		grid-template-columns: 1fr;
		justify-items: center;
		padding: 0 8rem;
		gap: 6.4rem;
	}

	.hero-img-container{
		width: 60%;
	}

	.hero-content-conatiner{
		text-align: center;
	}

	.delivered-meals{
		justify-content: center;
		margin-top: 3.2rem;
	}

	.logo{
		height: 2.4rem;
	}

	.step-number {
	    font-size: 6.4rem;
	}

	.meal-content{
		padding: 2.4rem 3.2rem 3.2rem 3.2rem;
	}

	.gallery{
		grid-template-columns: repeat(6,1fr);
	}

	.section-testimonials{
		grid-template-columns: 1fr;
	}

	.cta-grid{
		/* 3/5 = 60% and 2/5 = 40% */
		grid-template-columns: 3fr 2fr;
	}

	.cta-form{
		grid-template-columns: 1fr;
	}

	.btn--form{
		margin-top: 1.4rem
	}

	/* for mobile navigation */
	.mobile-nav-btn{
		display: block;
		z-index: 9999;
	}

	.main-nav{
		position: absolute;
		top: 0;
		left: 0;
		background: rgba(255, 255, 255, 0.97);
		width: 100%;
		height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;
		/* Hide Navigation */
		/* Don't allow transitions on display none property */
/*		display: none;*/
		
		/* hide element without using display none */
		/* step 1 is to hide it visually */
		opacity: 0;

		/* step 2 is to make it unaccessible to mouse and keyboard */
		pointer-events: none;

		/* step 3 is to hide it from screen readers */
		visibility: none;

		transform: translateX(100%);

		transition: all 0.5s ease-in;
	}

	.main-nav-list{
		flex-direction: column;
		gap: 4.8rem;
	}

	.main-nav-link:link,.main-nav-link:visited{
		font-size: 3rem;
	}

	.nav-open .main-nav{
		opacity: 1;
		pointer-events: auto;
		visibility: visible;
		transform: translateX(0);
	}

	.nav-open .mobile-nav-icon[name="close-outline"]{
		display: block;
	}	

	.nav-open .mobile-nav-icon[name="menu-outline"]{
		display: none;
	}
}

/***********************************/
/* Below 704px (smaller tablets) */
/***********************************/


@media(max-width: 44em){

	.grid--3-cols, .grid--4-cols{
		grid-template-columns: repeat(2,1fr);
	}

	.diets-container{
		grid-column: 1/-1;
    	justify-self: center;
	}

	.heading-secondary{
		margin-bottom: 4.8rem;
	}

	.pricing-plan{
		width: 100%;
	}

	.grid--footer{
		grid-template-columns: repeat(6, 1fr);
	}

	.nav-col{
		grid-row: 1;
		grid-column: span 2;
		margin-bottom: 3.2rem;
	}

	.contact-col, .logo-col{
		grid-column: span 3;
	}
}

/***********************************/
/* Below 544px (phones) */
/***********************************/


@media(max-width: 34em){

	.grid{
		row-gap: 4.8rem;
	}

	.grid--2-cols,.grid--3-cols, .grid--4-cols{
		grid-template-columns: repeat(1,1fr);
	}

	.hero{
		padding: 2.4rem 0 6.4rem 0;
	}

	.hero-section{
		padding: 0 3.2rem;
	}

	.btn,
	.btn:link,.btn:visited{
		padding: 2.4rem 1.6rem;
	}

	.hero-img-container{
		width: 80%;
	}

	.logo {
	    height: 1.2rem;
	}

	.step-img-box:nth-child(2){
		grid-row: 1;
	}

	.step-img-box:nth-child(6){
		grid-row: 5;
	}

	.step-img-box{
		transform: translateY(2.4rem);
	}

	.section-meals {
	    padding: 4.8rem 0 9.6rem 0;
	}

	.testimonials {
	    grid-template-columns: 1fr;
	}

	.gallery {
	    grid-template-columns: repeat(4,1fr);
	}

	.cta-grid {
	    grid-template-columns: 1fr;
	}

	.cta-text-box{
		padding: 3.2rem;
	}

	.cta-img-box{
		height: 32rem;
		grid-row: 1;
	}
}

/*******************************************/
/* if flex gap not supported by browser */
/*******************************************/

@media (max-width: 75em) {
  .no-flexbox-gap .main-nav-list li:not(:last-child) {
    margin-right: 3.2rem;
  }
}

@media (max-width: 59em) {
  .no-flexbox-gap .main-nav-list li:not(:last-child) {
    margin-right: 0;
    margin-bottom: 4.8rem;
  }
}

