/*
    CIS 89A CSS Layout Project

    This project demonstrates:
    - Flexbox
    - Float
    - Padding
    - Margin
    - Borders
    - Text formatting
    - Positioning
*/

/* Makes padding and borders easier to control */
* {
    box-sizing: border-box;
}

/* Smoothly scrolls to sections when navigation links are clicked */
html {
    scroll-behavior: smooth;
}

/* Basic page styling */
body {
    margin: 0;
    background-color: #f3f7f5;
    color: #263238;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

/* Header styling */
.main-header {
    padding: 40px 8%;
    color: white;
    text-align: center;
    background: linear-gradient(135deg, #174f3c, #2f7d5c);
    border-bottom: 6px solid #f1c75b;
}

.main-header h1 {
    margin: 0;
    font-size: 42px;
    letter-spacing: 1px;
}

.main-header p {
    margin: 8px 0 22px;
    font-size: 18px;
}

/*
    FLEXBOX DEMONSTRATION

    The navigation links are placed inside a flex container.
*/
nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

nav a {
    padding: 9px 18px;
    color: white;
    font-weight: bold;
    text-decoration: none;
    border: 2px solid white;
    border-radius: 25px;
}

nav a:hover {
    color: #174f3c;
    background-color: white;
}

/* Main content container */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 25px;
}

/* General section formatting */
section {
    margin: 30px 0;
    padding: 28px;
    background-color: white;
    border: 1px solid #ccd8d1;
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
}

/* Heading text formatting */
h2 {
    margin-top: 0;
    padding-bottom: 8px;
    color: #174f3c;
    border-bottom: 3px solid #f1c75b;
}

/*
    FLOAT DEMONSTRATION

    The image floats on the left and the paragraphs wrap around it.
*/
.float-image {
    float: left;
    width: 40%;
    max-width: 360px;
    margin: 5px 24px 15px 0;
    padding: 7px;
    border: 4px solid #7aa18d;
    border-radius: 12px;
    background-color: #edf4f0;
}

/* Clears the float after the about section */
.about-section::after {
    display: block;
    clear: both;
    content: "";
}

/*
    FLEXBOX CARD LAYOUT

    The destination cards appear in a flexible row.
*/
.card-container {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 20px;
}

/* Individual destination cards */
.card {
    position: relative;
    flex: 1 1 250px;
    min-height: 285px;
    margin: 5px 0;
    padding: 24px;
    background-color: #fbfdfb;
    border: 2px solid #bad0c3;
    border-radius: 12px;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Large icons inside the cards */
.card-icon {
    font-size: 42px;
}

.card h3 {
    margin: 8px 0;
    color: #236147;
}

/* Button styling */
.button {
    display: inline-block;
    margin-top: 12px;
    padding: 9px 14px;
    color: white;
    font-weight: bold;
    text-decoration: none;
    background-color: #2f7d5c;
    border: 2px solid #2f7d5c;
    border-radius: 8px;
}

.button:hover {
    color: #2f7d5c;
    background-color: white;
}

/*
    PADDING, MARGIN, AND BORDER DEMONSTRATION
*/
.tips-box {
    max-width: 750px;
    margin: 20px auto 0;
    padding: 18px 25px;
    background-color: #fff9e8;
    border-top: 2px solid #f1c75b;
    border-right: 2px solid #f1c75b;
    border-bottom: 2px solid #f1c75b;
    border-left: 9px solid #f1c75b;
}

.tips-box ul {
    margin: 0;
    padding-left: 25px;
}

.tips-box li {
    margin: 8px 0;
}

/* Footer styling */
footer {
    margin-top: 30px;
    padding: 22px;
    color: white;
    text-align: center;
    background-color: #263238;
    border-top: 5px solid #f1c75b;
}

footer p {
    margin: 0;
}

/*
    RESPONSIVE DESIGN

    Changes the layout for smaller screens.
*/
@media screen and (max-width: 650px) {

    .main-header {
        padding: 30px 20px;
    }

    .main-header h1 {
        font-size: 32px;
    }

    nav {
        flex-direction: column;
    }

    nav a {
        width: 100%;
    }

    section {
        padding: 20px;
    }

    /*
        Removes the float on small screens so the image
        appears above the text.
    */
    .float-image {
        float: none;
        display: block;
        width: 100%;
        max-width: 450px;
        margin: 0 auto 20px;
    }
}