/*
Theme Name: TTW
Theme URI: https://throughthewall.org
Author: Ibanez
Author URI: 
Description: This is a custom theme developed for throughthewall.org
Version: 1.0
*/

html {
    font-size: 1rem;
}

:root {
    --ui-step: 4px;
    --white: #efefef;
}

@font-face {
    font-family: "NonBureauExtended-Bold";
    font-style: normal;
    font-weight: 400;
    src: url("/wp-content/uploads/fonts/NonBureauExtended-Bold.woff2") format("woff2")
}

body {
    font-family: "Roboto Flex", sans-serif;
    color: var(--white);
    word-break: break-word;
    white-space: normal;
    hyphens: manual;
    overflow-x: hidden;
    font-size: 1rem;
    widows: 2;
    orphans: 2;
    overflow-wrap: break-word;
    hyphens: manual;
}

body:has(.page) {
    background-color: #333;
    background: url(/wp-content/uploads/img/fence.png), url(/wp-content/uploads/img/bg.jpg), #333;
    background-size: contain, cover;
    background-position: center bottom, center center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
}

.page {
    padding-block: calc(var(--ui-step) * 8);
    padding-inline: calc(var(--ui-step) * 4);
}

.lang-switcher {
    font-family: 'NonBureauExtended-Bold';
    font-weight: 700;
    font-size:  .75em;
    text-align: end;
    color: var(--white);
}

.lang-switcher a {
    color: var(--white);
    opacity: 60%;
    text-decoration: none;
}

h1 {
    font-family: 'NonBureauExtended-Bold';
    font-weight: 700;
    font-size: calc(var(--ui-step) * 7);
    line-height: 1;
    margin-top: 0;
    margin-bottom: 0;
    margin-block: .5em;
}

header p {
    font-size:  1em;
    font-weight: 450;
}

main {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: calc(var(--ui-step) * 20) 0;
}

:not(.lp) main {
    margin-block: calc(var(--ui-step) * 10);
}

.letter-item {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 3 / 2;
}

.letter {
    position: absolute;
    display: block;
    inset-inline-start: 50%;
    inset-block-start: 50%;
    width: 80%;
    color: var(--white);
    text-decoration: none;
    cursor: pointer;
}

.letter-item:nth-child(20n+1) .letter {
    transform: translate(-50%, -50%) rotate(-11deg);
}

.letter-item:nth-child(20n+2) .letter {
    transform: translate(-50%, -50%) rotate(4deg);
}

.letter-item:nth-child(20n+3) .letter {
    transform: translate(-50%, -50%) rotate(13deg);
}

.letter-item:nth-child(20n+4) .letter {
    transform: translate(-50%, -50%) rotate(-6deg);
}

.letter-item:nth-child(20n+5) .letter {
    transform: translate(-50%, -50%) rotate(4deg);
}

.letter-item:nth-child(20n+6) .letter {
    transform: translate(-50%, -50%) rotate(-6deg);
}

.letter-item:nth-child(20n+7) .letter {
    transform: translate(-50%, -50%) rotate(15deg);
}

.letter-item:nth-child(20n+8) .letter {
    transform: translate(-50%, -50%) rotate(-7deg);
}

.letter-item:nth-child(20n+9) .letter {
    transform: translate(-50%, -50%) rotate(-7deg);
}

.letter-item:nth-child(20n+10) .letter {
    transform: translate(-50%, -50%) rotate(8deg);
}

.letter-item:nth-child(20n+11) .letter {
    transform: translate(-50%, -50%) rotate(-9deg);
}

.letter-item:nth-child(20n+12) .letter {
    transform: translate(-50%, -50%) rotate(-4deg);
}

.letter-item:nth-child(20n+13) .letter {
    transform: translate(-50%, -50%) rotate(13deg);
}

.letter-item:nth-child(20n+14) .letter {
    transform: translate(-50%, -50%) rotate(-6deg);
}

.letter-item:nth-child(20n+15) .letter {
    transform: translate(-50%, -50%) rotate(9deg);
}

.letter-item:nth-child(20n+16) .letter {
    transform: translate(-50%, -50%) rotate(-7deg);
}

.letter-item:nth-child(20n+17) .letter {
    transform: translate(-50%, -50%) rotate(11deg);
}

.letter-item:nth-child(20n+18) .letter {
    transform: translate(-50%, -50%) rotate(4deg);
}

.letter-item:nth-child(20n+19) .letter {
    transform: translate(-50%, -50%) rotate(-8deg);
}

.letter-item:nth-child(20n+20) .letter {
    transform: translate(-50%, -50%) rotate(11deg);
}

.letter-envelope {
    position: relative;
}

.letter-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 0;
    overflow: hidden;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) { 
    .letter:hover .letter-screen {
        height: 100%;
        line-height: 100%;
    }
}

.letter-screen img {
    margin-inline: auto;
    vertical-align: middle;
    max-height: 100%;
}

.letter-envelope > img {
    width: 100%;
}

.letter-img > img {
    width: 100%;
}

.letter p {
    font-family: 'NonBureauExtended-Bold';
    font-size:  .75em;
    letter-spacing: .07em;
    padding-inline: calc(var(--ui-step) * 3);
}



@media (min-width: 768px) {

    .lang-switcher {
        font-size:  1em;
    }

    h1 {
        font-size: 3em;
        max-width: 75%;
    }

    header p {
        max-width: 75%;
    }

    .letter-item {
        width: 50%;
    }

    .letter p {
        font-size:  1em;
    } 

}

@media (min-width: 992px) {

    .lang-switcher {
        font-size:  1.25em;
    }

    header p {
        font-size:  1.25em;
    }

    .letter-item {
        width: 33.333%;
    }

    .letter p {
        font-size:  1.125em;
    } 

}

@media (min-width: 1400px) {

    .page {
        padding-inline: calc(var(--ui-step) * 16);
    }

    h1 {
        font-size: 3em;
    }

    .letter-item {
        width: 25%;
    }

    .letter-item:nth-child(11n + 9),
    .letter-item:nth-child(11n + 10),
    .letter-item:nth-child(11n + 11) {
        width: 33%;
    }

    .letter-item:nth-child(11n + 9) .letter,
    .letter-item:nth-child(11n + 10) .letter,
    .letter-item:nth-child(11n + 11) .letter {
        width: 65%;
    }

}

@media (min-width: 1800px) {
    
}



/* letter page template */



body:has(.lp) {
    background: url(/wp-content/uploads/img/bg.jpg), #333;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.lp {
    width: 100%;
    max-width: 1200px;
    padding-block: calc(var(--ui-step) * 8);
    margin-inline: auto;
}

.lp-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding-inline: calc(var(--ui-step) * 3);
    margin-bottom: calc(var(--ui-step) * 5);
}

.back a {
    color: var(--white);
    text-decoration: none;
    font-family: 'NonBureauExtended-Bold';
    font-size:  .75em;
    letter-spacing: .07em;
}

.back a:hover {
    opacity: .8;
}

.lp main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px 0;
}

.lp-left,
.lp-middle,
.lp-right {
    padding-inline: calc(var(--ui-step) * 3);
}

.lp-left {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
}

.lp-left #photoBtn img {
    max-height: 60px;
}

#photoBtn {
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.lp-left a {
    color: var(--white);
    text-underline-offset: 3px;
}

.lp-left a:hover {
    opacity: .8;
}

.fio-date {
    font-family: 'NonBureauExtended-Bold';
    font-weight: 700;
    font-size:  1em;
}

.fio-date-intro {
    display: flex;
    flex-direction: row;
    gap: calc(var(--ui-step) * 3);
}

.intro {
    line-height: 1.2;
}

.intro p {
    margin-bottom: 1em;
}

.lp-middle {
    font-size: 1em;
}

.lp-middle p {
    margin-bottom: 1em;
    line-height: 1.4;
}

.lp-right-img img {
    max-width: 100%;
}

.lp-right-img button {
    transform: rotate(10deg);
    display: block;
    cursor: pointer;
    margin-inline: auto;
}

#letterBtn {
    border: none;
    background-color: transparent;
}

@media (min-width: 768px) {

}

@media (min-width: 992px) {

    .lp-top {
        padding-inline: calc(var(--ui-step) * 6);
        margin-bottom: calc(var(--ui-step) * 8);
    }

    .lp main {
        grid-template-columns: 2fr 5fr 2fr;
        min-height: 80vh;
    }

    .lp-left,
    .lp-middle,
    .lp-right {
        padding-inline: calc(var(--ui-step) * 6);
    }

    .lp-left {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: calc(var(--ui-step) * 8);
    }

    .lp-left #photoBtn img {
        max-height: inherit;
    }
    
    .fio-date-intro {
        flex-direction: column;
    }

    .fio-date {
        font-family: 'NonBureauExtended-Bold';
        font-weight: 700;
        font-size: 1.125em;
        margin-bottom: 1em;
    }

    .tooltip svg {
        display: none;
    }

    .lp-middle {
        font-size: 1.25em;
    }

    .lp-right {
        height: 100%;
    }

    .lp-right-inv {
        height: 100%;
        content: '';
    }

    .lp-right-img {
        position: sticky;
        bottom: 15vh;
    }

    .back a {
        font-size:  1.25em;
    }

}

@media (min-width: 1400px) {

}

@media (min-width: 1800px) {
    
}


/* tooltip */

.tooltip .tooltiptext {
    visibility: hidden;
    width: 80vw;
    max-width: 300px;
    background-color: #555;
    color: var(--white);
    padding: 5px 5px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    top: 100%;
    left: 50%;
    transform:translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}
  
/* Tooltip arrow */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #555 transparent;
}
  
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

@media (min-width: 992px) {

    .tooltip .tooltiptext {
        position: relative;
        display: block;
        visibility: visible;
        width: auto;
        transform: none;
        background-color: transparent;
        padding: 0;
        border-radius: none;
        position: static;
        margin-left: 0;
        opacity: 1;
    }

    .tooltip .tooltiptext::after {
        display: none;
    }

}


/* Modal */


.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}
  
.modal-content {
    background-color: transparent;
    margin: 10vh auto;
    height: 80vh;
    width: max-content;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
}
  
.photoClose,
.letterClose {
    color: var(--white);
    float: right;
    font-size: 1.75em;
    font-weight: bold;
}
  
.photoClose:hover,
.letterClose:hover,
.photoClose:focus,
.letterClose:focus {
    color: var(--white);
    text-decoration: none;
    cursor: pointer;
}