/* ==================================================
   KAPPA POSTS TABLE PRO
   Tabella articoli professionale dark/light + mobile
================================================== */

.kappa-posts-table-wrap,
.kappa-posts-table-wrap *,
.kappa-posts-mobile-list,
.kappa-posts-mobile-card {
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: 0.003em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.kappa-posts-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  color: #e2e8f0;
}

.kappa-posts-table-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.kappa-posts-table-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
}

.kappa-posts-table-control select,
.kappa-posts-table-controls select,
.kappa-posts-per-page-select {
  appearance: auto;
  -webkit-appearance: auto;
  background-color: #020617 !important;
  color: #e2e8f0 !important;
  border: 1px solid #334155 !important;
  border-radius: 14px;
  padding: 10px 38px 10px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  outline: none;
}

.kappa-posts-table-control select option,
.kappa-posts-table-controls select option,
.kappa-posts-per-page-select option {
  background-color: #020617 !important;
  color: #e2e8f0 !important;
}

.kappa-posts-table-control select:focus,
.kappa-posts-table-controls select:focus,
.kappa-posts-per-page-select:focus {
  border-color: #22d3ee !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

.kappa-posts-table-desktop {
  width: 100%;
  overflow: hidden;
  border: 1px solid #1e293b;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 20px 50px rgba(8, 145, 178, 0.08);
}

.kappa-posts-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.kappa-posts-table thead {
  background: #020617;
}

.kappa-posts-table th {
  padding: 16px 14px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-align: left;
  border-bottom: 1px solid #1e293b;
}

.kappa-posts-table td {
  padding: 16px 14px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.003em;
  line-height: 1.65;
  border-bottom: 1px solid #1e293b;
  vertical-align: middle;
}

.kappa-posts-table tbody tr:last-child td {
  border-bottom: none;
}

.kappa-posts-table tbody tr:hover {
  background: rgba(34, 211, 238, 0.04);
}

/* Titolo automatico */
.kappa-posts-title-cell {
  width: auto;
  min-width: 280px;
}

.kappa-posts-table-title {
  display: inline-block;
  max-width: 100%;
  color: #f8fafc;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-decoration: none;
}

.kappa-posts-table-title:hover,
.kappa-posts-table-title:focus {
  color: #67e8f9;
  outline: none;
}

/* Colonne compatte */
.kappa-posts-table-number-cell,
.kappa-posts-table-date-cell,
.kappa-posts-table-category-cell,
.kappa-posts-table-author-cell,
.kappa-posts-table-action {
  width: 1%;
  white-space: nowrap;
}

.kappa-posts-table-excerpt-cell {
  width: 32%;
  min-width: 220px;
  color: #94a3b8 !important;
}

.kappa-posts-table-number-cell {
  text-align: center !important;
  font-weight: 700 !important;
  color: #67e8f9 !important;
}

.kappa-posts-table-date-cell,
.kappa-posts-table-category-cell,
.kappa-posts-table-author-cell {
  color: #cbd5e1;
}

/* Pulsante a destra */
.kappa-posts-table-action {
  text-align: right !important;
}

.kappa-posts-table-action .kappa-posts-button {
  margin-left: auto;
}

.kappa-posts-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #67e8f9 !important;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.kappa-posts-button:hover,
.kappa-posts-button:focus {
  background: rgba(34, 211, 238, 0.22);
  border-color: rgba(34, 211, 238, 0.65);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(8, 145, 178, 0.22);
  outline: none;
}

.kappa-posts-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.kappa-posts-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.kappa-posts-pagination a,
.kappa-posts-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.kappa-posts-pagination a:hover,
.kappa-posts-pagination a:focus {
  border-color: rgba(34, 211, 238, 0.65);
  color: #67e8f9;
  outline: none;
}

.kappa-posts-pagination .is-disabled {
  opacity: 0.45;
}

.kappa-posts-pagination-current {
  color: #94a3b8 !important;
}

.kappa-posts-empty {
  padding: 24px;
  border: 1px solid #1e293b;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  text-align: center;
}

/* Mobile cards */
.kappa-posts-mobile-list {
  display: none;
}

.kappa-posts-mobile-card {
  padding: 18px;
  border: 1px solid #1e293b;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 16px 36px rgba(8, 145, 178, 0.08);
}

.kappa-posts-mobile-card + .kappa-posts-mobile-card {
  margin-top: 14px;
}

.kappa-posts-mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kappa-posts-mobile-number {
  color: #67e8f9;
  font-size: 13px;
  font-weight: 700;
}

.kappa-posts-mobile-date,
.kappa-posts-mobile-card-meta {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 400;
}

.kappa-posts-mobile-card-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.kappa-posts-mobile-card-title a {
  color: #f8fafc;
  text-decoration: none;
}

.kappa-posts-mobile-card-title a:hover,
.kappa-posts-mobile-card-title a:focus {
  color: #67e8f9;
  outline: none;
}

.kappa-posts-mobile-card-excerpt {
  margin: 0 0 14px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
}

.kappa-posts-mobile-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.kappa-posts-mobile-card-meta span {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid #1e293b;
}

/* Light mode */
html.light .kappa-posts-table-wrap {
  color: #334155;
}

html.light .kappa-posts-table-control {
  color: #475569;
}

html.light .kappa-posts-table-control select,
html.light .kappa-posts-table-controls select,
html.light .kappa-posts-per-page-select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html.light .kappa-posts-table-control select option,
html.light .kappa-posts-table-controls select option,
html.light .kappa-posts-per-page-select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html.light .kappa-posts-table-desktop,
html.light .kappa-posts-mobile-card,
html.light .kappa-posts-empty,
html.light .kappa-posts-pagination a,
html.light .kappa-posts-pagination span {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}

html.light .kappa-posts-table thead {
  background: #ecfeff;
}

html.light .kappa-posts-table th {
  color: #0f172a;
  border-color: #e2e8f0;
}

html.light .kappa-posts-table td {
  color: #475569;
  border-color: #e2e8f0;
}

html.light .kappa-posts-table tbody tr:hover {
  background: #f8fafc;
}

html.light .kappa-posts-table-title,
html.light .kappa-posts-mobile-card-title a {
  color: #0f172a;
}

html.light .kappa-posts-table-title:hover,
html.light .kappa-posts-table-title:focus,
html.light .kappa-posts-mobile-card-title a:hover,
html.light .kappa-posts-mobile-card-title a:focus {
  color: #0891b2;
}

html.light .kappa-posts-table-number-cell,
html.light .kappa-posts-mobile-number {
  color: #0891b2 !important;
}

html.light .kappa-posts-table-excerpt-cell,
html.light .kappa-posts-mobile-date,
html.light .kappa-posts-mobile-card-meta,
html.light .kappa-posts-mobile-card-excerpt,
html.light .kappa-posts-pagination-current {
  color: #475569 !important;
}

html.light .kappa-posts-mobile-card-meta span {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html.light .kappa-posts-button {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0891b2 !important;
}

html.light .kappa-posts-button:hover,
html.light .kappa-posts-button:focus {
  background: #cffafe;
  border-color: #67e8f9;
  color: #0f172a !important;
}

@media (max-width: 768px) {
  .kappa-posts-table-controls {
    justify-content: flex-start;
  }

  .kappa-posts-table-control {
    width: 100%;
    justify-content: space-between;
  }

  .kappa-posts-table-desktop {
    display: none;
  }

  .kappa-posts-mobile-list {
    display: block;
  }

  .kappa-posts-title-cell {
    min-width: 0;
    width: auto;
  }

  .kappa-posts-table-action {
    text-align: left;
  }

  .kappa-posts-button {
    width: 100%;
    margin-left: 0;
  }
}
