
html, body {
    height: 100%;
}
body{
    font-family: var(--font);
    font-size: var(--font-size-base);
    line-height: 1.1;
}

a{
    color: black;
    font-family: var(--font-light);
}

main{
    padding: calc( var(--margin) * 3) var(--margin);
}


/* ----------------------------------------------- header / menu */

#site-title,
#menu {
    font-size: 0.5em;
    position: fixed;
    line-height: 1;
    z-index: 2;
}
#site-title {
    top: 0;
    font-size: 0.5em;
    padding: var(--margin);
    width: 100%;
}
#site-title a {text-decoration: none;}

#menu {
    bottom: 0;
    font-size: 0.5em;
    width: 100%;
}
#menu ul{
    list-style: none;
    margin: 0;
    padding: var(--margin);
    display: flex;
    justify-content: space-between
}

#menu a {
    text-decoration-thickness: 2px;
}

/* ----------------------------------------------- home */

[data-template="home"]{
    overflow-x: hidden;
}
[data-template="home"] .tips {
  height: 100vh;
  display: flex;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  flex-direction: column;
  box-sizing: border-box;
  overflow-x: hidden;
}

[data-template="home"] .tip {
    width: 100vw;
    height: 100vh;
    flex: 0 0 100vh;
    min-width: 100vw;
    height: 100vh;
    padding: calc( var(--margin) * 2.5) var(--margin);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--bg, #f3a333) ;
}

/* cicada principle: https://www.the215guys.com/learning/nth-child-cicada-principle/ */
[data-template="home"] .tip:nth-child(2n) {--bg: #d45454;  }
[data-template="home"] .tip:nth-child(3n) {--bg: #f16821;  }
[data-template="home"] .tip:nth-child(5n) {--bg: #f3a333; }
[data-template="home"] .tip:nth-child(7n) {--bg: #fffe9a; }
[data-template="home"] .tip:nth-child(11n) {--bg: #f6dc8c; /*color-mix(in srgb, #d45454 20%, #fffe9a) */}
[data-template="home"] .tip:nth-child(13n) {--bg: #f3a333; /* color-mix(in srgb, #f16821 20%, #f3a333) */}
[data-template="home"] .tip:nth-child(17n) {--bg: #da644d; /* color-mix(in srgb, #f3a333 20%, #d45454) */}
                              

[data-template="home"] h2{
    font-size: 1em;
    margin: 0 0 .5em;
    text-wrap: balance;
}

[data-template="home"]  p {
    font-size: .5em;
    line-height: 1.4;
    text-wrap: balance;
    max-width: 40em;
}
[data-template="home"] .source {
    display: block;
    text-align: center;
    margin-top: .5em;
}
#prevnext {
    position: fixed;
    top: 0;
    right: 0;
    padding: var(--margin);
    display: flex;
    gap: .15em;
    z-index: 3;
}
#prevnext button {
    line-height: 1;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-family: var(--font);
    cursor: pointer;
    padding: .1em 0;
}
#prevnext button:disabled {
    visibility: hidden;
    pointer-events: none;
}
#prevnext button img {
    width: min(40px, 8vw);
    transform: rotate(90deg);
}

/* ----------------------------------------------- default page */

[data-template="default"]{
    background: #f3a333;
}
[data-template="default"] #menu{
    background: #F3A333;
    background: linear-gradient(0deg,rgba(243, 163, 51, 0.85) 69%, rgba(243, 163, 51, 0) 100%);
}
[data-template="default"] #site-title{
    background: #F3A333;
    background: linear-gradient(180deg, rgba(243, 163, 51, 0.85) 69%, rgba(243, 163, 51, 0) 100%);
}

main .details {
    font-size: .5em;
    line-height: 1.2;
    margin: 1em 0;
    max-width: 32em;
}

/* ----------------------------------------------- print / download */

.tips-by-category {
    margin: 1em 0;
    font-size: .5em;
    line-height: 1.4;
}
.tips-by-category a {
    color: var(--c, currentColor);
}

/* -----------------------------------------------  liste de tous les tips */

[data-template="tips"]{
    background: #f6dc8c;
    display: flex;
    flex-direction: column;
}

[data-template="tips"] #menu{
    background: #f6dc8c;
    background: linear-gradient(0deg,rgba(246, 220, 140, 0.85) 69%, rgba(246, 220, 140, 0) 100%);
}

[data-template="tips"] #site-title{
    background: #f6dc8c;
    background: linear-gradient(180deg, rgba(246, 220, 140, 0.85) 69%, rgba(246, 220, 140, 0) 100%);
}

.tips-list {
    order: 2;
    font-size: .5em;
    display: flex;
    flex-direction: column;
    gap: .5em;
    padding: calc(var(--margin)*4) var(--margin);
}

.pour-toustes { --c: #f3a333; }
.collectifs { --c: #f16821; }
.aller-plus-loin { --c: #d45454; }


.tip-item  {
    line-height: 1.4;
    border: 2px solid var(--c);
    border-radius: .25em;
    padding: .5em;
    position: relative;
}
.tip-item:open  {
    margin-bottom: 1em;
}
.tip-item summary {
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    padding-right: 1em;
}

.tip-item:open summary::after {
    content: "×";
    position: absolute;
    right: .5em;
    top: .5em;
}
.tip-item p {
    max-width: 32em;
    margin-top: .5em;
}
summary::-webkit-details-marker {display: none;}


#filters {
    margin: 0 0 var(--margin) 0;
    display: flex;
    gap: .5em;
    flex-wrap: wrap;
}
#filters a {
    text-decoration: none;
    line-height: 1;
    appearance: none;
    background: var(--c);
    border: none;
    padding: 0;
    font: inherit;
    font-family: var(--font);
    cursor: pointer;
    line-height: 1;
    border: 2px solid var(--c); 
    padding: .25em .75em;
    border-radius: 1em;
}

#filters a.active::before{
    content: "* ";
    font-size: 1.5em;
    line-height: 0;
    position: relative;
    top: .35em;
} 