/* ==========================================================================
   JF Resource Pages
   Tokens — schimbă valorile de aici ca să potrivești tema, nu selectorii.
   ========================================================================== */

.jf-block {
    --jf-heading: #0F2233;
    --jf-text: #4D4D4D;
    --jf-muted: #000000;
    --jf-link: #1571B8;
    --jf-cta-bg: #E14B36;
    --jf-cta-bg-hover: #C93E2B;
    --jf-cta-text: #FFFFFF;
    --jf-star: #FFC201;
    --jf-radius: 12px;
    --jf-radius-cta: 999px;
    --jf-shadow: 0 8px 20px rgba(16, 44, 70, .12);
    --jf-shadow-hover: 0 14px 30px rgba(16, 44, 70, .18);
    --jf-gap: 30px;
    --jf-row-gap: 48px;
    --jf-font: inherit;

    --jf-cols-desktop: 3;
    --jf-cols-tablet: 2;
    --jf-cols-mobile: 1;

    font-family: var(--jf-font);
    box-sizing: border-box;
}

.jf-block *,
.jf-block *::before,
.jf-block *::after {
    box-sizing: inherit;
}

.jf-block__title {
    color: var(--jf-heading);
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 32px;
}

.jf-grid {
    display: grid;
    grid-template-columns: repeat(var(--jf-cols-desktop), minmax(0, 1fr));
    column-gap: var(--jf-gap);
    row-gap: var(--jf-row-gap);
}

.jf-block img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Orice element cu atributul hidden rămâne ascuns, chiar dacă are display
   setat de o regulă de autor (originea UA pierde mereu). */
.jf-block [hidden] {
    display: none !important;
}

/* Vizibil doar pentru screen readere (dacă tema nu are deja clasa). */
.jf-block .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================ Case Studies */

.jf-cs__item {
    display: flex;
    flex-direction: column;
}

.jf-cs__media {
    display: block;
    border-radius: var(--jf-radius);
    overflow: hidden;
    box-shadow: var(--jf-shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}

.jf-cs__media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

a.jf-cs__media:hover,
a.jf-cs__media:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--jf-shadow-hover);
}

.jf-cs__title {
    color: var(--jf-heading);
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
    margin: 20px 0 0;
}

.jf-cs__title a {
    color: inherit;
    text-decoration: none;
}

.jf-cs__title a:hover,
.jf-cs__title a:focus-visible {
    text-decoration: underline;
}

.jf-cs__excerpt {
    color: var(--jf-text);
    font-size: 16px;
    line-height: 1.6;
    margin-top: 10px;
}

.jf-cs__excerpt p:last-child {
    margin-bottom: 0;
}

/* ============================================================ Testimonials */

.jf-t .jf-grid {
    --jf-row-gap: 56px;
    align-items: start;
}

.jf-t__item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.jf-t--card .jf-t__item {
    background: #fff;
    border-radius: var(--jf-radius);
    box-shadow: var(--jf-shadow);
    padding: 28px;
}

.jf-t__stars {
    display: flex;
    gap: 4px;
    color: var(--jf-star);
    margin-bottom: 14px;
}

/* ------------------------------------------------------------------
   Numărul de rânduri afișate înainte de „Show more”.
   Butonul apare doar dacă textul depășește --jf-clamp rânduri.
   Schimbă doar aceste două valori; JS-ul le citește automat.
   ------------------------------------------------------------------ */
.jf-t__quote {
    --jf-clamp: 4;
    --jf-line: 27px;

    color: var(--jf-text);
    font-size: 17px;
    line-height: var(--jf-line);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--jf-clamp);
    line-clamp: var(--jf-clamp);
    overflow: hidden;
    max-height: calc(var(--jf-line) * var(--jf-clamp));
}

.jf-t__quote.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
    max-height: none;
}

/* wpautop() generează mai multe <p>; marginile dintre ele umflă scrollHeight
   și strică numărătoarea de rânduri. Le neutralizăm cât timp e clamp-at. */
.jf-t__quote p {
    margin: 0;
}

.jf-t__quote.is-expanded p {
    margin: 0 0 1em;
}

.jf-t__quote.is-expanded p:last-child {
    margin-bottom: 0;
}

.jf-t__toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    background: none;
    border: 0;
    padding: 6px 0 0;
    margin: 0;
    cursor: pointer;
    color: var(--jf-link);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
}

/* Fără asta, display: inline-flex bate display: none din stylesheet-ul
   browserului și butonul apare la toate testimonialele. */
.jf-t__toggle[hidden] {
    display: none !important;
}

.jf-t__toggle:hover .jf-t__toggle-label {
    text-decoration: underline;
}

.jf-t__chevron {
    width: 12px;
    height: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transform-origin: center;
    transition: transform .2s ease;
}

.jf-t__toggle[aria-expanded="true"] .jf-t__chevron {
    transform: rotate(-135deg);
}

.jf-t__footer {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 28px;
}

.jf-t__logo {
    flex: 0 0 56px;
    width: 56px;
}

.jf-t__logo img {
    width: 100%;
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

.jf-t__name {
    color: var(--jf-heading);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.jf-t__role {
    color: var(--jf-muted);
    font-size: 16px;
    line-height: 1.45;
}

/* ================================================================ Podcasts */

.jf-p .jf-grid {
    --jf-row-gap: 40px;
}

.jf-p__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.jf-p__media {
    display: block;
    width: 100%;
    border-radius: var(--jf-radius);
    overflow: hidden;
    box-shadow: var(--jf-shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}

.jf-p__media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

a.jf-p__media:hover,
a.jf-p__media:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--jf-shadow-hover);
}

.jf-p__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    padding: 14px 32px;
    border-radius: var(--jf-radius-cta);
    background: var(--jf-cta-bg);
    color: var(--jf-cta-text) !important;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.jf-p__cta:hover,
.jf-p__cta:focus-visible {
    background: var(--jf-cta-bg-hover);
    color: var(--jf-cta-text) !important;
    text-decoration: none;
    transform: translateY(-2px);
}

/* ================================================================== Focus */

.jf-block a:focus-visible,
.jf-block button:focus-visible {
    outline: 2px solid var(--jf-link);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============================================================ Responsive */

@media (max-width: 1024px) {
    .jf-grid {
        grid-template-columns: repeat(var(--jf-cols-tablet), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .jf-grid {
        grid-template-columns: repeat(var(--jf-cols-mobile), minmax(0, 1fr));
        --jf-row-gap: 36px;
    }

    .jf-block__title {
        margin-bottom: 24px;
    }

    .jf-cs__title {
        font-size: 20px;
    }

    .jf-p__cta {
        width: 100%;
        max-width: 320px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jf-block * {
        transition: none !important;
    }
}