/* ================================================
   Langrushi Card Widget v2 — Frontend CSS
   ================================================ */

/* ── Grid ─────────────────────────────────────── */
.lgr-grid {
    display: grid;
    grid-template-columns: repeat(var(--lgr-cols, 4), 1fr);
    gap: 24px;
    width: 100%;
    align-items: stretch;
}

/*
 * Last-row alignment:
 * Switch to flex only when alignment is needed. Card width is computed
 * from --lgr-cols (set by Elementor) and the gap so columns stay intact.
 * Left (default) stays as grid — no attribute written.
 */
.lgr-grid[data-last-align="center"],
.lgr-grid[data-last-align="flex-end"] {
    display: flex;
    flex-wrap: wrap;
}
.lgr-grid[data-last-align="center"] {
    justify-content: center;
}
.lgr-grid[data-last-align="flex-end"] {
    justify-content: flex-end;
}
.lgr-grid[data-last-align="center"] > .lgr-card,
.lgr-grid[data-last-align="flex-end"] > .lgr-card {
    /* Replicate grid column width: (100% - gaps) / cols */
    flex: 0 0 calc((100% - (var(--lgr-cols, 4) - 1) * var(--lgr-gap, 24px)) / var(--lgr-cols, 4));
    max-width: calc((100% - (var(--lgr-cols, 4) - 1) * var(--lgr-gap, 24px)) / var(--lgr-cols, 4));
    box-sizing: border-box;
}

/* ── Elementor wrapper ────────────────────────── */
.elementor-widget-lgr_card .elementor-widget-container,
.elementor-widget-lgr_course_grid .elementor-widget-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Card ─────────────────────────────────────── */
.lgr-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: #cef567;
    border-radius: 20px;
    padding: 24px 20px;
    box-sizing: border-box;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lgr-card--match-height {
    height: 100%;
    min-height: 0;
}

.lgr-spacer {
    flex: 1 1 auto;
    min-height: 0;
}

/* ── Pill ─────────────────────────────────────── */
.lgr-pill-wrap {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.lgr-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background-color: #4caf6e;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.lgr-pill-text {
    color: inherit;
    line-height: 1;
}

/* FontAwesome / inline SVG icon */
.lgr-pill-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}
.lgr-pill-icon i   { color: inherit; font-size: 14px; line-height: 1; }
.lgr-pill-icon svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.lgr-pill-icon svg path { fill: currentColor; }

/* SVG-from-URL icon — img tag */
.lgr-pill-icon--svg {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1;
}
.lgr-pill-icon--svg img {
    width: 16px;      /* default, overridden by Elementor pill_icon_size */
    height: 16px;
    display: block;
    object-fit: contain;
    /* Default tint: white. Overridden by JS (lgr-svg-tint) once color is computed. */
    filter: brightness(0) invert(1);
}
/* JS will replace the filter with a precise computed value for custom colors.
   The data-tint-color attribute holds the target hex color. */

/* ── Card image ───────────────────────────────── */
.lgr-card-image {
    width: 100%;
    display: flex;
    justify-content: center;
}
.lgr-card-image img {
    max-width: 100%;
    height: 120px;
    width: 100%;
    object-fit: contain;
    display: block;
}

/* ── Title ────────────────────────────────────── */
.lgr-title {
    font-size: 16px;
    /* font-weight intentionally not set — controlled by Elementor Typography */
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0 0 4px 0;
    padding: 0;
    width: 100%;
}

/* ── Description ──────────────────────────────── */
.lgr-description {
    font-size: 20px;
    /* font-weight intentionally not set — controlled by Elementor Typography */
    color: #1a1a1a;
    line-height: 1.3;
    width: 100%;
}

/* ── Pricing row ──────────────────────────────── */
.lgr-pricing {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.lgr-hours {
    font-size: 17px;
    /* font-weight intentionally not set — controlled by Elementor Typography */
    color: #1a1a1a;
    white-space: nowrap;
}

.lgr-divider {
    width: 2px;
    height: 36px;
    background-color: #1a1a1a;
    flex-shrink: 0;
    align-self: center;
    border-radius: 2px;
}

.lgr-price-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lgr-old-price {
    font-size: 13px;
    color: #888888;
    text-decoration: line-through;
    line-height: 1.2;
}

.lgr-new-price {
    font-size: 19px;
    /* font-weight intentionally not set — controlled by Elementor Typography */
    color: #1a1a1a;
    line-height: 1.2;
}

/* ── Buttons ──────────────────────────────────── */
.lgr-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: stretch;
}

.lgr-btn {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    border: none;
    outline: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    line-height: 1;
    padding: 12px 20px;
    border-radius: 50px;
    box-sizing: border-box;
    white-space: nowrap;
}

.lgr-btn:hover  { transform: translateY(-1px); text-decoration: none !important; }
.lgr-btn:active { transform: translateY(0); }

.lgr-btn-details       { background-color: #2d3e50; color: #ffffff !important; }
.lgr-btn-details:hover { background-color: #1a2a38; color: #ffffff !important; }
.lgr-btn-cta           { background-color: #e53935; color: #ffffff !important; }
.lgr-btn-cta:hover     { background-color: #c62828; color: #ffffff !important; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 1024px) {
    .lgr-grid { grid-template-columns: repeat(2, 1fr); --lgr-cols: 2; }
}
@media (max-width: 640px) {
    .lgr-grid  { grid-template-columns: 1fr; --lgr-cols: 1; }
    .lgr-description { font-size: 17px; }
    .lgr-new-price   { font-size: 16px; }
}

/* Buttons shrink-to-content mode (when alignment is not stretch) */
.lgr-buttons--shrink .lgr-btn {
    width: auto;
    display: inline-block;
}
