/* ==========================================================================
   Taulukkolohko (table_block) – teeman oma lohko (inc/balkonser-blocks).
   Rakennettu palvelulohkon (service_block) muuttujilla ja mitoilla.
   ========================================================================== */
.table-block {
  --tb-radius: 6.25rem;
  --tb-pad-x: 3.5rem;
  position: relative;
}
.table-block .block-overlay.table-block-rounded-top {
  border-top-left-radius: var(--tb-radius);
  border-top-right-radius: var(--tb-radius);
}
.table-block .page-block-wrapper { position: relative; }
.table-block .block-title-section { margin-left: auto; margin-right: auto; }
.table-block-lead p { font-size: 1.125rem; }
.table-block-card {
  border-radius: .5rem;
  margin-top: 2rem;
  padding: 1.5rem var(--tb-pad-x) 2rem;
}
.table-block-table {
  border-collapse: collapse;
  margin: 0;
  table-layout: fixed;
  width: 100%;
}
.table-block-table thead,
.table-block-table tbody,
.table-block-table tr { background: transparent; border: 0; }
.table-block-table th,
.table-block-table td {
  border: 0;
  border-bottom: 1px solid var(--bg-light);
  color: var(--color-dark);
  line-height: 1.5;
  padding: 1.1rem 1.25rem;
  text-align: left;
  vertical-align: top;
}
.table-block-table tbody tr:last-child th,
.table-block-table tbody tr:last-child td { border-bottom: 0; }
.table-block-table thead th {
  border-bottom: 3px solid var(--color-primary);
  font-size: 1.25rem;
  font-weight: 700;
  padding-bottom: 1rem;
}
.table-block-table thead .table-block-corner {
  border-bottom: 3px solid var(--color-primary);
  width: 24%;
}
.table-block-table tbody th { font-weight: 700; width: 24%; }
.table-block-table tbody tr,
.table-block-table tbody tr:nth-child(even),
.table-block-table tbody tr:nth-child(odd) { background: transparent; }
.table-block-after { margin: 2rem auto 0; }
.table-block-after p { margin: 0; }
.table-block-after a { color: var(--color-dark); font-weight: 700; text-decoration: underline; }

@media (max-width: 1199px) {
  .table-block { --tb-radius: 4rem; --tb-pad-x: 2.5rem; }
}
/* Sarakkeittain ryhmitelty versio pienille näytöille (piilossa isolla näytöllä) */
.table-block-stack { display: none; }

/* Mobiili: taulukon tilalla yksi kortti per sarake (esim. ensin KAIDE Kartoitus
   ja sen kaikki rivit, sitten KAIDE Tarkastus) */
@media (max-width: 1023px) {
  .table-block { --tb-radius: 2.75rem; --tb-pad-x: 1.5rem; }
  .table-block .block-title-section, .table-block-after { padding-left: 1.5rem; padding-right: 1.5rem; }
  .table-block-card { display: none; }

  .table-block-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
  }
  .table-block-stack-card {
    border-radius: .5rem;
    padding: 1.25rem var(--tb-pad-x) .75rem;
  }
  .table-block-stack-title {
    margin: 0;
    padding-bottom: .75rem;
    border-bottom: 3px solid var(--color-primary);
    color: var(--color-dark);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
  }
  .table-block-stack-list { margin: 0; }
  .table-block-stack-row {
    padding: .875rem 0;
    border-bottom: 1px solid var(--bg-light);
  }
  .table-block-stack-row:last-child { border-bottom: 0; }
  .table-block-stack-row dt {
    margin: 0 0 .25rem;
    color: var(--color-dark);
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .02em;
  }
  .table-block-stack-row dd {
    margin: 0;
    color: var(--color-dark);
    line-height: 1.5;
  }
}
