/**
 * MarinePhD — wave cards (hero pattern).
 * Dark ocean fill cut by a white wave — same motif as homepage hero ::after.
 *
 * Vacancy catalog card wave band ≈ half of the original 52/28 px (2026-10-09):
 * tall waves were overlapping vacancy titles / card heads.
 */

:root {
    --mphd-card-ocean-h: 26px;
    --mphd-card-wave-top: 14px;
    --mphd-card-wave-h: 14px;
    --mphd-card-pad-top: 28px;
}

/* ── Vacancy / scholarship / generic cards ────────────────────── */

.category-page .post-item.post-item--open-position,
.search-page .post-item.post-item--open-position,
.tag-page--open-positions .post-item.post-item--open-position,
.category-page .post-item.post-item--institute-jobs,
.search-page .post-item.post-item--institute-jobs,
.category-page .post-item.post-item--institute-postdocs,
.search-page .post-item.post-item--institute-postdocs,
.home-scholarship-cards .post-item.post-item--scholarship-rich,
.tag-scholarship-cards .post-item.post-item--scholarship-rich,
.home-latest-open-positions .post-item,
.posts-section .post-item.post-item--open-position,
.posts-section .post-item.post-item--scholarship-rich,
.card-item {
    position: relative !important;
    isolation: isolate;
    overflow: hidden !important;
    border: 1px solid rgba(14, 116, 144, 0.14) !important;
    border-top: none !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 8px 22px rgba(10, 51, 82, 0.08) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

/* Dark ocean band (cut by white wave below) */
.category-page .post-item.post-item--open-position::before,
.search-page .post-item.post-item--open-position::before,
.tag-page--open-positions .post-item.post-item--open-position::before,
.category-page .post-item.post-item--institute-jobs::before,
.search-page .post-item.post-item--institute-jobs::before,
.category-page .post-item.post-item--institute-postdocs::before,
.search-page .post-item.post-item--institute-postdocs::before,
.home-latest-open-positions .post-item::before,
.posts-section .post-item.post-item--open-position::before,
.card-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mphd-card-ocean-h);
    z-index: 0;
    pointer-events: none;
    background: var(--mphd-ocean-gradient-simple, linear-gradient(165deg, #061a2c 0%, #0a3352 38%, #0e7490 78%, #0f4668 100%));
}

/* White wave cutting the dark band */
.category-page .post-item.post-item--open-position::after,
.search-page .post-item.post-item--open-position::after,
.tag-page--open-positions .post-item.post-item--open-position::after,
.category-page .post-item.post-item--institute-jobs::after,
.search-page .post-item.post-item--institute-jobs::after,
.category-page .post-item.post-item--institute-postdocs::after,
.search-page .post-item.post-item--institute-postdocs::after,
.home-latest-open-positions .post-item::after,
.posts-section .post-item.post-item--open-position::after,
.card-item::after {
    content: "";
    position: absolute;
    top: var(--mphd-card-wave-top);
    left: 0;
    right: 0;
    height: var(--mphd-card-wave-h);
    z-index: 1;
    pointer-events: none;
    background: var(--mphd-wave-cut-white) center bottom / 100% 100% no-repeat;
}

.category-page .post-item.post-item--open-position,
.search-page .post-item.post-item--open-position,
.tag-page--open-positions .post-item.post-item--open-position,
.category-page .post-item.post-item--institute-jobs,
.search-page .post-item.post-item--institute-jobs,
.category-page .post-item.post-item--institute-postdocs,
.search-page .post-item.post-item--institute-postdocs,
.posts-section .post-item.post-item--open-position,
.home-latest-open-positions .post-item,
.card-item {
    padding-top: var(--mphd-card-pad-top) !important;
}

.category-page .post-item.post-item--open-position > *,
.search-page .post-item.post-item--open-position > *,
.tag-page--open-positions .post-item.post-item--open-position > *,
.category-page .post-item.post-item--institute-jobs > *,
.search-page .post-item.post-item--institute-jobs > *,
.category-page .post-item.post-item--institute-postdocs > *,
.search-page .post-item.post-item--institute-postdocs > *,
.posts-section .post-item.post-item--open-position > *,
.card-item > * {
    position: relative;
    z-index: 2;
}

.category-page .post-item.post-item--open-position:hover,
.search-page .post-item.post-item--open-position:hover,
.tag-page--open-positions .post-item.post-item--open-position:hover,
.category-page .post-item.post-item--institute-jobs:hover,
.search-page .post-item.post-item--institute-jobs:hover,
.category-page .post-item.post-item--institute-postdocs:hover,
.search-page .post-item.post-item--institute-postdocs:hover,
.home-scholarship-cards .post-item.post-item--scholarship-rich:hover,
.tag-scholarship-cards .post-item.post-item--scholarship-rich:hover,
.home-latest-open-positions .post-item:hover,
.posts-section .post-item:hover,
.card-item:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 14px 28px rgba(10, 51, 82, 0.14) !important;
}

.card-item:hover {
    transform: translateY(-3px) !important;
}

/* Scholarship rich cards — dark logo strip cut by white wave */
.home-scholarship-cards .post-item.post-item--scholarship-rich > .post-thumbnail,
.tag-scholarship-cards .post-item.post-item--scholarship-rich > .post-thumbnail,
.posts-section .post-item.post-item--scholarship-rich > .post-thumbnail,
.home-scholarship-cards .post-item.post-item--scholarship-rich > .post-thumbnail.op-card-logo,
.tag-scholarship-cards .post-item.post-item--scholarship-rich > .post-thumbnail.op-card-logo,
.posts-section .post-item.post-item--scholarship-rich > .post-thumbnail.op-card-logo {
    position: relative !important;
    background: var(--mphd-ocean-gradient-simple) !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    margin-top: 0 !important;
}

.home-scholarship-cards .post-item.post-item--scholarship-rich > .post-thumbnail::after,
.tag-scholarship-cards .post-item.post-item--scholarship-rich > .post-thumbnail::after,
.posts-section .post-item.post-item--scholarship-rich > .post-thumbnail::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 11px;
    z-index: 2;
    pointer-events: none;
    background: var(--mphd-wave-cut-white) center bottom / 100% 100% no-repeat;
}

/* Disable old crest/foam pseudo on scholarship shell */
.home-scholarship-cards .post-item.post-item--scholarship-rich::before,
.tag-scholarship-cards .post-item.post-item--scholarship-rich::before,
.posts-section .post-item.post-item--scholarship-rich::before,
.home-scholarship-cards .post-item.post-item--scholarship-rich::after,
.tag-scholarship-cards .post-item.post-item--scholarship-rich::after,
.posts-section .post-item.post-item--scholarship-rich::after {
    content: none !important;
    display: none !important;
}

/* ── Countries directory tiles — photo/ocean cut by white wave ─ */

.sch-countries-page .sch-country-dir-card {
    position: relative;
    overflow: hidden;
}

.sch-countries-page .sch-country-dir-card__media {
    position: relative;
    overflow: hidden;
}

.sch-countries-page .sch-country-dir-card__wave {
    background: var(--mphd-wave-cut-white) center bottom / 100% 100% no-repeat;
}

/* ── Country / field tiles — photo/dark cut by white wave ─────── */

.home-country-carousel__tile,
.home-field-carousel__tile {
    position: relative;
    overflow: hidden;
    border-radius: 14px !important;
    border-color: rgba(14, 116, 144, 0.16) !important;
    background: #ffffff !important;
    box-shadow: 0 6px 16px rgba(10, 51, 82, 0.08) !important;
}

.home-country-carousel__media {
    position: relative;
    overflow: hidden;
}

.home-country-carousel__media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 6px;
    z-index: 2;
    pointer-events: none;
    background: var(--mphd-wave-cut-white) center bottom / 100% 100% no-repeat;
}

.home-field-carousel__tile {
    background: var(--mphd-ocean-gradient-simple) !important;
    color: #ffffff !important;
    padding-bottom: 1.1rem !important;
}

.home-field-carousel__tile::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 7px;
    z-index: 2;
    pointer-events: none;
    background: var(--mphd-wave-cut-white) center bottom / 100% 100% no-repeat;
}

.home-field-carousel__tile .home-field-carousel__label,
.home-field-carousel__tile .home-field-carousel__meta {
    position: relative;
    z-index: 3;
    color: #ffffff !important;
}

.home-country-carousel__tile:hover,
.home-field-carousel__tile:hover,
.home-country-carousel__tile:focus-visible,
.home-field-carousel__tile:focus-visible {
    box-shadow: 0 10px 22px rgba(14, 116, 144, 0.16) !important;
}

/* Section shells (Browse by Country / Field) — thin ocean top + wave */
.home-country-carousel,
.home-field-carousel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(14, 116, 144, 0.14) !important;
    border-top: none !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(10, 51, 82, 0.06) !important;
    /* Thinner ocean band + wave (~1/3 of prior 28px wave) */
    padding-top: 1.25rem !important;
}

.home-country-carousel::before,
.home-field-carousel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 22px;
    background: var(--mphd-ocean-gradient-simple);
    z-index: 0;
    pointer-events: none;
}

.home-country-carousel::after,
.home-field-carousel::after {
    content: "";
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 7px;
    z-index: 1;
    pointer-events: none;
    background: var(--mphd-wave-cut-white) center bottom / 100% 100% no-repeat;
}

.home-country-carousel > *,
.home-field-carousel > * {
    position: relative;
    z-index: 2;
}

/* Assistant result cards */
.assistant-card,
.assistant-results .assistant-card__inner {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(14, 116, 144, 0.14);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(10, 51, 82, 0.08);
    padding-top: 1rem;
}

.assistant-card::before,
.assistant-results .assistant-card__inner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mphd-card-ocean-h);
    background: var(--mphd-ocean-gradient-simple);
    pointer-events: none;
}

.assistant-card::after,
.assistant-results .assistant-card__inner::after {
    content: "";
    position: absolute;
    top: var(--mphd-card-wave-top);
    left: 0;
    right: 0;
    height: var(--mphd-card-wave-h);
    pointer-events: none;
    background: var(--mphd-wave-cut-white) center bottom / 100% 100% no-repeat;
}

@media (prefers-reduced-motion: reduce) {
    .category-page .post-item.post-item--open-position:hover,
    .search-page .post-item.post-item--open-position:hover,
    .home-scholarship-cards .post-item.post-item--scholarship-rich:hover,
    .card-item:hover,
    .home-country-carousel__tile:hover,
    .home-field-carousel__tile:hover {
        transform: none !important;
    }
}
