/* WHOLE PAGE */
/* box-sizing makes padding and borders count inside the width,
   so the three columns add up to exactly 100% */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #dddddd;
}

/* The wrapper is centered with auto left/right margins */
#wrapper {
    font-family: Arial, sans-serif;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    line-height: 1.5;
}

/* HEADER */
#header {
    text-align: center;
    padding: 20px 10px 14px;
    border-bottom: 4px double #000000;
    font-family: "Times New Roman", Georgia, serif;
}

#header h1 {
    font-size: 4em;
    margin: 0;
}

.slogan {
    margin: 4px 0 0;
    font-style: italic;
    color: #555555;
}

/* NAV SECTION */
#menu {
    font-family: Arial, sans-serif;
    width: 100%;
}

#menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#menu > ul {
    display: flex;
    justify-content: space-evenly;
    width: 100%;
    background: #000000;
}

#menu ul ul {
    position: absolute;
    top: 30px;
    left: 0;
    visibility: hidden;
    min-width: 250px;
    width: max-content;
}

#menu ul ul a {
    white-space: nowrap;
}

#menu ul li:hover ul {
    visibility: visible;
    z-index: 1000;
}

#menu ul li:focus-within > ul {
    visibility: visible;
    z-index: 1000;
}

#menu li {
    position: relative;
    list-style: none;
}

#menu li a {
    display: block;
    padding: 0 15px;
    min-height: 30px;
    text-decoration: none;
    text-align: center;
    line-height: 30px;
    background-color: #000000;
    color: #fff;
    font-weight: 700;
}

#menu li a:hover {
    background-color: #BE8400;
    color: #000000;
    font-style: italic;
    text-decoration: underline;
}

/* LEFT SIDEBAR */
#leftbar {
    width: 22%;
    min-height: 620px;
    float: left;
    padding: 20px 18px;
    border-right: 1px solid #000;
}

#leftbar h2 {
    margin-top: 0;
    padding-bottom: 6px;
    border-bottom: 3px solid #000000;
}

.intro {
    font-size: 0.95em;
}

/* CENTER PAGE */
#center_page {
    width: 56%;
    min-height: 620px;
    float: left;
    padding: 20px;
}

.card {
    float: left;
    width: 48%;
    margin: 0 4% 20px 0;
}

.card.second {
    margin-right: 0;
}

.photo {
    position: relative;
}

/* every photo gets the same height so the cards line up */
.card img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin-bottom: 8px;
    border: 1px solid #222222;
    border-radius: 10px;
}

/* little bookmark circle on the corner of each photo */
.bookmark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    color: #ffffff;
    background: #000000;
    border-radius: 50%;
}

.card h3 {
    margin: 0 0 6px;
    font-size: 1.15em;
    line-height: 1.3;
}

.card p {
    margin: 0;
    font-size: 0.95em;
}

.card a {
    color: #000000;
}

.card a:hover {
    font-style: italic;
}

/* RIGHT SIDEBAR */
#rightbar {
    width: 22%;
    min-height: 620px;
    float: right;
    padding: 20px 18px;
    border-left: 1px solid #000;
}

#rightbar h2 {
    margin-top: 0;
    font-size: 1.2em;
}

#top_stories {
    margin-bottom: 24px;
    padding: 14px;
    background: #f2f2f2;
    border: 1px solid #cccccc;
}

#top_stories ol {
    margin: 0;
    padding-left: 20px;
    font-size: 0.92em;
}

#top_stories li {
    margin-bottom: 8px;
}

.newsletter {
    margin-top: 1em;
    text-align: center;
}

.newsletter p {
    margin-top: 1em;
    font-size: 0.92em;
}

.button {
    display: inline-block;
    padding: 8px 18px;
    background: #ffffff;
    color: #000000;
    font-family: Arial, sans-serif;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid #000000;
}

.button:hover {
    background: #000000;
    color: #ffffff;
}

/* FOOTER */
/* clear: both makes the footer sit below all the floated columns.
   The black background fixes the white text, which was invisible before. */
#footer {
    clear: both;
    padding: 20px;
    background: #000000;
    color: #ffffff;
    font-size: 0.9em;
    overflow: hidden;
    border-top: 1px double #000;
}

.footcol {
    float: left;
    width: 33.33%;
    padding-right: 20px;
}

.footcol h4 {
    margin: 0 0 6px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footcol p {
    margin: 0;
}

#footer a {
    color: #ffffff;
}

.copyright {
    clear: both;
    margin: 0;
    padding-top: 14px;
    text-align: center;
    font-size: 0.85em;
    color: #999999;
}

/* MEDIA QUERY: on screens 800px or narrower, stack everything */
@media screen and (max-width: 800px) {

    /* stops the hidden dropdown menus from causing a sideways scrollbar */
    #wrapper {
        overflow-x: hidden;
    }

    #header h1 {
        font-size: 2.4em;
    }

    #menu > ul {
        flex-wrap: wrap;
    }

    #leftbar,
    #center_page,
    #rightbar {
        float: none;
        width: 100%;
        min-height: 0;
        border: none;
    }

    .card {
        float: none;
        width: 100%;
        margin-right: 0;
    }

    .footcol {
        float: none;
        width: 100%;
        padding-bottom: 10px;
    }
}

/* MEDIUM SCREEN: KEEPS COLUMNS */
@media only screen and (min-width: 450px) and (max-width: 800px) {
    #wrapper {
        width: 95%;
    }

    #header h1 {
        font-size: 3em;
    }

    #menu > ul {
        flex-wrap: wrap;
    }

    #leftbar {
        width: 30%;
        min-height: 0;
    }

    #center_page {
        width: 70%;
        min-height: 0;
    }

    #rightbar {
        float: none;
        clear: both;
        width: 100%;
        min-height: 0;
        border: none;
        border-top: 1px solid #000;
    }
}

/* SMALL SCREEN: ALL ONE COLUMN */
@media only screen and (max-width: 449px) {
    #wrapper {
        width: 100%;
        overflow-x: hidden;
    }

    #header h1 {
        font-size: 2.2em;
    }

    #menu > ul {
        flex-wrap: wrap;
    }

    #leftbar,
    #center_page,
    #rightbar {
        float: none;
        width: 100%;
        min-height: 0;
        border: none;
    }

    .card {
        float: none;
        width: 100%;
        margin-right: 0;
    }

    .footcol {
        float: none;
        width: 100%;
        padding-bottom: 10px;
    }
}