/**
 * @file
 * Patient Education Print Styling
 *
 * PDF generation is downsizing fonts.
 *
 * - For pixels font-sizes are approximately 1/3rd smaller.
 *   For example: 18px (screen) = 12pt (pdf)
 *
 * - For points font-sizes are approximately 1/10th smaller.
 *   For example: 20pt (screen) = 18pt (pdf)
 *
 * References:
 * - Font sizes changing on PDF creation
 *   https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2290
 */

/******************************************************************************/
/* Base font
/******************************************************************************/

/*MSK-Sans*/
@font-face {
  font-display: swap;
  font-family: "MSK Sans Web";
  src: url("/themes/msk_cedar/global/base/src/cedar-base/fonts/MSKSans-Upright-VF-Web.woff2")
  format("woff2"),
  url("/themes/msk_cedar/global/base/src/cedar-base/fonts/MSKSans-Upright-VF-Web.woff")
  format("woff");
  font-style: normal;
}

@font-face {
  font-display: swap;
  font-family: "MSK Sans Web";
  src: url("/themes/msk_cedar/global/base/src/cedar-base/fonts/MSKSans-Italic-VF-Web.woff2")
  format("woff2"),
  url("/themes/msk_cedar/global/base/src/cedar-base/fonts/MSKSans-Italic-VF-Web.woff")
  format("woff");
  font-style: italic;
}

body {
  margin: 10px;
  font-family: 'MSK Sans Web', 'DejaVu Sans', 'Helvetica Neue', helvetica, arial, sans-serif;
  font-size: 18px; /* Base font */
  font-weight: 100; /* Thinest font-weight is needed for PDF generation on RedHat */
  line-height: 1.5;
  color: #333;
}

/******************************************************************************/
/* Header elements
/******************************************************************************/

h1 {
  margin: 0 0 20px 0;
  line-height: 1.2;
  font-weight: bold;
  font-size: 40px;
  color: #000;
}

h2 {
  margin: 0 0 15px 0;
  line-height: 1.2;
  font-size: 30px;
  font-weight: bold;
  color: #000;
}

h3 {
  margin: 0 0 5px 0;
  line-height: 1.2;
  font-size: 24px;
  font-weight: bold;
  color: #000;
}

h4 {
  margin: 0 0 5px 0;
  line-height: 1.2;
  font-size: 21px;
  font-weight: bold;
  color: #000;
}

h5 {
  margin: 0 0 5px 0;
  line-height: 1.2;
  font-weight: bold;
  font-size: 19px;
  color: #000;
}

h6 {
  margin: 0 0 5px 0;
  line-height: 1.2;
  font-weight: bold;
  font-size: 18px;
  color: #000;
}

.msk-patient-education-checkbox:before {
  content: '';
  display: inline-block;
  vertical-align: baseline;
  border: 2px solid #000;
  border-radius: 2px;
  height: 14px;
  width: 14px;
  margin-right: 6px;
}

/******************************************************************************/
/* Block-level elements
/******************************************************************************/

p {
  margin: 0 0 20px 0;
}

blockquote {
  margin: 20px 40px;
}

address {
  margin: 0 0 20px 0;
}

/******************************************************************************/
/* Miscellaneous elements
/******************************************************************************/

a:link,
a:visited {
  color: #2986e2;
  text-decoration: none;
}

a[href^=tel]{
  color:inherit;
  text-decoration:none;
}

hr {
  margin: 0;
  padding: 20px 0;
  width: 100%;
  height: 1px;
  border: none 0;
  border-top: 1px solid #dfdfd8; /* $grey */
}

time {
  white-space: nowrap;
}

/******************************************************************************/
/* List elements
/******************************************************************************/

ul,
ol {
  margin-top: 20px;
  margin-bottom: 20px;
  -webkit-padding-start: 30px !important;
}

ol li,
ul li {
  margin-bottom: 10px;
}

li ul,
li ol {
  margin-top: 10px;
  margin-bottom: 0;
}

/*
 * Bullet list
 */
table.table ul.msk-bullet-list {
  list-style-position: outside;
  margin-left: 0;
  padding-left: 1em;
}

table.table ul.msk-bullet-list li {
  padding-left: 0;
  margin-bottom: 2px;
}

/*
 * Play button list.
 */
ul.msk-play-list {
  list-style-image: url(/modules/custom/msk_markup/images/bullets/play.png);
}

/*
 * Checkbox list.
 */
ul.msk-checkbox-list {
  list-style-image: url(/themes/mskcc/images/msk_tools/print/checkbox.png);
  -webkit-padding-start: 26px !important;
}

ul.msk-checkbox-list li {
  padding-left: 4px;
}

/******************************************************************************/
/* Table elements
/******************************************************************************/

table.table {
  border-spacing: 1px;
  border-collapse: collapse;
  background-color: #fff;
  margin-bottom: 20px;
  width: 100%;
}

table.table tr {
  background-color: #dfdfd8; /* $grey */
}

table.table tr:nth-child(odd) {
  background-color: #f1f1ed;
}

table.table th,
table.table td {
  padding: 5px 10px;
  vertical-align: top;
  border: 1px solid #999;
  font-size: 0.6667em; /* 12px = 0.6667em * 18px */
}

table.table th {
  background-color: #b3b3a6; /* $grey-warm */
  font-size: 0.8889em; /* 16px = 0.8889em * 18px */
  color: #000;
}

table.table td {
  font-size: 0.8333em; /* 15px = 0.8333em * 18px */
}

table.table ul {
  margin: 0;
}

/* overlapping text when repeating headers/footers in table - https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1524 */
thead, tfoot {
  display: table-row-group
}

/******************************************************************************/
/* Alignment
/******************************************************************************/

.left,
.align-left {
  float: left;
  margin: 0 20px 20px 0 !important;
}

.right,
.align-right {
  float: right;
  margin: 0 0 20px 20px !important;;
}

.center,
.align-center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/******************************************************************************/
/* Indent
/******************************************************************************/

.indent-1 {
  margin-left: 2em;
}

.indent-2 {
  margin-left: 4em;
}

.indent-3 {
  margin-left: 6em;
}

/******************************************************************************/
/* Inline elements
/******************************************************************************/

b, strong {
  font-weight: 700;
}

.msk-checkbox {
  font-size: 1.1111em; /* 20px = 1.1111em * 18px */
}

/* https://css-tricks.com/snippets/css/prevent-superscripts-and-subscripts-from-affecting-line-height/ */
sup {
  font-size: 0.6667em; /* 12px = 0.6667em * 18px */
  vertical-align: baseline;
  position: relative;
  top: -0.4em;
}
sub {
  font-size: 0.6667em; /* 12px = 0.6667em * 18px */
  vertical-align: baseline;
  position: relative;
  bottom: -0.25em;
}

/******************************************************************************/
/* Image and Figure elements (http://stackoverflow.com/a/13363408)
/******************************************************************************/

figure {
  display: table;
  margin: 0 0 20px 0;
  background-color: #fff;
  line-height: 1.2;
  font-size: 0.8889em; /* 16px = 0.8889em * 18px */
}

figure img {
  display: block;
}

figure figcaption {
  display: table-caption;
  caption-side: bottom;
  background: #fff;
  border-bottom: 1px solid #dfdfd8; /* $grey */
  padding: 10px 0;
}

figure.align-left {
  margin: 4px 20px 10px 0;
}

figure.align-right {
  margin: 4px 0 10px 20px;
}

/******************************************************************************/
/* Horizontal images.
/******************************************************************************/

.horizontal-images { }

.horizontal-images:after {
  content: "";
  display: table;
  clear: both;
}

.horizontal-images.align-center /* http://stackoverflow.com/questions/1232096/how-to-horizontally-center-a-floating-element-of-a-variable-width */ {
  display: table;
  margin: auto;
}

.horizontal-images figure {
  float: left;
  margin-left: 15px;
}

.horizontal-images figure:first-child {
  margin-left: 0;
}

/******************************************************************************/
/* Container elements */
/******************************************************************************/


.msk-callout {
  clear: both;
  display: block;
  padding: 20px;
  margin: 20px 0;
  background-color: #dfdfd8; /* $grey */
}

.msk-callout.right,
.msk-callout.left {
  max-width: 33%;
}

/*
 * Feature (used for exclamations)
 */
.msk-feature.warning {
  min-height: 56px;
  padding: 0 0 0 30px;
  background: #fff url(/themes/mskcc/images/msk_tools/print/exclamation.png) 0 4px no-repeat;
}

.msk-feature.warning.center {
  height: 56px;
  line-height: 56px;
}

.msk-feature.warning.center,
.msk-feature.warning h3,
.msk-feature.warning b,
.msk-feature.warning strong {
  color: #e95644;
  font-weight: bold;
}


/******************************************************************************/
/* Page elements */
/******************************************************************************/

/*
 * Header
 */
header {
  margin-bottom: 10px;
  border-bottom: 1px solid #dfdfd8; /* $grey */
  padding-bottom: 10px;
}

/*
 * Breadcrumb
 */
.breadcrumb {
  margin: 0 0 5px 0;
  line-height: 1.5;
  font-size: 0.9444em; /* 17px = 0.9444em * 18px */
  color: #000;
}

/*
 * Watch video
 */
.msk-callout-video {
  padding: 20px;
}

span.msk-callout-video-play {
  display: block;
  border: 3px solid;
  padding: 8px 4px 8px 10px;
  border-radius: 50%;
  margin-right: 10px;
}

span.msk-callout-video-play svg {
  display: block;
  height: 18px;
  width: 18px;
}

.msk-callout-video td {
  line-height: 1.1;
}

/*
 * Contact (aka footer)
 */
.msk-patient-education-footer .msk-callout {
  color: #000;
  margin: 20px 0 5px 0;
}

.msk-patient-education-footer p {
  margin: 5px 0;
}

.msk-patient-education-footer address {
  border-top: 1px solid #dfdfd8; /* $grey */
  padding-top: 10px;
  font-size: 0.8889em; /* 16px = 0.8889em * 18px */
  color: #707070;
  font-style: normal;
}

/******************************************************************************/
/* Hidden elements */
/******************************************************************************/

/*
 * Hide inline elements
 */
.back-to-top,
.content-moderation-entity-moderation-form,
.msk-entity-field-access-administrative,
.field-name-field-shared-last-updated,
.field-name-webform,
.field-node--comment,
.webform-message,
.msk-readtime,
.msk-patient_ed__video-transcript {
  display: none;
}

/******************************************************************************/
/* Page breaks */
/******************************************************************************/

.page-break {
  display: block;
  page-break-before: always;
}

.msk-tools-lang-en h1,
.msk-tools-lang-en h2,
.msk-tools-lang-en h3,
.msk-tools-lang-en h4,
.msk-tools-lang-en h5,
.msk-tools-lang-en h6 {
  page-break-inside: avoid;
  page-break-after: avoid;
}

/* @see https://stackoverflow.com/questions/9238868/how-do-i-avoid-a-page-break-immediately-after-a-heading/9238898 */
.msk-tools-lang-en h1:after,
.msk-tools-lang-en h2:after,
.msk-tools-lang-en h3:after,
.msk-tools-lang-en h4:after,
.msk-tools-lang-en h5:after,
.msk-tools-lang-en h6:after {
  content: "";
  display: block;
  height: 100px;
  margin-bottom: -100px;
}

figure,
.msk-callout,
.msk-patient-education-footer {
  page-break-inside: avoid;
}

/******************************************************************************/
/* Herb */
/******************************************************************************/

.node--type-herb img {
  display: block;
  float: right;
  width: 30%;
  margin: 0 0 10px 10px;
}

.node--type-herb .field-field_shared_main_image_3x2 {
  display: none;
}

.node--type-herb .field-field_shared_main_image_1x1 {
  display: block;
}

/******************************************************************************/
/* Large Font */
/******************************************************************************/

body.msk-tools-print-mode-large,
body.msk-tools-print-mode-large h4,
body.msk-tools-print-mode-large h5,
body.msk-tools-print-mode-large h6{
  font-size: 24px !important; /* Base font */
}

.msk-tools-print-mode-large .page-break {
  page-break-before: auto;
}

.msk-tools-print-mode-large .page-break-mode-large {
  display: block;
  page-break-before: always;
}

/******************************************************************************/
/* Bootstrap Print Styles - http://getbootstrap.com/css/#responsive-utilities-print */
/******************************************************************************/

.hidden-print {
  display: none !important;
}

.visible-print {
  display: block !important;
}

table.visible-print {
  display: table !important;
}

tr.visible-print {
  display: table-row !important;
}

th.visible-print,
td.visible-print {
  display: table-cell !important;
}

.visible-print-block {
  display: block !important;
}

.visible-print-inline {
  display: inline !important;
}

.visible-print-inline-block {
  display: inline-block !important;
}

/******************************************************************************/
/* BUILD-6630 Redirect node preview button to print PDF version. */
/******************************************************************************/

.node-preview-backlink {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  background-color: #fdf8ed;
  border: 2px #f4daa6 solid;
  padding: 5px 20px;
  font-weight: bold;
  font-size: 20px;
  white-space: nowrap;
}
