/* ============================================
   Miroslav Gabrovski – Personal Academic Website
   Template inspired by nicolepaul.io (Hugo Blox)
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; zoom: 1; }

body {
    font-family: 'Libre Franklin', sans-serif;
    color: #000;
    background: #fff;
    line-height: 1.75;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

a { color: #4a6fa5; text-decoration: none; transition: color 0.2s; }
a:hover { color: #2d4a6e; }

/* ---- Navigation ---- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    height: 58px;
    backdrop-filter: blur(8px);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

.brand {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #000;
    text-decoration: none;
    position: absolute;
    left: 24px;
    letter-spacing: -0.01em;
}
.brand:hover { color: #000; }

.nav-links {
    display: flex;
    gap: 0;
}

.nav-links a {
    color: #000;
    font-size: 1rem;
    font-weight: 400;
    padding: 0 18px;
    line-height: 58px;
    text-decoration: none;
    transition: color 0.2s;
}
.nav-links a:hover { color: #4a6fa5; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000;
    position: absolute;
    right: 24px;
}

/* ---- About Section ---- */
.about-section {
    padding: 70px 24px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.about-container {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 60px;
    align-items: start;
    justify-items: center;
}

.profile-column {
    text-align: center;
    justify-self: center;
    background: #fdf6f0;
    border-radius: 12px;
    padding: 28px 20px;
}

.profile-photo {
    width: 360px;
    height: 360px;
    border-radius: 50%;
    object-fit: contain;
    object-position: center top;
    display: block;
    margin: 0 auto 12px;
}

.profile-name {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
}

.profile-title {
    font-size: 1.05rem;
    color: #000;
    font-weight: 300;
    margin-bottom: 0;
}

.profile-affiliation {
    font-size: 0.95rem;
    color: #000;
    font-weight: 300;
    margin-bottom: 0;
    line-height: 1.4;
}

.profile-affiliation a {
    color: #4a6fa5;
    text-decoration: none;
}
.profile-affiliation a:hover {
    color: #2d4a6e;
}

.social-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    color: #000;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}
.social-links a:hover {
    opacity: 0.6;
}

/* Glossary */
.glossary-intro {
    margin-top: 20px;
    margin-bottom: 6px;
}
.glossary {
    margin-top: 4px;
}
.glossary-group {
    margin-bottom: 10px;
}
.glossary-topic {
    font-weight: 700;
    font-size: 1.0rem;
    color: #000;
}
.glossary ol {
    list-style: decimal;
    padding-left: 1.4rem;
    margin-top: 2px;
}
.glossary ol li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2px;
    color: #000;
}
.glossary ol li a {
    color: #4a6fa5;
    font-style: normal;
    font-weight: 500;
}
.glossary ol li a:hover {
    text-decoration: underline;
}

/* Bio column */
.bio-column {
    flex: 1;
    min-width: 0;
}

.greeting {
    font-family: 'DM Sans', 'Libre Franklin', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 18px;
}

.bio-column p {
    font-size: 1.08rem;
    margin-bottom: 14px;
    line-height: 1.75;
}

.bio-column ul {
    font-size: 1.08rem;
    line-height: 1.75;
    margin-top: 0;
    margin-bottom: 14px;
    padding-left: 1.4em;
}

.bio-column ul li {
    margin-bottom: 2px;
}

.also-list {
    list-style: none;
    padding-left: 0;
}

.also-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    line-height: 1.75;
}

.also-logo {
    height: 1.3rem;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
}

.hea-logo {
    height: 1.7rem;
}

/* Info columns (Interests / Education) */
.info-columns {
    display: flex;
    gap: 50px;
    margin-top: 28px;
}

.info-col h3 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 12px;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #000;
    line-height: 1.5;
}

.info-list li i {
    color: #4a6fa5;
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

.info-sub {
    font-size: 0.85rem;
    color: #000;
    margin-left: 26px;
    display: block;
}

/* ---- Content Sections ---- */
.content-section {
    padding: 40px 24px;
}

.content-section.alt-bg {
    background: #f7f7f7;
}

.section-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 30px;
}

/* ---- Publication Cards ---- */
.pub-card {
    background: #fff;
    border-left: 4px solid #4a6fa5;
    padding: 22px 28px;
    margin-bottom: 20px;
    border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.pub-authors {
    font-size: 0.85rem;
    color: #000;
    margin-bottom: 2px;
}

.pub-authors a {
    color: #4a6fa5;
    text-decoration: underline;
    text-decoration-color: rgba(90, 70, 76, 0.3);
    text-underline-offset: 2px;
    transition: color 0.2s, text-decoration-color 0.2s;
}
.pub-authors a:hover {
    color: #2d4a6e;
    text-decoration-color: #2d4a6e;
}

.pub-year {
    font-size: 0.85rem;
    color: #000;
    font-weight: 700;
    margin-bottom: 6px;
}

.pub-rr {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8a5a00;
    background: rgba(200, 140, 20, 0.1);
    border: 1px solid rgba(200, 140, 20, 0.35);
    border-radius: 4px;
    padding: 2px 8px;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.pub-title {
    font-family: 'DM Sans', 'Libre Franklin', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #000;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    line-height: 1.4;
}
.pub-title:hover { color: #000; text-decoration: underline; }

.featured-pub-title {
    color: #4a6fa5;
    font-weight: 700;
    font-style: italic;
    margin-bottom: 4px;
}
.featured-pub-title:hover { color: #2d4a6e; }

.pub-abstract {
    font-size: 0.9rem;
    color: #000;
    line-height: 1.65;
    margin-bottom: 10px;
    text-align: justify;
}

.pub-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.pub-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #6080a8;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid #c0cdd9;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.pub-links a:hover {
    background: rgba(74, 111, 165, 0.07);
    border-color: #a0b4c8;
}

/* ---- Abstract toggle ---- */
.pub-abstract.collapsed {
    display: none;
}
.abstract-toggle {
    background: transparent;
    border: 1px solid #c0cdd9;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: #6080a8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.abstract-toggle:hover { background: rgba(74, 111, 165, 0.07); border-color: #a0b4c8; color: #4a6fa5; }
.abstract-toggle i { font-size: 0.75rem; transition: transform 0.2s; }
.abstract-toggle.open i { transform: rotate(180deg); }

/* Smaller abstract-toggle when inside paper-list pub-links */
.paper-list li .pub-links .abstract-toggle {
    font-size: 0.72rem;
    padding: 2px 8px;
}

/* Plain bracket links for publications list */
.pub-links-plain {
    font-size: 0.9rem;
    color: #555;
    display: block;
    margin-top: 2px;
}
.pub-links-plain a {
    color: #000;
    text-decoration: none;
}
.pub-links-plain a:hover {
    text-decoration: underline;
}
.pub-links-plain .abstract-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    letter-spacing: -0.02em;
}
.pub-links-plain .abstract-toggle .toggle-arrow {
    display: inline-block;
    width: 0.7em;
    text-align: center;
}
.pub-links-plain .abstract-toggle:hover {
    text-decoration: underline;
    color: #000;
}

/* Inline plain-text links for publications list */
.pub-links-inline {
    font-size: 0.9rem;
    color: #555;
}
.pub-links-inline a {
    color: #6080a8;
    text-decoration: none;
}
.pub-links-inline a:hover {
    text-decoration: underline;
}
.pub-links-inline .abstract-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    color: #6080a8;
    cursor: pointer;
    text-decoration: none;
}
.pub-links-inline .abstract-toggle:hover {
    text-decoration: underline;
    background: none;
    border: none;
    color: #4a6fa5;
}

.see-all {
    margin-top: 20px;
    text-align: center;
}
.see-all a {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4a6fa5;
}
.see-all a:hover { text-decoration: underline; }

/* ---- Contact Section ---- */
.contact-section {
    background: #2e3f52;
}
.contact-section .section-title {
    color: #fff;
}
.contact-section .contact-item {
    color: rgba(255, 255, 255, 0.85);
}
.contact-section .contact-item i {
    color: rgba(255, 255, 255, 0.6);
}

.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
}

.contact-item i {
    color: #4a6fa5;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* ---- Footer ---- */
.site-footer {
    text-align: center;
    padding: 30px 24px;
    font-size: 0.82rem;
    color: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ---- Research Page ---- */
.research-section h2 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 2rem;
    font-weight: 300;
    color: #000;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

.paper-list { list-style: decimal; padding-left: 1.5rem; margin-bottom: 0; }
.paper-list li { margin-bottom: 0.4rem; font-size: 0.95rem; line-height: 1.6; }
.paper-list li .paper-title-link { color: #4a6fa5; text-decoration: none; font-weight: 700; font-size: 0.95rem; font-style: italic; }
.publications-list li .paper-title-link { font-weight: 700; }
.paper-list li .paper-title-link:hover { color: #2d4a6e; text-decoration: underline; }
.paper-list li .authors { color: #000; font-style: italic; }
.paper-list li .authors a {
    color: #4a6fa5;
    text-decoration: underline;
    text-decoration-color: rgba(90, 70, 76, 0.3);
    text-underline-offset: 2px;
    font-style: italic;
    transition: color 0.2s, text-decoration-color 0.2s;
}
.paper-list li .authors a:hover {
    color: #2d4a6e;
    text-decoration-color: #2d4a6e;
}
.paper-list li .venue { color: #000; font-weight: 700; font-style: italic; }
.paper-list li .venue-detail { color: #000; font-weight: normal; }
.paper-list li .accepted { font-weight: normal; }
.paper-list li .status-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    font-style: normal;
    color: #8a5a00;
    background: rgba(200, 140, 20, 0.1);
    border: 1px solid rgba(200, 140, 20, 0.35);
    border-radius: 4px;
    padding: 2px 8px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0.01em;
}
.paper-list li .pub-links {
    margin-top: 6px;
}
.paper-list li .pub-links a {
    font-size: 0.72rem;
    padding: 2px 8px;
}

.paper-list li a.txt-link {
    color: #4a6fa5;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 2px 8px;
    border: 1px solid #d8d0d3;
    border-radius: 3px;
    margin-right: 4px;
}
.paper-list li a.txt-link:hover { background: rgba(74, 111, 165, 0.06); border-color: #4a6fa5; }

.wip-list { list-style: disc; padding-left: 1.5rem; }
.wip-list li { margin-bottom: 0.4rem; font-size: 0.95rem; }

.abstract {
    font-size: 0.9rem;
    color: #000;
    margin-top: 0.5rem;
    line-height: 1.65;
    text-align: justify;
}
.abstract.collapsed { display: none; }


/* ---- Teaching Page ---- */
.teaching-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #000;
}
.teaching-section h3:first-child { margin-top: 0; }
.teaching-section ul { list-style: disc; padding-left: 1.5rem; }
.teaching-section ul li { margin-bottom: 0.3rem; font-size: 0.95rem; }
.teaching-section ul li em { color: #000; }

/* ---- Contact Page (standalone) ---- */
.contact-name {
    font-size: 1.3rem;
    color: #4a6fa5;
    margin-bottom: 1rem;
    font-weight: 400;
}
.contact-block {
    background: #f7f7f7;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.9rem;
    line-height: 1.9;
    color: #000;
    max-width: 500px;
}

/* ---- Page Content wrapper (for sub-pages) ---- */
.page-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 24px 60px;
}

/* ---- Hero Banner (for sub-pages) ---- */
.hero-banner {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    object-position: center top;
    display: block;
    margin-top: 58px;
}

/* ---- Research Topics Section (index page) ---- */
.topics-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
}

.topics-heading {
    padding-right: 20px;
}

.topics-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.topic-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 3px;
    padding: 18px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.topic-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
    color: inherit;
}

/* Per-card tinted backgrounds */
.topic-card:nth-child(1) { background: #fdf6f0; border-color: rgba(180, 120, 80, 0.2); }
.topic-card:nth-child(2) { background: #f0f4fb; border-color: rgba(80, 110, 170, 0.2); }
.topic-card:nth-child(3) { background: #f2f7f2; border-color: rgba(80, 140, 90, 0.2); }
.topic-card:nth-child(1):hover { border-color: rgba(180, 120, 80, 0.4); }
.topic-card:nth-child(2):hover { border-color: rgba(80, 110, 170, 0.4); }
.topic-card:nth-child(3):hover { border-color: rgba(80, 140, 90, 0.4); }

.topic-icon {
    font-size: 1.4rem;
    color: #4a6fa5;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.topic-card:nth-child(1) .topic-icon { color: rgba(180, 120, 80, 0.9); }
.topic-card:nth-child(2) .topic-icon { color: rgba(80, 110, 170, 0.9); }
.topic-card:nth-child(3) .topic-icon { color: rgba(80, 140, 90, 0.9); }

.topic-card-text {
    flex: 1;
    min-width: 0;
}

.topic-card-title {
    font-family: 'DM Sans', 'Libre Franklin', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 2px;
}

.topic-card-desc {
    font-size: 0.85rem;
    color: #000;
    font-style: italic;
    line-height: 1.4;
}

/* ---- Topic Filter Bar (research page) ---- */
.research-nav-bar {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.topic-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none;
}

.topic-filter-btn {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 16px;
    border: 1px solid #d8d0d3;
    border-radius: 20px;
    background: #fff;
    color: #000;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.topic-filter-btn:hover {
    background: rgba(74, 111, 165, 0.06);
    border-color: #4a6fa5;
}
.section-jump-btn {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.04);
    color: #000;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.section-jump-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000;
}

.topic-filter-btn.active {
    background: #4a6fa5;
    color: #fff;
    border-color: #4a6fa5;
}

/* Topic-specific filter button colors */
.topic-filter-btn[data-filter="housing"] { background: #fdf6f0; border-color: rgba(180, 120, 80, 0.3); }
.topic-filter-btn[data-filter="housing"]:hover { background: #f7ece0; border-color: rgba(180, 120, 80, 0.5); }
.topic-filter-btn[data-filter="housing"].active { background: rgba(180, 120, 80, 0.75); border-color: rgba(180, 120, 80, 0.9); color: #fff; }

.topic-filter-btn[data-filter="otc"] { background: #f0f4fb; border-color: rgba(80, 110, 170, 0.3); }
.topic-filter-btn[data-filter="otc"]:hover { background: #e4ecf7; border-color: rgba(80, 110, 170, 0.5); }
.topic-filter-btn[data-filter="otc"].active { background: rgba(80, 110, 170, 0.75); border-color: rgba(80, 110, 170, 0.9); color: #fff; }

.topic-filter-btn[data-filter="macro"] { background: #f2f7f2; border-color: rgba(80, 140, 90, 0.3); }
.topic-filter-btn[data-filter="macro"]:hover { background: #e6f0e6; border-color: rgba(80, 140, 90, 0.5); }
.topic-filter-btn[data-filter="macro"].active { background: rgba(80, 140, 90, 0.75); border-color: rgba(80, 140, 90, 0.9); color: #fff; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .profile-column {
        width: 100%;
        justify-self: center;
    }

    .topics-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .topics-heading {
        padding-right: 0;
    }

    .profile-photo {
        width: 200px;
        height: 200px;
    }

    .bio-column {
        text-align: left;
    }

    .info-columns {
        flex-direction: column;
        gap: 24px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 58px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        line-height: 48px;
        padding: 0 24px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    }

    .pub-card {
        padding: 16px 18px;
    }

    .section-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .profile-photo {
        width: 160px;
        height: 160px;
    }

    .greeting {
        font-size: 1.5rem;
    }

    .about-section {
        padding: 80px 16px 40px;
    }
}
