/* ---------------------------- actual CSS ---------------------------- */
main {padding: 0 20px;}
.article>div {margin: 40px auto;}
main section 
{
    border-radius: 20px;
    background: var(--white);
    padding: 20px;
    box-shadow: var(--shadow-ipad);
    margin: 50px auto;
    scroll-margin-top: 70px;
}
.meta 
{
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}
.date,.author
{
    margin: 2px 0;
    color: var(--light-grey);
    font-size: 15px;
    display: inline-block;
    margin-left: 5px;
}
.date 
{
    display: inline-block;
    margin-left: 5px;
}

.module 
{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    margin: auto;
    width: 100%;
    justify-content: space-evenly;
    position: relative;
}
.img-left {flex-direction: row-reverse;}
.module .text 
{
    margin: 0;
    width: 100%;
    max-width: 100%;
}
.module p {margin: 10px 0;}
p 
{
    margin: 30px 0;
    text-align: justify;
}
.text 
{
    margin: 12pt auto;
    text-align: left;
    font-size: 19px;
}
.articles section a {color: var(--EP-Blue);}
.articles section a:hover {text-decoration: underline;}

/* Titraille ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.big_title
{
    font-family: study;
    font-size: 80px;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    padding-bottom: 20px;
}
.title-decoration
{
    position: absolute;
    height: 100%;
    pointer-events: none;
}
.title-underline
{
    width: 100%;
    left: 0;
    z-index: -1;
    bottom: calc(-100% + 20px);
}
.title-triangles
{
    width: 70px;
    left: calc(100% - 7px);
    bottom: calc(100% - 40px);
}
/* Normalized mask strokes preserve the original variable-width filled artwork.
   Adjust per-path --draw-delay and --draw-duration to change the drawing sequence. */
.title-draw-stroke
{
    stroke-dasharray: 1.1;
    stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: no-preference)
{
    .title-draw-stroke
    {
        animation: blog-title-draw 0.75s ease-in-out both;
        animation-delay: var(--draw-delay, 0s);
    }
    .title-triangles .title-draw-stroke {animation-duration: var(--draw-duration, 0.22s);}
}
@keyframes blog-title-draw
{
    from {stroke-dashoffset: 1.1;}
    to {stroke-dashoffset: 0;}
}
h2{margin-bottom: 0;}

.Title
{
    width: 95%;
    margin: auto;
    text-wrap-style: balance;
}
.Title h2
{
    margin-bottom: 10px;
    display: inline;
    position: relative; 
    width: fit-content;
}
.Title H2 span{
    /* z-index: 3; */
    /* position: relative;  ??? */
}
.underline
{
    width: 100%;
    position: absolute;
    bottom: -7px;
    left: 0;
    height: 10px;
}
.underline svg
{
    width: 100%;
    height: 100%;
    display: block;
}
.underline svg path{
    stroke: var(--EP-Light-Blue);
}

/* Highlights ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.highlight 
{
    animation: none;
    Margin: 0 -4px;
    Padding: 2px 7px;
    Background-position: 3px;
    position: relative;
}
.article>div:nth-of-type(4n+2) .highlight 
{
  background: linear-gradient(104deg,
        rgba(156, 196, 60,0) 0.45%,
        rgba(156, 196, 60,1.25) 1.2%,
        rgba(156, 196, 60,0.6) 2.9%,
        rgba(156, 196, 60,0.3) 46.5%,
        rgba(156, 196, 60,0.7) 48%,
        rgba(156, 196, 60,0) 49%);
    background-size: 200% 100%;
    Background-position: 3px;
}
.article>div:nth-of-type(4n+3) .highlight 
{
    background: linear-gradient(104deg,
        rgba(255, 228, 53,0) 0.45%,
        rgba(255, 228, 53,1.25) 1.2%,
        rgba(255, 228, 53,0.6) 2.9%,
        rgba(255, 228, 53,0.3) 46.5%,
        rgba(255, 228, 53, 0.7) 48%,
        rgba(255, 228, 53,0) 49%);
    background-size: 200% 100%;
    Background-position: 3px;
}
.article>div:nth-of-type(4n+4) .highlight 
{
  background: linear-gradient(104deg,
        rgba(115, 151, 242,0) 0.45%,
        rgba(115, 151, 242,1.25) 1.2%,
        rgba(115, 151, 242,0.6) 2.9%,
        rgba(115, 151, 242,0.3) 46.5%,
        rgba(115, 151, 242, 0.7) 48%,
        rgba(115, 151, 242,0) 49%);
    background-size: 200% 100%;
    Background-position: 3px;
}
.article>div:nth-of-type(4n+1) .highlight 
{
    background: linear-gradient(104deg,
        rgba(251, 160, 227,0) 0.45%,
        rgba(251, 160, 227,1.25) 1.2%,
        rgba(251, 160, 227,0.6) 2.9%,
        rgba(251, 160, 227,0.3) 46.5%,
        rgba(251, 160, 227, 0.7) 48%,
        rgba(251, 160, 227,0) 49%);
    background-size: 200% 100%;
    Background-position: 3px;
}

.article .post-it p .highlight
{
    background: linear-gradient(104deg,
        rgba(232, 147, 255,0) 0.45%,
        rgba(232, 147, 255,1.25) 1.2%,
        rgba(232, 147, 255,0.6) 2.9%,
        rgba(232, 147, 255,0.3) 46.5%,
        rgba(232, 147, 255,0.7) 48%,
        rgba(232, 147, 255,0) 49%);
    background-size: 200% 100%;
    Background-position: 3px;
}

.manualscript 
{
    font-size: 24px;
    font-weight: bold;
    word-spacing: normal;
    line-height: 0;
    color: black;
    font-family: 'study', sans-serif;
}
.post-it .manualscript {font-size: 22px}

/* Photos~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.photo 
{
    background-color: var(--white);
    max-width: 350px;
    /* margin: 30px auto 0; */
    margin: 0 30px;
    width:75%;
    display: block;
    box-shadow: var(--shadow-ipad);
    position: relative;
    border: 15pt solid var(--white);
    box-sizing: border-box;
    rotate: -3deg;
}
.img-left .photo {rotate: 3deg;}
.small-photo {max-width: 200px;}
.photo img 
{
    background-color: #b0d2da;
    max-width: 100%;
    width: 100%;
    vertical-align: middle;
}
.photo div 
{
    margin-bottom: -10px;
    width: 100%;
    text-align: center;
}
.photo video{
    width: 100%;
    display: block;
}
.photo .note 
{
    font-family: 'Courier New', monospace;
    margin-bottom: -20px;
    padding: 10px 0;
}


.Screen-cut 
{
    width: 100%;
    box-shadow: var(--shadow-ipad);
    position: relative;
    border-radius: 7px;
}
.Screen-cut video 
{
    width: 100%;
    display: block;
    border-radius: 7px;
}


/* Polaroids ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.photo .polaroid-trigger
{
    position: absolute;
    inset: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    color: #fff;
}
.polaroid-expand-icon
{
    position: absolute;
    right: 26px;
    top: 26px;
    width: 30px;
    height: 30px;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgb(0 0 0 / 55%);
    opacity: 0;
    transition: opacity 150ms ease;
}
.polaroid-expand-icon svg
{
    display: block;
    width: 100%;
    height: 100%;
}
.photo:hover .polaroid-expand-icon, .polaroid-trigger:focus-visible .polaroid-expand-icon {opacity: 1;}
.polaroid-trigger:focus-visible
{
    outline: 3px solid var(--EP-Blue);
    outline-offset: 5px;
}
.polaroid-trigger svg, .polaroid-close svg
{
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.polaroid-source-hidden {visibility: hidden;}
/* The persistent SVG replaces the old decorative pseudo-element. */
.photo::before {content: none;}
.photo > .polaroid-tape
{
    display: block;
    position: absolute;
    left: 50%;
    top: -35px;
    width: 70%;
    max-width: 120px;
    height: 30px;
    rotate: -3deg;
    transform: translateX(-50%);
    overflow: visible;
    pointer-events: none;
    z-index: 1;
}
.img-right .photo > .polaroid-tape {rotate: 3deg;}
.polaroid-viewer
{
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    background: transparent;
    overflow: hidden;
    color: #111;
}
.polaroid-viewer::backdrop
{
    background: rgb(15 18 20 / 82%);
    opacity: 0;
    transition: opacity 300ms ease;
}
.polaroid-viewer.is-visible::backdrop {opacity: 1;}
.polaroid-stage
{
    position: absolute;
    inset: max(64px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    justify-content: center;
}
.polaroid-card
{
    flex: none;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    background: var(--white);
    box-shadow: 0 18px 70px rgb(0 0 0 / 40%);
    transform-origin: center;
}
.polaroid-card > img, .polaroid-card > video
{
    display: block;
    width: 100%;
    height: auto;
}
.polaroid-card figcaption
{
    padding-top: 14px;
    font: 16px/1.35 'Courier New', monospace;
    text-align: center;
    overflow-wrap: anywhere;
}
.polaroid-close
{
    position: absolute;
    z-index: 1;
    top: max(10px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 50%;
    background: rgb(0 0 0 / 25%);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 100ms ease;
}
.polaroid-viewer.is-visible .polaroid-close
{
    opacity: 1;
    pointer-events: auto;
}
.polaroid-close svg
{
    width: 100%;
    height: 100%;
}
.polaroid-close:hover {background: rgb(255 255 255 / 15%);}
.polaroid-close:focus-visible
{
    outline: 3px solid #fff;
    outline-offset: 3px;
}


/* Arrows~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.img-right 
{
    position: relative;
    /* calcul de la différence de height entre le texte et la photo, avec comme maximum et minimum la taille de la flèche */
    --diff: clamp(-170px, calc(var(--textHeight) - var(--photoHeight)), 170px);
}
.img-left 
{
    position: relative;
    /* calcul de la différence de height entre le texte et la photo, avec comme maximum et minimum la taille de la flèche */
    --diff: clamp(-170px, calc(var(--textHeight) - var(--photoHeight)), 170px);
}

.img-right .arrow 
{
    position: absolute;
    width: 135px;
    height: 35px;
    transform-origin: center;
    /* calcul de la différence divisée par son max/min pour obstenir un %, multiplié par le résultat qu'on souhaite avoir lorsqu'on atteint ces limites, ajusté par le résultat qu'on souhaite avoir si la différence est nulle. */
    /* valeur absolue de la différence pour le top, car la position monte puis redescend */
    /* le côté prends en compte la largeur de l'image */
    top: calc(abs(var(--diff) / 170) * 55 - 40px);
    right: calc((var(--diff) / 170) * -50 + (var(--photoWidth) - 10px));
    transform: rotate(calc((var(--diff) / 170px) * 35deg - 3deg));
}
.img-left .arrow 
{
    position: absolute;
    width: 145px;
    height: 35px;
    transform-origin: center;
    top: calc(abs(var(--diff) / 170) * 55 - 40px);
    left: calc((var(--diff) / 170) * -50 + (var(--photoWidth) - 10px));
    transform: rotate(calc(((var(--diff) / 170px) * -35deg) + 10deg));
}

.img-right:has(.small-photo) .arrow
{
    width: 80px;
    height: 41px;
    top: calc(abs(var(--diff) / 135) * 40 - 35px);
    right: calc((var(--diff) / 135) * -10 + (var(--photoWidth) + 30px));
    transform: rotate(calc(((var(--diff) / 135px) * 35deg) - 10deg));
}
.img-left:has(.small-photo) .arrow
{
    width: 80px;
    height: 22px;
    top: calc(abs(var(--diff) / 135) * 40 - 35px);
    left: calc((var(--diff) / 135) * -10 + (var(--photoWidth) + 30px));
    transform: rotate(calc((((var(--diff)) / 135px) * -35deg) + 10deg));
}

/* Desktop and tablet retain their existing photo-dependent arrow shapes. */
.arrow > use {display: none;}
@media (width > 700px)
{
    .img-left:not(:has(.small-photo)) .arrow > .arrow-left,
    .img-right:not(:has(.small-photo)) .arrow > .arrow-right,
    .img-left:has(.small-photo) .arrow > .arrow-small-left,
    .img-right:has(.small-photo) .arrow > .arrow-small-right
    {
        display: inline;
    }
}

.arrow use
{
  stroke-dasharray: 350; /*longeur maximale des paths des arrows*/
  stroke-dashoffset: 350;
  stroke: var(--light-grey);
}
.animated-path use{animation: dash 0.4s ease-in-out forwards;}
.module:has(.small-photo) .animated-path use{animation: dash 0.8s ease-in-out forwards;}

@keyframes dash 
{
  0% {stroke-dashoffset: 350;}
  100% {stroke-dashoffset: 700;}
}

/* Post it~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.post-it 
{
    background-color: var(--post-it-yellow);
    padding: 25px 40px;
    margin: 40px auto;
    clear: left;
    box-shadow: -1px 2px 1px rgba(202, 202, 202);
    font-size: 20px;
    font-weight: 300;
    color: #3a3a3a;
    font-family: 'AppleStorm', sans-serif;
}
.post-it .highlight 
{
    background: linear-gradient(104deg, rgba(156, 196, 60, 0) 0.45%, rgb(232 147 255) 1.2%, rgb(210 130 242 / 60%) 2.9%, rgb(195 75 255 / 30%) 46.5%, rgb(213 128 247 / 70%) 48%, rgba(156, 196, 60, 0) 49%);
    background-size: 200% 100%;
    Background-position: 3px;
}
 .post-it h2
 {
    rotate: 1deg;
    translate: -33px;
    margin: 0;
    line-height: 0;
}
 .post-it h2 span{
    background-color: var(--post-it-purple);
    width: fit-content;
    padding: 10px 15px;
    color: var(--black);
    line-height: 36px;
    font-size: 22px;
    -webkit-box-decoration-break: clone;
    font-weight: normal;
    mask: conic-gradient(from 45deg at left, #0000, #000 1deg 89deg, #0000 90deg) left / 51% 10% repeat-y, conic-gradient(from -135deg at right, #0000, #000 1deg 89deg, #0000 90deg) right / 51% 10% repeat-y;
}
.post-it h2 span img{
    height: 22px;
    Vertical-align: middle;
    padding-right: 10px;
}
.post-it p {margin: 10px 0;}

/* Media~Sizes~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@media (max-width: 800px) 
{
    .module {
        flex-direction: column;
        gap: 0px;
    }
    .text {width: 100% !important;}
    .photo {margin: 30px auto 0;}
    .img-left .arrow{
        top: initial;
        right: calc(50% + var(--photoWidth)/2);
        bottom: calc(var(--photoHeight) - 60px);
        left: initial;
        transform: rotate(-120deg);
    }
    .img-right .arrow{
        top: initial;
        right: initial;
        bottom: calc(var(--photoHeight) - 60px);
        left: calc(50% + var(--photoWidth)/2);
        transform: rotate(120deg);
    }
    .img-left:has(.small-photo) .arrow{
        top: initial;
        right: calc(50% + var(--photoWidth)/2 + 10px);
        bottom: calc(var(--photoHeight) - 30px);
        left: initial;
        transform: rotate(-120deg);
    }
    .img-right:has(.small-photo) .arrow{
        top: initial;
        right: initial;
        bottom: calc(var(--photoHeight) - 30px);
        left: calc(50% + var(--photoWidth)/2 + 10px);
        transform: rotate(120deg);
    }
}

@media(max-width:700px)
{
    /* Tilt away from the mobile arrow while keeping the tape level. */
    .module[data-mobile-arrow] .photo
    {
        --mobile-photo-tilt: 3deg;
        rotate: var(--mobile-photo-tilt);
    }
    .module:is([data-mobile-arrow="2"], [data-mobile-arrow="4"], [data-mobile-arrow="6"]) .photo
    {
        --mobile-photo-tilt: -3deg;
    }
    .module[data-mobile-arrow] .photo > .polaroid-tape
    {
        rotate: calc(-1 * var(--mobile-photo-tilt));
    }

    /* Match the mobile mockup: 48px through 320px, rising to 90px at 700px.
       The positioning script measures the tilted photo and rotated arrow. */
    .module[data-mobile-arrow] .arrow
    {
        --mobile-arrow-size: clamp(48px, calc(48px + (100vw - 320px) * 42 / 380), 90px);
        --mobile-arrow-gap: 0px;
        display: block;
        width: var(--mobile-arrow-size);
        height: calc(var(--mobile-arrow-size) * 42 / 173);
        top: var(--mobile-arrow-top, 0px);
        left: var(--mobile-arrow-left, 0px);
        right: auto;
        bottom: auto;
        transform: rotate(-105deg);
        pointer-events: none;
    }

    @media (width > 360px)
    {
        .module[data-mobile-arrow]:has(.small-photo) .arrow {--mobile-arrow-gap: 9px;}
    }

    .module:is([data-mobile-arrow="2"], [data-mobile-arrow="5"]) .arrow
    {
        height: calc(var(--mobile-arrow-size) * 88 / 177);
        transform: rotate(105deg);
    }
    .module[data-mobile-arrow="5"] .arrow
    {
        transform: scaleX(-1) rotate(105deg);
    }
    .module:is([data-mobile-arrow="4"], [data-mobile-arrow="6"]) .arrow
    {
        transform: scaleX(-1) rotate(-105deg);
    }

    .module:is([data-mobile-arrow="1"], [data-mobile-arrow="4"]) .arrow > .arrow-small-left,
    .module:is([data-mobile-arrow="2"], [data-mobile-arrow="5"]) .arrow > .arrow-small-right,
    .module:is([data-mobile-arrow="3"], [data-mobile-arrow="6"]) .arrow > .arrow-small-curve
    {
        display: inline;
    }
    .module .animated-path use {animation-duration: 0.8s;}
}

@media (max-width: 600px)
{
    .polaroid-stage
    {
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }
    .polaroid-card {padding: 12px;}
    .polaroid-card figcaption
    {
        font-size: 14px;
        padding-top: 10px;
    }
}

@media (max-width: 500px) 
{
    .big_title
    {
        margin-block-start: 0.67em;
        line-height: 65px;
        font-size: 62px;
    }
    .title-triangles
    {
        left: calc(100% - 10px);
        bottom: calc(100% - 30px);
        height: 60px;
    }
    .sub_title {margin: 0 auto;}
    .module 
    {
        flex-direction: column;
        gap: 0px;
    }
    .date, .author {font-size: 13px;}
    .post-it {padding: 10px 20px;}
    .post-it h2 {translate: -15px;}
    .post-it h2 span
    {
        padding: 5px 10px;
        font-size: 16px;
    }
    .post-it h2 span img{height: 16px;}
    .post-it .manualscript {font-size: 16px}
    .manualscript {font-size: 18px;}
    .note {font-size: 15px ;}
    .iPad-Screen{border-width: 8px;}
}
@media (max-width:400px)
{
    .manualscript {font-size: 16px;}
    .big_title
    {
        margin-block-start: 0.67em;
        line-height: 65px;
        font-size: 62px;
    }
}
@media (max-width:320px)
{
    .title-triangles {display: none;}
}



@media (prefers-reduced-motion: reduce) {
    .arrow use
    {
        stroke-dasharray: 0;
        opacity: 0;
    }

    .animated-path use{animation: dash 0.8s linear forwards;}
    .module:has(.small-photo) .animated-path use{animation: dash 0.8s linear forwards;}

    @keyframes dash 
    {
    0% {opacity: 0;}
    100% {opacity: 1;}
    }

    .polaroid-viewer::backdrop, .polaroid-expand-icon, .polaroid-close { transition: none; }
}
