/*
 * LE COLIBRÌ — Gestionale Royalty
 * Foglio di stile frontend per gli shortcode [lc_royalty*]
 *
 * Installazione consigliata:
 * 1. Caricare questo file in /wp-content/themes/NOME-CHILD-THEME/css/lcr-royalty.css
 * 2. Aggiungere lo snippet PHP indicato nella documentazione di consegna.
 *
 * Le regole sono circoscritte a .lcr-front per non modificare il resto del sito.
 */

:root {
  --lcr-color-primary: #245b78;
  --lcr-color-primary-dark: #183f55;
  --lcr-color-accent: #c49a55;
  --lcr-color-text: #263238;
  --lcr-color-muted: #687780;
  --lcr-color-border: #dce4e8;
  --lcr-color-soft: #f3f7f9;
  --lcr-color-white: #ffffff;
  --lcr-radius: 12px;
  --lcr-shadow: 0 5px 20px rgba(20, 48, 62, .07);
}

/* Contenitore generale di ogni pagina shortcode */
.lcr-front {
  width: 100%;
  max-width: 1180px;
  margin: 28px auto;
  padding: clamp(18px, 3vw, 34px);
  color: var(--lcr-color-text);
  background: var(--lcr-color-white);
  border: 1px solid var(--lcr-color-border);
  border-radius: var(--lcr-radius);
  box-shadow: var(--lcr-shadow);
  font-size: 15px;
  line-height: 1.6;
}

/* Titolo principale generato dal plugin */
.lcr-front > h2 {
  margin: 0 0 24px;
  padding: 0 0 14px;
  color: var(--lcr-color-primary-dark);
  border-bottom: 2px solid var(--lcr-color-accent);
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.2;
  font-weight: 700;
}

/* Titoli secondari: andamento storico, documenti, ecc. */
.lcr-front h3 {
  margin: 28px 0 13px;
  color: var(--lcr-color-primary);
  font-size: 19px;
  line-height: 1.3;
}

/* Riquadri KPI del riepilogo */
.lcr-front .lcr-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}

.lcr-front .lcr-kpi {
  min-width: 0;
  padding: 20px;
  background: var(--lcr-color-soft);
  border: 1px solid var(--lcr-color-border);
  border-top: 4px solid var(--lcr-color-primary);
  border-radius: 10px;
  color: var(--lcr-color-muted);
  font-size: 13px;
  font-weight: 600;
}

.lcr-front .lcr-kpi strong {
  display: block;
  margin-top: 8px;
  color: var(--lcr-color-primary-dark);
  font-size: clamp(22px, 3vw, 29px);
  line-height: 1.2;
  font-weight: 750;
  overflow-wrap: anywhere;
}

/* Filtro anno */
.lcr-front .lcr-year-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
  padding: 14px 16px;
  background: var(--lcr-color-soft);
  border: 1px solid var(--lcr-color-border);
  border-radius: 9px;
}

.lcr-front .lcr-year-filter label {
  color: var(--lcr-color-text);
  font-weight: 650;
}

.lcr-front .lcr-year-filter select {
  min-width: 110px;
  min-height: 42px;
  padding: 8px 34px 8px 12px;
  color: var(--lcr-color-text);
  background: #fff;
  border: 1px solid #c8d3d9;
  border-radius: 7px;
}

.lcr-front .lcr-year-filter button,
.lcr-front a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 17px;
  color: #fff;
  background: var(--lcr-color-primary);
  border: 1px solid var(--lcr-color-primary);
  border-radius: 7px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.lcr-front .lcr-year-filter button:hover,
.lcr-front a.button:hover {
  color: #fff;
  background: var(--lcr-color-primary-dark);
  border-color: var(--lcr-color-primary-dark);
  transform: translateY(-1px);
}

/* Tabelle: riepiloghi, libri, ordini, conto vendita, eventi,
   liquidazioni e documenti */
.lcr-front table {
  width: 100%;
  margin: 16px 0 26px;
  border: 1px solid var(--lcr-color-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  font-size: 14px;
}

.lcr-front thead th {
  padding: 13px 14px;
  color: #fff;
  background: var(--lcr-color-primary);
  border: 0;
  text-align: left;
  vertical-align: middle;
  font-weight: 700;
  white-space: nowrap;
}

.lcr-front tbody td {
  padding: 12px 14px;
  color: var(--lcr-color-text);
  border: 0;
  border-bottom: 1px solid var(--lcr-color-border);
  text-align: left;
  vertical-align: middle;
}

.lcr-front tbody tr:nth-child(even) {
  background: #f8fafb;
}

.lcr-front tbody tr:hover {
  background: #eef5f8;
}

.lcr-front tbody tr:last-child td {
  border-bottom: 0;
}

.lcr-front td strong {
  color: var(--lcr-color-primary-dark);
}

.lcr-front table a:not(.button) {
  color: var(--lcr-color-primary);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lcr-front table a:not(.button):hover {
  color: var(--lcr-color-primary-dark);
}

/* Stato pagamenti: classe già prevista dal plugin */
.lcr-front .lcr-paid {
  color: #18733b;
  font-weight: 700;
}

/* Nota fiscale in fondo a ogni pagina */
.lcr-front .lcr-legal {
  margin: 28px 0 0;
  padding: 14px 16px;
  color: var(--lcr-color-muted);
  background: #f7f8f9;
  border-left: 3px solid var(--lcr-color-accent);
  border-radius: 0 7px 7px 0;
  font-size: 12px;
  line-height: 1.55;
}

/* Messaggi e paragrafi */
.lcr-front p {
  margin: 12px 0;
}

.lcr-front a {
  overflow-wrap: anywhere;
}

/* Tablet */
@media (max-width: 900px) {
  .lcr-front .lcr-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lcr-front {
    padding: 22px;
  }
}

/* Smartphone: KPI in colonna e tabelle scorrevoli */
@media (max-width: 640px) {
  .lcr-front {
    margin: 14px auto;
    padding: 16px 12px;
    border-radius: 8px;
    font-size: 14px;
  }

  .lcr-front > h2 {
    margin-bottom: 18px;
    font-size: 22px;
  }

  .lcr-front .lcr-kpis {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lcr-front .lcr-kpi {
    padding: 15px;
  }

  .lcr-front .lcr-kpi strong {
    font-size: 24px;
  }

  .lcr-front .lcr-year-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .lcr-front .lcr-year-filter select,
  .lcr-front .lcr-year-filter button {
    width: 100%;
  }

  .lcr-front table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .lcr-front thead th,
  .lcr-front tbody td {
    padding: 10px 11px;
  }

  .lcr-front .lcr-legal {
    font-size: 11px;
  }
}
