/* Styles specific to research.html */

:root {
    --bg-light: #F8F5F2;
    --bg-dark: #3B2F2F;
    --text-light: #E2D8CF;
    --text-dark: #4F4A45;
    --text-dark-header: #6A5A4F;
    --text-accent: #BC544B;
    --burnt-orange: #8C3A2B;
    --burnt-orange-text: #E6A34B;
    --almost-black: #1a1a1a;
    --light-grey: #cccccc;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Header styles for research.html */
#page-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(45, 41, 38, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    flex-shrink: 0;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-shadow: none;
    line-height: normal;
    text-align: left;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title span {
    display: inline;
}

#main-nav {
    display: flex;
    gap: 2rem;
}

#main-nav a {
    color: white;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}

#main-nav a:hover {
    color: var(--text-accent);
}

/* Carousel Header Styling */
#research-carousel-section {
    background: linear-gradient(to top, var(--almost-black) 50%, transparent 100%);
    color: var(--text-light);
    padding: 0.5rem 0;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}

#research-carousel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    position: relative;
    overflow: hidden;
    max-width: 710px; /* Increased by 150px from original 560px (800 * 0.7) */
    margin: 0 auto;
}

.carousel-item {
    position: absolute;
    width: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    pointer-events: none; /* Prevent clicks on inactive items */
}

.carousel-item.active {
    opacity: 1 !important;
    pointer-events: auto; /* Allow clicks on active item */
}

.teaser-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.3;
    border-left: 3px solid var(--burnt-orange);
    padding-left: 1rem;
    background: linear-gradient(to right, var(--almost-black) 80%, transparent 100%);
    padding: 0.5rem 1rem;
}

.teaser-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.teaser-subtitle {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--light-grey);
}

.read-more-btn {
    background-color: #4a4a4a;
    color: white;
    border: 1px solid var(--burnt-orange);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    justify-self: end;
    box-shadow: 2px 2px 0px var(--burnt-orange);
}

.read-more-btn:hover {
    box-shadow: 1px 1px 0px var(--burnt-orange-text);
    transform: translate(1px, 1px);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(230, 163, 75, 0.4);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--burnt-orange-text);
}

/* Main content wrapper to push content below the entire fixed header */
#page-content-wrapper {
    padding-top: 138px;
    max-width: 1000px; /* Max width for desktop */
    margin: 0 auto; /* Center the content wrapper */
}

/* Article Title Styling */
.research-article-title {
    font-size: clamp(1.3rem, 2.8vw, 1.8rem); /* Smaller base size for the second line */
    font-weight: 500;
    text-align: center;
    margin-bottom: 1.0rem;
    margin-top: 0.5rem;
    line-height: 1.2;
    color: var(--text-dark);
    text-shadow: none;
}

.research-article-title::first-line {
    font-size: clamp(2rem, 4.5vw, 2.5rem); /* Larger size for the first line */
    font-weight: 900;
    color: var(--text-dark-header);
    line-height: 1;
    margin-top: 0.5rem;
}


/* Article Section Styling */
.article-section {
    padding: 1rem 0; /* Increased padding */
}

.article-section h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--burnt-orange);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--burnt-orange-text);
    text-align: left;
}

.article-section:nth-of-type(odd) {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.article-section:nth-of-type(even) {
    background-color: #F0EBE6;
    color: var(--text-dark);
}

.article-section:nth-of-type(even) h3 {
    color: var(--text-dark-header);
}

.article-section:nth-of-type(even) p {
    color: var(--text-dark);
}

.article-section:nth-of-type(even) blockquote {
    border-left-color: var(--text-accent);
    color: var(--text-dark);
}

/* Two-column layout for images */
.layout-container {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 2rem;
    align-items: flex-start;
    margin: 0.5rem 0;
}

.layout-image-right .image-placeholder {
    grid-column: 2;
    grid-row: 1;
}

.layout-image-right .text-content {
    grid-column: 1;
    grid-row: 1;
}

.image-placeholder {
    width: 100%;
    height: auto;
}
.image-placeholder img {
    width: 100%;
    height: 100%;
    display: block; /* Remove extra space below image */
    object-fit: contain;
}

/* Navigation for SPA-like behavior */
.article-nav {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.article-nav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.5rem;
    background-color: var(--text-accent);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.article-nav a:hover {
    background-color: #A47C6A;
}

/* Hide all articles by default, show only active one */
.blog-post {
    display: none;
}

.blog-post.active {
    display: block;
}

@media (max-width: 768px) {
    .layout-container {
        grid-template-columns: 1fr;
    }
    .layout-image-right .image-placeholder {
        grid-column: 1;
        grid-row: auto;
    }
    .layout-image-right .text-content {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Modal Styles for Curriculum Materials */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: #BC544B;
}

.modal-image-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border-radius: 12px 12px 0 0;
    min-height: 400px;
    overflow: hidden;
}

.modal-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.modal-nav-btn:hover {
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-nav-btn.left {
    left: 20px;
}

.modal-nav-btn.right {
    right: 20px;
}

.modal-nav-btn.hidden {
    display: none;
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    justify-content: center;
    background-color: #fff;
    border-radius: 0 0 12px 12px;
    overflow-x: auto;
}

.thumbnail-item {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumbnail-item:hover {
    border-color: #A47C6A;
}

.thumbnail-item.active {
    border-color: #BC544B;
    box-shadow: 0 0 0 3px rgba(188, 84, 75, 0.2);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .modal-image-container {
        min-height: 300px;
    }
    
    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .modal-nav-btn.left {
        left: 10px;
    }
    
    .modal-nav-btn.right {
        right: 10px;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 440px) {
    #page-header {
        height: auto;
        padding-bottom: 0.5rem;
    }

    #header-content {
        flex-direction: column;
        justify-content: center;
        padding-top: 0.5rem;
        height: auto;
    }

    .hero-title {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    #main-nav {
        flex-direction: row;
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 0.5rem;
        gap: 1rem;
    }
}
