/* Anonymous consultation UI - page chrome and survey-specific styling.
   Layout/grid/typography/buttons come from Bootstrap 5 (see collab/base.html);
   this file only covers what Bootstrap doesn't: the page "card" frame, the
   inline comment controls, survey tables, progress bars, and the small
   number of per-client visual overrides below. */

/* Typography
==========================================================*/
div#content h1 {
  font-size: 20px;
}
div#content h2 {
  font-size: 19px;
}
div#content h3 {
  font-size: 18px;
}
div#content h4 {
  font-size: 17px;
}
div#content h5 {
  font-size: 16px;
}
div#content h6 {
  font-size: 15px;
}
div#content li,
div#content p,
div#content th,
div#content td {
  font-size: 15px;
}

/* Page frame
==========================================================*/
#content {
  padding: 2em;
  /* The page chrome's grey gradient backdrop, carried over from the
     pre-Bootstrap design (previously projectspace.css's shared #content
     rule, dropped when collab/base.html stopped loading that file) - a
     narrow image tiled horizontally, not a CSS gradient. */
  background-image: url("/static/img/bg_content.577f96c81af1.png");
  background-repeat: repeat-x;
}
#content .rf-page-frame {
  /* Fixed width, matching the old 960.css .container_12 grid - Bootstrap's
     own .container keeps growing past 960px at the xl/xxl breakpoints, so
     cap it rather than let it track the viewport like collab_reflection.css
     does. */
  max-width: 960px;
  padding: 2em;
  border: 1px solid #aaa;
  background-color: white;
}

/* Authored page content sometimes carries a legacy border="1" table
   attribute (from older TinyMCE/Word-pasted content) - reset.css used to
   zero this out globally before the Bootstrap rebuild; collab.css didn't
   pick up an equivalent, so those tables started showing a default browser
   grid again. Explicit table classes (.tbl-bordered, .tbl_roc, ...) below
   still opt back in where a border is actually wanted. */
/* :where() keeps this at the specificity of a bare element selector, so the
   explicit border classes above/below (.tbl-bordered, .tbl_roc, ...), which
   only ever use class selectors, still win over this reset regardless of
   source order. */
:where(#content) table,
:where(#content) table td,
:where(#content) table th {
  border: 0;
}

@media (max-width: 767px) {
  #content {
    padding: 0.75em;
  }
  #content .rf-page-frame {
    padding: 1em;
  }
}

/* Navigation - any "next"-position button (default or custom) floats right;
   "prev"-position buttons follow normal document flow (left). This applies
   to both the top and bottom <nav> (see navigation_top/bottom.html and
   partial_navbutton.html). */
nav a.button.next {
  float: right;
}
nav button.next {
  float: right;
}

/* Inline paragraph comment/edit controls (PS.Collab.Controls in collab.js).
   Reachable by tap as well as hover - see addMouseOvers()/controlShower() -
   so the hit targets need to be touch-sized, not just clickable.
   [data-commentid] is `position: relative` so #controls (one shared element,
   moved paragraph to paragraph by collab.js) anchors inside whichever one is
   active, instead of the old page-relative pixel math. */
[data-commentid] {
  position: relative;
}
div#controls {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 20;
  display: flex;
  gap: 4px;
  border: 1px solid #777;
  background-color: #ffffff;
  padding: 4px;
  box-shadow: -10px 10px 3px #aaa;
}
.rf-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #333333;
  font-family: inherit;
  padding: 6px 10px;
  cursor: pointer;
}
.rf-inline-btn:hover {
  background: #e8e8e8;
}
.rf-inline-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.comment-hover {
  outline: 1px dashed #999999;
}
[contenteditable='true'] {
  outline: 2px solid #777777;
  background-color: #fffef0;
}

div#editor {
  position: absolute;
  z-index: 100;
  padding: 6px 8px;
  background-color: #eeeeee;
  border: 1px solid #dddddd;
  box-shadow: 0 0 5px #888;
  width: 400px;
  max-width: 90vw;
}
div#editor.rf-inline-editor--direct {
  width: auto;
}
.rf-inline-textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  max-height: 50vh;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
.rf-inline-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
.rf-inline-btn-link {
  color: #555555;
}
.rf-inline-btn-primary {
  display: inline-block;
  background-color: #dddddd;
  border: 1px solid #999999;
  padding: 4px 12px;
  color: #000000;
  text-decoration: none;
}
.rf-inline-btn-primary:hover {
  background-color: #cccccc;
}

/* A saved edit/comment shown as a box under its paragraph - tag/class match
   what the server renders on reload (CommentableDocument) and what
   collab.js's upsertAnnotationBox creates right after a save. */
.comment,
.edit {
  padding: 4px;
  margin: 4px;
  margin-left: 50px;
  background-color: #fef5ca;
}
.edit {
  border-left: 3px solid #777777;
}

/* First-visit hint for touch devices - see
   PS.Collab.Controls.maybeShowMobileHint in collab.js. */
.rf-inline-hint[hidden] {
  display: none;
}
.rf-inline-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background-color: #f5f5f5;
  border: 1px solid #cccccc;
  padding: 8px 10px;
  margin-bottom: 1em;
}
.rf-inline-hint-dismiss {
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
}

/* Survey utilities
==========================================================*/
.text-left {
  text-align: left !important;
}
.text-right {
  text-align: right !important;
}
.text-center {
  text-align: center !important;
}
.survey content .direction {
  font-style: italic;
}
#survey-header {
  clear: both;
}
#survey-header h1 {
  float: left;
}
#survey-header-spacer {
  clear: both;
}
.tbl-Survey-text-left td {
  text-align: left;
}
.tbl-Survey-element-text-center {
  text-align: center;
}
.tbl-bordered,
.tbl-bordered th,
.tbl-bordered td {
  border: 1px solid #aaaaaa;
}
.tbl-header {
  font-size: 16px;
  font-weight: bold;
}
.tbl-Survey th {
  text-align: left;
}
.tbl-Survey td {
  text-align: center;
}
.tbl-Survey th,
.tbl-Survey td {
  font-size: 15px;
  padding: 4px 8px;
}
div#div-SubmitBtn {
  margin: 10px auto;
  text-align: center;
}

/* FIXME: Sort, clean and move out */
div.ncma-file-list li {
  list-style-type: none;
  margin-top: 5px;
}

/* Intro page */
div#collab_intro_submit_container {
  text-align: right;
  width: 200px;
  float: right;
}
#survey-textual-progress {
  float: right;
}

/* table odd / even colour difference. odd-even class used until no old
   collabs are in use as these styles affect all collabs, a thead and tbody
   are required */
.odd-even thead tr {
  background-color: #eeeeee;
  font-weight: bold !important;
}
.odd-even thead tr th {
  font-weight: bold !important;
}
.odd-even tbody tr:nth-child(even) {
  background-color: #defdef;
}
.odd-even tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

/* Temporary roc styles */
.roc_collab_table tr td {
  padding: 3px 10px;
}
div.roc-container h4 {
  margin-bottom: 0;
}
table.tbl_roc {
  width: 100%;
  margin-bottom: 2em;
}
table.tbl_roc,
table.tbl_roc th,
table.tbl_roc td {
  border: 1px solid #999999;
}
table.tbl_roc th {
  font-size: 12pt;
  padding: 2px 4px;
}
table.tbl_roc td {
  font-size: 10pt;
  padding: 2px 4px;
}
.left_title {
  text-align: left;
}
.left_col-top {
  width: 30%;
  text-align: left;
}
.left_col-btm {
  width: 26%;
  text-align: left;
}
.tbl_roc_5-1,
.tbl_roc_5-2 {
  width: 12%;
  text-align: left;
}
.tbl_roc_5-3 {
  width: 10%;
  text-align: left;
}
.tbl_roc_5-4,
.tbl_roc_5-5 {
  width: 33%;
  text-align: left;
}
.tbl_roc_7-1 {
  width: 13%;
  text-align: left;
}
.tbl_roc_7-2 {
  width: 37%;
  text-align: left;
}
.tbl_roc_7-3,
.tbl_roc_7-4,
.tbl_roc_7-5,
.tbl_roc_7-6,
.tbl_roc_7-7 {
  width: 10%;
  text-align: left;
}
div#question_area {
  margin: 10px 0;
  padding: 4px 10px 2px 10px;
  background-color: #eeeeee;
  border: 1px solid #999999;
}
div#question_area textarea {
  width: 100%;
  height: 50px;
  margin-bottom: 10px;
}

@media (max-width: 575px) {
  /* Narrow-screen tables rarely fit their authored column widths -
     let them scroll horizontally rather than squeeze/overlap text. */
  table.tbl_roc,
  .tbl-Survey {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Progress bar
==========================================================*/
.progress-bar-container {
  margin: 10px auto;
}
.progress-bar-container label {
  float: left;
  margin-right: 10px;
}
.progress-bar-position-left {
  float: left;
}
.progress-bar-position-right {
  float: right;
}
.progress-bar {
  float: right;
  height: 15px;
  position: relative;
  background: #555;
  border-radius: 25px;
  padding: 3px;
  box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
}
.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 20px;
  background-color: #2bc253;
  background-image: linear-gradient(to top, #2bc253 37%, #54f054 69%);
  box-shadow:
    inset 0 2px 9px rgba(255, 255, 255, 0.3),
    inset 0 -2px 6px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

/* Per-client visual overrides
==========================================================*/
#content.nuance {
  background-image: none !important;
}
#content.nuance .rf-page-frame {
  padding: 2em;
  border: 1px solid #aaa;
  background-color: white;
}
#content.nuance .logo-container .bab-logo {
  float: right;
  margin: 0 10px;
}
#content.nuance .logo-container .nuance-logo {
  float: left;
  margin: 0 10px;
}
#content.nuance .tbl-Survey th {
  text-align: left;
}
#content.nuance .tbl-Survey td {
  text-align: center;
}
#content.nuance .tbl-Survey th,
#content.nuance .tbl-Survey td {
  font-size: 15px;
  padding: 4px 8px;
}
#content.nuance .tbl-Survey.odd-even {
  border-spacing: 2px;
  border-collapse: separate;
}
#content.nuance .tbl-Survey.odd-even tr,
#content.nuance .tbl-Survey.odd-even th {
  font-size: 15px;
}
#content.nuance .tbl-Survey.odd-even thead tr {
  background-color: #2dc6d6;
  color: #ffffff;
  font-weight: bold !important;
}
#content.nuance .tbl-Survey.odd-even thead tr th {
  color: #ffffff;
  font-weight: bold !important;
}
#content.nuance .tbl-Survey.odd-even tbody tr:nth-child(even) {
  color: #000000;
  background-color: #c4caca;
}
#content.nuance .tbl-Survey.odd-even tbody tr:nth-child(odd) {
  color: #000000;
  background-color: #e5eceb;
}
#content.nuance .tbl-bordered,
#content.nuance .tbl-bordered th,
#content.nuance .tbl-bordered td {
  border: 1px solid #aaaaaa;
}
#content.nuance .tbl-header {
  font-size: 16px;
  font-weight: bold;
}
#content.nuance .progress-bar-container {
  margin: 10px auto;
  float: right;
  max-width: 200px;
  width: 100%;
}
#content.nuance .progress-bar-container label {
  display: none;
}
#content.nuance .progress-bar-container .progress-bar {
  width: 100%;
  height: 12px;
  position: relative;
  background: #626d6f;
  border-radius: 25px;
  padding: 3px;
  box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
}
#content.nuance .progress-bar-container .progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 20px;
  background-color: #2bc253;
  background-image: linear-gradient(to top, #2dc6d6 37%, #2dc6d6 69%);
  box-shadow:
    inset 0 2px 9px rgba(255, 255, 255, 0.3),
    inset 0 -2px 6px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

@media (max-width: 767px) {
  #content.skills-for-justice .rf-page-frame {
    width: 100% !important;
    border: none !important;
    box-sizing: border-box;
    padding: 1em !important;
  }
  #content.skills-for-justice #content {
    padding: 0 !important;
  }
  #content.skills-for-justice .logo-container img {
    width: 100%;
  }
  #content.skills-for-justice .tbl-Survey {
    width: 100%;
  }
}
#content.skills-for-justice .sfj-intro-block {
  width: 50%;
  float: left;
  box-sizing: border-box;
  padding: 10px;
}
#content.skills-for-justice .logo-container .sfj-wales-logo {
  float: left;
}
#content.skills-for-justice .logo-container .sfj-esf-logo {
  float: right;
}
@media (max-width: 767px) {
  #content.skills-for-justice .sfj-intro-block {
    width: 100%;
    float: none;
  }
  #content.skills-for-justice .logo-container .sfj-wales-logo {
    width: 62%;
  }
  #content.skills-for-justice .logo-container .sfj-esf-logo {
    width: 26%;
  }
}

.er-micro-biz .tbl-Survey.odd-even thead tr {
  background-color: #efdca4;
}
.er-micro-biz .tbl-Survey.odd-even tbody tr:nth-child(even) {
  background-color: #fff7e0;
}

#content.sqa {
  background-image: none !important;
}
#content.sqa .rf-page-frame {
  padding: 2em;
  border: 1px solid #aaa;
  background-color: white;
}
#content.sqa .logo-container img {
  float: right;
  margin: 0 10px;
}
#content.sqa .tbl-Survey th {
  text-align: left;
}
#content.sqa .tbl-Survey td {
  text-align: center;
}
#content.sqa .tbl-Survey th,
#content.sqa .tbl-Survey td {
  font-size: 15px;
  padding: 4px 8px;
}
#content.sqa .tbl-Survey.odd-even {
  border-spacing: 2px;
  border-collapse: separate;
}
#content.sqa .tbl-Survey.odd-even tr,
#content.sqa .tbl-Survey.odd-even th {
  font-size: 15px;
}
#content.sqa .tbl-Survey.odd-even thead tr {
  background-color: #053776;
  color: #ffffff;
  font-weight: bold !important;
}
#content.sqa .tbl-Survey.odd-even thead tr th {
  color: #ffffff;
  font-weight: bold !important;
}
#content.sqa .tbl-Survey.odd-even tbody tr:nth-child(even) {
  color: #000000;
  background-color: #cfe4ff;
}
#content.sqa .tbl-Survey.odd-even tbody tr:nth-child(odd) {
  color: #000000;
  background-color: #faf0ff;
}
#content.sqa .tbl-bordered,
#content.sqa .tbl-bordered th,
#content.sqa .tbl-bordered td {
  border: 1px solid #aaaaaa;
}
#content.sqa .tbl-header {
  font-size: 16px;
  font-weight: bold;
}
#content.sqa .progress-bar-container {
  margin: 10px auto;
  float: right;
  max-width: 200px;
  width: 100%;
}
#content.sqa .progress-bar-container label {
  display: none;
}
#content.sqa .progress-bar-container .progress-bar {
  width: 100%;
  height: 12px;
  position: relative;
  background: #053776;
  border-radius: 25px;
  padding: 3px;
  box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
}
#content.sqa .progress-bar-container .progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 20px;
  background-color: #2bc253;
  background-image: linear-gradient(to top, #b392c4 37%, #b392c4 69%);
  box-shadow:
    inset 0 2px 9px rgba(255, 255, 255, 0.3),
    inset 0 -2px 6px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
