body {
    background-color: black;
    color: white;
    font-family: sans-serif;
    margin: 0;
    padding: 0;
}

header {
    background-color: #222;
    padding: 10px 20px;
    display: flex;
    align-items: center;
   /* justify-content: space-between; */
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 26px;
    row-gap: 6px;
}

/* Cada grup temàtic: un títol i, a sota, la llista de seccions en horitzontal.
   Només dues línies d'alçada perquè tot el menú s'encabeixi dins l'alçada del logo. */
.menu-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.menu-group-title {
    font-family: Calibri, sans-serif;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 6px;
}

/* Quan el títol de grup és un enllaç cap a la subpàgina d'un altre grup temàtic */
a.menu-group-title {
    text-decoration: none;
    cursor: pointer;
}

a.menu-group-title:hover {
    color: #fff;
}

.menu-group-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.menu-group-links li {
    margin: 0;
}

.menu-group-links a {
    display: inline-block;
    color: white;
    text-decoration: none;
    white-space: nowrap;
    padding: 5px 18px;
    background-color: black;
    border-radius: 14px;
    font-family: Calibri, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.menu-group-links a:hover {
    background-color: white;
    color: black;
}

main {
    padding: 20px;
}

#gallery .grid {
    columns: 280px; /* Nombre de columnes automàtic segons l'amplada disponible, com un mosaic (masonry) */
    column-gap: 10px;
}

/* Cada imatge es mostra sencera, amb la seva proporció natural, sense retallar */
.grid-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 10px;
    overflow: hidden; /* Important per no sobresortir en l'animació de hover */
}

#gallery .grid img {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#gallery .grid img:hover {
    transform: scale(1.05);
}

/* Estils per al nom del fitxer sota cada imatge del grid */
.image-name-grid {
    display: none;
/*
    position: absolute;
    bottom: 5px;
    left: 5px;
    color: white;
    font-size: 12px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
*/
}

#full-image-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

#full-image-container {
    position: relative;
    width: 90%; /* Canviat max-width per width */
    height: 90vh; /* Canviat max-height per height i usant vh */
    display: flex;
    align-items: center;
    justify-content: center;
}


#full-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#image-name {
    display: none;
/*
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    text-align: center;
*/
}


.nav-button img {
    width: 50px; /* Ajusta segons necessitis */
    height: 50px; /* Ajusta segons necessitis */
    vertical-align: middle; /* Alinea verticalment la imatge */
}


#prev-image {
    left: 10px;
    background-color: transparent; /* Fons transparent */
    color: white;
    border: none;
    padding: 5px 5px;
    cursor: pointer;
    font-size: 5px;
    border-radius: 5px;
    transform: scale(0.6);
}


#next-image {
    right: 10px;
    background-color: transparent; /* Fons transparent */
    color: white;
    border: none;
    padding: 5px 5px;
    cursor: pointer;
    font-size: 5px;
    border-radius: 5px;
    transform: scale(0.6);
}


#prev-image img,
#next-image img {
    filter: invert(1) opacity(0.8);
}


#prev-image img:hover,
#next-image img:hover {
/*    filter: invert(0); */
    transform: scale(1.1);
}


#about {
    display: none;
    margin-top: 20px;
}

#about-content {
    line-height: 1.6;
}
