/* =====================================================
   TRIAL SUMMARY – PUBLIC VIEW (THEME AWARE)
   Shared by BodyFilter + MapFilter
===================================================== */


/* =====================================================
   CONTAINER
===================================================== */

.trial-summary {
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  padding: 28px;
  background: var(--bg-card);
  border: 2px solid var(--accent-border);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}


/* =====================================================
   BACK BUTTON
===================================================== */

.trial-back-btn {
  background: none;
  border: none;
  color: var(--section-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
}

.trial-back-btn:hover {
  text-decoration: underline;
}


/* =====================================================
   HEADER
===================================================== */

.trial-summary-header {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 32px;
}


/* =====================================================
   METADATA
===================================================== */

.trial-meta {
  display: inline-block;
}

.trial-meta dl {
  display: grid;
  grid-template-columns: max-content auto;
  column-gap: 12px;
  row-gap: 10px;
  margin: 0;
}

.trial-meta dt {
  font-weight: 700;
  color: var(--section-heading);
  white-space: nowrap;
}

.trial-meta dt::after {
  content: ":";
}

.trial-meta dd {
  margin: 0;
  color: var(--text-primary);
}


/* =====================================================
   IMAGE
===================================================== */

.trial-image {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background: #ffffff;   /* intentionally fixed white */
  padding: 16px;
  border-radius: 10px;
}

.trial-image img {
  max-width: 140px;
  height: auto;
  display: block;
}


/* =====================================================
   SECTIONS
===================================================== */

.trial-summary-section {
  margin-top: 28px;
}

.trial-summary-section h3 {
  margin-bottom: 10px;
  color: var(--section-heading);
  font-size: 1.25rem;
  text-align: left;
}


/* =====================================================
   RICH TEXT CONTENT
===================================================== */

.trial-summary .synopsis-text {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
}

.trial-summary .synopsis-text p {
  margin: 0 0 1em;
}

.trial-summary .synopsis-text br {
  display: block;
  margin-bottom: 0.75em;
}

.trial-summary .synopsis-text div {
  margin: 1em 0;
}


/* =====================================================
   FOOTER
===================================================== */

.trial-summary-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}


/* =====================================================
   FLAGS
===================================================== */

.trial-flags {
  display: flex;
  justify-content: center;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 20px auto 0;
}

.trial-flags li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--section-heading);
}

.trial-flags li[data-flag="true"]::before {
  content: "✔";
  color: var(--nhs-green);
}

.trial-flags li[data-flag="false"]::before {
  content: "✖";
  color: var(--nhs-red);
}


/* =====================================================
   ADVISORY IMAGE
===================================================== */

.trial-advisory {
  margin-top: 36px;
  text-align: center;
}

.trial-advisory img {
  max-width: 100%;
  border-radius: 10px;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {

  .trial-summary-header {
    flex-direction: column;
    text-align: center;
  }

  .trial-meta dl {
    grid-template-columns: 1fr;
  }

  .trial-meta dt::after {
    content: "";
  }

  .trial-flags {
    flex-direction: column;
    gap: 10px;
  }
}


/* =====================================================
   PAGINATION (THEME AWARE)
===================================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin: 18px auto 0;
  padding: 12px 14px;
  border: 2px solid var(--accent-border);
  border-radius: 10px;
  background: var(--bg-card);
  width: fit-content;
  max-width: 100%;
  box-shadow: var(--shadow-soft);
}

.pagination .button-59,
.pagination button.button-59 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  white-space: nowrap;
}

.pagination .button-59.active {
  background: var(--nhs-blue) !important;
  color: var(--text-inverse) !important;
  border-color: var(--nhs-blue) !important;
  width: auto;
}

.pagination .button-59:first-child,
.pagination .button-59:last-child {
  min-width: 92px;
}

/* =====================================================
   TABLE CTA BUTTON (LAST COLUMN)
===================================================== */

.trial-results-table th:last-child,
.trial-results-table td:last-child {
  width: 160px;
  min-width: 160px;
  text-align: center;
  vertical-align: middle;
}

.trial-results-table td:last-child > .button-59 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  white-space: nowrap;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 2px solid var(--btn-primary-bg);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease,
              color 0.15s ease,
              border-color 0.15s ease;
}

.trial-results-table td:last-child > .button-59:hover {
  background: #ffeb3b;
  color: #000;
  border-color: #ffeb3b;
}

.trial-results-table td:last-child > .button-59:active {
  transform: translateY(1px);
}

.trial-results-table td:last-child > .button-59:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px #ffeb3b;
}


/* =====================================================
   TRIAL ADVISORY BOX
===================================================== */

.trial-advisory-box {
  margin-top: 40px;
  padding: 24px 28px;
  border-left: 6px solid var(--accent-border);
  background: var(--bg-section);
  border-radius: 8px;
  max-width: 820px;
}

.trial-advisory-box strong {
  display: block;
  font-size: 1.1rem;
  color: var(--section-heading);
  margin-bottom: 8px;
}

.trial-advisory-box p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
}


/* =====================================================
   FULL RECORD BUTTON
===================================================== */

.trial-full-record {
  margin-top: 30px;
  text-align: center;
}

.trial-summary a.trial-full-record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  text-decoration: none;
  border: 2px solid var(--btn-primary-bg);
  border-radius: 8px;
  transition: background 0.15s ease,
              color 0.15s ease,
              border-color 0.15s ease;
}

.trial-summary a.trial-full-record-btn:hover {
  background: #ffeb3b;
  color: #000;
  border-color: #ffeb3b;
}

.trial-summary a.trial-full-record-btn:active {
  transform: translateY(1px);
}


/* =====================================================
   INDICATION COLUMN (SUMMARY VIEW SIZE)
===================================================== */

.indication-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}

.indication-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.indication-cell span {
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 768px) {

  /* Remove fixed last-column width on ALL pages */
  .trial-results-table th:last-child,
  .trial-results-table td:last-child {
    width: auto !important;
    min-width: 0 !important;
  }

  /* Allow button to wrap */
  .trial-results-table td:last-child > .button-59 {
    white-space: normal !important;
  }
}
.trial-results-table td:first-child,
.trial-results-table th:first-child {
  white-space: nowrap;
  min-width: 60px;
}