
@charset "utf-8";

/* Structural Styles */

/* Includes padding and borders within an element's dimensions */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-width: 640px;
    min-height: 100vh;  /* scaled to fit available screen size*/
}

main {
    width: 80%;			/* allows for spacing on the sides */
    max-width: 1200px;  /* prevents main content from stretching too wide*/
    margin: 0 auto;		/* centers container*/
}

body > header > img { /* Logo image (Mount Rainier pic) */
    width: 100%;
    height: 600px;			/* img does not grow too large*/
    display: block;
    margin: 0;
    object-fit: cover;		/* img scales to cover area*/
    object-position: center top;	/* as img scales it zooms into top center*/
}

#leftcol { /* Welcome to Good Hike Trails and list of trails */
    width: 100%;  	/* section fills entire width of parent container */
    padding: 20px;
}

h1 {
    text-align: center; /*center main header */
}

footer {
    clear: both;
    text-align: center; 
    padding: 10px;
}

/* Header and Navigation */

header > nav {
    display: table;
    width: 100%;
    padding: 10px; /* added padding to make nav wider*/
}

header > nav > ul {
    display: table-row;
    list-style-type: none;
}

header > nav > ul > li {
    display: table-cell;
    text-align: center;
}

header > nav a {
    display: block;
    width: 100%;
}

/* Two floating boxes: List of trails and Learn more */
.sidebar-container {
    display: flex; 			/* Activates Flexbox layout */
    flex-direction: column;
    gap: 20px;				/* Adds spacing between the two boxes */
    width: 100%;			/* Ensures the container takes up full width */
}

.listsoftrails, .LearnMore {
	border: 1px solid #ccc;/* Adds a visible border */
    border-radius: 5px;     /* Rounds the corners slightly */
	padding: 15px;			/* Adds breathing room inside the boxes */
}

.listsoftrails {
    height: 600px;
    overflow-y: auto;
}

.listsoftrails h2, .LearnMore h2 {
    padding-left: 0px; 
}

.trail-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: start;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgb(225, 188, 4);
    padding-bottom: 20px;
}

.trail-card img {
    width: 90%;
    max-height: 300px;
    margin: 0 auto;
    object-fit: cover;
    object-position: center;
    border-radius: 5px;
    border: 3px solid rgb(227, 225, 215);
}

/* MOBILE MEDIA QUERY */
@media screen and (max-width: 767px) {

    body {
        min-width: 0;
    }

    body > header > img {
        height: 250px;
    }

    header > nav > ul {
        display: block;
        padding: 0;
        line-height: 2.0;
        margin: 0;
    }

    header > nav > ul > li {
        display: block;
        padding: 0px;
    }

    main {
        width: 95%;
    }

    body main #leftcol h1 {
        font-size: 26px;
    }

    .trail-card {
        grid-template-columns: 1fr;
    }

    .trail-card img {
    width: 100%;
    }

    .listsoftrails,
    .LearnMore {
        width: 100%;
    }

    .listsoftrails {
        height: 500px;
        flex: none;
        overflow-y: auto;
    }

    footer {
        font-size: 12px;
    }

}