/*
 * Funded hours & chargeable extras page (Crowborough). Follows the East Sussex
 * "chargeable extras" template layout (Description / Unit / Unit price / Line
 * total, then the pattern of funded hours). Accent is the Crowborough
 * colour-4 (#84bed6). Tables collapse to labelled cards below 768px.
 */
.cx-page { font-size: 15px; line-height: 1.65; }
.cx-page h3 { font-weight: 700; color: #0b0f1a; margin: 0 0 12px; }

.cx-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e9ee;
  color: #6b7280;
  font-size: 14px;
}
.cx-meta a { font-weight: 600; }

.cx-intro { max-width: 860px; margin-bottom: 28px; }
.cx-intro h3 + p { margin-top: 0; }
.cx-intro p + h3 { margin-top: 28px; }

.cx-ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  columns: 2;
  column-gap: 32px;
}
.cx-ticks li { break-inside: avoid; padding: 3px 0 3px 26px; position: relative; }
.cx-ticks li:before {
  content: "\f00c"; /* fa-check */
  font-family: FontAwesome;
  position: absolute;
  left: 0;
  top: 4px;
  color: #84bed6;
}

.cx-cards { margin-bottom: 8px; }
.cx-card {
  height: calc(100% - 20px);
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid #e5e9ee;
  border-top: 4px solid #84bed6;
  border-radius: 6px;
  background: #fff;
}
.cx-card ul { margin: 0; padding-left: 20px; }
.cx-card ul li,
.cx-table ul li { list-style: disc; }
.cx-card p:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  .cx-cards { display: flex; flex-wrap: wrap; }
}

.cx-callout {
  max-width: 860px;
  margin: 4px 0 28px;
  padding: 20px 22px;
  background: #f2f8fb;
  border-left: 4px solid #84bed6;
  border-radius: 0 6px 6px 0;
}
.cx-callout p:last-child { margin-bottom: 0; }

.cx-heading {
  margin-top: 40px !important;
  padding-bottom: 8px;
  display: inline-block;
  border-bottom: 3px solid #84bed6;
}

/* Main tables */
.cx-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 8px 0 18px;
  background: #fff;
}
.cx-table > thead > tr > th,
.cx-table > tbody > tr > th,
.cx-table > tbody > tr > td {
  padding: 12px;
  border: 1px solid #d6e2ea;
  vertical-align: top;
  text-align: left;
}
.cx-table > thead > tr > th { background: #dcecf4; font-weight: 700; color: #0b0f1a; }
.cx-table > tbody > tr > th { font-weight: 400; }
.cx-table > thead > tr > th:nth-child(1) { width: 46%; }
.cx-table > thead > tr > th:nth-child(2) { width: 14%; }
.cx-table > thead > tr > th:nth-child(3),
.cx-table > thead > tr > th:nth-child(4) { width: 20%; }
.cx-table ul { margin: 6px 0 0; padding-left: 18px; }
.cx-sub { margin: 6px 0 0; font-weight: 600; }
.cx-note { margin: 8px 0 0; color: #4b5563; font-size: 14px; }

/* Label/value pairs spanning Unit price + Line total; the 24px gap puts the
   values on the Line total column edge. */
.cx-pairs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 4px;
  margin: 0;
}
.cx-pairs dt { font-weight: 400; }
.cx-pairs dd { margin: 0; font-weight: 600; }

.cx-row-lead > th,
.cx-row-lead > td { border-bottom: 0 !important; }
.cx-row-detail > td { padding-top: 0 !important; border-top: 0 !important; }

.cx-subtable { width: 100%; border-collapse: collapse; }
.cx-subtable caption {
  caption-side: top;
  padding: 0 0 8px;
  color: #0b0f1a;
  font-weight: 700;
  text-align: left;
}
.cx-subtable th,
.cx-subtable td { padding: 9px 12px; border-bottom: 1px solid #e5e9ee; text-align: left; }
.cx-subtable thead th { background: #f2f8fb; font-weight: 700; }
.cx-subtable tbody th { font-weight: 400; }
.cx-subtable td { width: 22%; font-weight: 600; white-space: nowrap; }
.cx-subtable .cx-group th { padding-top: 14px; font-weight: 700; color: #0b0f1a; border-bottom-color: #d6e2ea; }
.cx-subtable .cx-group span { font-weight: 400; color: #4b5563; }

.cx-sessions > thead > tr:first-child > th:nth-child(1),
.cx-sessions > thead > tr:first-child > th:nth-child(2) { width: 30%; }
.cx-sessions > thead > tr:first-child > th:nth-child(3) { width: 40%; }
.cx-sessions > thead > tr + tr > th { width: auto; }

.cx-optout { max-width: 860px; font-style: italic; color: #4b5563; }
.cx-contact { margin-top: 28px; }

@media (max-width: 767px) {
  .cx-ticks { columns: 1; }
  .cx-card { height: auto; }

  .cx-table,
  .cx-table > tbody,
  .cx-table > tbody > tr,
  .cx-table > tbody > tr > th,
  .cx-table > tbody > tr > td { display: block; width: 100%; }
  .cx-table > thead { display: none; }
  .cx-table > tbody > tr {
    margin-bottom: 14px;
    border: 1px solid #d6e2ea;
    border-top: 4px solid #84bed6;
    border-radius: 6px;
  }
  .cx-table > tbody > tr > th,
  .cx-table > tbody > tr > td { border: 0; padding: 8px 14px; }
  .cx-table > tbody > tr > th { padding-top: 12px; }
  .cx-table > tbody > tr > td:last-child { padding-bottom: 12px; }
  .cx-table > tbody > tr > td[data-label]:before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6b7280;
  }

  /* Keep the voluntary services lead row and its termly charges as one card */
  .cx-table > tbody > tr.cx-row-lead { margin-bottom: 0; border-bottom: 0; border-radius: 6px 6px 0 0; }
  .cx-table > tbody > tr.cx-row-detail { border-top: 0; border-radius: 0 0 6px 6px; }
  .cx-row-detail > td { padding-top: 4px !important; }
  .cx-subtable th,
  .cx-subtable td { padding: 8px 6px; font-size: 14px; }
  .cx-subtable td { white-space: normal; }

  .cx-sessions > tbody > tr > th { font-weight: 700; }
}
