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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-image: url("../images/fond_lintisse+gazon_vertical.png");
    background-repeat: repeat;
    background-position: top center;
    font-family: Arial, Helvetica, sans-serif;
}

.site-width {
    max-width: 1160px;
    margin-left: auto;
    margin-right: auto;
}

/* TOP BROWN BAR */

/* même gabarit que .site-footer : toute la largeur, 81px de haut */
.header-bar {
    background: #5b4d3d;
}

.header-inner {
    box-sizing: border-box;
    width: 100%;
    min-height: 81px;
    padding: 0 55px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px 30px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.header-title:hover {
    color: white;
    text-decoration: none;
}

.header-logo {
    height: 70px;
    width: auto;
    flex-shrink: 0;
    filter: brightness(0) invert(1); /* logo brun (fond transparent) affiché en blanc, comme le titre */
}

.header-title-name {
    display: block;
    font-size: 28px;
    font-weight: bold;
    line-height: 1.1;
}

.header-title-tagline {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    line-height: 1.1;
}

.search-zone {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-zone input {
    height: 20px;
    width: 150px;
}

.search-zone button {
    height: 26px;
}

.search-zone a {
    color: white;
    font-size: 13px;
}

/* en-tête toujours visible au défilement */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: inherit;
}

/* search */

.search-results {
    list-style: none;
    padding-left: 0;
    margin-top: 20px;
}

.search-results li {
    margin-bottom: 8px;
}

.search-results a {
    color: #7a4f1d;
    font-weight: bold;
    text-decoration: none;
}

.search-results a:hover {
    text-decoration: underline;
}

/* GREEN NAV */

.main-nav {
    height: 50px;
    margin-top: 0; /* collé sous le bandeau brun (le chevauchement servait à l'ancien hero-banner) */
    display: flex;
    overflow: hidden;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 12px 18px rgba(0, 0, 0, 0.25);
    background: #95b52c;
    position: relative;
    z-index: 5;
}

.main-nav a {
    flex: 1;
    color: white;
    text-decoration: none;
    text-align: center;
    font-size: 20px;
    line-height: 50px;
}

.main-nav a:hover,
.main-nav a.active {
    background: linear-gradient(#e98b22, #c75f08);
}

/* CENTER PANEL */

.wrapper {
    width: 100%;
    box-sizing: border-box;
    max-width: 1160px;
    margin: -5px auto 0;
    background-image: url("../images/fond_lintisse_rect.png");
    background-repeat: repeat;
    border-radius: 8px 8px 0 0;
    min-height: 600px;
}

.content .container {
    padding: 45px 55px;
}

/* patrimoine fruitier */

.breadcrumb {
    font-style: italic;
    color: #7b6a55;
}

.page-title {
    color: #d9781f;
    font-size: 28px;
}

.fruitier-intro {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 45px;
    margin-top: 30px;
}

.fruitier-text {
    color: #6b5a45;
    font-size: 16px;
    line-height: 1.35;
}

.fruitier-text a {
    color: #657d18;
    font-weight: bold;
    text-decoration: none;
}

.fruitier-links {
    display: flex;
    flex-direction: column;
}

.fruitier-links a {
    color: #6b5a45;
    text-decoration: none;
    font-size: 20px;
    padding: 5px 0;
    border-bottom: 1px dotted #8b7b67;
}

.fruitier-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 80px;
}

.fruitier-card {
    height: 170px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.fruitier-card.green {
    background: #9ca93d;
}

.fruitier-card.orange {
    background: #df842b;
}

.fruitier-card.yellow {
    background: #dda52d;
}

.card-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon img {
    height: 75px;
    width: auto;
}

.card-title {
    border-top: 1px solid white;
    text-align: center;
    padding: 10px;
    font-size: 22px;
    font-weight: bold;
}

/* patrimoine fruitier variete liste */
.variete-intro {
    color: #6b5a45;
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 40px;
}

.variete-intro h1 {
    font-size: 18px;
    color: #6b5a45;
    margin-bottom: 3px;
}

.variete-intro h2 {
    font-size: 14px;
    color: #6b5a45;
    text-decoration: underline;
    margin-top: 20px;
}

.variete-intro p {
    margin: 10px 0;
}

.breadcrumb {
    font-size: 13px;
    font-style: italic;
    color: #7b6a55;
}

/* variete index clé de détermination */
.determination-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 45px;
    align-items: start;
}

.determination-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.determination-filters label {
    font-size: 11px;
    color: #7b6a55;
    margin-top: 5px;
}

.determination-filters select,
.determination-filters input {
    width: 100%;
    height: 24px;
}


.determination-display {
    align-self: start;
}

.determination-results {
    display: grid;
    grid-template-columns: repeat(4, 140px);
    gap: 18px 28px;
    align-content: start;
    justify-content: start;
}

.determination-results a {
    display: block;
    width: 120px;
    min-height: 28px;

    color: #6b5a45;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.15;
}

.determination-results a:hover {
    text-decoration: underline;
}

/* pagination de variete */

.pagination {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.pagination a,
.pagination span {
    color: #2f2f2f;
    text-decoration: none;
    font-size: 13px;
}

.pagination .current {
    background: #333;
    color: white;
    padding: 3px 7px;
    border-radius: 2px;
}

/* variete detail (fiche variétale) */

.variete-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.variete-thumbnail {
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.variete-detail-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
}

.variete-detail-left {
    flex: 1;
}

.variete-image-box {
    flex: 0 0 320px;
}

.variete-detail-title {
    color: #d9781f;
    font-size: 26px;
    margin: 0 0 25px;
}

.variete-synonyms {
    color: #d9781f;
    font-style: italic;
    font-size: 13px;
}

.variete-detail-summary {
    color: #6b5a45;
    font-size: 13px;
    line-height: 1.25;
}

.variete-detail-menu {
    margin-top: 70px;
}

.variete-detail-menu a {
    display: block;
    color: #6b5a45;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0 4px 18px;
    border-bottom: 1px dotted #6b5a45;
    position: relative;
}

.variete-detail-menu a::before {
    content: "›";
    position: absolute;
    left: 0;
    top: 3px;
    background: #d9781f;
    color: white;
    border-radius: 50%;
    width: 13px;
    height: 13px;
    line-height: 12px;
    text-align: center;
    font-size: 12px;
}

.variete-image-box {
    text-align: center;
}

.variete-image-box img,
.variete-image-placeholder {
    width: 350px;
    height: 350px;
    border: 4px solid white;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    background: #e6e0cf;
}

.variete-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7b6a55;
    font-size: 16px;
}

.image-dots {
    margin-top: 12px;
}

.image-dots span {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: #5b5b5b;
    border-radius: 50%;
    margin: 0 4px;
}

.variete-detail-sections {
    margin-top: 30px;
    border: 1px dotted #6b5a45;
    padding: 18px;
    background: #ffffff;
    color: #6b5a45;
    font-style: italic;
}

.variete-detail-section {
    position: relative;
    margin-bottom: 25px;
}

.variete-detail-section h2 {
    color: #d9781f;
    font-size: 16px;
    margin: 0 0 10px;
    font-style: normal;
}

.variete-detail-section p,
.variete-detail-section .fiche-item {
    font-size: 13px;
    line-height: 1.25;
    margin: 2px 0;
    font-style: italic;
}

.variete-detail-section strong {
    font-weight: bold;
    font-style: italic;
}

.section-top-link {
    position: absolute;
    right: 10px;
    top: 0;
    color: #657d18;
    font-size: 10px;
    font-weight: bold;
    text-decoration: none;
}

/* breadcrumb  */
.breadcrumb a {
    color: #8a7b63;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* qui-sommes-nous */

.who-grid {
    width: 520px;
    margin: 25px auto 80px;
    display: grid;
    grid-template-columns: 250px 190px;
    column-gap: 30px;
    row-gap: 90px;
    color: #6b5a45;
    font-size: 14px;
    line-height: 1.25;
}

.who-logo-craw {
    width: 260px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.who-block-enrx {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    grid-column: 1 / span 2;
}

.who-logo-enrx {
    height: 120px;
    width: auto;
    flex-shrink: 0;
}

.who-text-enrx {
    max-width: 320px;
    text-align: justify;
}

.who-grid {
    width: 650px;
    margin: 25px auto 80px;
    display: grid;
    grid-template-columns: 260px 260px;
    column-gap: 40px;
    row-gap: 80px;
}

.who-text p,
.who-block p {
    margin: 0 0 16px;
}

.who-text-craw {
    text-align: justify;
}

/* footer */
.site-footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
    margin-top: auto;
    box-sizing: border-box;
    width: 100%;
    min-height: 81px; /* logos 60px + marges, même hauteur que l'en-tête */
    padding: 0 55px;
    background: #5b4d3d;
    color: white;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px 30px;
}

.site-footer a {
    color: white;
}

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

.footer-logos {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-logos a {
    display: block;
}

.footer-logos img {
    height: 60px;
    width: auto;
    display: block;
}

.footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* page-text or home */
.page-text {
    color: #6b5a45;
    line-height: 1.5;
}

.page-text p {
    margin-bottom: 1.5rem;
}

/* login */
.login-page {
    padding: 28px 60px 40px;
    min-height: 360px;
}

.breadcrumb {
    color: #7b6a50;
    font-size: 16px;
    margin-bottom: 18px;
}

.login-tabs {
    border-bottom: 1px solid #aaa;
    margin-bottom: 28px;
}

.login-tab {
    display: inline-block;
    padding: 4px 18px;
    border: 1px solid #aaa;
    border-bottom: none;
    background: #ddd;
    color: #6b5a45;
    font-size: 18px;
}

.login-tab.active {
    background: white;
    color: black;
}

.vip-login-form {
    max-width: 620px;
}

.form-row {
    margin-bottom: 24px;
}

.form-row label {
    display: block;
    font-weight: bold;
    color: #6b5a45;
    font-size: 18px;
    margin-bottom: 4px;
}

.form-row label span {
    color: red;
}

.form-row input {
    width: 100%;
    height: 25px;
    border: 1px solid #aaa;
    border-radius: 4px;
    font-size: 16px;
}

.form-row p {
    margin: 4px 0 0;
    color: #666;
    font-size: 16px;
}

.login-button {
    padding: 7px 15px;
    border: 1px solid #aaa;
    border-radius: 5px;
    background: #e5e5e5;
    color: #6b5a45;
    font-weight: bold;
    cursor: pointer;
}

.login-error {
    color: #b00000;
    font-weight: bold;
}

.form-group-title {
    color: white;
}

/* form, especially the criteria selector */
.criteria-details {
    width: 420px;
    max-width: 100%;
    margin-bottom: 14px;
    border-bottom: 1px dotted #c8bfae;
    padding-bottom: 10px;
}

.criteria-details summary {
    cursor: pointer;
    font-weight: bold;
    color: #6b5a45;
    font-size: 18px;
    margin-bottom: 8px;
}

.criteria-checkbox-list {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid #c8bfae;
    max-height: 220px;
    overflow-y: auto;
}

.criteria-checkbox-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.criteria-checkbox-list li {
    margin-bottom: 5px;
}

.criteria-checkbox-list label {
    font-weight: normal;
    color: #333;
    display: flex;
    gap: 8px;
    align-items: center;
}

.criteria-checkbox-list .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.criteria-checkbox-list .form-check-input {
    margin: 0;
    flex-shrink: 0;
}

.criteria-checkbox-list .form-check-label {
    margin: 0;
}

/* fiche d'identite */

.fiche-identite {
    margin-top: 30px;
    margin-bottom: 10px;

    border: 1px solid #df8a2e;
    background: #fff;
}

.fiche-identite-title {
    margin: 0;
    padding: 12px 14px;

    background: #df872b;
    color: white;

    font-size: 20px;
    font-style: italic;
    font-weight: bold;
}

.fiche-identite-grid {
    padding: 16px 12px 20px;

    column-count: 4;
    column-gap: 28px;
}

.fiche-identite-group {
    break-inside: avoid;
    margin-bottom: 12px;
}

.fiche-identite-group h3 {
    color: #df7b18;
}

.fiche-identite-group p,
.fiche-identite-group .fiche-item {
    color: #666;
}

.fiche-identite-group p strong,
.fiche-identite-group .fiche-item strong {
    color: #555;
}

/* VARIETE ADD/EDIT FORM - deterministic custom admin UI */

.bdm-variete-form-page {
    width: 100%;
}

.bdm-variete-form-title {
    margin: 0 0 22px;
    color: #000;
    font-size: 30px;
    line-height: 1.15;
}

.bdm-variete-form {
    width: 100%;
}

.bdm-variete-section {
    width: 100%;
    margin: 0 0 22px;
    border: 1px dotted #c8bfae;
    background: rgba(255, 255, 255, 0.42);
}

.bdm-variete-section summary {
    cursor: pointer;
    display: block;
    padding: 8px 13px;
    background: #df8425;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    font-style: italic;
    line-height: 1.2;
}

.bdm-variete-section summary::-webkit-details-marker {
    display: none;
}

.bdm-variete-section summary::before {
    content: "▾";
    display: inline-block;
    margin-right: 7px;
    font-size: 13px;
}

.bdm-variete-section:not([open]) summary::before {
    content: "▸";
}

.bdm-variete-section-body {
    padding: 14px 16px 18px;
}

.bdm-variete-text-field {
    margin-bottom: 14px;
}

.bdm-variete-text-field label,
.bdm-variete-choice-title {
    display: block;
    margin: 0 0 5px;
    color: #6b5a45;
    font-weight: bold;
    font-size: 15px;
}

.bdm-variete-text-field textarea,
.bdm-variete-text-field input,
.bdm-variete-text-field select {
    display: block;
    width: calc(100% - 24px);
    max-width: none;
    box-sizing: border-box;
    border: 1px solid #b8ad9a;
    border-radius: 3px;
    background: #ffffff;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.25;
    padding: 6px 8px;
}

.bdm-variete-text-field textarea {
    height: 72px;
    min-height: 72px;
    resize: vertical;
}

.bdm-variete-text-field input[type="number"],
.bdm-variete-text-field input[type="text"],
.bdm-variete-text-field select {
    height: 32px;
}

.bdm-variete-choice-field {
    margin-bottom: 16px;
}

.bdm-variete-choice-box {
    width: calc(100% - 24px);
    max-width: none;
    max-height: 145px;
    overflow-y: auto;
    box-sizing: border-box;
    border: 1px solid #d6d0c2;
    background: rgba(255, 255, 255, 0.55);
    padding: 7px 9px;
}

.bdm-variete-choice-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bdm-variete-choice-box li {
    margin: 0 0 4px;
    padding: 0;
}

.bdm-variete-choice-box label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #222;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.2;
}

.bdm-variete-choice-box input[type="checkbox"] {
    margin: 0;
    flex: 0 0 auto;
}

.bdm-variete-save-zone {
    margin-top: 26px;
}

.bdm-variete-save-button {
    padding: 8px 16px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #e5e5e5;
    color: #6b5a45;
    font-weight: bold;
    cursor: pointer;
}

.bdm-variete-save-button:hover {
    background: #f1f1f1;
}

.bdm-variete-links {
    margin-top: 18px;
}

.bdm-variete-links a {
    color: #6b5a45;
    font-weight: bold;
    text-decoration: none;
    margin-right: 14px;
}

.bdm-variete-links a:hover {
    text-decoration: underline;
}

.form-error {
    margin: 5px 0 0;
    color: #b00000;
    font-weight: bold;
}

/* blog (page d'accueil) */
.blog-article {display: flow-root; margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid #e3dccf;}
.blog-article:last-child {border-bottom: 0;}
.blog-title {margin: 0 0 .25rem; font-size: 1.4rem;}
.blog-date {margin: 0 0 1rem; font-size: .9rem; color: #8a7a64;}
.blog-images {float: right; display: flex; flex-direction: column; gap: 12px; margin: 0 0 12px 24px; max-width: 280px;}
.blog-images figure {margin: 0;}
.blog-images img {display: block; max-width: 100%; height: auto;}
.blog-images figcaption {font-size: .85rem; margin-top: 4px;}
.blog-texte p {margin-bottom: 1rem;}
.blog-texte table {border-collapse: collapse;}
.blog-texte td, .blog-texte th {border: 1px solid #d8cfbf; padding: 4px 8px;}
.blog-liens {clear: both; margin: 1rem 0 0; padding-left: 1.2rem;}
@media (max-width: 700px) {.blog-images {float: none; max-width: 100%; margin: 0 0 1rem;}}

/* infobulles d'aide des critères (filtres variétés) */
.criteria-head {display: flex; align-items: center; gap: 6px; margin-top: 5px;}
.criteria-head .criteria-label {margin-top: 0;}
.critere-aide {position: relative; display: inline-block; line-height: 1;}
.critere-aide-bouton {width: 15px; height: 15px; padding: 0; border: 1px solid #a8977e; border-radius: 50%; background: #fff; color: #7b6a55; font: bold 10px/13px Arial, sans-serif; cursor: help;}
.critere-aide-bouton:focus-visible {outline: 2px solid #7b6a55; outline-offset: 1px;}
.critere-aide-bulle {display: none; position: absolute; z-index: 50; top: 50%; left: calc(100% + 10px); transform: translateY(-50%); width: max-content; max-width: min(560px, 70vw); padding: 12px 16px; background: #fff; border: 1px solid #d8d0c2; box-shadow: 0 3px 12px rgba(0,0,0,.2); color: #333; font: 14px/1.45 Arial, sans-serif; text-align: left;}
.critere-aide:hover .critere-aide-bulle, .critere-aide:focus-within .critere-aide-bulle {display: block;}
.critere-aide-bulle img {display: block; max-width: 100%; height: auto;}
.critere-aide-texte {max-width: 420px;}
.critere-aide-texte + img {margin-top: 10px;}
.critere-aide-texte p, .critere-aide-texte ul {margin: 0 0 .5em;}
.critere-aide-texte ul {padding-left: 1.1em;}
@media (max-width: 700px) {
    .critere-aide-bulle {position: fixed; top: auto; bottom: 10px; left: 10px; right: 10px; transform: none; width: auto; max-width: none; max-height: 70vh; overflow: auto;}
}
/* sur la fiche variété : bulle sous le « ? », texte droit */
.fiche-item .critere-aide {vertical-align: middle;}
.fiche-item .critere-aide-bulle {top: calc(100% + 6px); left: -10px; transform: none; font-style: normal; font-weight: normal;}
.fiche-item .critere-aide-bulle strong, .fiche-item .critere-aide-bulle b {font-weight: bold;}

/* recherche de variétés (liste / identification) */
.varietes-nom {display: flex; gap: 4px;}
.varietes-nom input {flex: 1; min-width: 0;}
.varietes-nom button {height: 24px; padding: 0 8px;}
.determination-filters select.is-selected {border-color: #df7b18; background: #fff4e8;}
.varietes-total {font-size: .7em; font-weight: normal; color: #8a7a64;}
.varietes-autre-recherche {margin: 0 0 1rem;}
.varietes-autre-recherche a {font-weight: bold;}
