:root {
  --header-height: 95.76px;
}

* {box-sizing: border-box; margin: 0;}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* fa sì che il body copra tutto lo schermo */
}

main {
  flex: 1; /* occupa tutto lo spazio rimanente */
  padding: 20px;
}

a {
    text-decoration: none;
    color: inherit;
    font-family: 'Inter', sans-serif;
}

textarea {
  resize: none;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    box-shadow: 0px 0px 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 50px;
}

.logo span {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 10px;
}

.menu-toggle {
  position: absolute;
  top: calc(var(--header-height) / 2);
  right: 1rem;
  transform: translateY(-50%);
  z-index: 1100;          /* sopra l’overlay */
  background: transparent;
  border: none;
  cursor: pointer;
  display: none;          /* visibile solo su mobile */
}

.icon-close { display: none; }
.menu-toggle.is-open .icon-burger { display: none; }
.menu-toggle.is-open .icon-close  { display: inline; }

.site-header ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.home-link {
    position: relative;
}

.home-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;          /* distanza dal testo */
  width: 100%;
  height: 2px;
  background-color: #007bff;
  transform: scaleX(0);  /* linea "nascosta" */
  transform-origin: left; 
  transition: transform 0.3s ease;
}

.home-link:hover::after {
  transform: scaleX(1);  /* si espande da sinistra a destra */
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Blocca lo scroll quando aperto  */
/* .menu-open { overflow: hidden; } */

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0;
  margin: 0;
}

.mobile-menu a {
  font-size: 1.5rem;
  text-decoration: none;
  color: #333;
}

/* .mobile-menu {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
} */

@media (max-width: 800px) {
  .menu-toggle { display: block; }
  .site-header ul { display: none; }
}

footer {
    width: 100%;
    text-align: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 2px solid #e9ecef;
    margin-top: 2rem;
}

footer p {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

footer p a {
    width: 24px;
    height: 24px;
}

footer p a:hover {
    color: #007bff;
}

.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('/img/hero.jpg') center/cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7); /* layer intermedio */
  z-index: 1;
}

.hero-text {
  position: relative;
  z-index: 2; /* sopra overlay */
  color: #fff;
  text-align: center;
}

.hero-text {
    text-align: center;
    padding: 2rem;
}

.hero-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.btn-primary {
    background-color: #007bff;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.h3-home {
    border-left: 5px solid #007bff;
    padding-left: 5px;
}

.section-home {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    box-shadow: 0px 0px 20px 0px;
    border-radius: 10px;
}

.placeholder {
    padding: 10px;
}

.steps {
    padding: 30px;
}

@media (max-width: 600px) {
    .hero-text h2 {
        font-size: 1.5rem;
    }
}

.h2-catalog {
    font-size: 2rem;
}

.filters {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters input[type="search"], .filters select, .btn-cauta {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-cauta {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%; /* mantiene tutte le card della stessa altezza */
}

.card-cover,
.cover-ph {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    font-size: 3rem; /* grandezza icona/emoji */
}

.card-body {
    flex: 1;              /* prende tutto lo spazio disponibile */
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.card-body h4 {
    margin: 0 0 5px;
    flex-grow: 0;
}

.card-body .author {
    margin: 0 0 10px;
    flex-grow: 0;
}

.catalog-availability {
    margin-top: auto;     /* spinge in basso */
    font-weight: bold;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  font-size: 1rem;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  text-decoration: none;
  color: #333;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination a:hover {
  background-color: #007bff20; /* leggero sfondo azzurro */
  color: #007bff;
}

.pagination .current {
  font-weight: bold;
  background-color: #007bff;
  color: white;
  cursor: default;
}

.pagination .disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Rimuove l'effetto quadrato */
.pagination a {
  -webkit-tap-highlight-color: transparent; /* per Safari/Chrome su mobile */
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 10px;
    justify-content: center;
}

.gallery img {
    width: 200px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 4px;
}

.metaPrimary {
    margin: 1rem 0;
    background-color: #007bff;
    color: #ffffff;
    padding: 10px;
    border-radius: 10px;
}

table.metadata {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

table.metadata th,
table.metadata td {
  border: 1px solid #ddd;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

table.metadata th {
  background-color: #f8f9fa;
  font-weight: 600;
  width: 30%;
  color: #333;
}

table.metadata tr:nth-child(even) td {
  background-color: #fafafa;
}

table.metadata tr:hover td {
  background-color: #f1f1f1;
}

.availability {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  margin-top: 1rem;
}

.availability .back-link {
  display: flex;
  align-items: center;
  color: #007bff;
  transition: transform 0.2s;
}

.availability .back-link:hover {
  transform: translateX(-3px);
}

.availability .text strong {
  margin-left: 4px; /* piccolo spazio solo tra 'Disponibile:' e il numero */
}

.div-contribue {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    box-shadow: 0 0 20px;
    border-radius: 10px;
}

.div-contribue form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: fit-content;
    margin: auto;
}

.div-contribue form label {
    padding: 0.5rem 1rem;
}

.div-contribue form label:hover {
    background-color: #f1f1f1;
}

.div-contribue form span {
    margin-right: 8px;
}

.div-contribue form input, .div-contribue form textarea {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    float: right;
}

.btn-contribue {
    background-color: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    border: none;
    font-size: 1rem;
}

.contacte-container {
    display: flex;
    flex-wrap: wrap;
    background-color: #f1f1f1;
    border-radius: 12px;
}

.contacte-container section {
    flex: 1;
    min-width: 350px;
    padding: 1rem;
}

.map-container {
  position: relative;
  padding-bottom: 56.25%; /* rapporto 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 12px; /* angoli arrotondati */
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-list li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.contact-list li a:hover {
  color: #007bff;
}

.contact-list svg {
  flex-shrink: 0;
}

.admin-login {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border-radius: 10px;
    background-color: #ffffff;
}

.admin-login h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.admin-login form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-login label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
}

.admin-login input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
}

.admin-login .btn {
    background-color: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    outline: none;
    transition: background-color 0.2s ease;
}

.admin-login .btn:hover {
    background-color: #0056b3;
}

.admin-login p {
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.notfound-wrap {
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.notfound-card {
  width:min(720px,100%);
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:28px;
  box-shadow:0 4px 14px rgba(0,0,0,.05);
  text-align:center;
}

.notfound-title { font-size:64px; line-height:1; margin:0 0 8px; }
.notfound-subtitle { font-size:20px; margin:0 0 8px; }
.notfound-text { margin:4px 0 16px; }
.notfound-muted { color:#64748b; margin:0 0 6px; word-break:break-all; }

.notfound-actions {
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}

.notfound-btn {
  padding:10px 14px;
  border:1px solid #e5e7eb;
  background:#ffffff;
  border-radius:10px;
  cursor:pointer;
  transition:filter .15s, background .15s, color .15s;
  font-weight:500;
}
.notfound-btn:hover { background:#f8fafc; }

.notfound-btn.primary {
  background:#111827;
  color:#ffffff;
  border-color:#111827;
}
.notfound-btn.primary:hover { filter:brightness(1.08); }

.notfound-footer {
  position:fixed;
  left:0; right:0; bottom:0;
  color:#64748b;
  text-align:center;
  padding:10px 0;
  font-size:.9rem;
}