
/* =========================================
   MEDINFO DAILY — PROFESSIONAL WEBSITE CSS
   ========================================= */

:root {
    --navy: #123b5d;
    --navy-dark: #0c2c46;
    --blue: #176b9a;
    --green: #247653;
    --green-light: #eaf5ee;
    --page: #f5f8fb;
    --white: #ffffff;
    --text: #273746;
    --muted: #586b7b;
    --border: #dce5ed;
    --shadow: 0 4px 18px rgba(18, 59, 93, 0.07);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.75;
}

img {
    max-width: 100%;
    height: auto;
}

/* HEADER */

header {
    padding: 28px 20px;
    background: var(--navy);
    color: var(--white);
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.3;
}

header h1 a {
    color: var(--white);
    text-decoration: none;
}

header p {
    margin: 7px 0 0;
    color: #e0ebf4;
    font-size: 16px;
}

/* NAVIGATION */

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

nav a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
}

nav a:hover,
nav a:focus-visible,
nav a[aria-current="page"] {
    background: var(--green-light);
    color: var(--green);
}

/* MAIN LAYOUT */

main {
    width: min(1100px, 92%);
    margin: 32px auto;
}

main > section {
    margin-bottom: 38px;
}

main section > h2 {
    color: var(--navy);
    font-size: clamp(23px, 3vw, 30px);
    line-height: 1.4;
    margin: 0 0 16px;
}

/* HOMEPAGE HERO */

.hero {
    margin: 0 0 38px;
    padding: clamp(30px, 6vw, 64px) 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--navy), #216b91);
    color: var(--white);
    text-align: center;
}

.hero .hero-label {
    color: #cce8f5;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero h2 {
    max-width: 780px;
    margin: 12px auto 18px;
    color: var(--white);
    font-size: clamp(28px, 4vw, 43px);
    line-height: 1.25;
}

.hero p {
    max-width: 700px;
    margin: 14px auto;
    color: #edf5fb;
    font-size: 17px;
}

.hero .hero-button {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 23px;
    border: 2px solid var(--white);
    border-radius: 8px;
    background: var(--white);
    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
}

.hero .hero-button:hover {
    background: var(--green-light);
    border-color: var(--green-light);
}

/* FEATURED ARTICLE */

.featured-article {
    padding: clamp(18px, 4vw, 30px);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.featured-article .category,
.category {
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.featured-article h3 {
    margin: 8px 0 16px;
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.4;
}

.featured-article h3 a {
    color: var(--navy);
    text-decoration: none;
}

.featured-article h3 a:hover {
    color: var(--blue);
    text-decoration: underline;
}

.featured-article img {
    display: block;
    width: 100%;
    max-width: 760px;
    max-height: 430px;
    margin: 18px 0;
    border-radius: 10px;
    object-fit: cover;
}

.featured-article p {
    line-height: 1.85;
}

/* ARTICLE LINKS */

.read-more,
.all-articles-link a,
#database-articles article > a:last-child {
    display: inline-block;
    margin-top: 10px;
    padding: 9px 0;
    color: var(--blue);
    background: transparent;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.read-more:hover,
.all-articles-link a:hover,
#database-articles article > a:last-child:hover {
    color: var(--green);
}

/* LATEST ARTICLES */

.latest-articles > p {
    color: var(--muted);
}

#database-articles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
}

#database-articles > article {
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--shadow);
    overflow-wrap: anywhere;
}

#database-articles article h2 {
    margin: 0 0 12px;
    font-size: 21px;
    line-height: 1.45;
}

#database-articles article h2 a {
    color: var(--navy);
    text-decoration: none;
}

#database-articles article h2 a:hover {
    color: var(--blue);
    text-decoration: underline;
}

#database-articles .article-card-image {
    display: block;
    width: 100%;
    height: 190px;
    margin: 12px 0;
    border-radius: 8px;
    object-fit: cover;
}

#database-articles article p {
    color: var(--muted);
    line-height: 1.8;
}

.all-articles-link {
    margin-top: 22px;
}

/* HEALTH TOPIC CARDS */

.topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.topic-card {
    display: block;
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(18, 59, 93, 0.12);
}

.topic-card h3 {
    margin: 0 0 8px;
    color: var(--navy);
    line-height: 1.4;
}

.topic-card p {
    margin: 0;
    color: var(--muted);
}

/* HEALTH DISCLAIMER */

.health-disclaimer {
    padding: 24px;
    border-left: 4px solid var(--green);
    border-radius: 8px;
    background: var(--green-light);
}

.health-disclaimer h2 {
    margin-top: 0;
    color: var(--navy);
    font-size: 22px;
}

/* GENERAL CONTENT PAGES */

main > article,
main > section > article {
    overflow-wrap: anywhere;
}

main article img {
    max-width: 100%;
    height: auto;
}

main article p {
    line-height: 1.85;
}

main article h2,
main article h3 {
    color: var(--navy);
    line-height: 1.45;
}

main article a {
    color: var(--blue);
}

/* FULL MEDICAL ARTICLE PAGE */

#article-content {
    min-width: 0;
    overflow-wrap: anywhere;
}

#article-content > h1 {
    color: var(--navy);
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.35;
}

#article-content > img,
#article-content .article-image,
#article-content .featured-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: 10px;
}

#article-content > div h2 {
    margin: 32px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--navy);
    font-size: 25px;
    line-height: 1.45;
}

#article-content > div h3 {
    margin-top: 25px;
    color: var(--navy);
}

#article-content > div p {
    margin: 0 0 20px;
    font-size: 17px;
    line-height: 1.9;
}

#article-content > div ul,
#article-content > div ol,
#article-content div ul,
#article-content div ol {
    display: block;
    padding-left: 32px;
    margin: 14px 0 26px;
}

#article-content > div ul,
#article-content div ul {
    list-style: disc outside;
}

#article-content > div ol,
#article-content div ol {
    list-style: decimal outside;
}

#article-content > div li,
#article-content div li {
    display: list-item;
    margin-bottom: 10px;
    padding-left: 4px;
    line-height: 1.8;
}

#article-content blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 4px solid var(--green);
    border-radius: 0 8px 8px 0;
    background: var(--green-light);
    color: var(--text);
    font-style: italic;
    line-height: 1.8;
}

#article-content a {
    color: var(--blue);
    text-decoration: underline;
    overflow-wrap: anywhere;
}

#article-content a:hover {
    color: var(--green);
}

/* BACK TO HOME LINKS */

.back-home {
    display: block;
    margin: 0 0 24px;
    padding: 10px 0;
    background: transparent;
}

.back-home a,
a.back-home {
    display: inline-block;
    color: var(--green);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}

.back-home a:hover,
a.back-home:hover {
    text-decoration: underline;
}

.bottom-back-home {
    margin-top: 32px;
    margin-bottom: 24px;
}

/* FOOTER */

footer {
    margin-top: 48px;
    padding: 28px 16px;
    background: var(--navy-dark);
    color: var(--white);
    text-align: center;
}

footer p {
    margin: 6px 0;
}

footer a {
    color: #dceaf5;
}

footer a:hover {
    color: var(--white);
}

/* ACCESSIBILITY */

a:focus-visible {
    outline: 3px solid #f0b429;
    outline-offset: 3px;
}

/* TABLETS */

@media (max-width: 850px) {
    #database-articles,
    .topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* MOBILE PHONES */

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    header {
        padding: 23px 14px;
    }

    header h1 {
        font-size: 29px;
    }

    header p {
        font-size: 15px;
    }

    nav {
        gap: 3px;
        padding: 9px 5px;
    }

    nav a {
        padding: 8px 9px;
        font-size: 14px;
    }

    main {
        width: 92%;
        margin: 22px auto;
    }

    .hero {
        margin-bottom: 28px;
        padding: 30px 19px;
        border-radius: 12px;
    }

    .hero h2 {
        font-size: 29px;
    }

    .hero p {
        font-size: 16px;
    }

    .featured-article {
        padding: 18px;
    }

    .featured-article img {
        max-height: 280px;
    }

    #database-articles,
    .topic-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #database-articles > article {
        padding: 18px;
    }

    #database-articles .article-card-image {
        height: 210px;
    }

    #article-content > h1 {
        font-size: 28px;
    }

    #article-content > div h2 {
        font-size: 23px;
    }

    #article-content > div p,
    #article-content > div li,
    #article-content blockquote {
        font-size: 17px;
        line-height: 1.8;
    }

    #article-content > div ul,
    #article-content > div ol {
        padding-left: 27px;
    }

    .health-disclaimer {
        padding: 19px;
    }

    footer {
        padding: 24px 14px;
    }
}

/* Add space after the final Back to Home link */
#article-content .bottom-back-home {
    margin-top: 35px !important;
    margin-bottom: 45px !important;
    padding-bottom: 20px !important;
}
