
/* FUNTANELLA VIVA CORSA */
/* ADMINISTRATION - V13.29 */

[hidden] {
    display: none !important;
}

.admin-body {
    background: #f4f6f5;
}

.admin-wrap {
    max-width: 1100px;
    margin: auto;
    padding: 45px 35px 65px;
}

.admin-heading {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    align-items: center;
}

.admin-heading h1 {
    font-size: 43px;
    margin: 0 0 13px;
}

.admin-heading .eyebrow {
    margin-bottom: 12px;
}

.admin-heading p:not(.eyebrow) {
    color: var(--muted);
    font-size: 14px;
}

.admin-status {
    font-size: 13px;
    padding: 12px 17px;
    background: #e9eef1;
    border-left: 3px solid #7894a8;
    min-height: 46px;
    margin: 20px 0;
}

.admin-status.error {
    background: #fff0ec;
    border-color: #a44128;
    color: #81311e;
}

.admin-status.success {
    background: #e6f1e9;
    border-color: #2d6947;
    color: #205139;
}

.admin-panel {
    background: #fff;
    border: 1px solid #dbe1df;
    padding: 32px;
}

.admin-panel h2 {
    font-size: 30px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.admin-panel h3 {
    font-size: 22px;
    margin-top: 35px;
}

.admin-panel p {
    font-size: 13px;
    color: var(--muted);
}

.admin-panel label {
    display: block;
    font-size: 12px;
    margin-top: 15px;
}

.admin-panel textarea {
    margin-bottom: 8px;
    line-height: 1.65;
}

.admin-panel input {
    margin-bottom: 8px;
}

.admin-panel input,
.admin-panel textarea {
    font-size: 16px;
}

.auth-panel {
    max-width: 540px;
    margin: 30px auto;
}

.auth-panel .button {
    margin-top: 20px;
}

/* ONGLETS */

.admin-tabs {
    display: flex;
    background: #e9eeec;
    border: 1px solid #dbe1df;
    border-bottom: 0;
    margin-top: 30px;
    overflow: auto;
    scrollbar-width: thin;
}

.admin-tabs button {
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 17px 22px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 13px;
    color: var(--muted);
}

.admin-tabs button[aria-selected=true] {
    background: white;
    border-bottom-color: var(--gold);
    color: var(--navy);
    font-weight: bold;
}

/* BARRE D'ENREGISTREMENT */

.editor-toolbar {
    background: var(--navy);
    color: #fff;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    position: sticky;
    top: 0;
    z-index: 12;
}

.editor-toolbar small {
    display: block;
    font-size: 11px;
    color: #ccd6de;
    margin-top: 3px;
}

.editor-toolbar .button {
    background: #d5b578;
    color: #102f4b;
    white-space: nowrap;
}

.save-actions,
.rich-validation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.rich-validation {
    margin: 10px 0 20px;
}

/* BOUTONS ET COMMANDES */

.row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.secondary {
    background: #f5f3ed;
    border-color: #c5bcab;
    color: var(--navy);
}

.secondary:hover {
    background: #ece7db;
}

.quiet {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.admin-panel .button {
    margin: 8px 8px 8px 0;
}

button:disabled,
.upload-button:has(input:disabled) {
    opacity: .5;
    cursor: not-allowed;
}

.order-actions {
    display: flex;
    gap: 12px;
}

/* CARTES ET RUBRIQUES */

.item-card {
    background: #f8f9f8;
    border: 1px solid #dde3df;
    margin: 20px 0;
    padding: 22px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.item-header strong {
    font-size: 14px;
}

.item-header > div {
    display: flex;
    gap: 12px;
}

.item-card .remove {
    color: #994433;
}

.editor-group {
    border: 1px solid #dbe1df;
    padding: 16px;
    margin: 15px 0;
    background: #fff;
}

.editor-group summary {
    font-size: 15px;
}

.group-body {
    padding-top: 18px;
}

.check-row {
    display: flex !important;
    align-items: center;
    gap: 12px;
}

.check-row input {
    width: 20px;
    margin: 0;
}

.admin-panel input[type=color] {
    width: 100px;
    height: 48px;
}

.admin-body header {
    position: relative;
}

#password-form {
    max-width: 420px;
}

#account-name {
    font-size: 11px;
    display: block;
    text-align: right;
    color: var(--muted);
}

#status {
    scroll-margin-top: 150px;
}

.admin-panel .form-note {
    font-size: 11px;
}

/* PHOTOS ET VIDEOS */

.item-card img,
.media-preview {
    max-height: 160px;
    max-width: 100%;
    object-fit: contain;
    margin-top: 15px;
}

.media-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.admin-panel .upload-button {
    display: inline-flex;
    align-items: center;
    margin: 0;
    font-size: 12px;
    cursor: pointer;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.media-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.media-card video,
.media-card iframe,
.video-consent {
    width: 100%;
    aspect-ratio: 16/9;
    border: 0;
    background: #edf0f1;
}

.media-card h3 {
    font-size: 22px;
    margin-top: 15px;
}

.video-consent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    min-height: 240px;
}

.video-consent p {
    font-size: 12px;
    color: var(--muted);
}

.play-mark {
    font-size: 28px;
    color: var(--gold);
}

.video-consent .button {
    font-size: 11px;
}

.admin-panel video {
    margin-top: 20px;
}

.news-image {
    width: 100%;
    margin-bottom: 20px;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
}

[data-cms=heroTitle] {
    white-space: pre-line;
}

.news-main > p,
.news-side > p {
    white-space: pre-line;
}

.cms-inline-image {
    margin: 20px 0;
    max-width: 100%;
}

.cms-inline-image img {
    display: block;
    width: 100%;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
}

.cms-inline-image figcaption {
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.5;
}

.cms-text-images {
    min-width: 0;
    width: 100%;
}

.inline-images-editor {
    border-left: 2px solid #d5b578;
    padding-left: 12px;
    margin-bottom: 24px;
}

/* STATISTIQUES */

.admin-panel .analytics-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.analytics-card {
    border: 1px solid #dbe1df;
    background: #f8f9f8;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analytics-card span {
    font-size: 14px;
    color: var(--muted);
}

.analytics-card strong {
    font-size: 30px;
    color: var(--navy);
}

.admin-panel .analytics-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 24px;
}

.analytics-table th,
.analytics-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #dbe1df;
    font-size: 14px;
}

.analytics-table th {
    color: var(--navy);
    background: #f4f6f5;
}

.analytics-table td:last-child,
.analytics-table th:last-child {
    text-align: right;
}

/* CONTROLES DE MISE EN FORME */

.format-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin: 8px 0;
}

.format-controls label {
    font-size: 12px;
    max-width: 145px;
}

.format-controls input[type=checkbox] {
    width: auto;
    margin-left: 6px;
}

.format-preview {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid #d8cbb5;
    padding: 12px;
    margin-bottom: 16px;
    background: white;
    color: #102f4b;
}

/* EDITEUR DE TEXTE ENRICHI */

.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
    align-items: center;
}

.rich-toolbar button,
.rich-toolbar select {
    font-size: 13px;
    padding: 7px;
    min-height: 34px;
    width: auto;
    cursor: pointer;
}

.admin-panel .rich-toolbar input[type=color] {
    width: 45px;
    height: 34px;
    padding: 2px;
    cursor: pointer;
}

.admin-panel .rich-editor {
    border: 1px solid #b9c3ca;
    padding: 12px;
    min-height: 140px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    background: white;
    color: #102f4b;
    cursor: text;
    text-align: left;
    box-sizing: border-box;
    max-width: 100%;
}

.rich-editor:focus {
    outline: 2px solid #a9792d;
}

/* Respect des styles choisis dans l'editeur */

.admin-panel .rich-editor p,
.admin-panel .rich-editor div,
.admin-panel .rich-editor span,
.admin-panel .rich-editor li,
.admin-panel .rich-editor ul,
.admin-panel .rich-editor ol {
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    line-height: inherit;
}

.admin-panel .rich-editor p {
    margin: 0 0 10px;
}

.admin-panel .rich-editor div {
    margin: 0;
}

.admin-panel .rich-editor b,
.admin-panel .rich-editor strong {
    font-weight: 700;
}

.admin-panel .rich-editor i,
.admin-panel .rich-editor em {
    font-style: italic;
}

.admin-panel .rich-editor u {
    text-decoration: underline;
}

.admin-panel .rich-editor s {
    text-decoration: line-through;
}

.admin-panel .rich-editor ul {
    list-style-type: disc;
    padding-left: 28px;
    margin: 8px 0;
}

.admin-panel .rich-editor ol {
    list-style-type: decimal;
    padding-left: 28px;
    margin: 8px 0;
}

.admin-panel .rich-editor li {
    display: list-item;
    margin: 4px 0;
}

.admin-panel .rich-editor::selection,
.admin-panel .rich-editor *::selection {
    background: #dce8f3;
}

/* AFFICHAGE TABLETTE ET MOBILE */

@media (max-width: 700px) {

    .admin-wrap {
        padding: 30px 18px;
    }

    .admin-heading {
        display: block;
    }

    .admin-heading h1 {
        font-size: 33px;
    }

    .admin-panel {
        padding: 22px;
    }

    .admin-tabs button {
        padding: 15px;
        font-size: 12px;
    }

    .editor-toolbar,
    .row {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-toolbar .button {
        justify-content: center;
    }

    .item-card {
        padding: 15px;
    }

    .media-grid {
        grid-template-columns: 1fr;
    }

    .admin-heading #account-name {
        text-align: left;
    }

    .admin-panel h2 {
        font-size: 26px;
    }

    .admin-panel .analytics-cards {
        grid-template-columns: 1fr;
    }

    .analytics-card {
        padding: 16px;
    }

    .analytics-table th,
    .analytics-table td {
        padding: 9px 6px;
        font-size: 13px;
    }

    .rich-toolbar {
        gap: 5px;
    }

    .rich-toolbar button,
    .rich-toolbar select {
        min-height: 38px;
    }

    .rich-validation {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 580px) {

    .editor-toolbar {
        padding: 15px;
    }

    .admin-heading h1 {
        font-size: 32px;
    }

    .editor-group {
        padding: 12px;
    }

    .admin-wrap {
        padding-inline: 12px;
    }

    .admin-panel {
        padding: 15px;
    }

    .item-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-tabs button {
        min-height: 48px;
    }

    .admin-panel .rich-editor {
        padding: 10px;
        min-height: 160px;
    }

    .save-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
