/* -------------------- IMPORT FONTS -------------------- */
@import url('https://fonts.googleapis.com/css2?family=Manufacturing+Consent&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* -------------------- GLOBAL STYLES -------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Merriweather", "serif", "sans-serif"; /* Global font */
}

/* -------------------- HEADER -------------------- */
header {
    position: fixed;              /* Stays at the top when scrolling */
    top: 0;
    left: 0;
    width: 100%;
    height: 4rem;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 1000;                /* Keeps header above content */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); /* Soft shadow */
}

.logo {
    font-size: 1.5rem;
    color: darkblue;
}

.navigation {
    display: flex;
    width: 40rem;
    justify-content: space-evenly;
}

.navigation a {
    text-decoration: none;
    color: darkblue;
    font-weight: 500;
    transition: transform 0.3s ease-in-out; /* Smooth hover animation */
}

.navigation a:hover {
    color: #3949AB;
    transform: scale(1.15); /* Slight zoom effect */
    border-top: 3px solid rgb(211, 207, 207); /* Top border on hover */
}

/* -------------------- MAIN LAYOUT -------------------- */
.main {
    padding-top: 4rem; /* Avoids overlap with fixed header */
}

.gray-box {
    max-width: 100%;
    height: 3rem;
    background-color: rgb(246, 243, 243);
    margin-top: 4rem;
}

/* White box section for main text */
.white-box {
    max-width: 100%;
    height: auto;
    padding: 2rem;
}

.white-box h1 {
    color: darkblue;
    text-align: center;
    font-size: 2rem;
    margin: 1rem;
}

/* Image floating to the right on large screens */
.image {
    float: right;
    margin: 3rem 4rem;
    border-radius: 20px;
    max-width: 30rem;
    height: 20rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease-in-out;
}

.image:hover {
    transform: scale(1.05); /* Slight zoom on hover */
    opacity: 0.9;           /* Dim effect */
}

/* Scrollable container for long text */
.scroll {
    max-height: 30rem; /* Restricts height */
    overflow-y: auto;  /* Enables vertical scrolling */
    padding-right: 1rem;
}

/* Text inside white box */
.white-box p, 
.white-box ul {
    margin: 2rem 3rem;
    text-align: justify;
    font-size: 1rem;
    line-height: 1.8;
    text-transform: capitalize;
}

.white-box h3 {
    color: darkblue;
    font-size: 1.5rem;
    margin-left: 3rem;
}

/* -------------------- READING STATS SECTION -------------------- */
.reading-stats {
    background-color: rgb(246, 243, 243);
    max-width: 100%;
    min-height: 22rem; /* Prevents collapsing if content is small */
    height: auto;
    padding: 2rem 0;
}

.reading-stats h2 {
    color: darkblue;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

/* Table styling */
table {
    width: 40%;
    border-collapse: collapse;
    margin: 1rem 3rem;
    float: right; /* Positions table on the right */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

table th, table td {
    border: 1px solid #ccc;
    padding: 0.8rem;
    text-align: center;
}

table th {
    background-color: rgb(9, 9, 137);
    color: whitesmoke;
}

/* Paragraph text in stats section */
.reading-stats p {
    font-size: 1rem;
    line-height: 1.8;
    margin: 1rem 3rem;
    text-align: justify;
}

/* -------------------- FOOTER -------------------- */
footer {
    background-color: rgb(3, 3, 110);
    color: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 4rem;
    width: 100%;
}

.icon-cap {
    color: whitesmoke;
    text-decoration: none;
}

.icon-cap:hover {
    border-bottom: 3px solid whitesmoke;
}

/* -------------------- RESPONSIVENESS -------------------- */

/* Tablets (≤1024px) */
@media (max-width: 1024px) {
    .image {
        max-width: 50%;
        height: auto;
    }
    table {
        width: 60%;
    }
}

/* Mobiles (≤768px) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }
    .navigation {
        width: 100%;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap; /* Makes nav wrap instead of overflow */
    }
    .image {
        float: none;       /* Image moves below text */
        display: block;
        max-width: 90%;
        margin: 1rem auto;
        height: auto;
    }
    table {
        width: 100%;
        float: none;
        margin: 1rem auto;
    }
    footer {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }
}

/* Small Phones (≤480px) */
@media (max-width: 480px) {
    .white-box h1,
    .reading-stats h2 {
        font-size: 1.5rem;
    }
    table {
        font-size: 0.9rem;
        width: 100%;
    }
    .scroll {
        max-height: 20rem; /* Reduces scrollable area */
    }
}
