@import url("theme.css");
@import url("pagination.css");

html,
body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    width: min(100%, 1440px);
    margin-inline: auto;
    padding: 0 2px 30px;
    color: var(--np-text);
    background: transparent;
}

h1,
h2,
h3,
h4 {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0 6px;
    color: #FFFFFF;
    background: var(--np-heading-accent);
    text-align: center;
    font-weight: 600;
}

h1 {
    min-height: 30px;
    font-size: 22px;
    line-height: 30px;
}

h2 {
    min-height: 22px;
    font-size: 16px;
    line-height: 22px;
}

h3 {
    min-height: 18px;
    font-size: 13px;
    line-height: 18px;
}

h4 {
    min-height: 18px;
    font-size: 12px;
    line-height: 18px;
}

p {
    margin: 0;
    padding: 0;
}

a {
    color: var(--np-text);
    text-decoration: none;
}

/* En-tête ------------------------------------------------------------------ */
header {
    --np-banner-height: 100px;
    position: relative;
    min-width: 300px;
    height: calc(60px + var(--np-banner-height));
    min-height: 160px;
    margin-top: 2px;
    overflow: visible;
    border: 1px solid var(--np-border);
    background-color: var(--np-panel);
    box-shadow: var(--np-shadow);
}

header > h1 {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    height: 30px;
}

#test_signin {
    position: relative;
    z-index: 5;
    width: 100%;
    min-height: 30px;
    background: color-mix(in srgb, var(--np-surface) 30%, transparent);
}

#test_signin:has(.header-theme[open]) {
    z-index: 10050;
}

.signin-row,
.signin-login-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    margin-top: 2px;
    white-space: nowrap;
}

.signin-row > a,
.signin-login-row > a {
    display: flex;
    align-items: center;
}

.parametre-link {
    margin-right: auto;
}

.signin,
#msgbtn,
#chatbtn,
.parametre,
.header-theme > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-height: 30px;
    margin: 0;
    padding: 1px 8px;
    border: 1px solid var(--np-accent);
    background: var(--np-heading-accent);
    color: #FFFFFF;
    line-height: 26px;
}

.signin {
    min-width: 100px;
}

.parametre {
    width: 100px;
}

.signin:hover,
#msgbtn:hover,
#chatbtn:hover,
.parametre:hover,
.header-theme > summary:hover {
    background-color: var(--np-accent-hover);
}

#msgbtn,
#chatbtn {
    width: 30px;
    min-width: 30px;
    padding: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 24px 24px;
}

#msgbtn { background-image: url('../images/header-mail.svg'); }
#chatbtn { background-image: url('../images/header-chat.svg'); }

.signin-login-row {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
    white-space: nowrap;
}

.signin-form {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
    margin: 0;
    order: 1;
}

.signin-inline-form {
    display: flex;
    align-items: center;
    margin: 0;
}

.password-recovery {
    display: inline-flex;
    flex: 0 0 auto;
    order: 2;
}

.registration-link {
    display: inline-flex;
    flex: 0 0 auto;
    order: 3;
}

#inputbannierepseudo,
#inputbannierepass {
    width: 100px;
    height: 25px;
    margin: 0;
    padding: 1px 4px;
    box-sizing: border-box;
}

#avatar {
    width: 100%;
    height: 100%;
    background: center / contain no-repeat url('../images/no_avatar.png');
}

#avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#RightHeader {
    position: absolute;
    top: 30px;
    right: 0;
    bottom: 30px;
    z-index: 2;
    width: var(--np-banner-height);
    height: auto;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--np-border) 70%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--np-surface) 45%, transparent);
    backdrop-filter: blur(3px);
}

.header-theme {
    position: relative;
    flex: 0 0 auto;
}

.header-theme > summary {
    min-width: 70px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.header-theme > summary::-webkit-details-marker {
    display: none;
}

.header-theme > summary::after {
    content: " ▾";
    margin-left: 4px;
}

.header-theme[open] > summary::after {
    content: " ▴";
}

.header-theme-panel {
    position: absolute;
    top: calc(100% + 3px);
    right: 0;
    z-index: 10030;
    display: grid;
    gap: 7px;
    width: 244px;
    padding: 8px;
    border: 1px solid var(--np-accent);
    background: var(--np-surface);
    color: var(--np-text);
    box-shadow: var(--np-shadow);
}

.header-theme-modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.header-theme-modes label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 26px;
    border: 1px solid var(--np-border);
    background: var(--np-panel);
    cursor: pointer;
    font-size: 12px;
}

.header-theme-modes label:has(input:checked) {
    border-color: var(--np-accent);
    background: var(--np-accent-soft);
}

.header-theme-colors {
    display: grid;
    grid-template-columns: repeat(8, 24px);
    justify-content: center;
    gap: 4px;
}

.header-theme-swatch {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.header-theme-swatch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.header-theme-swatch span {
    display: block;
    width: 100%;
    height: 100%;
    border: 2px solid var(--np-border);
    background: var(--swatch-color);
}

.header-theme-swatch input:checked + span {
    border-color: var(--np-text);
    box-shadow: 0 0 0 2px var(--np-accent-soft);
}

.header-theme-apply {
    width: 100%;
    min-height: 28px;
    border: 1px solid var(--np-accent);
    background: var(--np-accent-soft);
    color: var(--np-text);
}

.header-theme-apply:hover {
    background: var(--np-accent-hover);
}

/* Menu --------------------------------------------------------------------- */
#menu {
    position: sticky;
    top: 0;
    z-index: 9000;
    width: 100%;
    margin-top: 6px;
}

#menu nav {
    width: 100%;
    min-height: 26px;
    border: 1px solid var(--np-accent);
    background: var(--np-heading-accent);
}

#menu nav a {
    display: block;
    width: 100%;
    color: #FFFFFF;
}

#menu nav > ul {
    display: flex;
    width: 100%;
    min-height: 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.MenuPrincipal {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 26px;
    color: #FFFFFF;
    text-align: center;
    font-size: clamp(14px, 1.65vw, 18px);
    line-height: 26px;
    list-style: none;
}

.MenuPrincipal:hover,
.MenuSecondaire:hover {
    background: var(--np-accent-hover);
}

.MenuDeroulant {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.MenuPrincipal:hover > .MenuDeroulant,
.MenuPrincipal:focus-within > .MenuDeroulant {
    display: block;
}

.MenuSecondaire {
    display: block;
    width: 100%;
    min-height: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    background: var(--np-heading-accent);
    color: #FFFFFF;
    text-align: center;
    font-size: 14px;
    line-height: 26px;
    list-style: none;
}

.MenuSecondaire:active {
    text-shadow: 0 0 5px #FFFFFF;
}

/* Structure principale ----------------------------------------------------- */
section {
    display: grid;
    grid-template-columns: minmax(0, 1120px) minmax(200px, 310px);
    justify-content: space-between;
    align-items: start;
    gap: 8px;
    width: 100%;
    max-width: 1440px;
    margin: 8px auto 0;
}

article {
    min-width: 0;
    width: 100%;
    max-width: 1120px;
    padding-bottom: 28px;
    overflow: hidden;
}

aside {
    min-width: 0;
    width: 100%;
    max-width: 310px;
    margin-bottom: 30px;
    overflow: hidden;
    background: transparent;
}

footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    width: 100%;
    min-height: 20px;
    background: var(--np-accent);
    color: var(--np-text);
    text-align: center;
    line-height: 20px;
}

/* Cartes de l'accueil / Info ---------------------------------------------- */
#conteneur {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr);
    grid-template-areas:
        "title title"
        "logo info"
        "logo content";
    align-items: start;
    min-height: 170px;
    margin: 0 0 10px;
    overflow: hidden;
    border: 1px solid var(--np-border);
    background: var(--np-surface);
    box-shadow: var(--np-shadow);
}

#titre {
    grid-area: title;
    min-height: 30px;
    line-height: 30px;
}

#logo {
    grid-area: logo;
    width: 125px;
    height: 125px;
    margin: 8px;
    border: 1px solid var(--np-border);
    background: var(--np-panel);
}

#conteneur > #info {
    grid-area: info;
    min-width: 0;
    padding: 7px 10px 0 0;
    color: var(--np-muted);
}

#conteneur > #contenu {
    grid-area: content;
    min-width: 0;
    padding: 7px 10px 10px 0;
    color: var(--np-text);
    line-height: 1.4;
}

#button_edition {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    background: center / 21px 21px no-repeat url('../images/admin/actions/edit.svg');
}

#button_edition:hover {
    background-color: var(--np-accent-hover);
}

@media (max-width: 900px) {
    section {
        grid-template-columns: minmax(0, 1fr);
    }

    aside {
        display: none;
    }

    article {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .signin-row,
    .signin-login-row {
        overflow-x: auto;
        justify-content: flex-end;
    }

    .header-theme-panel {
        position: fixed;
        top: 34px;
        right: 6px;
    }

    .signin {
        min-width: 86px;
        padding-inline: 5px;
    }

    #inputbannierepseudo,
    #inputbannierepass {
        width: 90px;
        min-width: 80px;
    }

    body {
        padding-inline: 0;
    }

    header {
        margin-inline: 0;
    }

    .MenuPrincipal {
        font-size: clamp(11px, 2.8vw, 14px);
    }

    .MenuSecondaire {
        font-size: 12px;
    }

    #conteneur {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    #logo {
        width: 85px;
        height: 85px;
        margin: 6px;
    }
}
