/* Base styles */
body {
    margin: 0;
    padding: 0;
    background-color: white;
    font-family: sans-serif;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
}

/* Layout */
.container {
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 992px) {
    .container {
        width: 970px;
    }
}

.row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
}

/* Header */
#dhead {
    margin-top: 20px;
}

#dpic {
    grid-column: span 6;
    text-align: right;
}

#ddesc {
    padding-top: 40px;
    padding-left: 20px;
    grid-column: span 6;
}

@media (max-width: 991px) {
    #dpic {
        grid-column: span 12;
        text-align: center;
    }

    #ddesc {
        grid-column: span 12;
        padding-top: 20px;
        text-align: center;
    }
}

h1 {
    font-size: 34px;
    font-weight: normal;
    margin: 0;
}

h2 {
    font-weight: normal;
    color: #999;
    font-size: 18px;
    margin: 5px 0 10px 0;
}

@media (min-width: 992px) {
    h2 {
        max-width: 300px;
    }
}

#dpic img {
    width: 240px;
    height: 240px;
    border-radius: 120px;
}

.iico {
    width: 40px;
    height: 40px;
}

/* Divider */
hr {
    height: 1px;
    background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    background-image: -ms-linear-gradient(left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    margin: 20px 0;
    border: 0;
}

/* Experience & Education */
.ico {
    grid-column: span 1;
    vertical-align: top;
    border-left: 2px solid #cfcfcf;
    position: relative;
    margin-top: 5px;
}

.ico img {
    border-radius: 5px;
    width: 100%;
    max-width: 80px;
    margin-left: 10px;
}

.desc {
    grid-column: span 10;
    font-size: 17px;
    list-style-type: square;
    padding-left: 20px;
    padding-bottom: 20px;
    margin: 0 15px;
    /* only left & right margin */
}

.entry-dot {
    position: absolute;
    top: 0px;
    left: -8px;
    width: 10px;
    height: 10px;
    border-radius: 7px;
    background-color: #cfcfcf;
    border: 2px solid white;
}

.timespan {
    grid-column: span 1;
    font-size: 14px;
    text-align: right;
    padding-right: 5px;
    color: #979797;
}

.ctitle {
    font-size: 36px;
    margin-bottom: 20px;
    margin-top: 40px;
}

/* Publications */
.pub {
    font-size: 16px;
    border-left: 4px solid #aaa;
    padding: 2px 0 2px 10px;
    margin-bottom: 10px;
}

.pub-title {
    display: block;
    color: #333;
}

.pub-title a {
    text-decoration: none;
    display: inline;
}

.pub-title a:hover {
    text-decoration: underline;
}

.pub-venue {
    display: inline;
    color: #090;
}

.pub-authors {
    display: block;
    color: #900;
}

/* Publication status badges */
.pub-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    background-color: #ddd;
    color: #333;
    border: 1px solid transparent;
}

.pub-badge.in-preparation {
    background-color: #fce7f3;
    color: #831843;
    border-color: #f9a8d4;
}

.pub-badge.under-review {
    background-color: #ede9fe;
    color: #5b21b6;
    border-color: #c4b5fd;
}

.pub-badge.preprint {
    background-color: #fff7ed;
    color: #92400e;
    border-color: #fdba74;
}

.pub-badge.published {
    background-color: #ccfbf1;
    color: #115e59;
    border-color: #5eead4;
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: white;
    color: #333;
    border: 2px solid #cfcfcf;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.3s, border-color 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#backToTop:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

.teaching-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* exactly 3 per row */
    gap: 25px;
    margin: 40px 0;
}

.video-card {
    background: white;
    border-radius: 12px;
    padding: 10px;
}


.video-card iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    border: none;
}

/* Tablet: 2 per row */
@media (max-width: 900px) {
    .teaching-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 per row */
@media (max-width: 600px) {
    .teaching-grid {
        grid-template-columns: 1fr;
    }
}
