/* =====================================================================
   BASE
   ===================================================================== */

:root {
    font-family: "Times New Roman", Times, serif;
}

body {
    font-family: "Times New Roman", Times, serif;
    background-color: #ffffff;
    color: #000000;
    font-size: 1.1rem;

    margin: 0 3.5%;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

/* =====================================================================
   HEADER
   ===================================================================== */

header {
    padding-top: 1.2rem;
}

h1 {
    font-size: 1.8rem;
    color: #000000;
    margin-bottom: 4px;
}

h2 {
    font-size: 1rem;
    font-weight: normal;
    font-style: italic;
    color: #333333;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #999999;
}

/* =====================================================================
   NAVIGATION
   ===================================================================== */

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    text-align: left;
    font-size: 1rem;
    margin: 12px 0;
}

nav a {
    color: #0000ee;
    text-decoration: underline;
}

nav a:visited {
    color: #660099;
}

nav a:hover {
    color: #ff0000;
}

/* =====================================================================
   PAGE LAYOUT (main / article / aside)
   ===================================================================== */

main {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-top: 10px;
}

article {
    padding-right: 30px;
    border-right: 1px solid #999999;
}

aside {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

aside img {
    max-width: 100%;
    height: auto;
}

.widget {
    padding-top: 2px;
}

.widget p {
    text-align: left;
}

.widget:first-child {
    border-top: none;
    padding-top: 0;
}

.widget h3 {
    font-size: 1.2rem;
    margin: 0 0 8px;
    color: #000000;
}

/* =====================================================================
   BODY TYPOGRAPHY
   ===================================================================== */

p {
    color: #000000;
    font-size: 1.15rem;
    line-height: 1.5;
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}

figcaption {
    font-size: 0.85rem;
    font-style: italic;
    color: #555555;
    margin-top: 4px;
}

/* =====================================================================
   FOOTER
   ===================================================================== */

footer {
    margin-top: 50px;
    font-size: 0.9rem;
    color: #555555;
    padding: 12px 0;
    text-align: right;
    border-top: 1px solid #999999;
}

/* =====================================================================
   ICON LINKS (CV, etc.)
   ===================================================================== */

.icon-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: underline;
    color: #0000ee;
    font-size: 1rem;
}

.icon-link:visited {
    color: #660099;
}

.link-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* =====================================================================
   QUOTE OF THE DAY
   ===================================================================== */

.quote-box {
    border: 1px solid #020352;
    background-color: #bae2e43c;
    padding: 16px 20px;
    margin: 24px 0;
}

.quote-label {
    font-weight: bold;
    font-size: 0.95rem;
    margin: 0 0 8px;
}

.quote-text {
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.4;
    margin: 0 0 8px;
}

.quote-author {
    text-align: right;
    color: #2f0101;
    font-size: 1.2rem;
    margin: 0;
}

.quote-author::before {
    content: "\2014 ";
}

/* =====================================================================
   ART OF THE DAY (The Met)
   ===================================================================== */

.art-widget {
    width: 350px;
    padding: 14px 16px 16px;
    border: 1px solid #999999;
    text-align: center;
}

.art-widget h3 {
    text-align: left;
    margin-bottom: 10px;
}

.art-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 8px;
    border: 1px solid #cccccc;
}

.art-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin: 4px 0 2px;
}

.art-artist {
    font-style: italic;
    color: #555555;
    font-size: 0.85rem;
    margin: 0 0 8px;
}

.art-link {
    font-size: 0.85rem;
    color: #0000ee;
    text-decoration: underline;
}

.art-link:visited {
    color: #660099;
}

/* =====================================================================
   ON THIS DAY
   ===================================================================== */

#onthisday-link {
    color: #0000ee;
    text-decoration: underline;
    font-size: 0.9rem;
}

#onthisday-link:visited {
    color: #7c03b9;
}

/* =====================================================================
   EARTHQUAKE FLOATED BOX STACK
   ===================================================================== */

.side-api-stack {
    float: right;
    width: 325px;
    margin-left: 20px;
    margin-bottom: 15px;
}

.widget-box {
    border: 1px solid #999999;
    padding: 14px 16px 16px;
    margin-bottom: 15px;
    background-color: #b559591c;
}

.widget-box:last-child {
    margin-bottom: 0;
}

.widget-box h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.quake-widget h3 #quake-date {
    font-weight: normal;
    color: #555555;
    font-size: 0.85rem;
}

.quake-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    font-size: 0.9rem;
}

.quake-list li {
    margin-bottom: 6px;
}

.quake-list .quake-mag {
    font-weight: bold;
}

.quake-link {
    font-size: 0.85rem;
    color: #0000ee;
    text-decoration: underline;
}

.quake-link:visited {
    color: #660099;
}

/* =====================================================================
   NASA GIBS DAILY EARTH IMAGE (GOES-East live view)
   ===================================================================== */

.gibs-widget {
    float: right;
    clear: right;
    width: 600px;
    margin-left: 20px;
    margin-bottom: 15px;
    border: 1px solid #999999;
    padding: 14px 16px 16px;
    background-color: #fafafa;
}

.gibs-widget h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

/* Wraps the image so the live badge can sit on top of it */
.gibs-image-wrap {
    position: relative;
}

.gibs-image {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #cccccc;
    margin-bottom: 8px;
}

/* Pulsing "LIVE · [time]" badge overlaid on the top-left of the image */
.gibs-live-badge {
    position: absolute;
    top: 1px;
    left: 1px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(0, 0, 0, 0.107);
    color: #ff4d4d;
    font-weight: bold;
    font-size: 0.60rem;
    padding: 5px 12px;
    border-radius: 4px;
}

.gibs-live-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ff4d4d;
    animation: gibs-pulse 2.5s ease-in-out infinite;
}

@keyframes gibs-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.gibs-caption {
    font-size: 0.85rem;
    color: #060606;
    margin: 0 0 8px;
}

.gibs-link {
    font-size: 0.85rem;
    color: #0000ee;
    text-decoration: underline;
}

.gibs-link:visited {
    color: #660099;
}

/* =====================================================================
   WEATHER WIDGET
   ===================================================================== */

.weather-widget {
    width: 375px;
    box-sizing: border-box;
    padding: 14px 16px 16px;
    border: 1px solid #999999;
}

.weather-widget h3 {
    margin: 0 0 10px;
}

/* ---- Main icon + big temperature ---- */

.wx-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.wx-main-icon {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
}

.wx-main-temp {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
}

.weather-temp-f {
    font-size: 1.2rem;
    font-weight: normal;
    color: #555555;
    margin-left: 4px;
}

/* ---- Description / feels like / updated ---- */

.weather-desc {
    font-family: monospace;
    font-style: italic;
    color: #000000;
    margin: 0px 0 8px;
    font-size: 1.2rem;
}

.weather-feels {
    font-size: 1.2rem;
    color: #555555;
    margin: 0 0 10px;
}

.weather-feels #weather-feels-c {
    font-weight: bold;
    color: #000000;
    font-size: 1.2rem;
}

.weather-updated {
    font-size: 0.95rem;
    color: #888888;
    margin: 0 0 0px;
    display: flex;
    justify-content: flex-end;
}

/* ---- Stat rows (humidity, wind, sunrise, sunset, moon, AQI, dust, etc.) ---- */

.weather-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.85rem;
    color: #333333;
    border-top: 1px solid #cccccc;
    padding-top: 8px;
    margin-top: 8px;
}

.weather-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wx-stat-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.weather-moon-row {
    align-items: center;
}

.moon-illum {
    color: #020e3b;
    font-size: 1rem;
    text-shadow: 0 0 5px #a3541871;
}

.weather-extra {
    width: 100%;
    margin-top: 0;
}

.weather-alert {
    margin: 8px 0 0;
    font-size: 0.85rem;
    padding-top: 8px;
    border-top: 1px solid #cccccc;
}

.weather-alert.has-alert {
    color: #a13d2b;
    font-weight: bold;
}

/* ---- 7-day forecast strip ---- */

.weather-forecast {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #cccccc;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 1rem;
    color: #333333;
}

.forecast-day .forecast-label {
    font-weight: bold;
}

.forecast-icon {
    width: 64px;
    height: 64px;
}

.forecast-day .forecast-lo {
    color: #888888;
}

/* ---- Cat Fact of the Day additions (box/label/text reuse .quote-box etc.) ---- */

.cat-fact-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cat-fact-icon {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cat-fact-row .quote-text {
    margin: 0;
}


/* =====================================================================
   MOBILE (max-width: 700px)
   Every mobile override lives here now, in one place. Desktop rules
   above are untouched.
   ===================================================================== */

@media (max-width: 700px) {

    /* ---- Base / layout ---- */

    body {
        margin: 0 5%;
    }

    main {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    article {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #999999;
        padding-bottom: 20px;
        margin-bottom: 10px;
    }

    /* ---- Navigation: bigger, easier tap targets ---- */

    nav {
        gap: 0.6rem 1rem;
        font-size: 1rem;
    }

    nav a {
        display: inline-block;
        padding: 4px 2px;
    }

    /* ---- Typography ---- */

    h1 {
        font-size: 1.5rem;
    }

    p {
        font-size: 1.05rem;
    }

    /* ---- Footer ---- */

    footer {
        text-align: left;
    }

    /* ---- Art of the day: full width instead of fixed 350px ---- */

    .art-widget {
        width: 100%;
        box-sizing: border-box;
    }

    /* ---- Earthquake stack: full width instead of fixed 325px ---- */

    .side-api-stack {
        float: none;
        width: 100%;
        margin-left: 0;
    }

    /* ---- NASA GIBS: full width instead of fixed 600px ---- */

    .gibs-widget {
        float: none;
        width: 100%;
        margin-left: 0;
        box-sizing: border-box;
    }

    /* ---- Weather widget: full width instead of fixed 375px ---- */

    .weather-widget {
        width: 100%;
    }

    .weather-forecast {
        justify-content: flex-start;
        gap: 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .forecast-day {
        flex: 0 0 auto;
    }

    .cat-fact-icon {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    margin-top: 1px;
    }
    
}
