/* =====================================================================
   Course cards — shared by the home, courses, search and teacher pages.
   Columns opt in with .pcc-col (Home::pages.courses.section.course-box,
   Home::components.courses.course-box, Home::pages.teachers.courses).
   ===================================================================== */

/* Equal height: the column stretches to its row, the card fills the column,
   and the footer sits at the bottom whatever the title length. */
.pcc-col { display: flex; }
.pcc-col > .courses__item,
.pcc-col > .courses__item-two {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.pcc-col .courses__item-content,
.pcc-col .courses__item-two-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* Category tags stay on one line, so a course with more categories is not taller. */
.pcc-col .pcc-tags {
    display: flex;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 13px;
}
.pcc-col .pcc-tags .courses__item-tag { flex-shrink: 0; margin: 0 !important; }

/* Every title takes exactly two lines: short ones keep the space, long ones are cut. */
.pcc-col .courses__item-content .title,
.pcc-col .courses__item-two-content .title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 19px;
    line-height: 1.55;
    min-height: 3.1em;
}
.pcc-col .courses__item-content .title a,
.pcc-col .courses__item-two-content .title a { font-size: inherit; }

/* Same thumbnail size for every card — the uploaded thumbs are 300x153. */
.pcc-col .shine__animate-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 300 / 153;
}
.pcc-col .pcc-thumb-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* A course without an image shows the logo instead of a broken image. */
.pcc-col .pcc-thumb-img--placeholder {
    object-fit: contain;
    padding: 12% 30%;
    background: #eef3fb;
}
body.dark-mode .pcc-col .pcc-thumb-img--placeholder { background: rgba(255, 255, 255, .04); }

/* Teacher avatar on the thumbnail: the teacher's name shows in a tooltip on hover/focus.
   The avatar is pinned to the card's left edge, so the tooltip grows rightwards from it. */
.pcc-avatar {
    position: relative;
    display: block;
}
.pcc-avatar__tip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 220px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    background: #1b2333;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    width: max-content;
    text-align: start;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.pcc-avatar__tip small {
    color: #9aa5b8;
    font-size: 11px;
    font-weight: 500;
}
/* little arrow pointing at the avatar */
.pcc-avatar__tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 19px;
    border: 6px solid transparent;
    border-top-color: #1b2333;
}
.pcc-avatar:hover .pcc-avatar__tip,
.pcc-avatar:focus-visible .pcc-avatar__tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .pcc-avatar__tip { transition: none; }
}

/* margin-top:auto on the footer drops its own margin, so the row above keeps the gap
   — otherwise the meta row (sessions, duration, students) sits on the divider line. */
.pcc-col .courses__item-two-content .courses__item-meta { margin-bottom: 10px !important; }

/* Footer: author and price on one line; the price never wraps under the author. */
.pcc-col .courses__item-bottom {
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    margin-top: auto !important;
}
.pcc-col .courses__item-bottom .author { min-width: 0; }
.pcc-col .courses__item-bottom .author > a:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    line-height: 48px;
}
.pcc-col .courses__item-bottom .price,
.pcc-col .courses__item-bottom .course__price {
    flex-shrink: 0;
    margin: 0 !important;
    margin-inline-start: auto !important;
}

/* =====================================================================
   Free course price — Home::components.courses.free-price
   A free course may keep the price it is worth; it is shown struck through
   next to «رایگان» so the user sees what they save.
   ===================================================================== */
.pfp {
    --pfp-green: #16c172;
    --pfp-green-soft: rgba(22, 193, 114, .1);
    --pfp-green-line: rgba(22, 193, 114, .4);
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    line-height: 1.3;
}
.pfp__was {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-size: 14px;
    font-weight: 500;
    color: #7a8699;
    white-space: nowrap;
}
body.dark-mode .pfp__was { color: #9aa5b8; }
.pfp__was del { color: inherit !important; text-decoration-thickness: 1.5px; }
.pfp__was small { font-size: 11px; }
.pfp__now {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 20px;
    font-weight: 800;
    color: var(--pfp-green) !important;
    white-space: nowrap;
}
.pfp__now i { font-size: .8em; }

/* Course card: old price stacked over «رایگان» so it fits beside the author */
.pfp--card {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    line-height: 1;
}
.pfp--card .pfp__was { font-size: 13px; }

/* Cards whose footer is the full width (no author beside it) keep it on one line */
.courses__item-two .pfp--card {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
}

/* Thumbnail badge (sits with .pui-badge--off / --soon) */
.pui-badge--gift {
    background: linear-gradient(135deg, #16c172 0%, #0a9d55 100%);
    box-shadow: 0 8px 18px -8px rgba(18, 187, 106, .65);
}
