/* =================================
   HOME.CSS - Home Page Styles (corrected)
   - Uses [hidden] for Education items
   - Removes .hidden class dependency for visibility
   - FIXED: Mobile view shows profile image before about text
   ================================= */


/* ==================
   HERO SECTION WITH ABOUT
   ================== */

.hero-about-wrapper {
    padding: var(--space-12) 0;
}

.hero-about-container {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: var(--space-12);
    align-items: start;
}


/* Left Content */

.hero-main-content {
    padding-top: var(--space-4);
}

.hero-name {
    font-size: var(--text-4xl);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--space-2);
    line-height: var(--leading-tight);
}

.hero-title {
    font-size: var(--text-lg);
    color: var(--text-light);
    margin-bottom: var(--space-2);
}

.hero-affiliation {
    font-size: var(--text-base);
    color: var(--text-color);
    margin-bottom: var(--space-8);
}


/* Right Sidebar - Profile Image */

.hero-sidebar {
    position: sticky;
    top: 100px;
    text-align: center;
}

.profile-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-base);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-4);
}


/* Contact Links Below Image */

.hero-contact-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    color: var(--accent-color);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
}

.contact-link:hover {
    color: var(--accent-hover);
    background-color: var(--bg-light);
}

.contact-icon {
    width: 18px;
    height: 18px;
}


/* About Section */

.about-section {
    margin-bottom: var(--space-8);
}

.section-heading {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--space-4);
    line-height: var(--leading-tight);
}

.about-text {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--text-color);
    text-align: justify;
}

.about-text p {
    margin-bottom: var(--space-4);
}

.about-text p:last-child {
    margin-bottom: 0;
}


/* ==================
   FULL WIDTH SECTIONS
   ================== */

.full-width-section {
    padding: var(--space-12) 0;
    border-top: 1px solid var(--border-light);
}


/* ==================
   EDUCATION SECTION
   ================== */

.education-section {}

.education-item {
    display: block;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-light);
}


/* Native hiding with [hidden] */

.education-item[hidden] {
    display: none !important;
}

.education-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.education-degree {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--space-2);
}

.education-institution {
    font-size: var(--text-base);
    color: var(--text-color);
    margin-bottom: var(--space-1);
}

.education-duration {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-bottom: var(--space-2);
}

.education-grade {
    font-size: var(--text-sm);
    color: var(--text-color);
    font-weight: 500;
}


/* Show More Button */

.show-more-btn {
    display: inline-block;
    margin-top: var(--space-4);
    padding: var(--space-2) var(--space-6);
    background-color: var(--bg-light);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.show-more-btn:hover {
    background-color: var(--accent-color);
    color: var(--bg-white);
    border-color: var(--accent-color);
}


/* Coursework Section */

.coursework-section {
    margin-top: var(--space-6);
    padding: var(--space-6);
    background-color: var(--bg-light);
    border-radius: var(--radius-base);
    display: none;
}

.coursework-section.visible {
    display: block;
}

.coursework-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--space-4);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.coursework-title::before {
    content: "▶";
    font-size: var(--text-sm);
    transition: transform var(--transition-fast);
}

.coursework-title.expanded::before {
    transform: rotate(90deg);
}

.coursework-content {
    display: none;
    margin-top: var(--space-3);
    overflow: hidden;
    max-height: 0;
}

.coursework-content.visible {
    display: block;
}

.coursework-category {
    margin-bottom: var(--space-3);
}

.coursework-category:last-child {
    margin-bottom: 0;
}

.coursework-category h4 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--space-2);
}

.coursework-category p {
    font-size: var(--text-sm);
    color: var(--text-color);
    line-height: var(--leading-relaxed);
}


/* ==================
   RESEARCH INTERESTS
   ================== */

.interests-section {}

.interests-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.interest-item {
    padding: var(--space-3) var(--space-4);
    background-color: var(--bg-light);
    border-left: 3px solid var(--accent-color);
    font-size: var(--text-base);
    color: var(--text-color);
}


/* ==================
   NEWS SECTION WITH SCROLL
   ================== */

.news-section {}

.news-scroll-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: var(--space-2);
}


/* Custom Scrollbar */

.news-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.news-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.news-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

.news-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.news-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.news-date {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--accent-color);
}

.news-content h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--space-2);
    line-height: var(--leading-tight);
}

.news-content p {
    font-size: var(--text-base);
    color: var(--text-color);
    line-height: var(--leading-relaxed);
}


/* ==================
   CONTACT SECTION
   ================== */

.contact-section {
    padding: var(--space-8);
    background-color: var(--bg-light);
    border-radius: var(--radius-base);
}

.contact-heading {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--space-4);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-base);
    color: var(--text-color);
}

.contact-info-item strong {
    min-width: 80px;
    font-weight: 600;
    color: var(--primary-color);
}

.contact-info-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.contact-info-item a:hover {
    text-decoration: underline;
}


/* ==================
   RESPONSIVE DESIGN
   ================== */


/* Tablet */

@media (max-width: 1023px) {
    .hero-about-container {
        grid-template-columns: 1fr 200px;
        gap: var(--space-8);
    }
    .interests-list {
        grid-template-columns: 1fr;
    }
    .news-item {
        grid-template-columns: 100px 1fr;
    }
}


/* Mobile - FIXED VERSION */

@media (max-width: 767px) {
    .hero-about-wrapper {
        padding: var(--space-8) 0;
    }
    /* Changed from grid to flex to control order */
    .hero-about-container {
        display: flex;
        flex-direction: column;
        gap: var(--space-8);
    }
    /* Make sidebar appear first */
    .hero-sidebar {
        position: relative;
        top: auto;
        max-width: 200px;
        margin: 0 auto;
        order: -1;
        /* This ensures sidebar appears first */
    }
    /* Main content appears after sidebar */
    .hero-main-content {
        order: 1;
        /* This ensures main content appears after sidebar */
    }
    .hero-name {
        font-size: var(--text-3xl);
        text-align: center;
    }
    .hero-title {
        font-size: var(--text-base);
        text-align: center;
    }
    .hero-affiliation {
        font-size: var(--text-sm);
        text-align: center;
    }
    .hero-contact-links {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    .section-heading {
        font-size: var(--text-xl);
    }
    .about-text {
        font-size: var(--text-sm);
        text-align: left;
    }
    .full-width-section {
        padding: var(--space-8) 0;
    }
    .news-item {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    .news-date {
        font-size: var(--text-xs);
    }
    .news-content h3 {
        font-size: var(--text-base);
    }
    .news-content p {
        font-size: var(--text-sm);
    }
    .news-scroll-container {
        max-height: 300px;
    }
    .contact-section {
        padding: var(--space-6);
    }
    .contact-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }
    .contact-info-item strong {
        min-width: auto;
    }
}


/* Small mobile */

@media (max-width: 479px) {
    .hero-name {
        font-size: var(--text-2xl);
    }
    .hero-contact-links {
        flex-direction: column;
        align-items: stretch;
    }
    .interest-item {
        font-size: var(--text-sm);
        padding: var(--space-2) var(--space-3);
    }
}


/* ==================
   PRINT STYLES
   ================== */

@media print {
    .hero-about-container {
        grid-template-columns: 1fr 180px;
    }
    .profile-image {
        max-width: 180px;
    }
    .contact-link {
        color: var(--text-color);
    }
    /* Reveal all education for print (JS also ensures this) */
    .education-item[hidden] {
        display: block !important;
    }
    .show-more-btn {
        display: none;
    }
    .news-scroll-container {
        max-height: none;
        overflow: visible;
    }
    .coursework-section {
        display: none;
    }
}