/* --------------------------------------------------- */
/* ----------- EDAPHOS Data Portal */
/* --------------------------------------------------- */

/* ---- Barre de filtres ---- */

.portal-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 40px;
}

.portal-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-filter {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #363636;
    background-color: white;
    border: 2px solid rgba(213, 124, 103, 0.35);
    border-radius: 30px;
    padding: 8px 18px;
    cursor: pointer;
    transition: 0.15s ease-out;
}

.portal-filter:hover {
    border-color: var(--main-color-salmon);
}

.portal-filter.is-active {
    color: white;
    background-color: var(--main-color-salmon);
    border-color: var(--main-color-salmon);
}

.portal-search {
    position: relative;
    min-width: 260px;
    flex: 0 1 320px;
}

.portal-search input {
    font-family: inherit;
    font-size: 15px;
    width: 100%;
    padding: 10px 16px 10px 42px;
    color: #363636;
    background-color: white;
    border: 2px solid rgba(213, 124, 103, 0.35);
    border-radius: 30px;
    transition: 0.15s ease-out;
}

.portal-search input:focus {
    outline: none;
    border-color: var(--main-color-salmon);
}

.portal-search i {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    color: var(--main-color-salmon);
    pointer-events: none;
}

.portal-count {
    font-size: 15px;
    font-weight: 600;
    color: #6d6d6d;
    margin-bottom: 25px;
}

/* ---- Grille de fiches ---- */

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 35px;
}

.portal-card {
    display: flex;
    flex-direction: column;
    color: #363636;
    background-color: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1),
        0 0px 0 1px rgba(10, 10, 10, 0.02);
    transition: 0.2s ease-out;
}

.portal-card:hover {
    color: #363636;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Les clichés de fiches (boîtes de Pétri, microscopie) sont sur fond sombre :
   on les affiche en entier plutôt que rognés. */
.portal-card-media {
    aspect-ratio: 16/11;
    overflow: hidden;
    background-color: #1c1c1c;
}

.portal-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-card-media.is-empty,
.portal-side-media.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--main-color-turquoise-opac), var(--bg-spring-wood));
}

.portal-card-media.is-empty span {
    font-family: "Syncopate", sans-serif;
    font-size: 46px;
    color: var(--main-color-salmon);
}

.portal-card-body {
    flex: 1;
    padding: 22px 25px 10px;
}

.portal-card-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #8a4433;
    background-color: rgba(213, 124, 103, 0.15);
    border-radius: 12px;
    padding: 6px 14px;
    margin-bottom: 12px;
}

.portal-card-body h3 {
    margin-bottom: 6px !important;
}

.portal-card-binomial {
    font-size: 14px;
    line-height: 1.4;
    color: #6d6d6d;
    margin-bottom: 10px;
}

.portal-card-description {
    font-size: 14px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Champs non renseignés : on n'occupe pas d'espace */
.portal-card-description:empty,
.portal-record-intro-text:empty {
    display: none;
}

.portal-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px 20px;
    font-size: 13px;
    color: #8a8a8a;
}

.portal-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    width: 38px;
    border-radius: 13px;
    background-color: var(--main-color-salmon);
    color: var(--bg-spring-wood);
}

.portal-card-icon i {
    transform: rotate(-45deg);
    transition: 0.1s ease-out;
}

.portal-card:hover .portal-card-icon i {
    transform: rotate(0deg);
}

.portal-empty,
.portal-no-result {
    grid-column: 1 / -1;
    text-align: center;
    font-weight: 600;
    color: #6d6d6d;
    padding: 60px 0;
}

/* ---- Fiche détaillée ---- */

.portal-record-header {
    margin-bottom: 40px;
}

.portal-record-header h2 {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    margin: 0 0 8px;
}

.portal-record-header .portal-card-binomial {
    font-size: 18px;
}

.portal-block {
    margin-bottom: 45px;
}

.portal-block-title {
    font-size: 20px !important;
    font-weight: 700;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--main-color-salmon);
    width: fit-content;
}

.portal-table {
    width: 100%;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.08);
}

.portal-table th,
.portal-table td {
    text-align: left;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: top;
}

.portal-table tr:last-child th,
.portal-table tr:last-child td {
    border-bottom: none;
}

.portal-table th {
    font-weight: 600;
    width: 40%;
    background-color: rgba(213, 124, 103, 0.07);
}

/* Chapô : texte d'introduction et photo côte à côte */
.portal-record-intro {
    display: flex;
    align-items: center;
    gap: 35px;
    margin-top: 18px;
}

.portal-record-intro-text {
    flex: 1 1 0;
    min-width: 0;
}

.portal-record-intro-text p:last-child {
    margin-bottom: 0;
}

.portal-photo {
    flex: 0 1 auto;
    margin-bottom: 0;
}

/* On ne suragrandit pas les clichés : ils sont souvent de petite taille. */
.portal-photo img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    width: auto;
    border-radius: 20px;
}

.portal-photo figcaption {
    font-size: 14px;
    color: #6d6d6d;
    margin-top: 10px;
}

.portal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.portal-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 130px;
    flex: 1 1 130px;
    padding: 18px 15px;
    text-align: center;
    background-color: white;
    border: 2px solid rgba(213, 124, 103, 0.25);
    border-radius: 15px;
}

.portal-chip-label {
    font-size: 13px;
    font-weight: 600;
    color: #6d6d6d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-chip-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--main-color-salmon);
}

.portal-free-content table {
    width: 100%;
    margin-bottom: 20px;
}

/* ---- Colonne latérale ---- */

.portal-side-item {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #363636;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    transition: 0.15s ease-out;
}

.portal-side-item:last-child {
    border-bottom: none;
}

.portal-side-item:hover {
    color: var(--main-color-salmon);
}

.portal-side-media {
    flex: 0 0 60px;
    height: 60px;
    width: 60px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #1c1c1c;
}

.portal-side-media img {
    height: 100%;
    width: 100%;
    object-fit: contain;
}

.portal-side-media.is-empty span {
    font-family: "Syncopate", sans-serif;
    font-size: 22px;
    color: var(--main-color-salmon);
}

.portal-side-info span {
    display: block;
    font-size: 12px;
    color: #8a8a8a;
    line-height: 1.3;
    margin-bottom: 4px;
}

.portal-side-info h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.portal-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

@media screen and (max-width: 769px) {
    .portal-record-intro {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .portal-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-search {
        flex: 1 1 auto;
    }

    .portal-table th {
        width: 45%;
    }
}
