@charset "utf-8";

/* =========================
   GLOBAL STYLES
   ========================= */
body {
    font-family: Verdana, Geneva, sans-serif;
    color: rgb(91, 91, 91);
    background-color: ivory; /* Accessibility background */
    margin: 0;
}

/* Image Reset */
img {
    max-width: 100%;
    height: auto;
}

header img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

header {
    text-align: center;
    padding: 20px;
}

h1, h2 {
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

/* =========================
   NAVIGATION (Hamburger Menu)
   ========================= */
nav {
    position: relative;
}

#menu-toggle {
    display: none;
}

/* FIX #2: Removed vertical margin dead zone */
#navicon {
    display: none;
    width: 40px;
    height: 30px;
    cursor: pointer;
    margin: 0 auto;
    flex-direction: column;
    justify-content: space-between;
}

#navicon span {
    display: block;
    height: 4px;
    background-color: #4682B4;
    border-radius: 2px;
}

nav ul.horizontal {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul.horizontal li {
    flex: 1 1 auto;
    min-width: 100px;
    text-align: center;
}

nav ul.horizontal a {
    display: block;
    background-color: #4682B4;
    line-height: 2.8em;
    text-decoration: none;
    color: white;
}

nav ul.horizontal a:hover {
    background-color: #2f5d87;
    color: ivory;
}

/* =========================
   TABLE STYLES
   ========================= */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    background-color: #FFFFFF;
    border: 2px solid #4682B4;
    border-collapse: collapse;
}

th, td {
    border: 1px solid #4682B4;
    padding: 12px;
    text-align: left;
}

thead {
    background-color: #4682B4;
    color: white;
}

tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

tfoot {
    background-color: #e7e7e7;
    font-weight: bold;
}

/* =========================
   VACATION FLEX GALLERY
   ========================= */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.gallery img {
    flex: 0 1 22%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

/* =========================
   MAIN & FOOTER
   ========================= */
main {
    padding: 20px;
}

footer {
    clear: both;
    background-color: #4682B4;
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
}

footer a {
    color: white;
    text-decoration: none;
}

/* =========================
   MEDIA QUERIES
   ========================= */
@media only screen and (max-width: 768px) {
    #navicon {
        display: flex;
    }

    nav ul.horizontal {
        display: none;
        flex-direction: column;
    }

    #menu-toggle:checked + #navicon + ul.horizontal {
        display: flex;
    }

    .gallery img {
        flex: 0 1 90%;
        height: auto;
    }
}

/* FIX #5: Background image correctly applied to html */
@media only screen and (min-width: 769px) {
    html {
        background-image: url("background.jpg");
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
    }

    body {
        width: 90%;
        margin: 0 auto;
    }

    main > img {
        width: 25%;
        float: right;
        margin-left: 20px;
        border-radius: 5px;
    }
}
