/***************************************************** Common ****************************************************/
html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    font-size: 2vw;
    font-min-size: 12px;
    font-family: sans-serif;
    height: 100%;
}

@media (min-width: 600px) and (orientation: landscape) {
    html, body {
        font-size: 18px;
    }
}

@media (min-width: 1024px) and (orientation: portrait) {
    html, body {
        font-size: 27px;
    }
}

body * {
    text-align: left;
}

.with-background {
    background-color: rgba(120, 150, 190, 1);
    background-size: 100%;
    background-image: url('background.jpg');
    background-position: bottom;
}

/***************************************************** Home ****************************************************/

body.with-background {
    background-repeat: no-repeat;
}

.gradient {
    height: calc(100% - 40vw);
    background: linear-gradient(rgba(120, 150, 190, 1) calc(100% - 20vw), rgba(120, 150, 190, 0));
}

.gradient main {
    margin-top: calc(2.5rem + 70px);
}

main nav {
    width: 80%;
    margin: auto;
}

main nav ul {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    justify-content: space-around;
}

main nav li {
    display: block;
    position: relative;
    flex-basis: 30%;
    align-self: center;
    text-align: center;
    margin: 0 5%;
}

main nav li a {
    display: block;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
}

main nav li a:hover {
    display: block;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}

main nav img {
    margin: 0;
}

main nav .label {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 2vw;
    text-align: center;
    color: white;
    text-shadow: 0 0 3px #000000;
    transform: translate(-50%, -10%);
}

main nav li.about {
    flex-basis: 100%;
}

@media screen and (orientation: portrait) {
    main nav ul {
        flex-direction: column;
    }

    main nav li {
        width: 60%;
        margin: 3% 0
    }

    main nav .label {
        font-size: 4vw;
    }
}

/***************************************************** Common in website ****************************************************/

header nav label, header nav input[type="checkbox"] {
    display: none;
}

header nav, .instead-of-nav {
    height: 2.5rem;
    background-color: #440300;
}

header nav ul {
    height: 100%;
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

header nav li {
    float: left;
    height: 100%;
}

header nav li a {
    display: block;
    height: 100%;
    color: white;
    text-align: center;
    padding: 1.2ex 1.2em;
    text-decoration: none;
}

header nav li a:hover {
    background-color: #005d00;
    text-decoration: none;
}

.page-header {
    margin-bottom: 50px;
}

.page-header.with-background {
    position: relative;
    height: 30vw;
    margin-bottom: 0;
}

.title-container {
    background-color: #440300;
    padding: 2ex 0;
}

h1 {
    color: white;
}

h2 {
    color: #440300;
}

@media (max-width: 1024px) {
    header .page-header img {
        left: 0;
        transform: none;
        max-width: 70%;
    }

    header nav label {
        display: block;
        width: 10vw;
        height: 10vw;
        float: right;
        color: white;
        font-size: 2.5rem;
        text-align: center;
        cursor: pointer;
    }

    header nav input ~ ul {
        display: none;
    }

    header nav input:checked ~ label {
        color: #005d00;
    }

    header nav input:checked ~ ul {
        display: flex;
        height: auto;
        flex-direction: column;
        position: absolute;
        right: 2vw;
        top: 2.5rem;

        background-color: #440300;

        z-index: 20;
    }

    header nav input:checked ~ ul li a {
        text-align: left;
    }

    header nav label:before {
        content: '\039e';
    }
}

/***************************************************** Blog ****************************************************/

.articleContainer {
    margin: 5vh 0;
    padding: 2vh 0;
}

.articleContainer::before {
    display: block;
    content: '';
    position: absolute;
    width: 100%;
    height: 100px;
    background: #005d00;
    z-index: 1;
}

header + .articleContainer {
    margin-top: 0;
    padding-top: 0;
}

article, .info {
    width: 65vw;
    margin: auto;
    background: white;
    padding: 2vh 3vw;
    border-radius: 8px;
    box-shadow: 3px -3px 8px 1px rgba(92, 92, 92, 1);
}

.info {
    width: 55vw;
}

article {
    position: relative;
    top: 15px;
    z-index: 10;
}

@media (max-width: 1024px) {
    article {
        width: 85vw;
        padding: 2vw;
    }
}

h1, header > h2 {
    text-align: center;
}

header img {
    position: absolute;
    margin: 0;
    top: 10px;
    left: 50%;
    transform: translate(-50%, 0);
}

.date {
    font-size: 0.9em;
}

header .date:not(:first-child) {
    position: absolute;
    top: 1.5ex;
    right: 1em;
    padding: 0 0.5em;
}

header .date:first-child {
    text-align: right;
    margin-bottom: 2em;
}

article footer {
    text-align: right;
    font-size: 0.8rem;
}

img {
    display: block;
    max-width: 100%;
    margin: 3ex auto;
}

table img {
    margin: auto;
}

a {
    color: #003300;
    text-decoration: underline dotted;
}

a:hover {
    text-decoration: underline;
}

/***************************************************** Blog ****************************************************/

table {
    box-shadow: 3px -3px 8px 1px rgba(140, 140, 140, 1);
    border-collapse: collapse;
    margin: auto;
}

td, th {
    padding: 0.3rem;
}

thead {
    position: sticky;
    top: 0;
    background: #005d00;
    color: white;
}

tr:nth-child(2n) {
    background: #99CC99;
}

.footnotes {
    font-size: 0.9rem;
}

li p {
    margin: 0;
}

.pagination {
    display: inline-block;
    margin-bottom: 2ex;
}

.pagination a {
    color: black;
    float: left;
    padding: 8px 16px;
    text-decoration: none;
}

.pagination a.active {
    background-color: #005d00;
    color: white;
}

.pagination a:hover:not(.active) {
    background-color: #ddd;
}

.d-flex {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
}

.divide-3 {
    text-align: center;
    width: 27%;
    margin: 0 3%;
}

/***************************************************** Photos ****************************************************/

#current_taxon {
    margin: 5ex auto 0 auto;
    width: 4rem;
    height: 4rem;
    background: #440300;
    position: relative;
    border-radius: 4rem;
    z-index: 150;
}

#current_taxon h2 {
    width: 90vw;
    color: #440300;
    position: absolute;
    top: -4ex;
    left: 50%;
    transform: translate(-50%, 0);
    text-align: center;
}

#current_taxon a {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

#current_taxon a span {
    position: absolute;
    display: block;
    top: -1000rem;
    left: 50%;
    background: white;
    z-index: 100;
    width: 90vw;
    height: 2rem;
    transform: translate(-50%, 0);
    text-align: center;
    font-weight: bold;
    color: #440300;
}

#current_taxon a:hover span {
    top: -2rem;
}

#current_taxon a:hover::before {
    content: '⇪';
    font-size: 3rem;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#children {
    display: flex;
    list-style-type: none;
    padding: 0;
    justify-content: center;
    margin: 1rem 0 3rem 0;
}

#children li {
    width: 4rem;
    height: 4rem;
    margin: 0 3.5rem;
}

#children a {
    display: block;
    width: 3rem;
    height: 3rem;
    background: #003300;
    border-radius: 4rem;
    position: relative;
    margin: auto;
    font-weight: bold;
}

#children a:hover {
    width: 4rem;
    height: 4rem;
    background: #005d00;
}

#children a::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 50%;
    height: 0;
    content: '';
    border: 1px solid #440300;
    transform-origin: 0 0;
    transform: rotate(var(--angle-arrow));
}

#children li:nth-child(1):nth-last-child(1) a::before,
#children li:nth-child(2):nth-last-child(2) a::before,
#children li:nth-child(3):nth-last-child(3) a::before {
    width: 3rem;
    --angle-arrow: -1.5708rad; /* atan2(-3,0) */
}

#children li:nth-child(1):nth-last-child(2) a::before,
#children li:nth-child(2):nth-last-child(3) a::before {
    width: 6.2650rem; /* sqrt(5.5*5.5+3*3) avec 5.5 = margin + width/2 et 3 = margin-top*/
    --angle-arrow: -0.4993rad; /* atan2(-3, 5.5) */
}

#children li:nth-child(2):nth-last-child(1) a::before,
#children li:nth-child(3):nth-last-child(2) a::before {
    width: 6.2650rem;
    --angle-arrow: -2.6422rad; /* atan2(-3, -5.5) */
}

#children li:nth-child(1):nth-last-child(3) a::before,
#children li:nth-child(2):nth-last-child(4) a::before {
    width: 11.4018rem;
    --angle-arrow: -0.2663rad;
}

#children li:nth-child(3):nth-last-child(1) a::before,
#children li:nth-child(4):nth-last-child(2) a::before {
    width: 11.4018rem;
    --angle-arrow: -2.8753rad;
}

#children li:nth-child(1):nth-last-child(4) a::before {
    width: 16.7706rem;
    --angle-arrow: -0.1799rad;
}

#children li:nth-child(4):nth-last-child(1) a::before {
    width: 16.7705rem;
    --angle-arrow: -2.9617rad;
}

#children li:nth-child(1):nth-last-child(5) a::before {
    width: 21.9073rem;
    --angle-arrow: -0.1355rad;
}

#children li:nth-child(5):nth-last-child(1) a::before {
    width: 21.9073rem;
    --angle-arrow: -3.0061rad;
}

#children a::after {
    content: '⇩';
    color: white;
    font-size: 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#children a:hover::after {
    font-size: 3rem;
}

#children a span {
    display: block;
    width: 10rem;
    position: absolute;
    top: 3.5rem;
    left: 50%;
    transform: translate(-50%, 0);
    text-align: center;
}

#children a:hover span {
    top: 4.5rem;
}

#gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

.polaroid {
    display: block;
    position: relative;
    margin: 10px;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.polaroid .name {
    position: absolute;
    box-sizing: border-box;
    bottom: 10px;
    width: calc(100% - 20px);
    height: 2.5ex;
    padding-left: 0.5rem;
    color: transparent;
}

.polaroid:hover .name {
    color: white;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    background: linear-gradient(0deg, rgba(2, 0, 36, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
}

.polaroid:hover {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}

#gallery img {
    --images-per-line: 5;
    margin: 0;
    max-width: calc(100vw / var(--images-per-line) - (var(--images-per-line) + 1) * 20px / var(--images-per-line));
    max-height: calc(100vw / var(--images-per-line) - (var(--images-per-line) + 1) * 20px / var(--images-per-line));
    transition: all 1s;
}

@media screen and (max-width: 1200px) {
    #gallery img {
        --images-per-line: 3;
    }
}

#zoom-container {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#zoom {
    display: flex;
    justify-content: center;
    align-items: center;
}

.previous, .next, .close {
    background: transparent;
    border: none;
    cursor: pointer;
    text-shadow: 0px 0px 3px rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    z-index: 50;
}

.previous:hover, .next:hover, .close:hover {
    text-shadow: 0px 0px 3px white;
}

.previous, .next {
    font-size: 2rem;
    flex-grow: 1;
    align-self: stretch;
}

#photo {
    position: relative;
}

.close {
    font-size: 1.5rem;
    position: absolute;
    top: 0;
    right: 0;
}

#photo img {
    max-width: calc(100vw - 90px);
    max-height: calc(100vh - 90px);
    margin: 0;
}

.description {
    z-index: 50;
    color: white;
    text-align: center;
    line-height: 60px;
    font-size: 1.5rem;
    background: radial-gradient(circle, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 30%);
}

.latin-name {
    font-style: italic;
}

.latin-name:not(:empty)::before {
    content: '-';
    margin: 1rem;
}

/***************************************************** About ****************************************************/

.reverse {
    unicode-bidi: bidi-override;
    direction: rtl;
}

/** Specific css **/
/* Rearrange the cells on small screen */
@media screen and (max-width: 1200px) {
    #especes-choisies-pour-la-haie table {
        font-size: 0;
    }

    #especes-choisies-pour-la-haie thead, #especes-choisies-pour-la-haie tr {
        width: 100%;
    }

    #especes-choisies-pour-la-haie table, #especes-choisies-pour-la-haie thead, #especes-choisies-pour-la-haie tbody, #especes-choisies-pour-la-haie tr, #especes-choisies-pour-la-haie td, #especes-choisies-pour-la-haie th {
        display: inline-block;
    }

    #especes-choisies-pour-la-haie th, #especes-choisies-pour-la-haie td {
        text-align: center;
        font-size: 1rem;
        box-sizing: border-box;
        height: 7ex;
    }

    #especes-choisies-pour-la-haie th, #especes-choisies-pour-la-haie td {
        border-left: 1px solid #CCCCCC;
        border-right: 1px solid #CCCCCC;
    }

    #especes-choisies-pour-la-haie th:first-child:nth-last-child(7),
    #especes-choisies-pour-la-haie th:first-child:nth-last-child(7) ~ th:nth-child(1),
    #especes-choisies-pour-la-haie th:first-child:nth-last-child(7) ~ th:nth-child(2),
    #especes-choisies-pour-la-haie th:first-child:nth-last-child(7) ~ th:nth-child(3),
    #especes-choisies-pour-la-haie td:first-child:nth-last-child(7),
    #especes-choisies-pour-la-haie td:first-child:nth-last-child(7) ~ td:nth-child(2),
    #especes-choisies-pour-la-haie td:first-child:nth-last-child(7) ~ td:nth-child(3) {
        width: 33.33%;
        border-bottom: 1px solid #CCCCCC;
    }

    #especes-choisies-pour-la-haie th:first-child:nth-last-child(7) ~ th:nth-child(4),
    #especes-choisies-pour-la-haie th:first-child:nth-last-child(7) ~ th:nth-child(5),
    #especes-choisies-pour-la-haie th:first-child:nth-last-child(7) ~ th:nth-child(6),
    #especes-choisies-pour-la-haie th:first-child:nth-last-child(7) ~ th:nth-child(7),
    #especes-choisies-pour-la-haie td:first-child:nth-last-child(7) ~ td:nth-child(4),
    #especes-choisies-pour-la-haie td:first-child:nth-last-child(7) ~ td:nth-child(5),
    #especes-choisies-pour-la-haie td:first-child:nth-last-child(7) ~ td:nth-child(6),
    #especes-choisies-pour-la-haie td:first-child:nth-last-child(7) ~ td:nth-child(7) {
        width: 25%;
    }
}

#planning-de-stratification-et-de-semis td:not(:first-child) {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

#planning-de-stratification-et-de-semis th {
    font-size: 0.8vw;
}

#planning-de-stratification-et-de-semis td img {
    max-width: 1vw;
}

#planning-de-stratification-et-de-semis td {
    font-size: 0.8vw;
}

@media screen and (max-width: 1024px) {
    #planning-de-stratification-et-de-semis th:not(:last-child):not(:first-child) {
        font-size: 0.7vw;
    }

    #planning-de-stratification-et-de-semis td {
        font-size: 1.4vw;
    }
}