/* styles.css – with parallax, homepage & publications styling */

:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f7;
    --color-text: #222222;
    --color-muted: #666666;
    --color-accent: #3949ab;
    --color-border: #e0e0e0;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.5;
}

/* HOME PAGE BACKGROUND: all sections white (parallax uses images) */
.home-page .section {
    background: #ffffff;
}

/* Publication page specific tweaks */
.pub-page {
    color: #333333;
}
.pub-page .section-page-intro p {
    color: #555555;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}
.pub-page .pub-list li {
    color: #444444;
    font-size: 0.95rem;
}
.pub-page a {
    color: #0073aa;
}
.pub-page a:hover,
.pub-page a:focus {
    color: #005177;
    text-decoration: underline;
}
.pub-page h2,
.pub-page h3 {
    font-family: "Amethysta", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    color: #DE8F6F;
    text-align: center;
}
.author-name {
    text-decoration: underline;
    font-weight: 400;
}

/* ALL PAGES SECTION HEADERS (About, Research areas, Work experience, Education) */
.home-page main .section h2,
.research-page main .section h2,
.pub-page main .section h2,
.news-page main .section h2 {
    font-family: "Amethysta", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    color: #DE8F6F;
    text-align: center;
    font-size: 2.1rem;   /* slightly larger */
}

/* Accessibility helper */
.skip-link {
    position: absolute;
    left: -999px;
    top: -999px;
    padding: 0.5rem 0.75rem;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    z-index: 1000;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* Header & navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;

    /* logo left, nav/hamburger right */
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.site-header .logo img {
    height: 48px;
    width: auto;
}
.site-header .site-title h1 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}
.site-header .site-title p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* NAV: desktop layout */
.site-nav {
    margin-top: 0;            /* on same line as logo */
}
.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}
.site-nav a {
    text-decoration: none;
    color: #0170B9;           /* requested blue */
    font-weight: 500;
}
.site-nav a[aria-current="page"] {
    color: #0170B9;           /* keep active link same color */
}

/* Mobile nav toggle – base definition (hidden on desktop) */
.nav-toggle {
    display: none;            /* hidden on desktop */
    background: none;
    border: none;
    padding: 0.25rem;
    margin-left: auto;
    cursor: pointer;
}
.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    margin: 3px 0;
    background: var(--color-text);
}
.nav-toggle-label {
    position: absolute;
    left: -999px;
}

/* Parallax sections */
.parallax-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;  /* prevent repeating */
    min-height: 400px;
    padding: 4rem 0;
}

/* soft fade at bottom into white */
.parallax-section::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20px;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 50%,
        #ffffff 100%
    );
}

/* Hero parallax with light grey overlay */
.hero {
    position: relative;
    min-height: 75vh;                  /* tall hero */
    display: flex;
    align-items: center;
    justify-content: flex-start;       /* text anchored left */
}
/* Semi-transparent light grey overlay over the image */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(111, 111, 111, 0.2); /* semi-transparent light grey */
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.hero.parallax-section {
    position: relative;
    height: 70vh;              /* must be ≤ hero min-height */
    padding-top: 0;
    padding-bottom: 0;
    background-image: url("Virtual_interior_Chiara2.png");
    background-size: contain;  /* show more of the image */
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Text block on the left */
.hero-inner {
    max-width: 960px;
    margin: 0 15rem;          /* anchor to the left */
    padding: 4rem 0;
    text-align: left;
    color: #ffffff;
}
/* VISUAL PASTS – uppercase, Amethysta, white */
.hero-inner h2 {
    margin: 0 0 1.25rem;
    font-size: 2.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: "Amethysta", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #ffffff;
}
/* Short line under VISUAL PASTS */
.hero-divider {
    width: 160px;
    max-width: 40%;
    height: 1.5px;
    background-color: #ffffff;
    margin: 0 0 1.25rem;
}
/* Chiara Piccoli's portfolio – Amethysta, white */
.hero-inner p {
    margin: 0.5rem 0 0;
    font-size: 1.7rem;
    font-family: "Amethysta", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #ffffff;
}

/* Light parallax overlay for content sections (About, Research areas) */
.parallax-light .section-inner,
.parallax-light .section-grid {
    background-color: rgba(245, 245, 245, 0.85);
    border-radius: 8px;
    padding: 1.5rem;
}

/* Mid-page parallax banners */
.parallax-banner {
    min-height: 60vh;
    position: relative;
}
.parallax-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(245, 245, 245, 0.4); /* subtle light grey overlay */
}

/* Layout */
.section {
    padding: 2.5rem 1rem;
}
.section-inner {
    max-width: 960px;
    margin: 0 auto;
}
.section h2,
.section h3 {
    margin-top: 0;
}
.section-heading-divider {
    width: 80px;
    height: 2px;
    background-color: #000000;
    margin: 0.75rem auto 1.5rem;  /* centered under the header */
}

/* ABOUT section: centered header, round portrait, social icons row, centered bio */
.about-inner {
    text-align: center;
}

.about-profile {
    display: block;
    margin: 1.5rem auto 1rem;
    width: 20vw;            /* ~20% of viewport width */
    max-width: 220px;       /* cap size on large screens */
    min-width: 140px;       /* avoid too small on small screens */
    height: auto;
    border-radius: 50%;     /* round shape */
    object-fit: cover;
}

/* social icons directly under the photo */
.about-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}
.social-icon img {
    display: block;
    width: 40px;
    height: 40px;
}

/* centered bio, wider than the portrait */
.about-bio {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}
.about-bio p {
    margin-bottom: 0.75rem;
}

/* Grid helpers */
.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
    gap: 1.5rem;
    align-items: start;
}
.section-media img {
    max-width: 100%;
    border-radius: 4px;
}

/* Cards */
.cards,
.research-cards {
    display: grid;
    gap: 1rem;
}
.card {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1rem;
    background: #fff;
}

/* Research area cards: 2x2 grid and styled titles */
.home-page .section-research-areas .research-cards,
.research-page .section-topic .research-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-page .section-research-areas .card h3,
.research-page .section-topic .card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-family: "Amethysta", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    color: #DE8F6F;
    text-align: center;
}
.home-page .section-research-areas .card p {
    text-align: center;
}
.card p:last-child {
    margin-bottom: 0;
}

/* Research cards: soft shadow instead of border rectangle */
.home-page .section-research-areas .card,
.research-page .section-topic .card {
    border: none;  /* override generic .card border */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-arrow {
    margin-top: 1rem;
}
.card-arrow img {
    display: block;
    margin: 0 auto;
    width: 24px;
    height: auto;
}

/* Extra spacing below each research card on the research page */
.research-page .section-topic .card {
    margin-bottom: 1.5rem;
}

/* Mosaic-style research items (used on research.html) */
.research-page .research-grid {
    column-count: 3;
    column-gap: 1.75rem;
}
@media (max-width: 900px) {
    .research-page .research-grid {
        column-count: 2;
    }
}
@media (max-width: 600px) {
    .research-page .research-grid {
        column-count: 1;
    }
}

.research-page .research-item {
    display: inline-block;        /* needed inside multi-column container */
    width: 100%;
    margin: 0 0 1.75rem;
    border: 2px solid #DE8F6F;
    border-radius: 10px;
    background-color: #ffffff;
    overflow: hidden;
    vertical-align: top;
    break-inside: avoid;          /* avoid items splitting across columns */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.research-page .research-item img {
    width: 100%;
    object-fit: cover;
}
.research-page .research-item-body {
    padding: 1rem 1.25rem 1.25rem;
}
.research-page .research-item-body h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #0170B9;
}
.research-page .research-item-body p {
    margin: 0.4rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Sketchfab embeds inside research items */
.research-page .sketchfab-embed-wrapper {
    margin: 1rem 1.25rem 1.25rem;
    text-align: center;
}
.research-page .sketchfab-embed-wrapper iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 380px;
    border: none;
}

/* Timeline (old vertical line version – now overwritten below) */
.timeline {
    border-left: 2px solid var(--color-border);
    margin-left: 0.5rem;
    padding-left: 1.5rem;
}
.timeline-item {
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.85rem;
    top: 0.3rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color-accent);
}
.timeline-video {
    grid-column: 1 / -1;
    margin-top: 1rem;
    margin-left: 100px;
}

/* Video as research card – scoped to research page only */
.research-page .research-video-card figure {
    margin: 0;
}
.research-page .research-video-card video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.research-page .research-video-card figcaption {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
}

/* Work & Education: timeline dots colored #DE8F6F */
.home-page .section-work .timeline-item::before,
.home-page .section-education .timeline-item::before {
    background: #DE8F6F;
}

.timeline-item h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}
.timeline-location {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: var(--color-muted);
}
.timeline-item h4 {
    margin: 0 0 0.5rem;
}

/* CV button */
.cv-button-wrap {
    text-align: center;
    margin: 0 0 1.5rem;
}
.cv-button {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background-color: #0170B9;
    color: #ffffff;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}
.cv-button:hover,
.cv-button:focus {
    background-color: #015a90;
}

/* Publications lists */
.pub-list {
    list-style: none;
    padding-left: 0;
}
.pub-list li {
    margin-bottom: 0.75rem;
}

/* Extra spacing between subsections on the publications page */
.pub-page main .section h3 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

/* Images & figures (used on other pages) */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
figure {
    margin: 0;
    background: #fff;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    padding: 0.5rem;
}
figure img {
    width: 100%;
    height: auto;
    border-radius: 3px;
}
figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* News page cards */
.news-page .news-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.news-page .news-item {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
}
.news-page .news-item-body {
    flex: 1 1 260px;
}
.news-page .news-item-meta {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666666;
    margin: 0 0 0.25rem;
}
.news-page .news-item-title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}
.news-page .news-item-media {
    flex: 0 0 180px;
    margin: 0;
    align-self: flex-start;
    padding: 4px;
}
.news-page .news-item-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

/* Special case: long image at the bottom of the post */
.news-page .news-item--image-bottom {
    flex-direction: column;
    gap: 0.25rem;
}
.news-page .news-item--image-bottom .news-item-body {
    order: 0;
}
.news-page .news-item--image-bottom .news-item-media {
    order: 1;
    margin-top: 0.25rem;
    margin-bottom: 0;
    flex: 0 0 auto;
    width: 100%;
}
.news-page .news-item--image-bottom .news-item-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}
.news-page .news-item--image-bottom .news-item-body > *:last-child {
    margin-bottom: 0;
}

/* Social links */
.social-links ul,
.footer-social {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.social-links a,
.footer-social a {
    text-decoration: none;
    font-size: 0.9rem;
    color: #ffffff; /* footer links white on gradient */
}

/* Contact block */
.contact-block img {
    max-width: 260px;
    height: auto;
    display: block;
    margin-top: 0.5rem;
}

/* Footer: centered, semi-transparent gradient #DE8F6F */
.site-footer {
    border-top: 0;
    padding: 3rem 1rem;
    background: linear-gradient(
        to top,
        rgb(227, 165, 141) 0%,
        #ffffff 100%
    );
    color: #ffffff;
}
.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;      /* stack text and links */
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.footer-inner p {
    margin: 0;
    font-size: 0.9rem;
    text-align: center;
}
.footer-social {
    justify-content: center;
}

/* copyright text under icons */
.site-footer .footer-copy {
    margin: 0;
    font-size: 1rem;
    color: #DE8F6F;
    text-align: center;
}

/* Links (global default) */
a {
    color: var(--color-accent);
}
a:hover,
a:focus {
    text-decoration: underline;
}

/* Page intro (generic) */
.section-page-intro h2 {
    margin-bottom: 0.5rem;
}
.section-page-intro p {
    max-width: 720px;
}

/* Homepage & other pages: extra nav spacing */
.home-page .site-nav,
.research-page .site-nav,
.pub-page .site-nav,
.news-page .site-nav {
    margin-right: 2rem;
}
.home-page .site-nav ul,
.research-page .site-nav ul,
.pub-page .site-nav ul,
.news-page .site-nav ul {
    gap: 2.5rem;
}

/* Timeline layout for Work experience & Education – two columns */
.timeline {
    margin: 2rem 0;
    border-left: none;          /* overrides old vertical line */
    padding-left: 0;
}
.timeline-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 2rem;
    align-items: flex-start;
    padding: 1.5rem 0;
}

/* LEFT COLUMN: date, line + arrow, location */
.timeline-left {
    text-align: left;
    margin-left: 100px;
    font-size: 0.95rem;
}
.timeline-date {
    margin: 0 0 0.5rem;
    color: #DE8F6F;
    font-weight: 600;
}
.timeline-line {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.timeline-line-inner {
    display: block;
    width: 100px;
    height: 1px;
    background-color: #969393;
    border: 0;
}
.timeline-arrow {
    width: 15px;
    height: auto;
}
.timeline-location {
    margin: 0;
    color: #666666;
    font-size: 0.9rem;
}

/* RIGHT COLUMN: title and description */
.timeline-right {
    text-align: left;
}
.timeline-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0170B9;
    text-transform: uppercase;
}
.timeline-description {
    margin: 0;
    font-size: 0.95rem;
    color: #222222;
}

/* Remove old dot markers for Work & Education timelines */
.home-page .section-work .timeline-item::before,
.home-page .section-education .timeline-item::before {
    content: none;
}

/* Responsive: tablets & phones (≤768px) */
@media (max-width: 768px) {
    .section-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-header {
        padding: 0.5rem 1rem;
        align-items: center;
        justify-content: space-between;
    }

    /* Mobile: show hamburger, hide nav until opened */
    .nav-toggle {
        display: flex;                 /* visible on mobile */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 32px;
        border: 1px solid #0170B9;
        background: #ffffff;
        padding: 4px;
    }
    .nav-toggle-bar {
        width: 24px;
        height: 3px;
        margin: 2px 0;
        background: #0170B9;
    }

    .site-nav {
        display: none;           /* hidden by default on mobile */
        position: absolute;
        top: 100%;               /* just below header */
        right: 0.8rem;			/* ← distance from the right edge */
        background: #ffffff;
        border: 1px solid var(--color-border);
        border-radius: 6px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
        padding: 0.5rem 0;
        z-index: 100;
    }
    .site-nav.is-open {
        display: block;          /* shown when hamburger is clicked */
    }
    .site-nav ul {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;      /* ← vertical space between items; 0.1 = almost no extra space */
        margin: 0;
        padding: 0;
    }
    .site-nav li {
        width: 100%;
    }
    .site-nav a {
        display: block;
        padding: 0.1rem 0.75rem; /* less top/bottom padding */
    }
	
	/* Override page-specific margins on mobile */
    .home-page .site-nav,
    .research-page .site-nav,
    .pub-page .site-nav,
    .news-page .site-nav {
        margin-right: 0;   /* remove the 2rem shift on small screens */
    }

    /* Avoid fixed backgrounds on mobile for performance */
    .parallax-section {
        background-attachment: scroll;
    }

    .hero {
        min-height: 40vh;
    }

    .home-page .section-research-areas .research-cards {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Smartphones: center hero text and reduce font sizes */
/* Mobiles / tablets: shorter banner, image covers area */
@media (max-width: 768px) {
    .hero {
        min-height: 45vh;              /* shorter than 75vh */
    }

    .hero.parallax-section {
        height: auto;                  /* remove fixed 70vh height */
        min-height: 45vh;              /* consistent with .hero */
        background-attachment: scroll; /* no parallax on mobile */
        background-size: cover;        /* fill banner, less grey bands */
        background-position: center;   /* keep subject centered */
    }

    /* Center the hero text and remove large side margins */
    .hero-inner {
        margin: 0 auto;
        padding: 2rem 1.25rem;
        max-width: 100%;
        text-align: left;
    }
}
@media (max-width: 600px) {	
    .hero-inner h2 {
        font-size: 1.8rem; /* smaller title */
    }
    .hero-inner p {
        font-size: 1.2rem; /* smaller subtitle */
    }
}

/* Smartphones: stack timeline in one column */
@media (max-width: 600px) {
    .timeline-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }
    .timeline-left {
        margin-left: 0;
        text-align: left;
    }
    .timeline-video {
        margin-left: 0;
    }
}

/* Smartphones: research items full-width with spacing */
@media (max-width: 600px) {
    .research-page .research-grid {
        column-count: 1;
        column-gap: 1rem;
    }
    .research-page .research-item {
        margin-bottom: 1rem;
    }
}

/* Smartphones: stack news image above text */
@media (max-width: 600px) {
    .news-page .news-item {
        flex-direction: column;
    }
    .news-page .news-item-media {
        flex: 0 0 auto;
        width: 100%;
        align-self: stretch;
        margin-bottom: 0.5rem;
    }
}

/* Smartphones: tighter header nav spacing */
@media (max-width: 600px) {
    .site-header {
        padding: 0.5rem 1rem;
    }

    /* override the desktop gap rule on small screens */
    .home-page .site-nav ul,
    .research-page .site-nav ul,
    .pub-page .site-nav ul,
    .news-page .site-nav ul {
        gap: 0.2rem;                    /* no extra space between items */
    }

    .home-page .site-nav a,
    .research-page .site-nav a,
    .pub-page .site-nav a,
    .news-page .site-nav a {
        padding: 0.2rem 0.75rem;      /* less top/bottom padding */
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}