/* Ppolon-style CSS */

* {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', 'Lato', helvetica, arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.4em;
    color: #222222;
    background: #ffffff;
    margin: 20px;
    padding-bottom: 60px;
}

a {
    color: #436cc8;
    text-decoration: none;
}

a:hover {
    color: #0d00ff;
    text-decoration: none;
}

p {
    padding: 0 0 10px 15px;
}

li {
    margin: 0 0 0 20px;
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #cccccc;
    padding: 10px 20px;
    z-index: 1000;
    font-weight: lighter;
    font-size: 12px;
}

#navbar #container {
    width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

#navbar #plain {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    margin-right: 30px;
    color: #000;
}

#navbar a {
    margin-right: 20px;
    color: #436cc8;
    text-decoration: none;
}

#navbar a:hover {
    color: #0d00ff;
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 18px;
    color: #666;
    transition: all 0.3s ease;
    margin-left: 10px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.theme-toggle:hover {
    color: #436cc8;
    transform: scale(1.1);
}

html.dark-mode .theme-toggle {
    color: #aaa;
}

html.dark-mode .theme-toggle:hover {
    color: #6b9cff;
}

/* Dark mode styles */
html.dark-mode {
    background: #1a1a1a;
}

html.dark-mode body {
    background: #1a1a1a;
    color: #e0e0e0;
}

html.dark-mode a {
    color: #6b9cff;
}

html.dark-mode a:hover {
    color: #8fb4ff;
}

html.dark-mode #navbar {
    background: #1a1a1a;
    border-bottom-color: #444;
}

html.dark-mode #navbar #plain {
    color: #e0e0e0;
}

html.dark-mode #navbar a {
    color: #6b9cff;
}

html.dark-mode #navbar a:hover {
    color: #8fb4ff;
}

html.dark-mode #name img.left {
    border-color: #444;
}

html.dark-mode #name h1 a {
    color: #e0e0e0 !important;
}

html.dark-mode #name h1 {
    color: #e0e0e0;
}

html.dark-mode #container h2 {
    color: #e0e0e0;
    border-bottom-color: #444;
}

html.dark-mode #container h3 {
    color: #d0d0d0;
}

html.dark-mode .date {
    color: #ff9999;
}

html.dark-mode .pub-item {
    border-bottom-color: #333;
}

html.dark-mode .pub-image {
    border-color: #444;
    background: #252525;
}

html.dark-mode .pub-image img {
    background: #252525;
}

html.dark-mode .pub-title {
    color: #e0e0e0;
}

html.dark-mode .pub-authors {
    color: #b0b0b0;
}

html.dark-mode .pub-venue {
    color: #999;
}

html.dark-mode .pub-links a {
    background: #2a2a2a;
    border-color: #555;
    color: #6b9cff;
}

html.dark-mode .pub-links a:hover {
    background: #6b9cff;
    color: #1a1a1a;
    border-color: #6b9cff;
}

html.dark-mode .vitae-date {
    color: #d0d0d0;
}

html.dark-mode .vitae-title {
    color: #e0e0e0;
}

html.dark-mode .vitae-item span {
    color: #999 !important;
}

html.dark-mode .vitae-item span[style*="color: #555"] {
    color: #999 !important;
}

html.dark-mode .vitae-item .vitae-title {
    color: #e0e0e0 !important;
}

html.dark-mode .vitae-item .vitae-date {
    color: #d0d0d0 !important;
}

html.dark-mode #container nav li {
    color: #b0b0b0;
}

html.dark-mode #container li {
    color: #b0b0b0;
}

html.dark-mode #container p {
    color: #b0b0b0;
}

html.dark-mode #toggle-news {
    color: #6b9cff !important;
}

html.dark-mode .caret {
    color: #6b9cff;
}

html.dark-mode .pub-content div[style*="color"] {
    color: #b0b0b0 !important;
}

html.dark-mode .pub-item:has(img[src*="research_exp"]) .pub-image {
    background: #1a1a1a !important;
}

html.dark-mode .pub-image img[src*="research_exp"] {
    filter: brightness(0) invert(1) contrast(3) brightness(1.2);
    opacity: 1;
}

html.dark-mode #name div[style] {
    color: #b0b0b0;
}

html.dark-mode #name div[style] span[style*="color"] {
    color: #999 !important;
}

html.dark-mode #footer {
    background: #1a1a1a;
    border-top-color: #444;
    color: #888;
}

html.dark-mode #footer a {
    color: #999;
}

html.dark-mode #footer a:hover {
    color: #6b9cff;
}

/* Name section */
#name {
    width: 960px;
    margin: 80px auto 30px auto;
    text-align: left;
    overflow: hidden;
}

#name img.left {
    float: left;
    margin: 0 25px 20px 0;
    border: 1px solid #ddd;
    width: 200px;
    height: 260px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#name h1 {
    font-size: 28px;
    font-weight: 600;
    padding: 35px 0 8px 0;
    margin-left: 225px;
}

#name h1 a {
    color: black;
}

/* Container */
#container {
    width: 960px;
    margin: 0 auto;
    font-size: 13.5px;
}

#container p {
    font-weight: 400;
    line-height: 1.6;
    padding: 0 10px 12px 15px;
}

#container h1 {
    font-size: 28px;
    font-weight: 200;
    padding-left: 0;
    padding-bottom: 5px;
    text-align: left;
}

#container h2 {
    margin: 0 0 15px 0;
    padding: 15px 0 12px 15px;
    font-size: 18px;
    font-weight: 600;
    color: #222222;
    border-bottom: solid 2px #e0e0e0;
}

#container li {
    font-weight: 400;
    font-size: 13.5px;
    color: #222222;
    padding-top: 3px;
    padding-bottom: 1px;
    line-height: 130%;
    list-style-type: none;
}

#container ol, #container ul {
    padding-left: 35px;
}

#container nav li {
    list-style-type: none;
    margin-left: 0;
}

#container .vitae-item {
    margin-bottom: 18px;
    padding-left: 15px;
    line-height: 1.7;
}

#container .vitae-date {
    display: inline-block;
    min-width: 150px;
    font-weight: 600;
    color: #2c2c2c;
    font-size: 13.5px;
}

#container .vitae-title {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

#container .vitae-desc {
    color: #555;
    font-size: 13px;
}

#container h3 {
    color: #333;
    letter-spacing: 0.3px;
}

/* Date styling in news */
.date {
    display: inline-block;
    min-width: 80px;
    font-weight: 600;
    color: #fa8072;
}

#container nav li {
    margin-bottom: 8px;
}

/* Anchor links */
a.anchor {
    display: block;
    position: relative;
    top: -80px;
    visibility: hidden;
}

/* Dropdown for old news */
#container nav ul ul {
    display: none;
    margin-top: 10px;
}

#container nav ul ul.show {
    display: block;
}

#container nav > ul > li > a {
    cursor: pointer;
    color: #436cc8;
}

/* Publication styling */
.pub-item {
    margin-bottom: 30px;
    padding: 5px 0 25px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-image {
    flex-shrink: 0;
    width: 200px;
    height: 120px;
    margin-right: 25px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
}

.pub-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fafafa;
}

.pub-content {
    flex: 1;
}

.pub-title {
    font-weight: 600;
    font-size: 14.5px;
    margin-bottom: 6px;
    line-height: 1.5;
    color: #1a1a1a;
}

.pub-authors {
    margin-bottom: 5px;
    line-height: 1.5;
    font-size: 13.5px;
    color: #444;
}

.pub-venue {
    font-style: italic;
    margin-bottom: 10px;
    color: #666;
    font-size: 13px;
}

.pub-links {
    margin-top: 5px;
}

.pub-links a {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 6px;
    padding: 4px 14px;
    background: #f8f8f8;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 11.5px;
    color: #436cc8;
    transition: all 0.2s ease;
}

.pub-links a:hover {
    background: #436cc8;
    color: white;
    border-color: #436cc8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(67, 108, 200, 0.3);
}

/* Footer */
#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    text-align: center;
    color: #999;
    font-size: 11px;
    border-top: 1px solid #e0e0e0;
    padding: 4px 0;
    z-index: 999;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

#footer p {
    margin: 0;
    padding: 0;
}

#footer a {
    color: #666;
}

#footer a:hover {
    color: #436cc8;
}

/* ============================================ */
/* Mobile Responsive Styles */
/* ============================================ */

/* Tablets and smaller (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    #navbar #container,
    #name,
    #container,
    #footer {
        width: 95%;
        max-width: 960px;
        padding-left: 2.5%;
        padding-right: 2.5%;
    }
}

/* Mobile devices (max-width: 768px) */
@media screen and (max-width: 768px) {
    body {
        margin: 10px;
    }

    /* Navbar adjustments */
    #navbar {
        padding: 8px 10px;
        font-size: 11px;
    }

    #navbar #container {
        width: 100%;
        padding: 0;
    }

    #navbar #plain {
        display: block;
        margin-bottom: 8px;
        margin-right: 0;
        font-size: 14px;
    }

    #navbar a {
        margin-right: 12px;
        font-size: 11px;
    }

    /* Name section - Critical overrides */
    #name {
        width: 100% !important;
        margin: 60px auto 20px auto !important;
        padding: 0 15px !important;
        text-align: center;
    }

    #name img.left {
        float: none !important;
        display: block;
        margin: 0 auto 20px auto !important;
        width: 160px;
        height: 208px;
    }

    #name h1 {
        text-align: center !important;
        margin-left: 0 !important;
        font-size: 26px !important;
        padding: 0 0 10px 0 !important;
    }

    /* Override inline styles in name section */
    #name div[style] {
        margin-left: 0 !important;
        text-align: center !important;
    }

    #name p {
        text-align: center !important;
    }

    /* Container */
    #container {
        width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box;
    }

    #container p {
        padding: 0 0 12px 0 !important;
        text-align: left;
    }

    #container h2 {
        padding: 15px 0 12px 0 !important;
        font-size: 17px;
        margin-left: 0;
    }

    #container h3 {
        padding-left: 0 !important;
        font-size: 14px;
        margin-left: 0;
    }

    /* Publication items - stack vertically */
    .pub-item {
        flex-direction: column !important;
        padding: 15px 0 25px 0 !important;
        margin-bottom: 20px;
        align-items: center;
    }

    .pub-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 150px;
        margin: 0 0 20px 0 !important;
        border-radius: 6px;
        overflow: hidden;
    }

    .pub-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .pub-content {
        width: 100%;
        text-align: left;
    }

    .pub-title {
        font-size: 14.5px;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .pub-authors {
        font-size: 13px;
        line-height: 1.5;
    }

    .pub-venue {
        font-size: 12.5px;
    }

    .pub-links {
        margin-top: 8px;
    }

    .pub-links a {
        font-size: 11px;
        padding: 4px 12px;
        margin-right: 8px;
        margin-bottom: 6px;
        display: inline-block;
    }

    /* Vitae items */
    .vitae-item {
        padding-left: 0 !important;
        margin-bottom: 20px;
    }

    .vitae-date {
        display: block;
        min-width: auto;
        margin-bottom: 5px;
        font-weight: 700;
    }

    .vitae-item span[style*="margin-left"] {
        margin-left: 0 !important;
        display: block;
        padding-left: 0 !important;
    }

    /* Date in news */
    .date {
        display: block;
        min-width: auto;
        margin-bottom: 5px;
        font-weight: 700;
    }

    #container nav ul {
        padding-left: 0 !important;
    }

    #container nav li {
        font-size: 13px;
        line-height: 1.7;
        margin-bottom: 10px;
    }

    #container ol,
    #container ul {
        padding-left: 20px !important;
    }

    /* Footer */
    #footer {
        padding: 10px 15px !important;
        font-size: 11px;
    }
}

/* Very small mobile devices (max-width: 480px) */
@media screen and (max-width: 480px) {
    body {
        margin: 5px;
    }

    #navbar {
        padding: 6px 8px;
    }

    #navbar #plain {
        font-size: 13px;
    }

    #navbar a {
        margin-right: 10px;
        font-size: 10.5px;
    }

    #name {
        margin-top: 55px !important;
        padding: 0 10px !important;
    }

    #name img.left {
        width: 140px !important;
        height: 182px !important;
    }

    #name h1 {
        font-size: 22px !important;
    }

    #name div[style] {
        font-size: 12.5px !important;
    }

    #container {
        padding: 0 10px !important;
    }

    #container h2 {
        font-size: 16px !important;
    }

    #container h3 {
        font-size: 13.5px !important;
    }

    .pub-item {
        padding: 10px 0 20px 0 !important;
    }

    .pub-image {
        min-height: 120px;
    }

    .pub-title {
        font-size: 13.5px;
    }

    .pub-authors {
        font-size: 12px;
    }

    .pub-venue {
        font-size: 11.5px;
    }

    .pub-links a {
        font-size: 10.5px;
        padding: 3px 10px;
    }

    #container nav li {
        font-size: 12px;
    }

    #footer {
        padding: 8px 10px !important;
        font-size: 10px;
    }
}
