/* ---------------- RESET ---------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    background: #ffffff;
    color: #111;
    line-height: 1.5;

}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a { text-decoration: none; color: inherit; }

/* ---------------- HEADER ---------------- */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 10px 0;

    /* 🔥 border-radius RIMOSSO */
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;     /* OK: la sfera rimane rotonda */
    background: #bf0000;
    overflow: hidden;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-title-group {
    display: flex;
    flex-direction: column;
}

.header-name {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: "Archivo Black", sans-serif;
}

.header-subtitle {
    font-size: 1rem;
    font-weight: 600;
}

/* NAV */
.nav-links {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
    font-weight: 700;
}

.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 2px;
    width: 0;
    background: #111;
    transition: 0.2s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    font-size: 1.6rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* SOCIAL ICONS */

.social-icons{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom: 14px; /* un po' di spazio dal nav */
}

.social-icons a{
  color:#89ab10;
  font-size: 2.5rem;
  line-height: 1;
  transition: color .2s ease, transform .2s ease;
}

.social-icons a:hover{
  color:#E94F37;
  transform: translateY(-1px);
}

.nav-social a{
    padding: 0.5rem 0.75rem; /* meno “bottonoso” */
  font-size: 1.2rem;
}

/* ---------------- HERO ---------------- */

.page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
}

.hero {
    margin-top: 0px;

    border-radius : 25px;
    overflow: hidden;

    background: #222;
    color: #fff;
    padding: 60px 32px;
    position: relative;
    min-height: 200px;
}

.hero::before {
    content: "";
    inset: 0;
    position: absolute;
    background-image: url("hero-background.jpg");
    background-size: cover;
    background-position: center;
    opacity: 0.85;
    z-index: -2;
}

.hero::after {
    content: "";
    inset: 0;
    position: absolute;
    background: rgba(0,0,0,0.6);
    z-index: -1;
}

/* ---------------- HEADINGS (H2 / H3) ---------------- */

h2 {
    font-size: 160%;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

h3 {
    font-size: 140%;
    margin: 18px 0 10px 0;
    line-height: 1.25;
}

/* se usi .card-title su H2, manteniamo anche quello coerente */
.card-title {
    margin: 0 0 12px 0;
    font-size: 200%;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

/* ---------------- SELECTED PUBLICATIONS ---------------- */

.selected-publication {
    padding: 10px 12px;
    margin: 0;
    transition: background-color 0.2s ease;

    /* ✅ line-height 1.2 per le pubblicazioni */
    line-height: 1.2;
}

.selected-publication:hover {
    background: #EBEBEB;
}

/* ---------------- GRID ---------------- */

.sections-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}

.card {
    background:none;
    color: #111;
    padding: 0px;
}

/* ✅ +20% sui paragrafi “normali” (tutti tranne side e selected-publication) */
.card p {
    font-size: 120%;
}

.card-side p {
    font-size: 100%;
    line-height: 1.2;
}

.card p.selected-publication {
    font-size:100%;
    padding-left:0;
}

.card-large { grid-column: 1 / 2; }
.card-side  { grid-column: 2 / 3; }
.card-full  { grid-column: 1 / 3; }

/* ✅ line-height 1.2 nei box laterali */
.card-side,
.card-side p {
    line-height: 1.2;
}

/* ---------------- TIMELINE ITEM (Education / Work) ---------------- */

.cv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.cv-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    overflow: hidden;
    background:none;
    flex: 0 0 76px;        /* non si schiaccia */
}

.cv-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cv-text {
    margin: 0;            /* evita margini strani del <p> */
}


/* ---------------- RESPONSIVE ---------------- */

@media (max-width: 768px) {

    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: center;
        padding: 16px 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    }

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

    .header-inner {
        flex-direction: column;
        gap: 14px;
    }

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

    .sections-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .hero-text { text-align: center; }
}

/* ---------------- FOOTER ---------------- */

.site-footer {
    width: 100%;
    margin-top: 44px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px;

    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    align-items: center;
    gap: 14px;
}

/* Brand (avatar + name + tagline) */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: #bf0000;   /* coerente con header-avatar */
    flex: 0 0 44px;
}

.footer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.footer-title-group {
    display: flex;
    flex-direction: column;
}

.footer-name {
    font-family: "Archivo Black", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
}

.footer-tagline {
    margin-top: 4px;
    font-size: 0.92rem;
    font-weight: 600;
    opacity: 0.75;
}

/* Middle: quick links */
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Right: contact */
.footer-contact {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 700;
    font-size: 0.95rem;
}

.footer-sep {
    opacity: 0.35;
}

/* Link style coerente col menu (underline animata) */
.site-footer a {
    position: relative;
    color: inherit;
}

.site-footer a::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    height: 2px;
    width: 0;
    background: #111;
    transition: 0.2s ease;
}

.site-footer a:hover::after {
    width: 100%;
}

/* Footer bottom bar */
.footer-bottom {
    border-top: 1px solid #e9e9e9;
    background: #ffffff;
}

.footer-bottom-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.85;
}

.back-to-top {
    font-weight: 800;
}

/* Responsive */
@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .footer-nav {
        justify-content: center;
    }

    .footer-contact {
        justify-content: center;
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* CONTACT FORM */
    .basin-form-container{font-family:Inter,system-ui,Segoe UI,Roboto,'Helvetica Neue',Arial;color:#111;background:#f7fafc;padding:24px;border-radius:10px;max-width:520px;margin:18px auto;box-shadow:0 6px 20px rgba(8,30,63,0.08)}
    .basin-form {display:flex;flex-direction:column;gap:12px}
    .basin-form label{font-size:14px;font-weight:600}
    .basin-form input[type="text"],
    .basin-form input[type="email"],
    .basin-form textarea{width:100%;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;background:#fff;box-sizing:border-box}
    .basin-form textarea{min-height:120px;resize:vertical}
    .basin-form .form-row{display:flex;flex-direction:column}
    .basin-form .hint{font-size:13px;color:#6b7280;margin-top:6px}
    .basin-form button{align-self:flex-end;background:#0b74ff;color:#fff;padding:10px 16px;border:none;border-radius:8px;font-weight:600;cursor:pointer;box-shadow:0 6px 18px rgba(11,116,255,0.18)}
    .basin-form button:active{transform:translateY(1px)}
    .basin-captcha-wrap{margin-top:6px}
    .basin-success-message{display:none;padding:12px;background:#ecfdf5;border:1px solid #bbf7d0;color:#03543f;border-radius:8px;margin-top:8px}

    /* ---------------- LINK COLOR (headings + paragraphs) ---------------- */

/* Link dentro intestazioni */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  color: #1F9ACF;
}

/* Link dentro paragrafi */
p a {
  color: #1F9ACF;
}

/* (opzionale) hover coerente */
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
p a:hover {
  text-decoration: underline;
}

/* ---------------- IMAGE MODAL / LIGHTBOX ---------------- */
.zoomable {
    cursor: zoom-in;
}

/* Modal hidden by default */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.modal.is-open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
}

.modal-content {
    position: relative;
    margin: 5vh auto;
    width: min(92vw, 1100px);
    max-height: 90vh;

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 12px;
    border-radius: 14px;
  background: #222;
  color: #fff;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 600;
}

.btn:hover { background: rgba(255,255,255,0.20); }

/* opzionale: blocca scroll quando modal aperto */
body.modal-open {
    overflow: hidden;
}

/* Image overlay / badge for inline previews */
.image-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 10px;
}

.image-figure {
    margin: 0;
}

.image-caption {
    margin: 6px 0 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #000;
}

.image-caption em {
    font-style: italic;
    font-weight: 400;
}

.image-wrap img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform .25s ease;
}

.image-wrap:hover img { transform: scale(1.03); }

.image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* allow click to reach the image */
}

.overlay-badge {
    background: rgba(0,0,0,0.55);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease;
}

.image-wrap:hover .overlay-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Fullscreen adjustments when using the Fullscreen API */
.modal:fullscreen {
    background: rgba(0,0,0,0.85);
}

.modal:fullscreen .modal-content {
    width: 100vw;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 24px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal:fullscreen .modal-content img {
    max-height: calc(100vh - 48px);
    width: auto;
}
