/* ========================================================================
   FYM Find-a-Teacher Directory
   Fully self-contained — does NOT depend on colors_and_type.css or any
   external custom properties. All values below are hardcoded literals
   matching the FYM brand spec directly, since colors_and_type.css is
   confirmed not present on the live site.
   ========================================================================= */

.fym-teacher-grid-container {
    background: #ffffff;
    padding: 48px 24px 96px;
    border-top: 1px solid #000E411F;
} 

.fym-teacher-grid {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    max-width: 1140px;
    width: 100%;
    margin: auto;
}

@media (max-width: 767px) {
    .fym-teacher-grid-container {
        padding: 24px 20px 40px;
    }
    .fym-directory-controls {
        padding: 16px 20px;
    }
}

.fym-directory-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 20px 0px;
    flex-wrap: wrap;
    max-width: 1140px;
    width: 100%;
    margin: auto;
}

.fym-search-wrap {
    flex: 1;
    min-width: 240px;
}

.fym-search-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fym-search-icon {
    position: absolute;
    left: 14px;
    color: #847A88;
    pointer-events: none;
    flex-shrink: 0;
}

.fym-teacher-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px !important;
    border: 1px solid rgba(0, 14, 65, 0.12) !important;
    border-radius: 4px !important;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: #000E41 !important;
    background: #FFFFFF !important;
    transition: border-color 200ms cubic-bezier(0.2, 0, 0, 1) !important;
}
.fym-teacher-search-input::placeholder {
    color: #847A88;
}
.fym-teacher-search-input:focus {
    outline: none;
    border-color: #E4AD49;
}

.fym-teacher-country-select {
    padding: 12px 16px;
    border: 1px solid rgba(0, 14, 65, 0.12);
    border-radius: 4px;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: #000E41;
    background: #FFFFFF;
    min-width: 180px;
    cursor: pointer;
}
.fym-teacher-country-select:focus {
    outline: none;
    border-color: #E4AD49;
}

.fym-results-count {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 300;
    color: #5a5060;
    white-space: nowrap;
}

.fym-results-count-number {
    font-weight: 500;
    color: #000E41;
}

@media (max-width: 767px) {
    .fym-directory-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .fym-search-wrap {
        min-width: 0;
    }

    .fym-teacher-country-select {
        width: 100%;
        min-width: 0;
    }

    .fym-results-count {
        text-align: left;
    }
}

.fym-teacher-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .fym-teacher-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .fym-teacher-card-image {
        height: 260px;
    }

    .fym-teacher-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .fym-contact-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 16px;
    }

    .fym-website-link {
        justify-content: center;
        text-align: center;
    }
}

.fym-teacher-card {
    border: 1px solid rgba(0, 14, 65, 0.12);
    border-radius: 6px;
    overflow: hidden;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 14, 65, 0.06);
    transition: box-shadow 200ms cubic-bezier(0.2, 0, 0, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.fym-teacher-card:hover {
    box-shadow: 0 2px 8px rgba(0, 14, 65, 0.08);
}

.fym-teacher-card-image {
    width: 100%;
    overflow: hidden;
}

.fym-teacher-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.fym-teacher-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fym-teacher-name {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.25;
    color: #000E41;
    margin: 0 0 4px;
}

.fym-teacher-location {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #847A88;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fym-location-icon {
    color: #B85C38;
    display: inline-flex;
    align-items: center;
}

.fym-teacher-bio {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.75;
    color: #5A5060;
    margin-bottom: 10px !important;
    /* Exactly 2 lines — more reliable than word-count truncation since it
       adapts to actual rendered width, font size, and word length. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fym-lang-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.fym-lang-pill {
    background: #E8F0EC;
    color: #3D6B4E;
    padding: 4px 12px;
    border-radius: 999px;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Visually distinct from language pills — muted outline signals
   "there are more" rather than being read as a language name */
.fym-lang-more {
    background: transparent;
    color: #847A88;
    border: 1px solid rgba(0, 14, 65, 0.15);
}

.fym-teacher-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.fym-website-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #847A88;
    text-decoration: underline;
    text-underline-offset: 2px;
    /* Long URLs (e.g. instagram.com/faceyoga.cr) were overflowing the
       footer or forcing it to wrap awkwardly next to Contact — truncate
       with ellipsis instead, since the full URL is still in the href. */
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    justify-content: flex-end;
}
.fym-website-link:hover {
    color: #E4AD49;
}

.fym-website-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Matches the canonical secondary button style from the FYM design spec
   (outline navy → fills navy on hover) */
.fym-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #000E41;
    color: #000E41;
    background: transparent;
    text-decoration: none !important;
    transition: background-color 200ms cubic-bezier(0.2, 0, 0, 1),
                color 200ms cubic-bezier(0.2, 0, 0, 1);
}
.fym-contact-btn:hover {
    background: #000E41;
    color: #FAF2F0;
}

.fym-load-more-wrap {
    text-align: center;
    margin-top: 32px;
}

.fym-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 14px 24px;
    border-radius: 4px;
    border: 1px solid #000E41;
    background: transparent;
    color: #000E41;
    cursor: pointer;
    transition: background-color 200ms cubic-bezier(0.2, 0, 0, 1),
                color 200ms cubic-bezier(0.2, 0, 0, 1);
}
.fym-load-more-btn:hover {
    background: #000E41;
    color: #FAF2F0;
}

.fym-no-results {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 300;
    text-align: center;
    color: #847A88;
    padding: 48px 0;
    grid-column: 1 / -1;
}

.fym-read-more-link {
    display: inline-block;
    margin-top: -8px;
    margin-bottom: 16px;
    color: #E4AD49;
    font-weight: 500;
    font-size: 15px;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: nowrap;
}
.fym-read-more-link:hover {
    color: #000E41;
}

.fym-bio-modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 14, 65, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    box-sizing: border-box;
}

.fym-bio-modal-overlay.is-open {
    display: flex;
}

.fym-bio-modal {
    position: relative;
    background: #FFFFFF !important;
    border-radius: 6px;
    max-width: 700px !important;
    width: 100% !important;
    max-height: 80vh;
    overflow-y: auto;
    padding: 40px !important;
    box-shadow: 0 8px 32px rgba(0, 14, 65, 0.16);
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 14, 65, 0.25) transparent;
}
.fym-bio-modal::-webkit-scrollbar {
    width: 6px;
}
.fym-bio-modal::-webkit-scrollbar-thumb {
    background: rgba(0, 14, 65, 0.25);
    border-radius: 3px;
}
.fym-bio-modal::-webkit-scrollbar-track {
    background: transparent;
}

.fym-bio-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #847A88;
    cursor: pointer;
    padding: 4px 8px;
}
.fym-bio-modal-close:hover {
    color: #000E41;
    background: none;
}

/* The modal reuses .fym-teacher-card-body's own internal styling (name,
   location, bio, pills, footer) since the JS clones that markup directly.
   Fully undo the card's line-clamp — need to reset the display type AND
   the clamp value, not just the clamp count on its own. */
.fym-bio-modal-content .fym-teacher-bio {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

/* Re-allow wrapping inside the modal — card restricts to nowrap for
   single-line display, but the modal has room to show all pills */
.fym-bio-modal-content .fym-lang-pills {
    flex-wrap: wrap;
    overflow: visible;
}
