/* #region Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* elimina scroll orizzontale */
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
}
/* #endregion */

/* #region Variabili */
:root {
    --color-white: #ffffff;
    --color-black: #000000;
    --color-text-muted: rgb(67, 67, 67);
    --spacing-side: clamp(24px, 8vw, 200px);
}
/* #endregion */

/* #region Topbar */
.topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 36px var(--spacing-side);
    background-color: var(--color-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo img {
    width: 48px;
    height: auto;
}

.site-name h1 {
    font-size: 26px;
    font-weight: 700;
}

.menu {
    display: flex;
    gap: 40px;
    font-size: 20px;
}

.menu a {
    text-decoration: none;
    color: rgba(0,0,0,0.55);
    transition: color 0.2s;
}

.menu a:hover {
    color: var(--color-black);
}

/* Dropdown Focus */
.menu .dropdown {
    position: relative;
}

.menu .dropdown > .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* Ponte invisibile tra voce e menu: evita che il mouse "cada nel vuoto" */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 16px; /* copre il gap sotto la voce */
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    background-color: var(--color-white);
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    border-radius: 10px;
    min-width: 230px;
    padding: 8px 0;
    z-index: 100;
    flex-direction: column;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu a {
    padding: 11px 20px;
    font-size: 15px;
    color: rgba(0,0,0,0.65);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
    color: var(--color-black);
}

.drop-num {
    font-size: 12px;
    font-weight: 900;
    color: rgba(0,0,0,0.2);
    min-width: 22px;
}

/* #endregion */

/* #region Hero (index.html) */
.hero {
    position: relative;
    width: 100%;
    height: calc(100vh - 124px);
    overflow: hidden;
}

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

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--color-white);
    width: 100%;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(36px, 6vw, 72px);
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero-subtitle {
    font-size: clamp(14px, 2vw, 18px);
    margin-top: 12px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.button {
    display: inline-block;
    margin-top: 250px;
    padding: 12px 28px;
    background-color: var(--color-black);
    color: var(--color-white);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.3s, transform 0.2s;
}

.button:hover {
    background-color: #333333;
    transform: translateY(-2px);
}
/* #endregion */

/* #region Pagina Informazioni */
.info-page {
    padding: 60px 10%;
    max-width: 1280px;
    margin: 0 auto;
}

.info-page-title {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: bold;
    margin-bottom: 48px;
}

/* Sezione intro */
.info-intro {
    display: flex;
    align-items: center;
    gap: 80px;
    margin-bottom: 48px;
}

.info-intro-img img {
    width: 450px;
    height: auto;
    border-radius: 12px;
}

.info-intro-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.info-intro-text p {
    font-size: 18px;
    color: var(--color-text-muted);
    line-height: 1.8;
    max-width: 550px;
}

hr {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin: 48px 0;
}

/* Sezione obiettivi */
.info-goals-title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: bold;
    margin-bottom: 16px;
}

.info-goals-text {
    font-size: 16px;
    color: var(--color-text-muted);
    line-height: 1.7;
    max-width: 900px;
    margin-bottom: 40px;
}

.info-goals-cards {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Card obiettivo con effetto hover */
.info-goal-card {
    flex: 1;
    min-width: 250px;
    max-width: 380px;
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.info-goal-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.info-goal-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
/* #endregion */

/* #region Pagina Obiettivi */
.goals-page {
    max-width: 1280px;
    margin: 0 auto;
}

/* Sezione titolo */
.goals-header {
    padding: 0px 10%;
    font-size: clamp(24px, 4vw, 48px);
    font-weight: bold;
    margin: 60px 0 40px;
    text-align: center;
}

.goals-main-title {
    font-size: clamp(24px, 4vw, 48px);
    font-weight: bold;
    margin-bottom: 16px;
}

.goals-main-subtitle {
    font-size: 18px;
    font-weight: normal;
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.7;
    text-align: center;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 0px 10%;
    margin-bottom: 60px;
}

.goal-card{
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* Effetto hover per le card degli obiettivi */
.goal-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.goal-card img {
    width: 100%;
    height: auto;
    display: block;
}

.goal-card-title {
    font-size: 18px;
    font-weight: bold;
    padding: 16px;
    background-color: var(--color-white);
    text-align: center;
}

.goal-card {
    position: relative;
}

.goal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    opacity: 0; /* nascosto di default */
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.goal-overlay h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.goal-overlay p {
    font-size: 14px;
    line-height: 1.5;
}

.goal-card:hover .goal-overlay {
    opacity: 1; /* appare solo all'hover */
}

/* #endregion */

/* #region Pagine Dettaglio Obiettivo */

.detail-page {
    max-width: 1280px;
    margin: 0 auto;
}

/* Hero della pagina dettaglio */
.detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    padding: 60px 10%;
    background-color: #f8f8f8;
}

.detail-hero-content {
    flex: 1;
}

.detail-number {
    font-size: clamp(64px, 10vw, 120px);
    font-weight: 900;
    line-height: 1;
    color: rgba(0,0,0,0.08);
    display: block;
    margin-bottom: -16px;
}

.detail-title {
    font-size: clamp(28px, 4vw, 52px);
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.detail-tagline {
    font-size: clamp(15px, 1.6vw, 20px);
    color: var(--color-text-muted);
    line-height: 1.7;
    max-width: 520px;
}

.detail-hero-img {
    flex-shrink: 0;
}

.detail-hero-img img {
    width: clamp(200px, 28vw, 360px);
    height: auto;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.detail-hero-img img:hover {
    transform: scale(1.03);
}

/* Colori accent per ogni obiettivo */
.detail-hero--4  { border-left: 6px solid #c5192d; }
.detail-hero--11 { border-left: 6px solid #fd9d24; }
.detail-hero--17 { border-left: 6px solid #19486a; }

/* Sezioni interne */
.detail-section {
    padding: 0 10%;
}

.detail-section-inner {
    padding: 48px 0;
}

.detail-section-title {
    font-size: clamp(20px, 2.5vw, 32px);
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.detail-section-text {
    font-size: 18px;
    color: var(--color-text-muted);
    line-height: 1.8;
    max-width: 860px;
}

/* Griglia traguardi */
.detail-targets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    margin-top: 36px;
}

.detail-target-card {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 28px 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.detail-target-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.detail-target-icon {
    font-size: 32px;
    margin-bottom: 14px;
}

.detail-target-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.detail-target-card p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Card obiettivi correlati */
.detail-related {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 36px;
}

.detail-related-card {
    flex: 1;
    min-width: 220px;
    max-width: 320px;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-related-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.detail-related-card img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-related-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background-color: #f8f8f8;
    font-size: 15px;
    font-weight: 600;
}

.detail-related-num {
    font-size: 22px;
    font-weight: 900;
    color: rgba(0,0,0,0.15);
    line-height: 1;
}

/* Bottone back */
.detail-back {
    padding: 0 10%;
    margin: 48px 0 72px;
}

.detail-back .button {
    margin-top: 0;
}

/* #endregion */

/* #region Sezione ONU (index.html) */
.un-section {
    background-color: #f0f4f8;
    padding: 72px var(--spacing-side);
}

.un-section-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.un-section-text {
    flex: 1;
}

.un-section-title {
    font-size: clamp(24px, 3vw, 38px);
    font-weight: bold;
    margin-bottom: 16px;
}

.un-section-desc {
    font-size: 17px;
    color: var(--color-text-muted);
    line-height: 1.8;
    max-width: 560px;
    margin-bottom: 32px;
}

.un-button {
    display: inline-block;
    padding: 14px 32px;
    background-color: #009edb;
    color: var(--color-white);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.5px;
    transition: background-color 0.3s, transform 0.2s;
}

.un-button:hover {
    background-color: #007ab8;
    transform: translateY(-2px);
}

.un-section-badge {
    flex-shrink: 0;
}

.un-badge {
    width: 120px;
    height: 120px;
    background-color: #009edb;
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    letter-spacing: 1px;
}

.un-badge span {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
}
/* #endregion */

/* #region Footer */
.footer {
    background-color: #111111;
    color: rgba(255,255,255,0.75);
    padding: 56px var(--spacing-side) 36px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto auto;
    gap: 32px 60px;
}

.footer-credits {
    grid-column: 1;
    grid-row: 1;
}

.footer-legal {
    grid-column: 2;
    grid-row: 1 / 3;
}

.footer-copy {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
}

.footer-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 10px;
}

.footer-credits p:not(.footer-label) {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    line-height: 1.6;
}

.footer-legal p:not(.footer-label) {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    line-height: 1.8;
}

.footer-copy p {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}
/* #endregion */