/* ============================================================
   Guestbook Modern — Catania Edition
   Autore: ChatGPT + Avv. Orazio Esposito
   Ultimo aggiornamento: Ottobre 2025
   ============================================================ */

/* ========== BASE LAYOUT ========== */
body.guestbook {
  background: #f9f9fa;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  color: #222;
  margin: 0;
  padding: 0;
}

#lazTop, #lazTable {
  max-width: 900px;
  margin: 1rem auto;
}

#lazTable {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* ========== INTESTAZIONE TABELLA ========== */
#lazTable tr:first-child {
  background: linear-gradient(90deg, #0055cc, #0088ff);
  color: #fff;
  font-weight: 600;
}

#lazTable th, #lazTable td {
  padding: 0.75rem 1rem;
  vertical-align: top;
}

/* ========== INTESTAZIONE SUPERIORE (Messaggi totali, pulsanti, nav) ========== */
.lazTop {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 0.6rem 1rem;
  gap: 0.5rem;
}

.lazTop span,
.lazTop a {
  font-size: 0.95rem;
}

.lazTop strong {
  color: #c22;
}

/* ========== BOTTONI ========== */
.gb-btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: #0066cc;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gb-btn:hover {
  background: #e53935;
  transform: translateY(-1px);
}

/* ========== RIGA SINGOLA MESSAGGIO ========== */
tr[bgcolor] {
  border-bottom: 1px solid #eee;
}

.message_name {
  display: block;
  background: #f4f7fb;
  color: #0044cc;
  font-weight: 700;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 6px;
  line-height: 1.3;
  word-break: break-word;
}

.gb-location {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 6px;
}

.gb-avatar img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}

.permalink {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-top: 2px;
  line-height: 1.4;
  word-break: break-word;
}

hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 8px 0;
}

.gb-message {
  font-size: 0.95rem;
  color: #222;
  line-height: 1.6;
  word-wrap: break-word;
}

.gb-message img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
/* --- Avatar utente uniformato --- */
.gb-avatar {
  background-color: #f0f0f0;
  background-repeat: no-repeat;
  background-size: cover !important;
  background-position: center !important;
}

.gb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Su mobile: centrato sopra il nome */
@media (max-width: 768px) {
  .gb-left {
    text-align: center;
  }
  .gb-avatar {
    margin: 0 auto 6px auto;
  }
}

/* ========== NAVIGAZIONE ========== */
.gb-navigation {
  text-align: center;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.gb-navigation a {
  color: #0066cc;
  text-decoration: none;
  margin: 0 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.gb-navigation a:hover {
  background: #0055cc;
  color: #fff;
}

.gb-navigation .current {
  background: #c22;
  color: #fff;
  font-weight: 700;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {

  /* Ogni messaggio diventa un blocco */
  tr[bgcolor] {
    display: block;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    overflow: hidden;
  }

  tr[bgcolor] td {
    display: block;
    width: 100% !important;
    padding: 0.75rem;
  }

  .message_name {
    background: none;
    color: #0044cc;
    font-size: 1rem;
    padding: 0;
  }

  .gb-location {
    margin-bottom: 0.5rem;
  }

  .gb-avatar {
    display: none;
  }

  .permalink {
    font-size: 0.8rem;
    margin-top: 0.5rem;
  }

  hr {
    margin: 0.6rem 0;
  }

  .gb-message {
    font-size: 0.95rem;
  }

  .lazTop {
    flex-direction: column;
    align-items: flex-start;
  }

  .gb-btn {
    width: 100%;
    text-align: center;
  }
}
/* === AVATAR / GRAVATAR / USER PIC === */
.gb-avatar,
div[style*="height:112px"],
.user-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
}

.gb-avatar img,
div[style*="height:112px"] img,
.user-pic img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
/* === Link visibili e coerenti con la palette CalcioCatania.com === */
.gb-entry a,
.gb-message a,
.permalink a {
  color: #0044cc; /* blu Catania */
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,68,204,0.2);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.gb-entry a:hover,
.gb-message a:hover,
.permalink a:hover {
  color: #c22; /* rosso acceso */
  border-color: rgba(204,34,34,0.4);
}
/* Su mobile: centrato sopra il nome */
@media (max-width: 768px) {
  .gb-avatar,
  div[style*="height:112px"] {
    width: 64px;
    height: 64px;
    margin: 0 auto 8px auto;
  }
  .gb-entry {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0,0,0,.07);
  }

  .gb-message {
    font-size: 1rem;
    line-height: 1.65;
  }

  .gb-name {
    font-size: 1rem !important;
  }
}
/* --- Blocco embed (ex ad_code / banner / post fissato) --- */
.gb-embed-block {
  background: #fff;
  border-left: 4px solid #0044cc;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  text-align: center;
  font-family: system-ui, Arial, sans-serif;
  line-height: 1.5;
}

.gb-embed-inner iframe {
  max-width: 100%;
  height: auto;
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-top: 0.5rem;
}
/* --- Blocco per embed/banner (ad_code) --- */
.gb-embed-block {
  background: #fff;
  border-left: 4px solid #0044cc;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  text-align: center;
  font-family: system-ui, Arial, sans-serif;
  line-height: 1.5;
  overflow: hidden;
}

.gb-embed-block.fb-embed {
  border-left-color: #1877f2;
}

/* --- contenitore responsivo per iframe --- */
.gb-embed-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Facebook iframe responsive fix */
.gb-embed-inner iframe {
  width: 100% !important;
  min-height: 450px !important;
  border: none;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* Mobile fix per altezze ridotte */
@media (max-width: 768px) {
  .gb-embed-inner iframe {
    min-height: 520px !important;
  }
}
/* --- Card base per ogni messaggio --- */
.gb-entry {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: background 0.3s ease;
}

/* Alternanza visiva tra card */
.gb-entry:nth-child(even) {
  background: #f8fafc; /* azzurrino chiarissimo */
}

.gb-entry:nth-child(odd) {
  background: #ffffff; /* bianco puro */
}

/* Hover morbido */
.gb-entry:hover {
  background: #f0f5ff;
}

/* Meta dati e messaggio */
.gb-entry-header {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: .8rem;
  padding-bottom: .4rem;
}

.gb-entry-author {
  font-weight: 700;
  color: #0044cc;
}

.gb-entry-meta {
  font-size: .9rem;
  color: #666;
}

/* Messaggio */
.gb-entry-body {
  color: #222;
  line-height: 1.6;
  font-size: 1rem;
}

/* Variante per i dispositivi mobili */
@media (max-width: 768px) {
  .gb-entry {
    padding: 1rem;
    margin: 0.9rem 0;
  }
}
/* --- GUESTBOOK PAGINATION - FIX DI SPECIFICITÀ E STATI LINK --- */
#content .gb-pagination a,
#content .gb-pagination a:link,
#content .gb-pagination a:visited {
  color: #004b9b !important;          /* testo visibile */
  background-color: #f4f7fc !important;
  border: 1px solid #dbe3ef !important;
  text-decoration: none;
  border-radius: 5px;
  padding: 4px 8px;
  margin: 0 3px;
}

#content .gb-pagination a:hover,
#content .gb-pagination a:focus {
  background-color: #0055cc !important;
  color: #fff !important;
  border-color: #0055cc !important;
}

/* Numero corrente: spesso è testo semplice tra parentesi quadre */
#content .gb-pagination {
  color: #000 !important;             /* [1] in nero, visibile su sfondo chiaro */
  font-weight: 700;
}
/* --- FIX PAGINAZIONE GUESTBOOK DENTRO LA NAV --- */
.gb-header .gb-nav .gb-pagination a,
.gb-header .gb-nav .gb-pagination a:link,
.gb-header .gb-nav .gb-pagination a:visited {
  color: #004b9b !important;              /* blu visibile su sfondo bianco */
  background-color: #f4f7fc !important;   /* leggero grigio-blu */
  border: 1px solid #dbe3ef !important;
  border-radius: 5px;
  padding: 3px 7px;
  margin: 0 2px;
  text-decoration: none;
  font-weight: 500;
}

.gb-header .gb-nav .gb-pagination a:hover {
  background-color: #0055cc !important;
  color: #fff !important;
  border-color: #0055cc !important;
}

/* Numero corrente [1] in nero */
.gb-header .gb-nav .gb-pagination {
  color: #000 !important;
  font-weight: 700;
}
/* --- PAGINAZIONE GUESTBOOK MOBILE FIX --- */
@media (max-width: 768px) {
  .gb-header .gb-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }

  .gb-header .gb-nav .gb-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-top: .5rem;
  }

  .gb-header .gb-nav .gb-pagination a,
  .gb-header .gb-nav .gb-pagination a:link,
  .gb-header .gb-nav .gb-pagination a:visited {
    color: #004b9b !important;
    background-color: #f4f7fc !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 6px;
    padding: 5px 9px;
    margin: 3px;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
  }

  .gb-header .gb-nav .gb-pagination a:hover,
  .gb-header .gb-nav .gb-pagination a:focus {
    background-color: #0055cc !important;
    color: #fff !important;
    border-color: #0055cc !important;
  }

  /* Numero corrente [1] */
  .gb-header .gb-nav .gb-pagination {
    color: #000 !important;
    font-weight: 700;
  }
}
/* --- GUESTBOOK FIX: mantieni solo lo sfondo di base-header-and-footer.css --- */
body.guestbook {
  /* eredita lo sfondo classico */
  background: #333333 url(https://calciocatania.com/css3/images/bg-body-top2.jpg) fixed repeat-x center top !important;
  color: #222 !important;
}

/* Ripristina i colori del testo e dei link */
body.guestbook a,
body.guestbook a:link,
body.guestbook a:visited {
  color: #0044cc !important;
  text-decoration: none !important;
  background: transparent !important;
}

body.guestbook a:hover,
body.guestbook a:focus {
  color: #c22 !important;
  background: transparent !important;
}

/* Disattiva eventuali regole globali */
body.guestbook #header-content,
body.guestbook #footer-content,
body.guestbook #nav,
body.guestbook .footer-nav,
body.guestbook .footer-legals {
  display: none !important;
}

/* Mantieni il layout moderno interno */
body.guestbook #page {
  background: transparent !important;
  box-shadow: none !important;
  max-width: 900px !important;
  margin: 1rem auto !important;
  padding: 0 !important;
}
/* --- FIX PAGINAZIONE GUESTBOOK MOBILE (PRIORITÀ MASSIMA) --- */
@media (max-width: 768px) {

  /* Forza i link della paginazione visibili anche se nav o altri CSS li nascondono */
  body.guestbook .gb-pagination a,
  body.guestbook .gb-pagination a:link,
  body.guestbook .gb-pagination a:visited {
    color: #004b9b !important;               /* blu visibile */
    background-color: #f4f7fc !important;    /* grigio chiaro */
    border: 1px solid #dbe3ef !important;
    border-radius: 6px !important;
    padding: 5px 9px !important;
    margin: 3px !important;
    text-decoration: none !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 10 !important;
  }

  body.guestbook .gb-pagination a:hover,
  body.guestbook .gb-pagination a:focus {
    background-color: #0055cc !important;
    color: #fff !important;
    border-color: #0055cc !important;
  }

  /* Il numero corrente (testo [1]) */
  body.guestbook .gb-pagination {
    color: #000 !important;
    font-weight: 700 !important;
    background: none !important;
  }

  /* Corregge casi in cui nav o sfondi del body coprono i link */
  body.guestbook .gb-nav,
  body.guestbook header .gb-nav,
  body.guestbook nav.gb-nav {
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
  }
}
