@charset "utf-8";

/* ======================
   Base Styles
====================== */
body {
    font-family: "Lato", sans-serif;
    font-weight: 400;
    padding-top: 5rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
}

/* ======================
   Cards & Rounded Elements
====================== */
.card, .theme-card {
    border-radius: 0.8rem !important;
    background-color: var(--card-bg);
    border-color: var(--card-border);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.card-img-overlay {
    border-radius: 0.8rem !important;
}

.rounded-xl {
    border-radius: 0.8rem !important;
}

.rounded-xl-bottom {
    border-bottom-right-radius: 0.8rem !important;
    border-bottom-left-radius: 0.8rem !important;
}

.rounded-xl-top {
    border-top-left-radius: 0.8rem !important;
    border-top-right-radius: 0.8rem !important;
}

.theme-border-bottom {
    border-bottom: 2px solid var(--border-color) !important;
}

/* ======================
   Profile Text
====================== */
.text-profile-position {
    font-weight: 400;
    line-height: 1.2;
}

.text-profile-bio {
    font-weight: 400;
}

.no-break {
  white-space: nowrap;
}

.education-grid {
    display: grid;
    grid-template-columns: 1fr auto; /* Name on left, date on right */
    gap: 0.25rem 0.5rem; /* row-gap, column-gap */
    width: 100%;
}

.entry-content {
    display: flex;
    flex-direction: column;
}

.entry-header {
    display: flex;
    align-items: baseline; /* keep date aligned with name */
    gap: 0.5rem; /* space between name and date */
}

.entry-name {
    font-weight: 600; /* bold for names */
    font-size: 0.95rem;
}

.entry-date {
    font-weight: 400;
    font-size: 0.85rem;
    text-align: right;
    /*color: var(--text-color-secondary, #666); !* optional: slightly muted *!*/
}

.entry-subtitle {
    grid-column: 1 / -1;
    font-size: 0.875rem;
    margin-top: 0.15rem;
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

/* ======================
   Navbar
====================== */
.navbar {
    opacity: 0.95;
    background-color: var(--navbar-bg) !important;
    color: var(--text-color-navbar) !important;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.navbar-brand, .navbar-nav .nav-link, .navbar-brand strong {
    color: var(--text-color-navbar) !important;
}

.navbar-nav .nav-link.active {
    font-weight: 750;
    opacity: 0.9;
}

.navbar-nav .nav-link:hover {
    opacity: 0.75;
}

/* Style the navbar toggle button in both themes */
.navbar-toggler {
  color: var(--text-color-navbar) !important;
  border-color: var(--text-color-navbar) !important;
}

/* The <i> icon inside the button */
.navbar-toggler .fa-bars {
  color: var(--text-color-navbar) !important;
}

/* Small screens (phones) */
@media (max-width: 576px) {
    .navbar { opacity: 1; }
}

/* ======================
   Logos
====================== */
.logo-container {
    display: flex;
    justify-content: left;
    align-items: center;
    margin: 20px 0;
    gap: 20px;
}

.logo {
    height: 53px;
    width: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover {
    transform: scale(1.025);
    filter: brightness(1.15);
}

.large-logo { height: 100px; }
.small-logo { height: 40px; }
.large-small-logo { height: 60px; }

@media (max-width: 800px) {
    .logo-container { gap: 5px; }
    .logo { max-height: 40px; }
    .large-logo { max-height: 70px; }
}

/* ======================
   Carousel
====================== */
.carousel-image { height: 36vh; object-fit: cover; }
.carousel { margin-top: 4.5rem; }
.carousel-caption { color: var(--text-color); }

/* ======================
   Text & Links
====================== */
.text-justify { text-align: justify; }
.email-text { font-family: Source Code Pro, monospace; }

a, .nav-link, .author-link, .citation-badge {
    color: var(--link-color);
    text-decoration: none !important;
    transition: color 0.3s ease, background-color 0.3s ease;
}

a:hover, .nav-link:hover, .author-link:hover, .citation-badge:hover {
    color: var(--link-hover-color);
}

/* Author */
.author-link { color: var(--link-color); transition: color 0.3s ease; }
.author-theme::after { content: ", "; }
.author-theme:last-child::after { content: ""; }

/* ======================
   Search bar
====================== */

/* for the research */
.highlight {
    background-color: yellow;
    color: black;
    font-weight: 600;
}

.searchbar {
    background-color: var(--card-bg);
    border-color: var(--card-border);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Default (desktop) */
.custom-spacing {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.custom-spacing-col {
  padding-left: 6rem;
  padding-right: 6rem;
}

/* Medium screens (tablets) */
@media (max-width: 992px) {
    .custom-spacing-col {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* Small screens (phones) */
@media (max-width: 576px) {
    .custom-spacing {
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
    .custom-spacing-col {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Match the placeholder color to the text color */
.searchbar::placeholder {
  color: var(--text-color);
  opacity: 0.6; /* optional: make it slightly lighter */
}

/* Focused state (light mode) */
.searchbar:focus {
  outline: none;
  border-color: var(#007bff);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
  background-color: var(--card-bg);
  color: var(--text-color);
}

/* ======================
   Badges
====================== */
.inline-badge {
    height: 1.6em;
    width: 1.6em;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
    margin-right: 0.25rem;
    transition: filter 0.3s ease;
}

.larger-inline-badge {
    height: 2.2em;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
    margin-right: 0.25rem;
    transition: filter 0.3s ease;
}

.citation-badge {
    display: inline-block;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0.13rem 0.25rem;
    vertical-align: text-bottom;
    border-radius: 0.25rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--citation-text);
    background-color: var(--citation-bg);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.3s ease;
}

.citation-badge:hover {
    background-color: var(--citation-bg-hover);
    color: var(--citation-text);
    transform: scale(1.05);
}

/* ======================
   Lazy-loaded Images / Divs
====================== */
img.lazy, div.lazy {
    background-image: url('images/loading.gif');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50px 50px;
    min-height: 80px;
    filter: none;
    transition: filter 0.4s ease, opacity 0.3s ease;
}

div.lazy.lazy-loaded { background-size: cover; background-position: center; }

/* ======================
   Cover Mobile Overlay
====================== */
.cover-mobile {
    position: relative;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    min-height: 120px;
}

/* Background image div */
.cover-mobile-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Overlay & text */
.cover-mobile-overlay {
    position: relative;
    inset: 0;
    background-color: var(--bg-translucent);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    color: var(--text-color);
    z-index: 1;
    transition: background-color 0.3s ease, color 0.3s ease;
}
/* Text scaling for headings and paragraphs */
.cover-mobile-overlay h5 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cover-mobile-overlay p {
    font-size: 0.8rem;
    margin: 0.125rem 0;
}

/* Slightly larger text for medium+ screens */
@media (min-width: 576px) {
    .cover-mobile-overlay {
        padding: 1rem 1.25rem;
    }
    .cover-mobile-overlay h5 {
        font-size: 1.1rem;
    }
    .cover-mobile-overlay p {
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) {
    .cover-mobile-overlay {
        padding: 1.25rem 1.5rem;
    }
    .cover-mobile-overlay h5 {
        font-size: 1.25rem;
    }
    .cover-mobile-overlay p {
        font-size: 0.9rem;
    }
}

/* Dark mode support (uses same var(--bg-translucent)) */
[data-theme="dark"] .cover-mobile-overlay {
    background-color: var(--bg-translucent);
    color: var(--text-color);
}

/* Optional: rounded corners for top/bottom first/last cards */
.cover-mobile.rounded-xl-top { border-top-left-radius: 0.8rem; border-top-right-radius: 0.8rem; }
.cover-mobile.rounded-xl-bottom { border-bottom-left-radius: 0.8rem; border-bottom-right-radius: 0.8rem; }
.cover-mobile-overlay.rounded-xl-top { border-top-left-radius: 0.8rem; border-top-right-radius: 0.8rem; }
.cover-mobile-overlay.rounded-xl-bottom { border-bottom-left-radius: 0.8rem; border-bottom-right-radius: 0.8rem; }
.cover-mobile-bg.rounded-xl-top { border-top-left-radius: 0.8rem; border-top-right-radius: 0.8rem; }
.cover-mobile-bg.rounded-xl-bottom { border-bottom-left-radius: 0.8rem; border-bottom-right-radius: 0.8rem; }

img[data-dark-src], div[data-dark-src] { transition: opacity 0.3s ease; }

/* Automatic dark-mode inversion for elements without data-dark-src */
img:not(.no-invert):not([data-dark-src]),
div.lazy:not([data-dark-src]) {
    transition: filter 0.4s ease, opacity 0.3s ease;
}

[data-theme="dark"] img:not(.no-invert):not([data-dark-src]),
[data-theme="dark"] div.lazy:not([data-dark-src]) {
    filter: invert(1) hue-rotate(180deg) brightness(1.05) contrast(0.95);
}

/* ======================
   Theme Toggle Icon
====================== */
#theme-toggle i {
    font-size: 1.1rem;
    display: inline-block;
    width: 1.2em;
    text-align: center;
    transition: color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

[data-theme="dark"] #theme-toggle i { color: #ffc107 !important; }
[data-theme="light"] #theme-toggle i { color: #101e7d !important; }

/* ======================
   Footer
====================== */
footer {
    background: var(--navbar-bg);
    color: var(--text-color-navbar);
}

.footer-link {color: var(--footer-link)}

.footer-link:hover {color: var(--footer-link-hover)}

/* ======================
   Transitions for smooth theme change
====================== */
html[data-theme="dark"], html[data-theme="light"],
body, body img, img, div.lazy,
.card, .carousel-caption, .citation-badge,
.navbar, .footer {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                filter 0.3s ease,
                opacity 0.3s ease;
}

/* Safety: ensure lazy-loaded elements are visible */
div.lazy,
img.lazy {
  opacity: 1;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

div.lazy:not(.lazy-loaded),
img.lazy:not(.lazy-loaded) {
  opacity: 0.3; /* show faintly before load instead of fully hidden */
}

/* Defensive reset: make sure no loaded element stays hidden */
/*img.lazy-loaded,*/
/*div.lazy-loaded {*/
/*  display: block !important;*/
/*  background-image: none !important;*/
/*}*/
/* Remove loading.gif background after load, but keep actual background images for cover-mobile-bg */
img.lazy-loaded {
  display: block !important;
  background-image: none !important;
}

div.lazy-loaded:not(.cover-mobile-bg) {
  display: block !important;
  background-image: none !important;
}

/* Ensure cover-mobile-bg keeps its image visible */
.cover-mobile-bg.lazy-loaded {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block !important;
}

/*============
    NEWS
============*/
/* Timeline layout */
.timeline-year-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-items {
  margin-left: 1.25rem;
  border-left: 2px solid var(--link-color);
  padding-left: 1rem;
}

.timeline-item {
  position: relative;
  padding-bottom: 1rem;
}

.timeline-line {
  position: absolute;
  left: -1.45rem;   /* aligns with year border */
  top: 0.4rem;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--link-color);
  border-radius: 50%;
}

.img-news{
    max-height: 250px;
    width: auto;
    border-radius: 4px;
}

@media (max-width: 576px) {
    .img-news{
        max-width: 100%;
        height: auto;
        display: block;
    }
}

.news-images {
  display: flex;
  flex-wrap: wrap;      /* allows wrapping on small screens */
  gap: 1rem;            /* spacing between images */
  justify-content: center;
}

/* ======================
   Theme Variables
====================== */
:root {
    --bg-color: #e4e6e5;
    --text-color: #212529;
    --text-color-navbar: #111519;
    --card-bg: #f4f3f2;
    --card-border: #dee2e6;
    --navbar-bg: #2d8efd;
    --border-color: #dee2e6;
    --bg-translucent: rgba(255, 255, 255, 0.875);
    --link-color: #0d6efd;
    --footer-link: #0d4edd;
    --link-hover-color: #2d8efd;
    --footer-link-hover: #1d5efd;
    --citation-bg: #0d6efd;
    --citation-bg-hover: #2d8efd;
    --citation-text: #ffffff;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e4e4e4;
    --text-color-navbar: #e4e4e4;
    --card-bg: #1e1e1e;
    --card-border: #333;
    --navbar-bg: #101e7d;
    --border-color: #444;
    --bg-translucent: rgba(30, 30, 30, 0.9);
    --link-color: #2d8eff;
    --footer-link: #2d8eff;
    --link-hover-color: #4daeff;
    --footer-link-hover: #4daeff;
    --citation-bg: #2d8eff;
    --citation-bg-hover: #4daeff;
    --citation-text: #000000;
}
