.iff38-guests {
    --guest-navy: #071a3d;
    --guest-coral: #f04b47;
    color: var(--guest-navy);
    font-family: Jost, Heebo, sans-serif;
}

body.post-type-archive-iff_guest .site-content > .ast-container,
body.post-type-archive-iff_guest #content > .ast-container {
    display: block;
    max-width: none;
    padding: 0;
}

.iff38-guests__hero {
    position: sticky;
    top: 80px;
    z-index: 15;
    background: var(--guest-navy);
    color: #fff;
}

.iff38-guests__hero-inner {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 64px clamp(20px, 4.5vw, 80px);
    transition: padding .45s ease;
}

.iff38-guests__hero h1 {
    color: #fff;
    font: 800 clamp(48px, 5.6vw, 96px)/1 Poppins, Heebo, sans-serif;
    margin: 0;
    transition: font-size .45s ease;
}

.iff38-guests__hero p {
    margin: 20px 0 0;
    color: #c9d1df;
    font-size: 20px;
    line-height: 1.5;
    transition: opacity .35s ease, max-height .35s ease, margin .35s ease;
    max-height: 70px;
    overflow: hidden;
}

.iff38-guests__hero.is-compact .iff38-guests__hero-inner {
    padding-top: 12px;
    padding-bottom: 12px;
    align-items: center;
}

.iff38-guests__hero.is-compact h1 {
    font-size: 34px;
}

.iff38-guests__hero.is-compact p {
    max-height: 0;
    margin: 0;
    opacity: 0;
}

.iff38-guests__gallery-link {
    flex: none;
    padding: 12px 24px;
    border: 1px solid #fff;
    border-radius: 40px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .05em;
}

.iff38-guests__gallery-link:hover {
    color: var(--guest-navy);
    background: #fff;
}

.iff38-guests__body {
    background: #eceef2;
    padding: 64px clamp(20px, 4.5vw, 80px) 96px;
}

.iff38-guests__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.iff38-guest-card {
    margin: 0;
    aspect-ratio: 4 / 5;
    position: relative;
    min-width: 0;
    perspective: 1400px;
}

.iff38-guest-card__inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.iff38-guest-card.is-flipped .iff38-guest-card__inner {
    transform: rotateY(180deg);
}

.iff38-guest-card__face {
    position: absolute;
    inset: 0;
    border-radius: 5px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--guest-navy);
    color: #fff;
}

.iff38-guest-card__back {
    transform: rotateY(180deg);
	display: flex;
}

.iff38-guest-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.iff38-guest-card:hover:not(.is-flipped) .iff38-guest-card__image {
    transform: scale(1.05);
}

.iff38-guest-card__caption {
    position: absolute;
    inset: auto 0 0;
    background: linear-gradient(0deg, rgba(2, 6, 17, .90), transparent);
    padding: 65px 64px 20px 20px;
}

.iff38-guest-card h3 {
    color: #fff;
    font: 800 clamp(18px, 1.4vw, 23px)/1.15 Poppins, Heebo, sans-serif;
    margin: 0 0 5px;
}

.iff38-guest-card p {
    margin: 0;
}

.iff38-guest-card__caption p {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
}

.iff38-guest-card__toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    background: rgba(2, 6, 17, .35);
    color: #fff;
    cursor: pointer;
}

.iff38-guest-card__plus {
    position: absolute;
    right: 16px;
    top: 16px;
    bottom: auto;
    opacity: 0;
    transform: translateY(7px);
    transition: opacity .25s ease, transform .3s ease, background .2s ease, color .2s ease;
}

.iff38-guest-card:hover .iff38-guest-card__plus,
.iff38-guest-card:focus-within .iff38-guest-card__plus {
    opacity: 1;
    transform: translateY(0);
}
.iff38-guest-card__toggle:hover {
  background: linear-gradient(90deg,#F04B47,#EB651B);
  border-color: #EB651B;
  color: #fff;
}
.iff38-guest-card__image--back {
    filter: grayscale(1);
    transform: none !important;
}

.iff38-guest-card__back::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(2, 6, 17, .72), rgba(2, 6, 17, .94));
}

.iff38-guest-card__back-content {
    position: relative;
    z-index: 2;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    box-sizing: border-box;
	margin-top: auto;
}

.iff38-guest-card__back-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.iff38-guest-card__back-heading p {
    color: #c9d1df;
    font-size: 14px;
}

.iff38-guest-card__languages {
    flex: none;
    display: flex;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 30px;
    padding: 2px;
}

.iff38-guest-card__languages button {
    border: 0;
    border-radius: 30px;
    padding: 7px 9px;
    color: #fff;
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.iff38-guest-card__languages button.is-active {
    background: #fff;
    color: var(--guest-navy);
}

.iff38-guest-card__biographies {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border-top: 1px solid rgba(255, 255, 255, .15);
    padding-top: 14px;
    color: #fff;
    font-size: 16px;
    line-height: 1.55;
}

.iff38-guest-card__biographies [hidden] {
    display: none !important;
}

.iff38-guest-card__biographies p + p {
    margin-top: 1em;
}

.iff38-guest-card__close {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 9;
}

.iff38-guests__empty {
    text-align: center;
    padding: 50px 0;
}

@media (max-width: 1100px) {
    .iff38-guests__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .iff38-guests__hero {
        top: 66px;
    }

    .iff38-guests__hero-inner {
        padding-top: 40px;
        padding-bottom: 38px;
        align-items: flex-start;
        flex-direction: column;
    }

    .iff38-guests__hero h1 {
        font-size: 48px;
    }

    .iff38-guests__hero p {
        font-size: 16px;
    }

    .iff38-guests__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .iff38-guest-card__back-content {
        padding: 14px;
        gap: 8px;
    }

    .iff38-guest-card__back-heading {
        flex-wrap: wrap;
    }

    .iff38-guest-card__biographies {
        font-size: 13px;
    }
}

@media (max-width: 520px) {
    .iff38-guests__grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .iff38-guest-card__back-content {
        padding: 20px;
    }

    .iff38-guest-card__biographies {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .iff38-guest-card__inner,
    .iff38-guest-card__image {
        transition-duration: .01ms;
    }
}

/* Mobile has no hover: keep the flip action discoverable. */
@media (hover: none) {
    .iff38-guest-card__plus {
        opacity: 1;
        transform: none;
    }
}

/* Biography scrollbar stays inside the card when text is long. */
.iff38-guest-card__back-content {
    overflow: hidden;
}
.iff38-guest-card__back-heading {
    flex: none;
}
