/* =========================================================
   GLOBAL
   ========================================================= */

html {
    scroll-behavior: smooth;
}

body {
    padding-top: 75px;
    line-height: 1.6;
    color: #222;
    background-color: #fff;
}

/* Plus large qu'avant pour réduire le blanc sur grands écrans */
.container,
.container-fluid {
    max-width: 1380px;
}

/* Encore plus large sur très grands écrans */
@media (min-width: 1600px) {
    .container,
    .container-fluid {
        max-width: 1520px;
    }
}

h4 {
    color: tomato;
    margin-bottom: 1rem;
    font-weight: 600;
}

h5 {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
}

.section-title {
    color: tomato;
    font-weight: 600;
}

.dark-link {
    color: black;
}

.dark-link:hover {
    color: #dc3545;
}

p {
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.55rem;
}

.row {
    row-gap: 1rem;
}

.text-justify {
    text-align: justify;
}

/* =========================================================
   NAVBAR
   ========================================================= */

.navbar {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-variant: small-caps;
    transition: color 0.3s;
}

.navbar-nav .nav-link:hover {
    color: #dc3545;
}

/* =========================================================
   LINKS / ICONS
   ========================================================= */

.pdf-link {
    padding-left: 10pt;
    padding-top: 5pt;
}

.fa-file-pdf-o {
    color: #b54030;
    margin-right: 0.35rem;
}

.small-caps {
    font-variant: small-caps;
}

.small-text {
    font-size: smaller;
}

/* =========================================================
   IMAGES - BASE
   ========================================================= */

img {
    max-width: 100%;
    height: auto;
}

.site-img,
.full-width-img,
.figure-img,
.banner-img,
.wide-img {
    display: block;
    width: 100%;
    height: auto;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    border-radius: 4px;
    object-fit: contain;
}

.fullscreen-img {
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fullscreen-img:hover {
    opacity: 0.92;
    transform: scale(1.01);
}

/* =========================================================
   INDEX / RESEARCH IMAGES PRINCIPALES
   ========================================================= */

/* Première image research/index : agrandie */
.index-main-img {
    width: 100% !important;
    max-width: 680px !important;
}

/* Grande première image */
.index-first-img {
    width: 100% !important;
    max-width: 920px !important;
}

/* Les 6 autres images : agrandies */
.index-gallery-img {
    width: 100% !important;
    max-width: 720px !important;
}

.sticky-md img[src*="SainteVictoire"] {
    width: 100% !important;
    max-width: 680px !important;
}

/* Les images research passent plus tôt l'une sous l'autre pour éviter le blanc */
@media (max-width: 1199px) {
    .row > [class*="col-"]:has(.index-main-img),
    .row > [class*="col-"]:has(.index-first-img),
    .row > [class*="col-"]:has(.index-gallery-img),
    .row > [class*="col-"]:has(img[src*="SainteVictoire"]) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* =========================================================
   RESEARCH
   ========================================================= */

.axis-img,
.research-axis-img {
    width: 100% !important;
    max-width: 500px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0.8rem auto 1rem auto !important;
}

.axis-wide-img,
.banner-img {
    width: 100% !important;
    max-width: 1150px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 1rem auto 1.2rem auto !important;
}

.research-interest-img,
.wide-img {
    width: 100% !important;
    max-width: 360px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 0 0 0 !important;
}

/* =========================================================
   TEAM - IMAGES CARREES
   ========================================================= */

/*
   Ces classes doivent être sur les images team :
   class="team-photo"
   ou class="team-img"
   ou class="member-img"
*/

.team-photo,
.team-img,
.member-img,
.alumni-img,
.team-card img,
.team-member img {
    display: block !important;
    width: 100% !important;
    max-width: 250px !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    object-fit: cover !important;
    margin: 1rem auto 1.2rem auto !important;
    border-radius: 4px;
}

/* Colonnes team sur PC */
@media (min-width: 992px) {
    .row > [class*="col-"]:has(.team-photo),
    .row > [class*="col-"]:has(.team-img),
    .row > [class*="col-"]:has(.member-img),
    .row > [class*="col-"]:has(.alumni-img),
    .team-card,
    .team-member {
        flex: 0 0 25% !important;
        max-width: 22% !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .row > [class*="col-"]:has(.team-photo),
    .row > [class*="col-"]:has(.team-img),
    .row > [class*="col-"]:has(.member-img),
    .row > [class*="col-"]:has(.alumni-img),
    .team-card,
    .team-member {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
}

.team-member,
.team-card {
    margin-bottom: 3rem;
    padding-left: 16px !important;
    padding-right: 16px !important;
    line-height: 1.35;
    min-width: 0;
}

.team-member .row,
.team-card .row {
    margin-left: 0;
    margin-right: 0;
}

.team-member .pdf-link,
.team-card .pdf-link {
    display: inline-block;
    padding-left: 8px;
    padding-top: 0;
}

/* =========================================================
   TEACHING
   ========================================================= */

.teaching-main-img,
img[src*="logo_IUT"] {
    display: block !important;
    width: 100% !important;
    max-width: 400px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 1rem auto !important;
}

/* Les deux images funded */
.teaching-funded-img,
img[src*="FIP_3DNoPrint"],
img[src*="Inproto2023"] {
    display: block !important;
    width: 100% !important;
    max-width: 460px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 1rem auto !important;
}

/* Force les colonnes des images funded teaching à être plus larges sur PC */
@media (min-width: 992px) {
    .row > [class*="col-"]:has(img[src*="FIP_3DNoPrint"]),
    .row > [class*="col-"]:has(img[src*="Inproto2023"]),
    .row > [class*="col-"]:has(.teaching-funded-img) {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }

    .row > [class*="col-"]:has(img[src*="logo_IUT"]),
    .row > [class*="col-"]:has(.teaching-main-img) {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
}

/* =========================================================
   CV
   ========================================================= */

/* PP uniquement : augmentée sans toucher aux autres images */
.profile-img,
img[src*="Loic"] {
    display: block !important;
    width: 100% !important;
    max-width: 340px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto 1rem auto !important;
}

.cv-header {
    margin-bottom: 2rem;
}

.cv-photo-block {
    margin-bottom: 1.5rem;
}

.cv-info-block {
    min-width: 0;
}

.cv-row {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.cv-date h5 {
    color: #222;
    margin-bottom: 0.3rem;
}

.cv-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================================
   LOGOS
   ========================================================= */

.logo-medium {
    width: auto;
    max-height: 65px;
    margin: 0.5rem;
}

.logo-right-space {
    padding-right: 10px;
}

.inline-logo-small {
    height: 20px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.inline-logo-medium {
    height: 50px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.orcid-icon {
    width: 1em;
    margin-right: 0.5em;
}

/* =========================================================
   RESEARCH AXIS BLOCKS
   ========================================================= */

.research-axis {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.axis-bar {
    width: 10px !important;
    flex: 0 0 10px;
}

.axis-content {
    min-width: 0;
}

.axis-bar-chocolate {
    background: repeating-linear-gradient(
        45deg,
        white,
        white 3px,
        chocolate 3px,
        chocolate 6px
    );
}

.axis-bar-blue {
    background: repeating-linear-gradient(
        45deg,
        white,
        white 3px,
        cornflowerblue 3px,
        cornflowerblue 6px
    );
}

.axis-bar-green {
    background: repeating-linear-gradient(
        45deg,
        white,
        white 3px,
        mediumseagreen 3px,
        mediumseagreen 6px
    );
}

.axis-title-chocolate {
    color: chocolate;
}

.axis-title-blue {
    color: cornflowerblue;
}

.axis-title-green {
    color: mediumseagreen;
}

.research-interest-card {
    margin-bottom: 2rem;
}

.research-interest-card h5 {
    text-align: left;
}

.research-interest-card ol {
    padding-left: 1.3rem;
}

/* =========================================================
   PUBLICATION METRICS
   ========================================================= */

.publication-metrics-section {
    margin-bottom: 1.5rem;
}

.metrics-card {
    height: 100%;
    padding: 1.35rem 1.5rem;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background-color: #fafafa;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1.6rem;

    text-align: left;
}

.metrics-card-header-logo {
    flex: 0 0 210px;
    width: 210px;
    height: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 0;
}

.metrics-card-header-logo img {
    width: 200px;
    max-height: 100px;
    object-fit: contain;
    display: block;
}

.metrics-card-content {
    flex: 0 1 auto;
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.metrics-card-values {
    width: auto;
}

.metrics-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1.4rem;
    margin-bottom: 0.75rem;
    width: auto;
}

.metric-item {
    min-width: 115px;
    text-align: left;
}

.metric-number {
    display: block;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    color: #222;
}

.metric-label {
    display: block;
    font-size: 0.92rem;
    color: #555;
}

.metrics-link {
    color: black;
    font-size: 0.92rem;
    text-align: left;
    white-space: nowrap;
}

.metrics-link:hover {
    color: #dc3545;
    text-decoration: none;
}

.metrics-error {
    color: #777;
    font-style: italic;
    margin-bottom: 1rem;
}

/* Version tablette/téléphone */
@media (max-width: 768px) {
    .metrics-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        padding: 1.25rem;
    }

    .metrics-card-header-logo {
        flex: none;
        width: 100%;
        justify-content: center;
    }

    .metrics-card-header-logo img {
        width: 165px;
        max-height: 85px;
    }

    .metrics-card-content {
        align-items: center;
        text-align: center;
    }

    .metrics-grid {
        justify-content: center;
        gap: 1rem;
    }

    .metric-item {
        min-width: 110px;
        text-align: center;
    }

    .metric-number {
        font-size: 1.75rem;
    }

    .metrics-link {
        text-align: center;
        white-space: normal;
    }
}

/* =========================================================
   STICKY
   ========================================================= */

@media (min-width: 768px) {
    .sticky-md {
        position: -webkit-sticky;
        position: sticky;
        top: 90px;
        align-self: flex-start;
    }
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    padding-top: 20px;
    margin-top: 2rem;
}

.site-footer p {
    margin-bottom: 1rem;
}

/* =========================================================
   FULLSCREEN OVERLAY
   ========================================================= */

#fullscreenOverlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

#fullscreenBackdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 1;
}

#fullscreenImage {
    max-width: 90%;
    max-height: 90%;
    z-index: 2;
    cursor: zoom-out;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    outline: none;
}

/* =========================================================
   TABLETTE
   ========================================================= */

@media (max-width: 991px) {
    .container-fluid {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .index-main-img,
    .sticky-md img[src*="SainteVictoire"] {
        max-width: 620px !important;
    }

    .index-first-img {
        max-width: 780px !important;
    }

    .index-gallery-img {
        max-width: 620px !important;
    }

    .axis-img,
    .research-axis-img {
        max-width: 440px !important;
    }

    .axis-wide-img,
    .banner-img {
        max-width: 100% !important;
    }

    .research-interest-img,
    .wide-img {
        max-width: 400px !important;
    }

    .team-photo,
    .team-img,
    .member-img,
    .alumni-img,
    .team-card img,
    .team-member img {
        max-width: 360px !important;
        aspect-ratio: 1 / 1 !important;
    }

    .teaching-main-img,
    img[src*="logo_IUT"] {
        max-width: 360px !important;
    }

    .teaching-funded-img,
    img[src*="FIP_3DNoPrint"],
    img[src*="Inproto2023"] {
        max-width: 390px !important;
    }

    .profile-img,
    img[src*="Loic"] {
        max-width: 300px !important;
    }

    .team-member,
    .team-card {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* =========================================================
   TELEPHONE
   ========================================================= */

@media (max-width: 767px) {
    body {
        padding-top: 70px;
        font-size: 15px;
    }

    .container-fluid {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .index-main-img,
    .index-first-img,
    .index-gallery-img,
    .sticky-md img[src*="SainteVictoire"] {
        max-width: 100% !important;
    }

    .axis-img,
    .research-axis-img {
        max-width: 300px !important;
    }

    .axis-wide-img,
    .banner-img {
        max-width: 100% !important;
    }

    .research-interest-img,
    .wide-img {
        max-width: 300px !important;
    }

    .row > [class*="col-"]:has(.team-photo),
    .row > [class*="col-"]:has(.team-img),
    .row > [class*="col-"]:has(.member-img),
    .row > [class*="col-"]:has(.alumni-img),
    .team-card,
    .team-member {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .team-photo,
    .team-img,
    .member-img,
    .alumni-img,
    .team-card img,
    .team-member img {
        max-width: 235px !important;
        aspect-ratio: 1 / 1 !important;
    }

    .teaching-main-img,
    img[src*="logo_IUT"] {
        max-width: 230px !important;
    }

    .teaching-funded-img,
    img[src*="FIP_3DNoPrint"],
    img[src*="Inproto2023"] {
        max-width: 230px !important;
    }

    .profile-img,
    img[src*="Loic"] {
        max-width: 210px !important;
    }

    .team-member,
    .team-card {
        margin-bottom: 2.4rem;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .cv-photo-block {
        text-align: center;
    }

    .cv-logos {
        justify-content: flex-start;
    }

    .logo-medium {
        max-height: 50px;
    }

    .axis-bar {
        display: none;
    }

    .axis-content {
        padding-left: 0 !important;
    }

    .text-justify {
        text-align: left;
    }
}

/* =========================================================
   TRES PETIT TELEPHONE
   ========================================================= */

@media (max-width: 420px) {
    body {
        font-size: 14px;
    }

    .container-fluid {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .navbar-brand {
        font-size: 0.9rem;
    }

    .axis-img,
    .research-axis-img {
        max-width: 270px !important;
    }

    .research-interest-img,
    .wide-img {
        max-width: 260px !important;
    }

    .team-photo,
    .team-img,
    .member-img,
    .alumni-img,
    .team-card img,
    .team-member img {
        max-width: 210px !important;
        aspect-ratio: 1 / 1 !important;
    }

    .teaching-main-img,
    img[src*="logo_IUT"] {
        max-width: 210px !important;
    }

    .teaching-funded-img,
    img[src*="FIP_3DNoPrint"],
    img[src*="Inproto2023"] {
        max-width: 210px !important;
    }

    .profile-img,
    img[src*="Loic"] {
        max-width: 190px !important;
    }

    .team-member,
    .team-card {
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-bottom: 2rem;
    }
}