/* ============================================
   DCLab Website - Unified Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #0d47a1;
    --primary-dark: #002171;
    --primary-light: #5472d3;
    --accent: #ff6f00;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border: #e0e0e0;
    --mono: 'Space Mono', monospace;
    --sans: 'Work Sans', sans-serif;
}

/* --- Language Toggle --- */
[data-lang="it"] { display: none; }
html[lang="it"] [data-lang="en"] { display: none; }
html[lang="it"] [data-lang="it"] { display: block; }

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

body {
    font-family: var(--sans);
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-white);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.lang-switch {
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: none;
    border-radius: 6px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-switch:hover {
    background: var(--primary);
    color: white;
}

/* Mobile hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.page-hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.page-hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.page-hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

/* Hero variant with colored background */
.page-hero-colored {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    padding: 4rem 2rem 8rem;
    margin: -2rem -2rem 0;
    text-align: center;
}

.page-hero-colored h1 {
    color: white;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.page-hero-colored p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.15rem;
}

.content-section {
    padding: 2rem 0;
}

/* Back link */
.back-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-dark);
}

/* ============================================
   HOMEPAGE - HERO
   ============================================ */
.hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 2rem 80px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.hero-content .highlight {
    color: var(--accent);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 71, 161, 0.3);
}

.btn-secondary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.hero-visual {
    position: relative;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 20px;
    overflow: hidden;
}

.hero-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="white" stroke-opacity="0.1" stroke-width="1"/></pattern></defs><rect width="1000" height="1000" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

/* ============================================
   HOMEPAGE - SECTIONS
   ============================================ */
.section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 2rem;
}

.section-bg {
    background: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.section-header p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Research cards (homepage) */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.research-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s;
    cursor: pointer;
}

.research-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.research-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.research-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.research-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* News cards (homepage) */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.news-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.news-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.news-meta {
    padding: 1.5rem;
    background: var(--bg-light);
}

.news-date {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 700;
}

.news-card h3 {
    margin: 0.5rem 0;
    font-size: 1.15rem;
    color: var(--primary-dark);
}

.news-content {
    padding: 1.5rem;
}

.news-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.news-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ============================================
   PEOPLE PAGE
   ============================================ */
.people-category {
    margin-bottom: 4rem;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--accent);
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.person-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.person-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.person-photo {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: var(--bg-light);
}

.person-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-info {
    padding: 1.5rem;
}

.person-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.person-role {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.person-bio {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.person-links {
    display: flex;
    gap: 1rem;
    font-size: 1.3rem;
}

.person-links a {
    text-decoration: none;
    transition: transform 0.2s;
}

.person-links a:hover {
    transform: scale(1.2);
}

/* Person Profile Page */
.person-profile {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-photo {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-light);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.profile-role {
    color: var(--accent);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.profile-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.profile-links a {
    padding: 0.4rem 1rem;
    background: var(--bg-light);
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.profile-links a:hover {
    background: var(--primary);
    color: white;
}

.profile-bio {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 1rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.research-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.interest-tag {
    padding: 0.3rem 0.8rem;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.course-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.course-card h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.course-card a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Person publication cards */
.person-pub-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.person-pub-card .pub-authors {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.person-pub-card .pub-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.person-pub-card .pub-venue {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   PUBLICATIONS PAGE
   ============================================ */
.stats-container {
    margin: -80px auto 60px;
    max-width: 1400px;
    padding: 0 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.stat-item {
    text-align: center;
    padding: 1rem;
    border-right: 1px solid var(--border);
    transition: all 0.3s;
}

.stat-item:last-child {
    border-right: none;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-item .stat-number {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--mono);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Filters */
.filters-section {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
    border: 2px solid #d0e8ff;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px rgba(13, 71, 161, 0.08);
}

.filters-section.simple {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filters-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: var(--sans);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-checkbox:hover {
    border-color: var(--accent);
    background: #fff8f0;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-checkbox label {
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

/* Publications List */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.pub-item {
    display: flex;
    gap: 2rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.pub-item:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.pub-thumbnail {
    flex-shrink: 0;
    width: 180px;
    height: 120px;
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.pub-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pub-content {
    flex: 1;
}

.pub-authors {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.pub-authors strong {
    color: var(--primary);
    font-weight: 600;
}

.pub-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.pub-venue {
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.pub-venue strong {
    font-weight: 600;
    font-style: normal;
    color: var(--accent);
}

.pub-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.pub-tag {
    padding: 0.3rem 0.8rem;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pub-tag.award {
    background: #fff8e1;
    color: #f57c00;
    border: 1px solid #ffcc80;
}

.pub-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pub-link {
    padding: 0.5rem 1.25rem;
    background: var(--bg-light);
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.pub-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pub-link.pdf {
    background: #e3f2fd;
    color: #1565c0;
}

.pub-link.pdf:hover {
    background: #1565c0;
    color: white;
}

/* Year Section */
.year-section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 3rem 0 2rem;
    padding-left: 1.5rem;
    border-left: 5px solid var(--accent);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ============================================
   RESEARCH AREAS PAGE
   ============================================ */
.research-areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.research-area-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all 0.3s;
}

.research-area-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.area-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.area-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.area-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.area-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    padding: 0.3rem 0.8rem;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   PROJECTS PAGE
   ============================================ */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-type-section {
    margin-bottom: 2rem;
}

.type-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--accent);
}

.projects-grid {
    display: grid;
    gap: 2rem;
}

.project-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.project-logo {
    width: 150px;
    height: 150px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.project-logo-placeholder {
    font-size: 3rem;
}

.project-content {
    flex: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.project-acronym {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: 1rem;
}

.project-status {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.project-status.active,
.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.project-status.completed,
.status-completed {
    background: #e3f2fd;
    color: #1565c0;
}

.project-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.meta-item strong {
    color: var(--text-primary);
}

.meta-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.project-coordinator {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-link {
    padding: 0.5rem 1.25rem;
    background: var(--bg-light);
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.project-link:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   COLLABORATIONS PAGE
   ============================================ */
#map-container {
    height: 600px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#collaborations-map {
    height: 100%;
    width: 100%;
}

.map-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.toggle-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: var(--sans);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.toggle-btn:hover {
    border-color: var(--primary);
}

/* Custom Leaflet Popup */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 280px;
}

.collaboration-popup {
    padding: 1.25rem;
}

.popup-header {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.popup-location {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.popup-contact {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.popup-area {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.popup-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.popup-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.popup-link:hover {
    background: var(--primary-dark);
}

/* Collab Stats */
.collab-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--mono);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* List View */
.collaborations-list {
    display: none;
}

.collaborations-list.active {
    display: block;
}

.collab-category {
    margin-bottom: 3rem;
}

.collab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.collab-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
}

.collab-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.collab-card h3 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.collab-card .location {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.collab-card .contact {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.collab-card .area-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.collab-card .description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--primary-dark);
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: 80px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-address {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.research-card, .news-card,
.person-card, .publication-item,
.research-area-card, .project-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.research-card:nth-child(1) { animation-delay: 0.1s; }
.research-card:nth-child(2) { animation-delay: 0.2s; }
.research-card:nth-child(3) { animation-delay: 0.3s; }
.research-card:nth-child(4) { animation-delay: 0.4s; }

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 968px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

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

    .hamburger {
        display: flex;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 60px 2rem 40px;
    }

    .hero-visual {
        height: 300px;
    }

    .page-hero h1 {
        font-size: 2rem;
    }

    .people-grid,
    .research-areas-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .project-card {
        grid-template-columns: 1fr;
    }

    .project-logo {
        width: 100%;
        height: 200px;
    }

    .pub-item {
        flex-direction: column;
    }

    .pub-thumbnail {
        width: 100%;
        height: 200px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* Person card link */
.person-card-link {
    text-decoration: none;
    color: inherit;
}

/* Hero visual with image */
.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* News image */
.news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-light);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* News category tag */
.news-category {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* News expanded */
.news-text-full {
    white-space: pre-line;
    line-height: 1.7;
}

.news-link {
    cursor: pointer;
}

.news-link-ext {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.news-link-ext:hover {
    text-decoration: underline;
}

/* Logo in navbar */
.logo-img {
    height: 40px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.keyword-box{ margin:0.6rem 0; }
.keyword-label{ display:inline-block; font-weight:600; margin-bottom:0.3rem; }
.keyword-chips{ display:flex; flex-wrap:wrap; gap:0.35rem; }
.keyword-chip{ padding:0.15rem 0.5rem; border-radius:999px; border:1px solid rgba(0,0,0,0.15); font-size:0.85rem; }

/* thumbnail box con dimensioni stabili */
.pub-thumbnail{
  width: 210px;
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* immagine mai tagliata, mantiene proporzioni */
.pub-thumbnail img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}


.consultancies-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:1rem;
}

.consultancy-card{
  display:flex;
  gap:1rem;
  align-items:flex-start;
  padding:0.85rem;
  border-radius:8px;
  background:var(--card-bg, #fff);
  box-shadow:var(--card-shadow, 0 1px 4px rgba(0,0,0,0.06));
}

.consultancy-logo{
  width:110px;
  height:110px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  flex:0 0 110px;
  border-radius:6px;
  background:rgba(0,0,0,0.02);
}

.consultancy-logo img{
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
}

.consultancy-body{ flex:1 1 auto; min-width:0; }

.consultancy-title{ margin:0 0 0.4rem 0; font-size:1.05rem; }

.consultancy-desc{ margin-top:0.4rem; color:var(--text-muted, #444); }

.consultancy-meta{ margin-top:0.6rem; display:flex; gap:0.6rem; align-items:center; }

.cons-toggle{
  background:transparent;
  border:1px solid rgba(0,0,0,0.08);
  padding:0.25rem 0.6rem;
  border-radius:6px;
  cursor:pointer;
}

.cons-site{
  padding:0.25rem 0.6rem;
  border-radius:6px;
  text-decoration:none;
  border:1px solid rgba(0,0,0,0.06);
}

.research-card{ display:flex; gap:1rem; padding:0.8rem; align-items:flex-start; border-radius:8px; background:var(--card-bg,#fff); margin-bottom:0.6rem; }
.research-left{ flex:0 0 110px; }
.research-logo{ width:110px; height:110px; display:flex; align-items:center; justify-content:center; overflow:hidden; border-radius:6px; background:rgba(0,0,0,0.02); }
.research-logo img{ max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; display:block; }
.research-right{ flex:1 1 auto; min-width:0; }
.research-title{ margin:0 0 0.35rem 0; font-size:1.05rem; }
.research-keywords{ margin:0.4rem 0; }
.keyword-chips{ display:flex; flex-wrap:wrap; gap:0.35rem; }
.keyword-chip{ padding:0.15rem 0.5rem; border-radius:999px; border:1px solid rgba(0,0,0,0.12); font-size:0.85rem; }

.press-grid{ display:grid; grid-template-columns: 1fr; gap:0.8rem; }
.press-card{ display:flex; gap:0.75rem; padding:0.6rem; align-items:flex-start; border-radius:8px; background:var(--card-bg,#fff); box-shadow:0 1px 4px rgba(0,0,0,0.04); }
.press-thumb{ width:140px; height:100px; flex:0 0 140px; display:flex; align-items:center; justify-content:center; overflow:hidden; border-radius:6px; background:rgba(0,0,0,0.03); }
.press-thumb img{ max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; display:block; }
.press-body{ flex:1 1 auto; min-width:0; }
.press-meta{ font-size:0.8rem; color:var(--muted,#666); display:flex; gap:0.5rem; align-items:center; margin-bottom:0.25rem; }
.press-title{ margin:0 0 0.25rem 0; font-size:1rem; }
.press-journal{ color:var(--muted,#444); margin-bottom:0.5rem; }
.press-links{ display:flex; gap:0.5rem; }
.press-link{ text-decoration:none; padding:0.25rem 0.5rem; border-radius:6px; border:1px solid rgba(0,0,0,0.06); font-size:0.85rem; }

/* === SOCIAL ICONS === */
.social-icons{display:flex;gap:1rem;margin-top:1.5rem}
.social-link{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,0.15);color:rgba(255,255,255,0.8);transition:all 0.2s}
.social-link:hover{background:var(--accent);color:white;transform:translateY(-2px)}

/* === PERSON PAGE ICONS === */
.profile-contact-icons{display:flex;gap:0.6rem;flex-wrap:wrap;margin:1rem 0}
.profile-contact-icons a{display:inline-flex;align-items:center;gap:0.4rem;padding:0.4rem 0.85rem;background:var(--bg-light);border:1px solid var(--border);border-radius:20px;text-decoration:none;color:var(--primary);font-size:0.82rem;font-weight:600;transition:all 0.2s}
.profile-contact-icons a:hover{background:var(--primary);color:white;border-color:var(--primary)}
.profile-contact-icons svg{flex-shrink:0}
.bio-short{color:var(--text-secondary);line-height:1.7;margin-top:1rem}
.bio-toggle{color:var(--primary);cursor:pointer;font-weight:600;font-size:0.9rem;border:none;background:none;padding:0;margin-top:0.3rem;display:inline-block}
.bio-toggle:hover{text-decoration:underline}
.person-note{color:var(--text-secondary);font-size:0.85rem;margin-top:0.2rem;font-style:italic}

/* === RESEARCH AREAS IMPROVED === */
.research-areas-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:2rem;margin-top:2rem}
.research-area-card{background:white;border:1px solid var(--border);border-radius:16px;padding:2rem;transition:all 0.3s;position:relative;overflow:hidden}
.research-area-card::before{content:'';position:absolute;top:0;left:0;right:0;height:4px;background:linear-gradient(90deg,var(--primary),var(--accent))}
.research-area-card:hover{transform:translateY(-6px);box-shadow:0 12px 40px rgba(0,0,0,0.1)}
.area-icon{width:60px;height:60px;background:linear-gradient(135deg,var(--primary),var(--accent));border-radius:14px;display:flex;align-items:center;justify-content:center;margin-bottom:1.2rem;color:white;font-size:1.6rem}
.area-icon img{width:36px;height:36px}
.area-title{font-size:1.2rem;font-weight:700;color:var(--primary-dark);margin-bottom:0.6rem}
.area-description{color:var(--text-secondary);line-height:1.6;font-size:0.92rem}
.area-keywords{display:flex;flex-wrap:wrap;gap:0.4rem;margin-top:1rem}
.keyword-tag{padding:0.25rem 0.65rem;background:rgba(68,113,197,0.08);color:var(--primary);border-radius:12px;font-size:0.78rem;font-weight:600}

/* === TOOLS GRID === */
.tools-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:1.5rem}
.tool-card{background:white;border:1px solid var(--border);border-radius:12px;padding:1.5rem;transition:all 0.3s}
.tool-card:hover{transform:translateY(-4px);box-shadow:0 8px 30px rgba(0,0,0,0.08);border-color:var(--primary)}
.tool-header{display:flex;align-items:center;gap:1rem;margin-bottom:1rem}
.tool-logo{width:48px;height:48px;border-radius:10px;background:var(--bg-light);display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0}
.tool-logo img{width:100%;height:100%;object-fit:contain}
.tool-name{font-size:1.1rem;font-weight:700;color:var(--primary-dark)}
.tool-type{font-size:0.72rem;text-transform:uppercase;letter-spacing:0.5px;color:var(--text-secondary);font-weight:600}
.tool-status{display:inline-block;padding:0.2rem 0.6rem;border-radius:12px;font-size:0.72rem;font-weight:600}
.tool-status.active{background:#e8f5e9;color:#2e7d32}

/* === CONSULTANCIES === */
.consultancies-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:1.5rem}
.consultancy-card{background:white;border:1px solid var(--border);border-radius:12px;padding:1.5rem;display:flex;gap:1.5rem;align-items:center;transition:all 0.3s}
.consultancy-card:hover{transform:translateY(-4px);box-shadow:0 8px 30px rgba(0,0,0,0.08);border-color:var(--primary)}
.consultancy-logo{width:80px;height:80px;flex-shrink:0;border-radius:10px;background:var(--bg-light);display:flex;align-items:center;justify-content:center;overflow:hidden}
.consultancy-logo img{width:100%;height:100%;object-fit:contain;padding:0.5rem}
.consultancy-info{flex:1}
.consultancy-info h3{font-size:1.05rem;color:var(--primary-dark);margin-bottom:0.4rem}
.consultancy-info p{color:var(--text-secondary);font-size:0.88rem;line-height:1.5}

/* === WORKSHOPS === */
.workshops-grid{display:grid;gap:1.25rem}
.workshop-card{background:white;border:1px solid var(--border);border-radius:12px;padding:1.25rem 1.5rem;transition:all 0.3s;display:grid;grid-template-columns:80px 1fr auto;gap:1.25rem;align-items:center}
.workshop-card:hover{box-shadow:0 6px 24px rgba(0,0,0,0.08);border-color:var(--primary)}
.workshop-date-badge{background:linear-gradient(135deg,var(--primary),var(--accent));color:white;border-radius:10px;padding:0.6rem 0.8rem;text-align:center;min-width:65px}
.workshop-date-badge .year{font-size:1.4rem;font-weight:700;line-height:1}
.workshop-date-badge .type{font-size:0.65rem;text-transform:uppercase;letter-spacing:0.5px;opacity:0.9}
.workshop-info h3{font-size:1rem;color:var(--primary-dark);margin-bottom:0.25rem}
.workshop-event{color:var(--accent);font-weight:600;font-size:0.88rem;margin-bottom:0.2rem}
.workshop-meta{color:var(--text-secondary);font-size:0.82rem}

/* === PRESS REVIEW === */
.press-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:1.5rem}
.press-card{background:white;border:1px solid var(--border);border-radius:12px;overflow:hidden;transition:all 0.3s}
.press-card:hover{transform:translateY(-4px);box-shadow:0 8px 30px rgba(0,0,0,0.08)}
.press-card-image{width:100%;height:180px;background:var(--bg-light);overflow:hidden}
.press-card-image img{width:100%;height:100%;object-fit:cover}
.press-card-body{padding:1.2rem}
.press-card-meta{display:flex;gap:0.4rem;margin-bottom:0.6rem;flex-wrap:wrap}
.press-card h3{font-size:0.95rem;color:var(--primary-dark);line-height:1.4;margin-bottom:0.6rem}
.press-card-links{display:flex;gap:0.5rem;flex-wrap:wrap}

.collab-flag{font-size:1.1rem;margin-right:0.2rem}

@media(max-width:768px){
    .workshop-card{grid-template-columns:1fr}
    .consultancy-card{flex-direction:column;text-align:center}
}

.area-icon-img{background:white;border:1px solid var(--border)}
.area-icon-img img{width:44px;height:44px;object-fit:contain}

/* === NEWS SECTION FULL WIDTH === */
.news-section-full{
    background:var(--bg-light);
    padding:4rem 0;
    width:100%;
}
.news-section-full .section-header,
.news-section-full .news-grid,
.news-section-full #load-more-wrap{
    max-width:1200px;
    margin-left:auto;
    margin-right:auto;
    padding-left:2rem;
    padding-right:2rem;
}

/* === RESEARCH AREAS: LARGE IMAGES === */
.research-area-card-img{
    background:white;
    border:1px solid var(--border);
    border-radius:16px;
    overflow:hidden;
    transition:all 0.3s;
}
.research-area-card-img:hover{
    transform:translateY(-6px);
    box-shadow:0 12px 40px rgba(0,0,0,0.1);
}
.area-cover{
    width:100%;
    height:200px;
    overflow:hidden;
}
.area-cover img{
    width:100%;
    height:100%;
    object-fit:cover;
    transition:transform 0.3s;
}
.research-area-card-img:hover .area-cover img{
    transform:scale(1.05);
}
.area-body{
    padding:1.5rem;
}

/* === COLLAB CARD WITH LOGO === */
.collab-card-logo{
    width:50px;height:50px;
    border-radius:8px;
    background:white;
    border:1px solid var(--border);
    overflow:hidden;
    flex-shrink:0;
}
.collab-card-logo img{width:100%;height:100%;object-fit:contain;padding:4px}
.collab-card-header{display:flex;align-items:center;gap:0.75rem;margin-bottom:0.5rem}

/* === CONSULTANCY BIGGER LOGOS === */
.consultancy-logo-lg{
    width:110px;height:110px;
    flex-shrink:0;border-radius:12px;
    background:white;border:1px solid var(--border);
    display:flex;align-items:center;justify-content:center;
    overflow:hidden;
}
.consultancy-logo-lg img{width:100%;height:100%;object-fit:contain;padding:0.6rem}

/* === PRESS REVIEW IMPROVED === */
.press-card-image-box{
    width:100%;height:200px;
    background:var(--bg-light);
    overflow:hidden;
    border-bottom:1px solid var(--border);
}
.press-card-image-box img{width:100%;height:100%;object-fit:cover}
.press-pdf-btn{
    display:inline-flex;align-items:center;gap:0.4rem;
    padding:0.4rem 0.8rem;
    background:#dc3545;color:white;
    border-radius:6px;font-size:0.8rem;font-weight:600;
    text-decoration:none;transition:all 0.2s;
}
.press-pdf-btn:hover{background:#b02a37}
.press-pdf-btn svg{flex-shrink:0}

/* === MOBILE MENU FIXES === */
@media (max-width: 968px) {
    .nav-menu {
        z-index: 1000;
        text-align: left;
    }
    .nav-menu .nav-item {
        width: 100%;
        text-align: left;
    }
    .nav-menu .nav-link {
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
        text-align: left;
    }
    .nav-menu .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--bg-light);
        padding: 0;
        margin: 0;
        border-radius: 0;
    }
    .nav-menu .dropdown-menu a {
        padding: 0.6rem 1rem 0.6rem 2rem;
        text-align: left;
        font-size: 0.9rem;
    }
    .nav-item:hover .dropdown-menu {
        /* Already visible on mobile, no hover needed */
    }
    .lang-switch {
        text-align: left;
        margin: 0.5rem 1rem;
    }
}

/* thumbnail — larger / responsive, blank fallback */
.pub-thumbnail-blank {
  width: clamp(180px, 20vw, 320px);
  aspect-ratio: 3 / 4;     /* fixed proportion */
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-thumbnail img,
.pub-thumbnail-blank img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 968px) {
  /* nasconde i dropdown per default su mobile */
  .nav-menu .dropdown-menu {
    display: none;
    position: static;     /* mantiene il flusso mobile */
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--bg-light);
    padding: 0;
    margin: 0;
    border-radius: 0;
    max-height: none;
    overflow: visible;
  }

  /* quando l'item ha la classe .expanded, mostra il suo dropdown */
  .nav-item.expanded > .dropdown-menu {
    display: block;
  }

  /* piccolo feedback visivo per il link che apre il menu */
  .nav-item.expanded > .nav-link::after {
    content: "▴";        /* freccia su quando aperto */
    margin-left: 0.5rem;
    font-size: 0.8rem;
  }

.nav-item:has(.dropdown-menu) > .nav-link::after {
  content: " ▾";
  margin-left: 0.5rem;
  font-size: 0.8rem;
}

.nav-item.expanded:has(.dropdown-menu) > .nav-link::after {
  content: " ▴";
}

  /* assicurati che i link interni del dropdown siano leggibili */
  .nav-menu .dropdown-menu a {
    padding: 0.6rem 1rem;
    display: block;
  }
}
