/* ------------------- global architecture and recurrent variables ----------------- */

:root {
    --color-bg: #f7f7f2;
    --color-dark: #283138;
    --color-accent: #84a98c;
    --color-sand: #e8ddc7;
    --color-ivory: #fefcf6;
    --color-shadow1: 0 8px 32px rgb(40 49 56 / 0.08);
    --color-shadow2: 0 12px 24px rgb(0 0 0 / 0.1);
    --color-shadow3: 0 0 0 3px rgb(132 169 140 / 0.25);
    --color-shadow4: 0 4px 6px rgb(40 49 56 / 0.2);
    
    /* Smooth transitions for interactive elements */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgb(232 221 199 / 0.28);
    --glass-blur: blur(12px);
    --glass-border: rgb(255 255 255 / 0.45);

    /* Header, navigation bar and language switcher: layout */
    --header-top: 1.5rem;        /* distance from the top of the page (logo, nav bar, language switcher) */
    --header-left: 3rem;         /* logo: distance from the left side */
    --nav-right: 8rem;           /* navigation bar: distance from the right side */
    --logo-width: 6rem;          /* logo size */
    --label-space: 1.6rem;       /* room above the language select for "Language :" */
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ---------------------- scrolling -------------- */

/* smooth scrolling when visitors click the back-to-top arrow */
html {
    scroll-behavior: smooth;
}

a:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-sand);
    border-radius: 5px;
    border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

body {
    background: var(--color-bg);
    font-family: "Montserrat", "Avenir Next", Avenir, "Segoe UI", sans-serif;
    color: var(--color-dark);
    line-height: 1.6;
    overflow-x: hidden; 
    display: flex;
    flex-direction: column;
    min-height: 100vh;

}

/* --------------------- header and branding ---------------------------- */

/* In the flow of the page: the content starts below it.
   (index.css lets it float over the hero image on the homepage, and sets the colours of
   the logo, title and motto there with the --hero-* variables) */
header {
    --interface-ink: var(--color-dark);
    position: relative;
    width: 100%;
    padding: var(--header-top) var(--header-left) 0;
}

/* Grid: logo on the left spanning two rows, title + motto stacked on its right.
   The two text rows share the extra height equally, so the text block
   is centred on the middle axis of the logo. */
.header-inner {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    align-items: center;
    column-gap: 1.5rem;
}

.logo-HB {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.logo-HB img {
    display: block;
    width: var(--logo-width);
    max-width: none;
    height: auto;
    filter: none;
    transition: filter 0.3s var(--ease-smooth);
}

/* The motto is centred on the middle axis of the title */
.main-headings,
.motto {
    text-align: center;
}

.main-headings {
    grid-column: 2;
    grid-row: 1;
    align-self: end;             /* title sits just above the middle axis of the logo */
}

.main-headings .title {
    color: var(--interface-ink);
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    transition: color 0.3s var(--ease-smooth);
}

/* Same column as the title and centred: the motto is on the middle axis of the title */
.motto {
    grid-column: 2;
    grid-row: 2;
    align-self: start;           /* motto sits just below the middle axis of the logo */
    color: var(--interface-ink);
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.3;
    transition: color 0.3s var(--ease-smooth);
}


/* ------------------------------ Navigation bar ----------------------------- */



.navigation {
    /* --- settings of the bar (tweak them here) --- */
    --nav-pad-y: 0.8rem;             /* top + bottom padding of the glass bar */
    --nav-pad-x: 1.8rem;             /* left + right padding of the glass bar */
    --submenu-gap: 0px;              /* space between the bar and its sub menu (0 = glued to the bar) */
    --interface-ink: var(--color-dark);

    /* --- hover outline (the "cartouche") --- */
    --cartouche-color: currentColor; /* same colour as the link; use var(--color-accent) for green */
    --cartouche-width: 1.5px;
    --cartouche-speed: 0.5s;

    position: fixed;
    top: var(--header-top);
    right: var(--nav-right);
    z-index: 1000;
    width: auto;
    margin: 0;
    display: flex;
    justify-content: center;
}

/* script.js adds this class while the bar is above a DARK area (hero image, dark section...) */
.navigation.is-on-dark {
    --interface-ink: var(--color-ivory);
}


.navigation ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1.5rem;
    padding: var(--nav-pad-y) var(--nav-pad-x);
    border-radius: 50px;
    flex-wrap: wrap;
    justify-content: center;
}

/* --- GLASS EFFECT of the main bar ---
   It is painted by a ::before layer and not on the <ul> itself: a parent that has a
   backdrop-filter stops the sub menu's own backdrop-filter from seeing the page behind it. */
.navigation > nav > ul {
    position: relative;
}

.navigation > nav > ul::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur); /* Safari support */
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--color-shadow1);
    pointer-events: none;
}

.navigation > nav > ul > li {
    position: relative;
    display: flex;
    align-items: center;
    align-self: stretch; /* as tall as the bar's content, so the sub menu can hang from the bar's real bottom edge */
}

.navigation li {
    position: relative;
}

/* Invisible bridge between "Projects" and its sub menu: the hover is not lost
   while the mouse crosses the bar's bottom padding */
.navigation > nav > ul > li:has(> ul)::after {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: calc(var(--nav-pad-y) + var(--submenu-gap));
}

/* Navigation Link Styling */
.navigation a {
    position: relative; /* anchor of the hover outline */
    text-decoration: none;
    color: var(--interface-ink);
    font-weight: 600;
    transition: var(--transition-smooth);
}

/* The home icon takes the colour of its link (its stroke is set in the SVG markup) */
.navbar-icons path {
    stroke: currentColor;
}

/* Removes the small gap an inline SVG leaves under itself, so the hover outline is centred on the icon */
.navbar-icons svg {
    display: block;
}

.navbar-icons {
    width: 28px;
    height: auto;
    display: block;
}


/* ---- Hover outline: a rounded "cartouche" drawn around the link ----
   Two strokes leave the bottom middle of the link, run around it in opposite directions
   and meet at the top middle. The outline is a rounded border (::after) shown through a
   conic-gradient mask; the mask angle (--cartouche-progress) is animated from 0deg to 180deg. */

@property --cartouche-progress {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.navigation a::after {
    content: "";
    position: absolute;
    inset: -0.3rem -0.75rem; /* room between the text and the outline: top/bottom, left/right */
    border: var(--cartouche-width) solid var(--cartouche-color);
    border-radius: 999px; /* fully rounded ends */
    pointer-events: none;
    mask: conic-gradient(
        from 180deg, /* 180deg = pointing down: the strokes start at the bottom middle */
        #000 0deg var(--cartouche-progress), /* stroke 1: clockwise (up the left side) */
        transparent var(--cartouche-progress) calc(360deg - var(--cartouche-progress)),
        #000 calc(360deg - var(--cartouche-progress)) 360deg /* stroke 2: anticlockwise (up the right side) */
    );
    transition: --cartouche-progress var(--cartouche-speed) ease-in-out;
}

.navigation a:hover::after {
    --cartouche-progress: 180deg; /* the two strokes have met at the top middle */
}

/* Home icon: tighter outline, so it stays close to a circle */
.navigation .navbar-icons::after {
    inset: -0.35rem -0.55rem;
}

@media (prefers-reduced-motion: reduce) {
    .navigation a::after {
        transition: none;
    }
}


/* Submenu Dropdown Container (same Liquid Glass as the main bar) */
.navigation li ul {
    display: none;
    position: absolute;
    /* starts exactly at the bottom edge of the bar... */
    top: calc(100% + var(--nav-pad-y) + var(--submenu-gap));
    /* ...and is centred on the middle axis of the "Projects" link */
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    gap: 0;
    list-style: none;

    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);

    border-radius: 12px;
    width: max-content;
    min-width: unset;
    padding: 6px 0;
    box-shadow: var(--color-shadow2);
    white-space: nowrap;
    z-index: 1000;
}

.navigation li:hover > ul,
.navigation li:focus-within > ul {
    display: flex;
}

.navigation li ul a {
    display: block;
    padding: 0.7rem 1.4rem;
}

/* These links already have padding: the outline sits inside it */
.navigation li ul a::after {
    inset: 0.4rem 0.65rem;
}


/* -------------------------- main ---------------------- */


main {
    display: flex;
    flex-direction: column; 
    align-items: center;  
    width: 100%;           
    padding: 1rem 1rem 3rem 1rem;
    flex: 1; 
}


/* --------------------- language switcher -------------------------- */

/* Fixed like the nav bar, so it follows it when scrolling. The select sits one label
   height below the top line; the label is taken out of the flow and written above it,
   so the box stays the select alone and the chevron (::after) keeps its position. */
.language-switcher {
    --interface-ink: var(--color-dark);
    position: fixed;
    top: calc(var(--header-top) + var(--label-space));
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1100;
}

.language-switcher.is-on-dark {
    --interface-ink: var(--color-ivory);
}

/* Dropdown Chevron Icon */
.language-switcher::after {
    content: "⌄";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-60%);
    color: var(--interface-ink);
    pointer-events: none;
    transition: color 0.3s var(--ease-smooth);
}

.language-switcher label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    translate: -50% 0;           /* centred above the select */
    margin-bottom: 0.2rem;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--interface-ink);
    transition: color 0.3s var(--ease-smooth);
}

.language-switcher select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.35rem 1.5rem 0.35rem 0.8rem;
    background: var(--color-bg);
    border: 1px solid var(--color-sand);
    border-radius: 20px;
    color: var(--color-dark);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.language-switcher select:hover {
    border-color: var(--color-accent);
    background: #ffffff;
}

.language-switcher select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--color-shadow3);
}

/* ------------------------ footer -------------------------------- */

footer {
    --interface-ink: var(--color-dark);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--color-shadow1);
    color: var(--interface-ink);
    margin-top: auto;
    transition: color 0.3s var(--ease-smooth);
}

footer.is-on-dark {
    --interface-ink: var(--color-ivory);
}

.footer-text {
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    gap: 0.3rem;     
    font-size: 0.9rem;
    font-weight: 500;
}

.hypertext-link {
    display: inline-block;
    position: relative;
    font-weight: bold;
    text-decoration: none;
    color: inherit;
}

.hypertext-link:visited {
    color: inherit;
}

.top-button {
    justify-self: center;
    display: flex;
    align-items: center;
    color: var(--interface-ink);
    transition: color 0.3s var(--ease-smooth);
}

.footer-icons {
    width: 38px;
    height: auto;
    stroke: currentColor;
    transition: var(--transition-smooth);
}

.footer-icons:hover {
    transform: translateY(-6px); 
}

#header-placeholder,
#footer-placeholder {
    display: contents;
}

/* --------------------- mobile devices optimisation --------------------------- */

/* Below 960px the nav bar no longer fits beside the logo: it moves under it, full width */
@media (max-width: 960px) {
    :root {
        --header-top: 1rem;
        --header-left: 1rem;
        --logo-width: 4rem;
    }

    header {
        padding-right: 5.5rem;   /* leaves room for the language switcher */
        margin-bottom: 5rem;     /* room for the fixed nav bar, which sits under the logo row */
    }

    .main-headings .title {
        font-size: 1.1rem;
    }

    .motto {
        font-size: 0.75rem;
    }

    .language-switcher {
        right: 1rem;
    }

    .navigation {
        left: 1rem;
        right: 1rem;
        top: calc(var(--header-top) + var(--logo-width) + 0.75rem);
    }
}

/* Tablet & Smaller Devices (Max Width: 768px) */
@media (max-width: 768px) {

    .map-mosaic {
        column-count: 2;
        column-width: 160px;
    }
}

/* Mobile Smartphones (Max Width: 600px) */
@media (max-width: 600px) {

    footer {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .footer-text, .top-button {
        justify-self: center;
    }
    
    header {
        margin-bottom: 7rem;     /* the nav bar can wrap onto two rows */
    }

    .navigation > nav > ul {
        border-radius: 20px;
        padding: 0.8rem;
        gap: 1rem;
    }

    /* Keep the Projects submenu outside the wrapped main bar.  The Projects
       item becomes static so its popup is positioned against the full <ul>. */
    .navigation > nav > ul > li:has(> ul) {
        position: static;
    }

    .navigation > nav > ul > li:has(> ul)::after {
        display: none;
    }

    .navigation li ul {
        top: calc(100% + var(--submenu-gap));
        left: 50%;
        width: max-content;
        max-width: calc(100vw - 2rem);
        margin: 0;
        transform: translateX(-50%);
    }

    .map-mosaic {
        column-count: 1;
    }

    .lightbox-content {
        padding: 1rem;
    }

    #lightbox-img {
        max-height: 65vh;
    }

    #map-carousel-img {
        max-height: 62vh;
    }

    .map-carousel-controls {
        margin-top: 0.75rem;
        gap: 0.5rem;
    }

    .map-carousel-arrow {
        font-size: 1.5rem;
    }
}


@media (hover: none), (pointer: coarse) {
    .map-tile .caption {
        position: static;
        display: block;
        opacity: 1;
        background: none;
        color: var(--color-dark);
        font-size: 0.85rem;
        text-align: center;
        padding: 0.5rem 0.25rem 0;
    }

    .map-tile:active .map {
        transform: scale(0.98); /* small tap feedback instead of a hover effect */
    }
}


/* -------------- Article styling (with transition) ------------------- */

/* Keyframe animation for smooth fade-in and subtle upward movement */
@keyframes fadeInSection {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


.article-section {
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 1rem;
    width: 100%; 
    max-width: 1200px; 
    margin: 2rem auto 2rem auto;
    padding: 0 2.5rem;
    scroll-margin-top: 110px;
    opacity: 0;
    animation: fadeInSection 0.6s ease-out 0.6s forwards;
}


.article-section .title-1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem); 
    color: var(--color-dark);
    padding-top: 0rem;
    margin-bottom: 2rem;
    text-align: left;
    width: 100%; 
    padding-left: 0.5rem; 
    opacity: 0;
    animation: fadeInSection 0.6s ease-out 0.2s forwards;
}

/* Shared glass panel used by article content and the contact card. */
.article-section .article-text,
.contact-card {
    border: 1px solid var(--color-dark); 
    padding: 2rem; 
    border-radius: 12px; 
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--color-shadow1);
}

.article-section .article-text {
    width: 100%; 
    opacity: 0;
    animation: fadeInSection 0.6s ease-out 0.4s forwards;
}

/* Paragraph spacing inside article-text */
.article-text p {
    margin-bottom: 1rem;
    color: var(--color-dark);
}

/* Removes the margin from the very last paragraph so the box padding stays even */
.article-text p:last-child {
    margin-bottom: 0;
}


/* ------------- image (sizing + transition + caption) ----------------- */


/* Wrapper handles the page load animation */
.image-wrapper {
    width: 100%;
    max-width: clamp(100px, 80vw, 800px);
    margin: 2rem auto 0 auto;
    opacity: 0;
    animation: fadeInSection 0.6s ease-out 0.6s forwards;
}

/* Image handles sizing & hover interaction */
.images {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: var(--transition-smooth);
    cursor: pointer;
}



.images:hover {
    transform: translateY(-4px);
    filter: drop-shadow(var(--color-shadow4)); 
}

/* Styling for image captions + credits*/
.caption {
    /* 1. Distance between the image above and this caption */
    margin-top: 0.75rem; 
    /* 2. Distance between this caption and the picture/content below it */
    margin-bottom: 3rem; 
    /* Typography & aesthetics */
    text-align: center;       /* Centers the caption beneath the image */
    font-size: 0.9rem;        
    font-style: italic;
    color: var(--color-dark);
}


/* --------------------- JS lightbox images --------------------*/

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1200;  /* above the fixed nav bar (1000) and language switcher (1100) */
    cursor: default;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

/* Lightbox Frame - glass morphism style matching the navigation bar */
.lightbox-content {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--color-shadow1);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 90vw;
    max-height: 90vh;
    min-width: 280px;
    position: relative;
    display: inline-block;
    cursor: default;
}


/* Enlarged Image inside Lightbox */
#lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    cursor: default;
}

/* Caption inside Lightbox */
.lightbox-caption {
    margin-top: 1rem;
    color: var(--color-dark);
    font-style: italic;
    text-align: center;
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: -3px;
    right: -1px;
    z-index: 10;
    font-size: 2.5rem;
    color: var(--color-dark, #fff);
    line-height: 1;
    cursor: pointer;
}



/* --------------------- map mosaic (thumbnails) --------------------*/

/* Outer wrapper — matches the width of .article-text and displays
   the mosaic directly on the main webpage without a nested scrollbar */
.map-wrapper {
    width: 100%;
}

/* Mosaic placed directly inside <main> (e.g. hb.html), not inside an .article-section
   (e.g. knowledge.html). In that case it does not inherit the width limits of
   .article-section, so it is given the same box here: same max-width and same side
   padding, which makes it exactly as wide as .article-text.
   It also gets the same fade-in as the other blocks of the page. */
main > .map-wrapper {
    max-width: 1200px;           /* same as .article-section */
    padding: 0 2.5rem;           /* same as .article-section */
    margin: 0 auto;              /* centred in <main> */
    opacity: 0;
    animation: fadeInSection 0.6s ease-out 0.6s forwards;
}

/* Inner multi-column mosaic — flows naturally on the main webpage */
.map-mosaic {
    column-count: 3;
    column-width: 220px;
    column-gap: 1rem;
    width: 100%;
}

/* Each tile: image + its caption overlay, self-contained */
.map-tile {
    position: relative;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.map-tile .map {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition-smooth);
}

/* Caption + gradient scrim, at the bottom of the image, hidden until revealed */
.map-tile .caption {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    margin: 0;
    padding: 1rem;
    color: #fff;
    font-style: italic;
    font-size: 0.9rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
}

/* Only reveal on hover for devices with a real pointer (mouse/trackpad) */
@media (hover: hover) and (pointer: fine) {
    .map-tile:hover .caption {
        opacity: 1;
    }

    .map-tile:hover .map {
        filter: drop-shadow(var(--color-shadow4));
    }
}



/* --------------------- map magnifying glass --------------------*/

.map-magnifier {
    position: fixed;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 4px solid var(--color-sand);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2),
                0 16px 40px rgba(0, 0, 0, 0.45),
                inset 0 0 30px rgba(0, 0, 0, 0.25);
    background-repeat: no-repeat;
    background-color: var(--color-bg);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.6);
    transition: opacity 0.25s ease, transform 0.25s var(--ease-smooth), visibility 0.25s;
    z-index: 1300;
    overflow: hidden;
}

.map-magnifier.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Glass shine / reflection highlight overlay */
.map-magnifier::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.15) 35%, transparent 65%);
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

/* Precision reticle indicator in the center of the optical loupe */
.map-magnifier::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(40, 49, 56, 0.45);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

/* Magnifier status pill */
.map-magnifier-pill {
    position: absolute;
    bottom: calc(100% + 0.6rem);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--color-dark);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s var(--ease-smooth), visibility 0.25s;
    box-shadow: var(--color-shadow1);
    white-space: nowrap;
    z-index: 20;
}

#map-carousel.is-magnifier-active .map-magnifier-pill {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
    .map-magnifier {
        width: min(340px, 85vw);
        height: min(340px, 85vw);
    }
}



/* --------------------- JS map carousel --------------------*/

#map-carousel-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.2s ease;
}

#map-carousel.is-magnifier-active #map-carousel-img {
    cursor: zoom-out;
    touch-action: none;
}

/* Bottom bar: prev arrow — caption & counter — next arrow, side by side */
.map-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
    min-height: 3rem;
}

.map-carousel-caption-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
}

#map-caption,
.map-carousel-controls .caption {
    margin: 0;
    color: var(--color-dark);
    font-style: italic;
    text-align: center;
    line-height: 1.4;
}

.map-counter,
#map-counter {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-dark);
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.05em;
}

.map-carousel-arrow {
    flex-shrink: 0;
    font-size: 1.8rem;
    color: var(--color-dark);
    cursor: pointer;
    line-height: 1;
    user-select: none;
    transition: var(--transition-smooth);
}

/* Nudge each arrow a little further in the direction it navigates */
.map-carousel-prev:hover {
    transform: translateX(-6px);
}

.map-carousel-next:hover {
    transform: translateX(6px);
}


/* --------------------- credits (under the caption) --------------------*/

/* Credits are only shown in the opened carousel (#map-credits), never on the
   thumbnails of the mosaic: they stay hidden inside a .map-tile, hover included. */
.map-tile .credits {
    display: none;
}

/* Credits line: a bit smaller than the caption (0.9rem in the mosaic, 1rem in the carousel) */
.credits {
    margin: 0;
    font-size: 0.8rem;
    font-style: normal;
    line-height: 1.4;
    text-align: center;
    color: var(--color-dark);
}

/* Clickable part of the credits: same size as .credits, bold, same colour in every state */
.credits-links,
.credits-links:link,
.credits-links:visited,
.credits-links:hover,
.credits-links:active {
    font-size: inherit;
    font-weight: 700;
    color: var(--color-dark);
    text-decoration: none;
}

/* Small extra cue on hover (delete this rule if you only want the bold) */
.credits-links:hover {
    text-decoration: underline;
}


/* --------------------- text links (inside article-text) --------------------*/

/* Same look as the text of .article-text, but bold to show the text is clickable */
.text-links,
.text-links:link,
.text-links:visited,
.text-links:hover,
.text-links:active {
    font-size: inherit;
    font-weight: 700;
    color: var(--color-dark);
    text-decoration: none;
}

/* Small extra cue on hover (delete this rule if you only want the bold) */
.text-links:hover {
    text-decoration: underline;
}


/* ------------------- software logos SVG ----------------------- */

.software-links {
    display: flex;
    flex-wrap: wrap;         /* Allows logos to wrap onto a new line on small mobile screens */
    align-items: center;     /* Keeps logos aligned vertically */
    gap: 1.5rem;             /* Adjust this value to increase or decrease space between logos */
    margin-top: 2.5rem; /* Space above the logos */
}

.external-logos {
    display: inline-block;
    position: relative;
}

.external-logos::after {
    content: attr(aria-label); /* Pulls the text dynamically from aria-label="QGIS" */
    position: absolute;
    bottom: 125%;              /* Places the tooltip above the icon */
    left: 50%;
    transform: translateX(-50%); /* Centers the tooltip horizontally */
    
    /* Styling for the tooltip box */
    background-color: var(--color-dark, #283138);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    
    /* Hiding state by default */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;      /* Prevents hovering the tooltip itself from interfering */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Tooltip arrow pointing down */
.external-logos::before {
    content: '';
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--color-dark, #283138) transparent transparent transparent;
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

/* Hover state: Reveal both the tooltip and arrow */
.external-logos:hover::after,
.external-logos:hover::before {
    opacity: 1;
    visibility: visible;
}

.external-logos svg,
.external-logos img {
    width: clamp(32px, 5vw, 45px); 
    height: auto;
    display : block;
    transition: var(--transition-smooth); 
}

/* Fill property specifically for SVGs */
.external-logos svg {
    fill: var(--color-dark);
}

.external-logos:hover svg,
.external-logos:hover img {
    transform: translateY(-4px);
    filter: drop-shadow(var(--color-shadow4)); 
}




/* ------------------ contact section ---------------- */


/* Main outer container for the contact section */
.contact-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 680px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
    text-align: center;
}

/* Fluid responsive section header */
.contact-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--color-dark);
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Contact-specific layout on the shared glass panel */
.contact-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

/* Paragraph text inside the card */
.contact-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 0;
}

/* Wrapper for interactive links */
.contact-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* Interactive button style */
.contact-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.4rem;
    background-color: #ffffff;
    border: 1px solid var(--color-sand);
    border-radius: 30px;
    color: var(--color-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

/* LinkedIn icon sizing */
.Linkedin-icon {
    width: 22px;
    height: 22px;
    fill: var(--color-dark);
    transition: var(--transition-smooth);
}

/* Text label within the button */
.Linkedin-button-text {
    line-height: 1;
}

/* Hover effect for the button */
.contact-button:hover {
    background-color: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.contact-button:hover .Linkedin-icon {
    fill: #ffffff;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .contact-card {
        padding: 1.5rem 1.25rem;
    }
    
    .contact-button {
        width: 100%;
        justify-content: center;
    }
}