/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
    font-family: Merriweather, serif;
    margin: 0;
    padding: 0;
    background: #f4f4f4;
}

.about-header {
    text-align: center;
    padding: 1.5rem;
    background: #1e96fc80;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    color: white;
}

.about-header h3 {
    font-size: 1.25rem;
    text-shadow: none;
    color: #323031;
}

/* ==========================================================================
   Section Containers
   ========================================================================== */
.why, .who, .when, .where {
    border-top: solid 1px #32303180;
    color: white;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    padding-top: 1rem;
    padding-bottom: 3rem;
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
}

.why h2, .who h2, .when h2, .where h2 {
    padding: 0 1.75rem .75rem .75rem;
}

.why .hero-illustration,
.who {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* margin: 2rem; */
    /* padding: 0 1.25rem; */
}

/* ==========================================================================
   Who Section Enhancements
   ========================================================================== */
.who, .where {
    background: #1e96fc80;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    color: white;
}

.why, .when {
    background:#32303180;
}

.why h4 {
    color: black;
    text-shadow: none;
    font-size: 1.2rem;
    padding: 0 0 1rem 0;
}

/* Team List Grid */
.team-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
}

/* People Card Base & Overrides */
.people-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    outline: none;  /* For custom focus styling */
    background: #323031;
}

/* Override people-card width in the Who section */
.who .people-card {
    width: auto;
    padding: 2rem;
    border-radius: 1.25rem;
    max-width: 378px;
}

/* Hover & Focus Effects for People Cards */
.people-card:hover,
.people-card:focus {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.people-card:focus {
    outline: 2px solid #7b44c1;
}

/* People Card Internal Elements */
.people-card .card-inner .card-front img {
    width: 70%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: .25rem solid #29c0ff;
    border-radius: 1rem;
}

.people-card .card-inner .card-back .people-description {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;       /* Grow and shrink as needed */
    overflow-y: auto;     /* Scrollable if text overflows */
}

.people-card .card-inner .card-back .people-description img {
    border: .25rem solid #29c0ff;
}

.people-card .card-inner .card-back,
.people-card .card-inner .card-back::before {
    background: #323031;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;         /* Use the full available height */
    overflow: hidden;
}

/* Place the maintainer-description at the bottom */
.people-card .card-inner .card-back .maintainer-description {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;       /* Do not grow or shrink */
    margin-top: auto;     /* Push it to the bottom */
    width: 100%;
}

.people-card .card-inner h2 {
    font-size: clamp(2.5rem, 2vw, 1.25rem);
}
.people-card .card-inner h3 {
    font-size: clamp(1.7rem, 1.5vw, 1rem);
}
.people-card .card-inner .card-back p {
    font-size: clamp(.75rem, 1.25vw, 1.5rem);
    padding: .5rem .1rem .5rem .1rem;
    text-align: justify;
}
.people-card .card-inner .card-back .project-logo {
    /* position: absolute; */
    /* bottom: 0; */
    /* right: 0; */
    width: 25%;
}

.project-logo img {
    border: none !important;
}

/* ==========================================================================
   Common Flip Card Inner Container & Effects
   ========================================================================== */
.job-card .card-inner,
.hero-card .card-inner,
.people-card .card-inner {
    transition: transform 0.8s ease;
    transform-style: preserve-3d;
    position: relative;
}

.job-card.flipped .card-inner,
.hero-card.flipped .card-inner,
.people-card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* People Card Heading Positioning */
.people-card .card-inner .card-front h2,
.people-card .card-inner .card-back h2 {
    position: absolute;
    color: white;
    width: 100%;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}
.people-card .card-inner .card-front h3 {
    position: absolute;
    width: 100%;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 0.5rem;
    font-size: 1.5rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    white-space: normal;
    text-align: center;
}

/* ==========================================================================
   Hero Card Styles & Enhancements
   ========================================================================== */
.hero-card {
    width: 80%;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.hero-card:hover,
.hero-card:focus {
    cursor: pointer;
    transform: scale(1.02);
    border-radius: 1.25rem;
}
.hero-card:focus {
    outline: 2px solid #7b44c1;
}
/* Remove box-shadow when the card is flipped */
.hero-card.flipped {
    box-shadow: none;
}
/* If a .no-shadow class is added, keep box-shadow removed */
.hero-card.no-shadow {
    box-shadow: none !important;
}

.hero-card .card-front {
    background: #1e96fc;
    border-radius: 1.25rem;
}
.hero-card .card-front .flip-chevron {
    position: absolute;
    bottom: 0.01rem;
    right: 0.35rem;
    font-size: 2rem;
    color: white;
    text-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.5);
    z-index: 2;
}
.hero-card .card-front .card-front-portrait img,
.hero-card .card-front .card-front-landscape img {
    width: 90%;
    height: auto;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.hero-card .card-front .card-front-landscape img {
    border: .25rem solid #29c0ff;
}
.hero-card .card-back {
    background: #1e96fc;
    text-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.5);
    text-align: justify;
    border-radius: 1.25rem;
    overflow-y: auto;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    z-index: 1;
}
.hero-card .card-back::before {
    display: none;
}
.hero-card .card-back h2,
.hero-card .card-back h3 {
    border-bottom: 2px solid #fff;
    text-align: center;
    padding: 0.5rem;
    margin: 0.5rem;
}
.hero-card .card-back h2 {
    font-size: 2rem;
}
.hero-card .card-back h3 {
    border-top: 2px solid #fff;
    font-size: 1.5rem;
}
.hero-card .card-back strong,
.hero-card .card-back em {
    color: #a5ffd6;
}
.hero-card .card-back p {
    margin: 0.5rem 0;
    line-height: 1.4;
}
.card-front-landscape,
.card-front-portrait {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   Jobs Page & Card Styles
   ========================================================================== */
.jobs-page {
    max-width: 75rem;
    margin: auto;
    padding: 1.25rem;
}
.jobs-header {
    text-align: center;
    padding: 2.5rem 0;
}
.jobs-header h1 {
    font-size: 3em;
    margin-bottom: 0.625rem;
    color: #333;
}
.jobs-header p {
    font-size: 1.2em;
    color: #777;
}
#jobSearch {
    margin-top: 1.25rem;
    padding: 0.625rem 0.9375rem;
    width: 60%;
    border: 0.0625rem solid #ccc;
    border-radius: 0.3125rem;
    font-size: 1em;
}
.jobs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    margin-top: 2.5rem;
}

/* Flip Card Container for Job Cards & People Cards within Hero Card */
.job-card,
.hero-card .people-card {
    perspective: 1000px;
    width: calc(33.333% - 1.25rem);
    position: relative;
    font-size: 1rem;
}

/* ==========================================================================
   Card Faces, Overlays & Button Styles
   ========================================================================== */
.card-front {
    position: relative;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.card-front-landscape {
    display: flex;
    padding: 2rem;
}
.card-front-portrait {
    display: none;
    padding: 2rem 1rem 2rem 1rem;
}
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    font-family: Merriweather, serif;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.3125rem rgba(0,0,0,0.1);
    background: url("https://pocket-watch-asset-library.s3.us-east-1.amazonaws.com/shared/images/illustrations/leafycardbackside") repeat, #fff;
    background-size: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    z-index: 1;
}
.card-back::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 0;
}
.card-back > * {
    position: relative;
    z-index: 1;
}
.card-front img {
    width: 100%;
    height: auto;
    display: flex;
    border-radius: 0.5rem;
}

/* Override job-card card-front to match card-back dimensions and remove border */
.job-card .card-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.job-card .card-front img {
    margin: 0 auto;
    border: none !important;
}

/* Flip Button Styling */
.flip-btn {
    position: absolute;
    bottom: 1.5%;
    left: 5%;
    padding: 0.4em 0.8em;
    font-size: 1em;
    background: transparent;
    border: solid 0.2em #a5ffd6;
    color: #a5ffd6;
    border-radius: 0.3125rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
}
.flip-btn:hover {
    background: #7b44c1;
}

/* Apply Button Styling */
.apply-btn {
    align-self: center;
    padding: 0.4em 0.8em;
    font-size: 1em;
    background: transparent;
    border: solid 0.2em #a5ffd6;
    color: #a5ffd6;
    border-radius: 0.3125rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
    text-decoration: none;
}
.apply-btn:hover {
    background: #7b44c1;
}

/* Job Description Styling on Card Back */
.job-description {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

/* Hide Flip Button When Card Is Flipped */
.job-card.flipped .flip-btn,
.hero-card.flipped .flip-btn {
    display: none;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 56.25rem) {
    .job-card {
        width: calc(50% - 1.25rem);
    }
    .hero-card {
        width: calc(100% - 1.25rem);
        overflow: hidden;
    }
    .hero-card .card-front img {
        height: 90%;
        width: auto;
        object-fit: cover;
        border: .25rem solid #29c0ff;
    }
    .card-front-landscape {
        display: none;
    }
    .card-front-portrait {
        display: flex;
    }
}

@media (max-width: 37.5rem) {
    #jobSearch {
        width: 80%;
    }
    .job-card,
    .hero-card {
        width: 100%;
    }
    .team-list {
        grid-template-columns: 1fr;
    }
    .people-card {
        width: 100%;
    }
    .hero-card {
        border-radius: 1.25rem;
        max-width: 678px;
        aspect-ratio: unset;
        overflow: visible;
    }
}

@media (min-width: 75rem) {
    .job-description p,
    .people-card .card-inner .card-back p {
        font-size: clamp(0.75rem, 1vw, 1rem);
    }
}


/* ==========================================================================
   Card Headings Scaling
   ========================================================================== */
.card-inner h2 {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}
.card-inner h3 {
    font-size: clamp(0.875rem, 2vw, 1rem);
    white-space: normal;
    text-align: center;
    padding: 0.5rem;
}