/* Styling for noaa-forecast.js */

/* Forecast container styles to fill full width */
#noaa-forecast-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: Arial, sans-serif;
    width: 100%; /* Full width */
    box-sizing: border-box;
}

/* Forecast wrapper to contain date and forecast-day, spans full width */
.forecast-wrapper {
    width: 100%;
    max-width: 1200px; /* Optional: limit max width for readability */
    margin: 0 auto 35px auto; /* Center and add bottom margin */
    text-align: left; /* Align content to the left */
}

/* Style for the date above each forecast container */
.forecast-date {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

/* Individual forecast day layout for desktop */
.forecast-day {
    display: grid;
    grid-template-columns: 1fr 2fr 3fr; /* Three columns with different widths */
    grid-template-rows: auto auto; /* Two rows to stack icon and temperature */
    align-items: center;
    background-color: #eee;
    gap: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 15px;
    width: 100%; /* Full width of wrapper */
    box-sizing: border-box;
}

/* Column 1: Icon and temperature */
.forecast-day img {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    max-width: 100px;
    justify-self: center;
}

.forecast-day .temperature {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    font-weight: bold;
    justify-self: center;
}

/* Column 2: Forecast summary */
.forecast-day .summary {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    align-self: center;
    font-size: 1.2em;
}

/* Column 3: Forecast detail */
.forecast-day .detail {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    font-size: 0.9em;
    color: #555;
    line-height: 1.4;
}

/* Responsive layout for tablet and mobile viewports */
@media (max-width: 768px) {
    .forecast-day {
        grid-template-columns: 1fr 2fr; /* Two columns on smaller screens */
        grid-template-rows: auto auto; /* Stack rows as needed */
    }

    /* Column 1: Icon and temperature remains the same */
    .forecast-day img {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }

    .forecast-day .temperature {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }

    /* Column 2: Forecast summary and detail stack vertically */
    .forecast-day .summary {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        align-self: start; /* Align summary to the top */
    }

    .forecast-day .detail {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        align-self: start; /* Align detail below the summary */
    }
}
