/* CSS RESET */
/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* General Styles */
* {
    box-sizing: border-box;
}

:root {
    --ft-color: #222;
}

body {
    font-family: "PT Serif", serif;
    font-size: 1.2rem;
    line-height: 1.6;
    font-weight: 400;
}

.hidden {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

a {
    display: block;
    color: var(--ft-color);
    text-decoration: none;
}

img {
    display: block;
    width: auto;
    height: 100%;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.4rem;
}

h4 {
    font-size: 1.2rem;
}

a {
    font-size: 1rem;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: rgb(106, 98, 255);
}

ul{
    display: flex;
    gap: 8px;
}

ul a {
    padding: 2px 7px;
    background-color: rgba(255,255,255,.5);
    border-radius: 7px;
}

/* Main Styles */
#mainIndex {
    width: 100%;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

h2 {
    grid-column: 1 / -1;
    padding-bottom: 1rem;
}

#mainIndex section {
    width: 100%;
    grid-column: 1 / -1;
    overflow: hidden;
    height: 300px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: space-between;
    align-items: end;
    grid-template-rows: 1fr;
    background:linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.3), rgba(0,0,0,.7)); 
}

#mainIndex > button {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    
}

#mainIndex h3 {
    color: rgb(244, 244, 244);
    padding: 1rem;
    grid-column: 1 / -1;
    align-self: start;
}

#mainIndex article h4 {
    padding: 5px;
}

#mainIndex article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

#mainIndex img {
    position: absolute;
    top:50%;
    left:50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    object-fit: cover;
    z-index: -1;
    opacity: 0.8;
}

#mainIndex h4 {
    font-weight: bold;
    color: white
}

svg {
    width: 30px;
}

#mainIndex article a {
    font-size: 1.3rem;
    text-decoration: underline;
    padding: 5px;
    color: rgb(164, 136, 235);
}

#mainIndex section button {
    background: none;
    border: none;
    fill:white;
    padding: 10px;
}


#mainSaved > h2 {
    padding: 10px;
}

#mainSaved section:first-of-type > h3 {
    padding: 10px 20px;
}

#fullMealsAccordion {
    padding: 0 20px;
}

#fullMealsAccordion section {
    display: grid;
    grid-template-columns: 1fr;
    max-height: 500px;
    overflow-y: scroll;
}

#mainSaved img {
    width: 100%;
    height: auto;
}

#fullMealsAccordion article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 300px;
    overflow: hidden;
    position: relative;
    margin: 5px 0;
}

#fullMealsAccordion img {
    position: absolute;
    top:50%;
    left:50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    object-fit: cover;
    opacity: 0.8;
}

#fullMealsAccordion h4, #fullMealsAccordion a, #fullMealsAccordion button {
    z-index: 1;
}

#fullMealsAccordion section h4 {
    grid-column: 1 / -1;
    color: rgb(244, 244, 244);
    background: linear-gradient(black, rgba(0,0,0,0));
    padding: 10px;
}

#fullMealsAccordion a, #fullMealsAccordion button {
    grid-row: 3 / 4;
    background-color: black;
    padding: 10px;
    margin: 10px;
    width: fit-content;
    border-radius: 6px;
}

#fullMealsAccordion button {
    width: fit-content;
    height: fit-content;
    justify-self: end;
    align-self: end;
    color: white;
}

#fullMealsAccordion a {
    align-self: end;
    text-decoration: underline;
    color: rgb(164, 136, 235);
}

#mainSaved .remove {
    border: none;
}




#savedFullMeals {
    padding: 20px;
    background-color: #ececec;
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 20px;
}

#savedFullMeals section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    background-color: rgb(156, 151, 255);
    border-radius: 10px;
}

#savedFullMeals article {
    height: 200px;
    overflow: hidden;
    position: relative; 
    z-index: 1;
    border-radius: 7px;
}

#savedFullMeals article div {
    display: flex;
    flex-direction: column;
    justify-content: end;
    width: 100%;
    height: 100%;
    background:linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.3), rgba(0,0,0,.7));
    color: white;
    padding: 10px;
}

#savedFullMeals img {
    position: absolute;
    top:50%;
    left:50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    object-fit: cover;
    z-index: -1;
}

#savedFullMeals a {
    text-decoration: underline;
    color: rgb(164, 136, 235);
}

#savedFullMeals button {
    padding: 10px;
    font-size: 1.2rem;
    border-radius: 7px;
    border: none;
}

footer p {
    text-align: center;
}

button:hover {
    cursor: pointer;
    background-color: black;
    color: white;
}

header a:hover {
    background-color: white;
}

#mainIndex a:hover {
    color: darkblue;
    text-decoration: none;
}

button:hover svg {
    fill: black;
    stroke: black;
}

#fullMealsAccordion a:hover {
    background-color: white;
    color: black;
}

#mainSaved .remove:hover {
    background-color: white;
    color: black;
}

#skip:focus {
    position: relative;
    top: 0;
    left: 0;
    width: fit-content;
    height: fit-content;
    overflow: hidden;
}

@media (min-width: 1000px) {
    #mainIndex {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        padding-left: 0;
        padding-right: 0;
        max-width: 1400px;
        margin: 0 auto;
    }
    #mainIndex section {
        grid-column: auto;
        height: 500px;
    }
    #mainIndex img {
        height: 100%;
        width: auto;
    }
    #mainIndex #generateMeal {
        grid-column: 1 / 3;
        width: 75%;
        justify-self: center;
    }
    #mainIndex #fullMealSave {
        grid-column: 3 / -1;
        width: 75%;
        justify-self: center;
    }


    #mainSaved > section:first-of-type {
        width: 1000px;
        margin: 0 auto;
    }

    #fullMealsAccordion section {
        grid-template-columns: 1fr 1fr;
        column-gap: 10px;
    }

    #savedFullMeals section {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}