/* Reset default styles for consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* General body styling */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
}

/* Fixed header styling */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px 40px;
    text-align: center;
    z-index: 1000;
}

.fixed-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.fixed-header nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.fixed-header nav ul li {
    font-size: 1.1rem;
}

.fixed-header nav ul li a {
    text-decoration: none;
    color: #2980b9;
    font-weight: 500;
    transition: color 0.3s ease;
}

.fixed-header nav ul li a:hover {
    color: #1abc9c;
}


.fixed-header nav ul li a.active {
    color: #1abc9c;
    font-weight: 600;
}

.fixed-header nav ul li a.active:hover {
    color: #1abc9c; 
}

/* Main content styling */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Home page specific styling */
body.home-page main {
    margin-top: 140px; 
    background: linear-gradient(180deg, #e6f0fa 0%, #f5f7fa 100%);
}

body.home-page .hero-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-bottom: 40px;
}

body.home-page .hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body.home-page h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a5276;
    margin: 40px 0 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Non-home page styling */
body:not(.home-page) main {
    margin-top: 140px;
}

body:not(.home-page) h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 20px 0 30px;
}

body:not(.home-page) h2 {
    font-size: 1.8rem;
    font-weight: 500;
    color: #2c3e50;
    margin: 30px 0 15px;
}

/* Shared content styling */
main p {
    font-size: 1rem;
    color: #34495e;
    margin-bottom: 20px;
    text-align: justify;
    text-indent: 20px;
}

/* Card container styling */
.card-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.card-content {
    padding: 20px;
    text-align: center;
}

.card-content h3 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.card-content p {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.read-more {
    opacity: 0;
    background-color: #2980b9;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.card:hover .read-more {
    opacity: 1;
}

.read-more:hover {
    background-color: #1abc9c;
}

/* Footer styling */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

footer p {
    font-size: 0.9rem;
}

footer a {
    color: #1abc9c;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.hero-image {
    width: 100%;
    margin-bottom: 40px;
}

.hero-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.hero-image .image-caption {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Side-by-side images */
.image-pair {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.image-pair-item {
    flex: 1;
    height: 400px;
    overflow: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.image-pair-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #2c3e50;
    opacity: 0.9;
}

.image-pair-item .image-caption {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.4;
}

.references-list {
    margin: 20px 0;
    padding-left: 40px;
}
.references-list li {
    font-size: 1rem;
    color: #34495e;
    margin-bottom: 10px;
}
.references-list a {
    color: #2980b9;
    text-decoration: none;
}
.references-list a:hover {
    color: #1abc9c;
}

#cosmetic,
#reconstructive {
    scroll-margin-top: 160px;
}

.bookmarks {
    list-style: none;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}
.bookmarks a {
    color: #2980b9;
    text-decoration: underline;
}
.bookmarks a:hover {
    color: #1abc9c;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
caption {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 10px;
}
th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
th {
    background-color: #f5f7fa;
}

.external-links {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}
.external-links li {
    margin-bottom: 10px;
}
.external-links a {
    color: #2980b9;
    text-decoration: none;
}
.external-links a:hover {
    color: #1abc9c;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px; 
}

.section-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.thumbnail {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* Responsive design */
@media (max-width: 768px) {
    .fixed-header {
        padding: 15px 20px;
    }
    .fixed-header h1 {
        font-size: 2rem;
    }
    .fixed-header nav ul {
        flex-direction: column;
        gap: 10px;
    }
    body.home-page main,
    body:not(.home-page) main {
        margin-top: 180px; /* Adjust for taller header on mobile */
    }
    .hero-image {
        height: 250px; /* Applies to all pages */
    }
    .image-pair {
        flex-direction: column; /* Stack side-by-side images */
        gap: 20px;
    }
    .image-pair-item {
        height: 250px; /* Matches hero height */
        width: 100%;
    }
    body.home-page h2 {
        font-size: 2rem;
    }
    body:not(.home-page) h1 {
        font-size: 1.8rem;
    }
    .card-container {
        grid-template-columns: 1fr; /* Stack cards vertically */
        overflow-x: visible; /* No horizontal scroll */
        gap: 15px;
    }
    .card {
        min-width: 0; /* Full width of container */
        width: 100%;
    }
    .thumbnails {
        gap: 8px; /* Tighter spacing for 104px total width */
    }
    .bookmarks {
        flex-direction: column; /* Stack bookmarks vertically */
        gap: 10px;
    }
    main {
        padding: 15px;
    }
}