<!doctype html>
<html>
  <head>
  <meta charset="utf-8">
  <link href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<style type="text/css">
    @media print {
		 div{
			page-break-inside: avoid;
		}
	}

	p {
		font-size: 14px;
		 line-height: 1.5em;
		 text-align: justify;
	}
	 p.p2 {
		 line-height: 150%;
		 font-size:15pt;
		font-stretch: ultra-expanded;
		 font-family: Arial, Helvetica, sans-serif;
		text-align: center;
	}
	 p.p3 {
		 line-height: 100%;
		 font-size:8pt;
	}
	 #back_cover {
		page: last_page;
	}
	 @page last_page {
		margin: 0;
		 border-bottom: none;
		 @bottom-right {
			content: normal;
		}
		 @bottom-center {
			content: normal;
		}
	}
	 
	 ol.toc {
		padding: 150;
		 list-style: none;
		font-size: 0.7 em;
		 font-family: sans-serif;
		width: 90%;
		 margin-left: 5%;
		 margin-top: 5%;
		 line-height: 175%;
		 padding: 1em 0em 1em 3.5em ;
		 border: 1px dotted #bbb;
		counter-reset: list-counter;
	}
	 @media print {
		ol.toc a {
			display: inline-block;
			 width: 90%;
			 position: relative;
		}
	}
	 ol.toc a::after {
		position: absolute;
		 right: 0;
		 content: target-counter(attr(href), page);
	}
	 .p2 {
		line-height: 150%;
		 font-size:15pt;
		font-stretch: ultra-expanded;
		 font-family: Arial, Helvetica, sans-serif;
		text-align: center;
	}
	.ui.custom-warning.message {
	    color: #664d03;
	    background-color: #fff3cd;
	    border-color: #ffecb5;
	}

	.ui.custom-negative.message {
	    color: #842029;
	    background-color: #f8d7da;
	    border-color: #f5c2c7;
	}

	.ui.custom-positive.message {
		color: #155724;
	    background-color: #d4edda;
	    border-color: #c3e6cb;
	}

 	

table {width: 100%}
th {
	font-size: 16px;
    font-family: JosefinSans-Bold_1n;
    color: #3C3D3A;
}

table.custom_table,
.custom_table th,
.custom_table td {
	
  border: 1px solid black;
  border-collapse: collapse;
  padding: .6em;
  font-size: 10px;
    font-family: Avenir-Roman_12;
    color: #333;
}

.table_center {
	text-align: center;
}

.cust_warning {
	background: #FFC200 !important;
}
.cust_positive {
	background: #A9CE4E !important;
}
.cust_negative {
 background: #EF8B8B !important;
}
/*div.divider {margin: 0 !important}*/

{% block css %}
{% endblock %}
</style>
  </head>

<body>

	<p class="footer">{{Name}}</p>

	<!-- cover page -->
 <div class="ui centered grid" style="border-radius: 20px;">
    <div class="row">
        <div class="coloumn">
        <div class="s2_1" style="margin-top: 60px">GENE {{package|upper}}</div>
        <div class="s3_1" style="margin-top: 300px;">Your genetic guide to</div>
        <div class="s4_1" style="margin-top: 40px">{{reportname|upper}}</div>
		{% block info_heading %}{% endblock %}
        <div class="s5_1" style="margin-top: 20px">{{ID}}</div>
        <img class="ui centered image" src="file:///{{cover_img}}" style="margin-top: 250px">
        </div>
      </div>
  </div>
	<p style="page-break-before: always"></p>
    <h1 class="ui center aligned header orange" id="toc">Table of Contents</h1>
    <ol class="toc">
    	{% for item in table2 %}
    		{% set link = item['trait'].replace(' ', '_') %}
    	<li><a class="xref" href="#{{link}}">{{item['trait']|title}}</a></li>
    	{%endfor %}
    </ol>
    <p style="page-break-before: always"></p>
    <div class="ui justified container">
    	{% if your_report != "[]" and your_report.0.0 %}
    		<h1 class="ui center aligned header big1">
    			INTRODUCTION
    		</h1>
			{% block understanding_your_report %}
    		<h2 class="ui center aligned header big2">
    			Understanding your report
    		</h2>

    		{{ your_report.0.0 }}
			{% endblock %}
    	{% else %}
    		{% markdown %}{% include folder+"/static_pages/intro.txt" %}{% endmarkdown %}
    	{% endif %}    		
	</div>


	

    <div class="ui justified container">
		{# sometimes -> "how to read": [["howto"]], #}
    	{% if how_to_read != "[]" and how_to_read.0.0 and how_to_read.0.0 != "howto" %}
    		<h1 class="ui center aligned header big1">
    			INTRODUCTION
    		</h1>
    		<h2 class="ui center aligned header big2">
    			Understanding your report
    		</h2>

    		{{ how_to_read.0.0 }}
    	{% else %}
    		{% markdown %}{% include folder+"/static_pages/how_to.txt" %}{% endmarkdown %}
    	{% endif %}  
	</div>
    <p style="page-break-before: always"></p>

    {% block body %}
	{% endblock %}
   
  <table class="custom_table">
    <colgroup>
       <col span="1" style="width: 40%;">
       <col span="1" style="width: 10%;">
       <col span="1" style="width: 50%;">
    </colgroup> 
    <thead>
      <tr class="table_center">
      <th>TRAIT NAME</th>
      <th>YOUR RESULTS</th>
      <th>POSSIBLE OUTCOMES</th>
    </tr></thead>
    <tbody>
	{% block outcometable %}
      {% for item in table1 %}
      {% set outcomes = item['comb']|split_and_order %}
      {% set link = item['trait'].replace(' ', '_') %}
      <tbody style="page-break-inside:avoid">
      <tr>
        <td rowspan={{outcomes|length}}>
        	<h3 style="margin:0;font-weight:bold">
        		<i>{{item['trait']}}</i>
        	</h3>
          <span>{{item['summary'].replace('Learn more','')}} <a href="#{{link}}">Learn more</a></span>
        </td>
        {% for oc in outcomes %}
        {% set cleaned_oc = oc|remove_unwanted_chars %}
        <td class="table_center {% if cleaned_oc.outcome == 'r' %}cust_negative{% elif cleaned_oc.outcome == 'g' %}cust_positive{% else %}cust_warning{%endif%}">
          {% if oc.endswith('_sss_') %}
          <i class="{% if cleaned_oc.outcome == 'r' %}red exclamation circle{% elif cleaned_oc.outcome == 'g' %}check circle{% else %}orange exclamation triangle{%endif%} large icon"></i>
          {%endif%}
        </td>

        <td>{{cleaned_oc.data}}</td>

        {% if not loop.last %}
              </tr><tr>
          {% endif %}
        {% endfor %}
      </tr>
    	</tbody>
      {% endfor %}
	{% endblock%}
    </tbody>
  </table>
  <p style="page-break-before: always" ></p>
  {% block recommendations %}
    {% for item in table2 %}
    {% set link = item['trait'].replace(' ', '_') %}
    {% set recommendations = item['recommendation'].split('*') %}
    {% set oc = item['outcome']|remove_unwanted_chars %}
    <div class="ui feed" style="background: #fff; color: #333 !important">
    <table class="custom_table recommendations">
    <tr><td colspan="2"><h2 class="ui center aligned header" id="{{link}}">{{item['trait']|upper}}</h2></td></tr>
    <tr><td colspan="2">
      <p style="line-height:1"><small>{{item['description']}}</small></p></td></tr>
    <tr>
      <td colspan="2">
        <img class="ui centered big image" style="padding:10px" src="file:///{{img_path}}/graph_{% if oc.outcome == 'r'  %}danger{% elif oc.outcome == 'g' %}positive{% else %}average{%endif%}.png" />
        <div class="ui center aligned header {% if oc.outcome == 'r'  %}red{% elif oc.outcome == 'g' %}green{% else %}yellow{%endif%}">{{oc.data}}</div>
      </td>
    </tr>
    <tr>
      <th style="width: 20%;"><h3 class="ui center aligned"><strong><i>Genes Tested</i></strong></h3></th>
      <th style="width: 80%;"><h3 class="ui center aligned"><strong><i>Recommendations</i></strong></h3></th>
    </tr>
    <tr style="font-size: 11px;">
      <td class="ui center aligned">{{item['genes']}} </td>
      <td><ul class="ui list">{% for rec in recommendations %}<li>{{rec}}</li>{% endfor %}</ul></td>
    </tr>
    </table>
  </div>
    <br><br>
    {% endfor %}
  {% endblock %}
  

    <div class="ui justified container">
    	{% markdown %}{% include folder+"/static_pages/disclaimer.txt" %}{% endmarkdown %}
	</div>


	 <div class="ui middle aligned centered grid" style="padding-top: 300px">
		<div class="row">
		  <div class="coloumn">
		  <h3 class="ui header orange">Powered by</h3>
		    
		  <img class="ui image" src="file:///{{back_img}}">
		  </div>
		</div>
	</div>
</body>
</html>