/*
Theme Name: Thème Sainte Jeanne Jugan du Désiremont
Author: Axel Parmentier
Description: Thème personnalisé pour le site de la Communauté de paroisses Sainte Jeanne Jugan du Désiremont, janvier 2026
Version: beta-1.0
Requires at least: 6.9
Requires PHP: 8.1.2
 */

:root {
    --brown: #A65F1B;
    --light-brown: #DB7C24;
    --orange: #FE7F01;
    --yellow: #FFDF20;
    --green: #22aa38;
    --orange-hover: #fda54b;
    --green-hover: #42cf58;
    --gradient: linear-gradient(to bottom,rgba(255,255,255,0.2) 0%,rgba(255,255,255,0) 100%);
    --text-shadow: 0 1px rgba(0,0,0,.25);
    --hover-shadow: 0 1px rgba(0,0,0,.25),0 0 15px #fff;
    --normal-text: #4a4a4a;
    --serif: "Liberation", "Times New Roman";
    --white-background: #f8f8f8;
    --light-background: #f3f3f3;
    --light-background-hover: #f3e0ce;
}

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

p, h1, h2, h3, h4, h5, figure {
    all: unset;
}

input:focus, textarea:focus {
    outline: none;
}

input[type="submit"] {
    all: unset;
    cursor: pointer;
}

textarea {
    resize: none;
}

summary {
    user-select: none;
    cursor: pointer;
}

body {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
}

.max-width {
    margin: auto;
    width: 80%;
    max-width: 1800px;
}

.no-select {
    user-select: none;
}

header {
    position: relative;
    display: flex;
}

#logo-place {
    display: flex;
    justify-content: center;
    width: 10%;
    min-width: 118px;
}

#logo {
    padding: 10px 40px 0 10px;
}

#logo img {
    max-width: 135px;
    max-height: 135px;
    width: 100%;
}

nav {
    display: flex;
    flex-direction: column;
    margin-right: 20px;
    width: 90%;
}

#upper-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
}

#site-title {
    display: flex;
    flex-direction: column;
    color: var(--brown);
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: var(--serif), serif;
    span:first-child {
        font-size: 16px;
    }
}

#upper-right {
    display: flex;
    align-items: center;
    column-gap: 20px;
}

#location {
    display: flex;
    column-gap: 5px;
    color: var(--normal-text);
    &:hover {
        color: var(--orange);
    }
    svg {
        height: 16px;
    }
    span {
        font-size: 14px;
        font-weight: bold;
    }
}

#login {
    color: var(--normal-text);
    &:hover {
        color: var(--green);
    }
}

#home-svg {
    width: 20px;
}

#menu-part-container {
    display: flex;
    flex: 1;
    align-items: center;
    width: 100%;
}

#menu-part {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

#main-menu {
    display: flex;
    & > li {
        position: relative;
        display: flex;
        &.current-menu-item, &.current_page_ancestor {
            border-bottom: 4px solid var(--light-brown);
        }
        &:hover > a {
            color: #fff;
            background: var(--light-brown);
            svg {
                color: #fff;
            }
        }
        & > a {
            display: flex;
            justify-content: center;
            align-items: center;
            column-gap: 8px;
            padding: 10px 20px;
            color: var(--normal-text);
            font-weight: bold;
            text-align: center;
            svg {
                width: 20px;
                height: 20px;
                color: var(--normal-text);
            }
        }
    }
    .sub-menu {
        position: absolute;
        top: calc(100% - 2px);
        left: 0;
        z-index: 20000;
        display: none;
        flex-direction: column;
        border: 2px solid var(--light-brown);
        background: #fff;
        box-shadow: 4px 4px 4px gray;
        a {
            display: block;
            padding: 10px 18px;
            font-weight: bold;
            color: var(--normal-text);
            white-space: nowrap;
            &:hover {
                color:var(--light-brown);
            }
        }
        li {
            &.current-menu-item a {
                color: var(--light-brown);
            }
            &:first-child a {
                padding-top: 20px;
            }
            &:last-child a {
                padding-bottom: 20px;
            }
        }
    }
}

#main-menu > li:first-child a {
    padding-left: 10px;
    padding-right: 10px;
}

#main-menu li:hover .sub-menu {
    display: flex;
}

#mobile-menu-button {
    display: none;
}

.menu-button {
    column-gap: 10px;
    align-items: center;
    flex-shrink: 0;
    align-self: center;
    border-radius: 6px;
    border: 2px solid var(--normal-text);
    padding: 5px 10px;
    color: var(--normal-text);
    font-weight: bold;
    min-height: 34px;
}

.burger-menu {
    display: flex;
    flex-direction: column;
    row-gap: 2px;
    width: 16px;
    div {
        border: 1px solid var(--normal-text);
        width: 100%;
    }
}

#mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 720000;
    display: flex;
    flex-direction: column;
    row-gap: 20px;
    padding: 40px 20px;
    background: var(--white-background);
    color: var(--normal-text);
    a {
        color: var(--normal-text);
    }
    &.hidden {
        display: none;
    }
}

#mobile-menu-menu {
    display: flex;
    flex-direction: column;
    .selected {
        color: var(--light-brown);
    }
    & > li {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid lightgray;
        padding: 16px 0;
    }
    & > li > a {
        position: relative;
        font-size: 18px;
        font-weight: bold;
        &.expand {
            padding-right: 10px;
            &::after {
                content: "\276F";
                position: absolute;
                top: 50%;
                left: 100%;
                transform: translateY(-50%) rotate(90deg);
            }
        }
        &.open::after {
            transform: translateY(-50%) rotate(90deg) scaleX(-1);
        }
    }
    li ul {
        display: flex;
        flex-direction: column;
        &.hidden {
            display: none;
        }
        li a {
            display: block;
            padding: 10px;
            font-weight: bold;
            color: var(--normal-text);
        }
        li:first-child a {
            padding-top: 20px;
        }
    }
}

.fullscreen-menu-top-part {
    display: flex;
    justify-content: space-between;
    h3 {
        font-size: 28px;
        font-weight: bold;
        color: var(--brown);
    }
}

#fullscreen-menu-right {
    display: flex;
    column-gap: 40px;
    align-items: center;
}

#fullscreen-menu-search {
    display: flex;
    column-gap: 10px;
    align-items: center;
    padding: 0;
    span {
        font-size: 18px;
        font-weight: bold;
    }
}

.exit-modal {
    position: relative;
    width: 40px;
    height: 40px;
    &::before, &::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        border-top: 4px solid var(--normal-text);
        width: 100%;
    }
    &::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    &::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }
}

#mobile-menu-menus {
    display: flex;
    flex-direction: column;
    row-gap: 40px;
    overflow: auto;
    #menu-aside {
        width: 100%;
    }
}

#mobile-other-buttons {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    font-weight: bold;
    a {
        display: flex;
        column-gap: 10px;
        svg {
            height: 16px;
        }
    }
}

header.fixed {
    #logo {
        position: fixed;
        top: 0;
        img {
            width: 40px;
            height: 40px;
            min-width: unset;
            min-height: unset;
        }
        z-index: 72000;
    }
    #menu-part-container {
        position: fixed;
        top: 0;
        left: 0;
        padding: 10px 10px 10px 10%;
        z-index: 10000;
        background: #fff;
    }
}

body:has(#wpadminbar) header.fixed {
    #logo, #menu-part-container {
        top: 32px;
    }
}

#horizontal-buttons {
    display: flex;
    flex-shrink: 0;
    align-self: center;
    column-gap: 10px;
}

#horizontal-buttons a {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    color: #fff;
    font-weight: bold;
}

a.search-button {
    padding-left: 10px;
    padding-right: 10px;
    svg {
        height: 20px;
        color: var(--normal-text);
    }
}

#horizontal-buttons .search-button {
    background: var(--orange);
    &:hover {
        background: var(--orange-hover);
    }
    svg {
        color: #fff;
    }
}

.search-button:hover svg {
    color: #fff;
}

a#mass-hours {
    display: none;
    background: var(--orange);
    &:hover {
        background: var(--orange-hover);
    }
    svg {
        width: 20px;
    }
}

#donate-button {
    background: var(--green);
    &:hover {
        background: var(--green-hover);
    }
}

#principal {
    background: var(--white-background);
    min-height: 72vh;
}

#principal-center {
    display: flex;
    column-gap: 40px;
    padding-top: 20px;
    padding-bottom: 20px;
}

main {
    flex: 1;
}

#main-navigation {
    margin-bottom: 20px;
    font-size: 14px;
    font-style: italic;
    color: var(--brown);
    a {
        color: var(--brown);
        &:hover {
            text-decoration: underline;
        }
    }
}

main h2 {
    display: block;
    margin: 10px 0;
    font-size: 28px;
    font-weight: bold;
    color: var(--brown);
}

article {
    display: flex;
    flex-direction: column;
}

article p {
    padding: 10px 0;
}

aside {
    margin-top: 40px;
}

#menu-aside {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    row-gap: 20px;
    width: 400px;
    & > li > a {
        display: inline-block;
        margin-bottom: 14px;
        position: relative;
        font-size: 20px;
        font-weight: bold;
        text-transform: uppercase;
        z-index: 1;
        color: #000;
        pointer-events: none;
        &::after {
            content: "";
            position: absolute;
            top: 14px;
            left: 8px;
            border-bottom: 12px solid var(--orange);
            width: 100%;
            z-index: -1;
        }
    }
    & > li:nth-child(even) > a::after {
        border-color: var(--green-hover);
    }
    & > li > ul {
        display: flex;
        flex-direction: column;
        row-gap: 5px;
        li::before {
            content: "- ";
        }
        a {
            color: #000;
            &:hover {
                color: var(--brown);
            }
        }
    }
}

#modal-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    z-index: 20000;
    display: flex;
    align-items: center;
}

#modal {
    border-radius: 8px;
    margin: auto;
    padding: 10px 20px;
    max-width: 80vw;
    max-height: 90vh;
    color: #fff;
    background: var(--white-background);
}

img.click {
    cursor: pointer;
}

#img-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
}

#img-modal-upper-part {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 10px 0;
}

#img-new-tab {
    color: #fff;
    background: var(--green) var(--gradient);
}

#img-modal figure {
    max-width: 100%;
}

#img-modal figure img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

#img-modal figcaption {
    padding: 10px;
    font-weight: bold;
}

.expand-button {
    position: relative;
    user-select: none;
}

.expand-button-title {
    position: relative;
    padding-right: 10px;
    cursor: pointer;
    &.option-button {
        padding-bottom: 10px;
        font-weight: bold;
        color: var(--brown);
    }
    &::after {
        content: "\276F";
        position: absolute;
        left: 100%;
        transform: rotate(90deg);
    }
}

.expand-button:not(:has(.hidden)) .expand-button-title::after {
    transform: rotate(90deg) scaleX(-1);
}

.expand-button-content {
    position: absolute;
    top: 100%;
    z-index: 72000;
    border-radius: 8px;
    background: var(--light-background);
    box-shadow: 4px 4px 4px lightgray;
    &.hidden {
        display: none;
    }
    &.option-list {
        ul {
            display: flex;
            flex-direction: column;
        }
        li {
            &:hover {
                background: var(--light-background-hover);
            }
            &:first-child {
                border-radius: 8px 8px 0 0;
            }
            &:last-child {
                border-radius: 0 0 8px 8px;
            }
        }
        a {
            display: block;
            padding: 10px 20px;
            color: var(--brown);
            &.selected {
                font-weight: bold;
            }
        }
        li.current-cat a {
            font-weight: bold;
        }
    }
    &.right-placed {
        right: -12px;
    }
}

img.wp-post-image {
    margin-bottom: 20px;
    max-width: 100%;
    height: auto;
}

footer {
    padding: 20px 0 5px 0;
    background: var(--brown);
    color: #fff;
}

#footer-center {
    display: flex;
    flex-direction: column;
    row-gap: 20px;
    column-gap: 100px;
    flex-wrap: wrap;
}

footer section {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
}

footer h2 {
    display: flex;
    flex-direction: column;
    font-size: 48px;
    font-family: var(--serif), serif;
    font-weight: bold;
}

footer h2 span:first-child {
    font-size: 44px;
}

footer a {
    color: #fff;
}

footer a:hover {
    text-decoration: underline;
}

footer a.sjjd-social {
    display: flex;
    column-gap: 20px;
    align-items: center;
    img {
        height: 22px;
    }
}

footer h3 {
    font-size: 22px;
    font-weight: bold;
}

footer h4 {
    font-size: 18px;
    font-weight: bold;
}

#menu-bas-de-page {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    & > li {
        & > a {
            font-size: 22px;
            font-weight: bold;
            pointer-events: none;
        }
        ul {
            margin-top: 10px;
        }
    }
}

.footer-vt-list {
    display: flex;
    flex-direction: column;
    row-gap: 5px;
    padding-left: 10px;
    font-size: 18px;
}

.footer-ht-list {
    display: flex;
    column-gap: 40px;
}

.footer-ht-list li {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px 0;
}

.footer-ht-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 10px;
    height: 100%;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    height: 100%;
}

.footer-ht-list img {
    height: 30px;
}

@media (max-width: 1700px) {
    .max-width {
        width: 90%;
    }
    #logo {
        padding-right: 10px;
    }
}

@media (max-width: 1472px) {
    .max-width {
        padding: 0 20px;
        width: 100%;
    }
}

@media (max-width: 1300px) {  
    #menu-aside {
        width: 300px;
    }
}

@media (max-width: 1200px) {
    #menu-aside {
        width: 250px;
    }
}

@media (max-width: 1072px) {
    #main-menu {
        display: none;
    }
    #mobile-menu-button {
        display: flex;
    }
    a#mass-hours {
        display: flex;
    }
    aside {
        display: none;
    }
    #aside-button {
        display: flex;
    }
    header.fixed {
        #logo {
            display: none;
        }
        #menu-part-container {
            padding: 10px;
        }
    }
}

@media (max-width: 782px) {
    body:has(#wpadminbar) header.fixed {
        #logo, #menu-part-container {
            top: 46px;
        }
    }
}

@media (max-width: 700px) {
    #upper-right {
        display: none;
    }
}

@media (max-width: 600px) {
    body:has(#wpadminbar) header.fixed {
        #logo, #menu-part-container {
            top: 0;
        }
    }
}

@media (max-width: 544px) {
    nav {
        margin: 0;
        width: 100%;
    }
    #logo-place {
        min-width: 64px;
        width: 64px;
        height: 64px;
    }
    header:not(.fixed) {
        padding-bottom: 54px;
        #menu-part-container {
            position: absolute;
            bottom: 5px;
            left: 0;
            padding: 0 10px;
        }
    }
    footer h2 {
        font-size: 32px;
    }
    footer h2 span:first-child {
        font-size: 24px;
    }
    footer h3 {
        font-size: 20px;
    }
    footer h4 {
        font-size: 16px;
    }
    .footer-ht-list {
        column-gap: 10px;
    }
}

@media (max-width: 416px) {
    .max-width {
        padding: 0 10px;
    }
}

@media (max-width: 380px) {
    #horizontal-buttons a.search-button {
        display: none;
    }
    #fullscreen-menu-right {
        column-gap: 10px;
    }
}
