/*
 * IMAT Academy Comments
 * Typography inherits Elementor globals. Colors are intentionally fixed to the IMAT palette.
 */
.imat-comments {
    --imat-navy-950: #032534;
    --imat-navy-900: #07354a;
    --imat-navy-800: #0b465d;
    --imat-teal-700: #087f83;
    --imat-teal-600: #0d9a9b;
    --imat-teal-500: #19b2ad;
    --imat-teal-300: #76d7d1;
    --imat-teal-100: #dff7f4;
    --imat-cyan-50: #f3fbfb;
    --imat-ink: #16313f;
    --imat-muted: #607985;
    --imat-line: #dbe9ed;
    --imat-white: #ffffff;
    --imat-success: #16745a;
    --imat-success-bg: #ecfbf6;
    --imat-error: #a13c49;
    --imat-error-bg: #fff2f3;
    --imat-shadow-sm: 0 10px 30px rgba(6, 49, 67, .07);
    --imat-shadow-md: 0 22px 60px rgba(6, 49, 67, .11);

    width: 100%;
    max-width: 980px;
    margin: 48px auto;
    color: var(--imat-ink);
    direction: rtl;
    text-align: right;
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-weight: var(--e-global-typography-text-font-weight, inherit);
    line-height: 1.9;
}

.imat-comments,
.imat-comments *,
.imat-comments *::before,
.imat-comments *::after {
    box-sizing: border-box;
}

.imat-comments h2,
.imat-comments h3,
.imat-comments strong,
.imat-comments button {
    font-family: var(--e-global-typography-primary-font-family, var(--e-global-typography-text-font-family, inherit));
}

.imat-comments svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.imat-comments__intro {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 30px 32px;
    margin-bottom: 18px;
    border: 1px solid rgba(13, 154, 155, .18);
    border-radius: 28px;
    background:
        radial-gradient(circle at 8% 10%, rgba(118, 215, 209, .18), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f3fbfb 100%);
    box-shadow: var(--imat-shadow-sm);
    overflow: hidden;
}

.imat-comments__intro::after {
    content: "";
    position: absolute;
    left: -42px;
    bottom: -70px;
    width: 170px;
    height: 170px;
    border: 28px solid rgba(25, 178, 173, .06);
    border-radius: 50%;
    pointer-events: none;
}

.imat-comments__intro-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.imat-comments__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
    color: var(--imat-teal-700);
    font-size: 13px;
    font-weight: 800;
}

.imat-comments__eyebrow::before {
    content: "";
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--imat-teal-500), var(--imat-navy-800));
}

.imat-comments__title {
    margin: 0 0 8px;
    color: var(--imat-navy-950);
    font-size: clamp(22px, 3vw, 31px);
    line-height: 1.55;
    font-weight: 900;
    letter-spacing: -.025em;
}

.imat-comments__description {
    max-width: 720px;
    margin: 0;
    color: var(--imat-muted);
    font-size: 14px;
    line-height: 2;
}

.imat-comments__count {
    position: relative;
    z-index: 1;
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: linear-gradient(145deg, var(--imat-navy-900), var(--imat-teal-600));
    color: #fff;
    box-shadow: 0 16px 34px rgba(7, 53, 74, .22);
}

.imat-comments__count strong {
    font-size: 24px;
    line-height: 1.1;
    font-weight: 900;
}

.imat-comments__count span {
    margin-top: 6px;
    font-size: 11px;
    opacity: .82;
}

.imat-comments__notice {
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
}

.imat-comments__notice--success {
    color: var(--imat-success);
    background: var(--imat-success-bg);
    border-color: rgba(22, 116, 90, .13);
}

.imat-comments__notice--error {
    color: var(--imat-error);
    background: var(--imat-error-bg);
    border-color: rgba(161, 60, 73, .12);
}

.imat-comments__form-card {
    position: relative;
    padding: 28px;
    border: 1px solid var(--imat-line);
    border-radius: 26px;
    background: var(--imat-white);
    box-shadow: var(--imat-shadow-md);
    overflow: hidden;
}

.imat-comments__form-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--imat-teal-500), var(--imat-navy-800));
}

.imat-comments__form-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 22px;
}

.imat-comments__icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--imat-teal-100);
    color: var(--imat-teal-700);
}

.imat-comments__icon svg {
    width: 22px;
    height: 22px;
}

.imat-comments__form-heading h3,
.imat-comments__list-head h3 {
    margin: 0;
    color: var(--imat-navy-950);
    font-size: 18px;
    line-height: 1.55;
    font-weight: 900;
}

.imat-comments__form-heading p {
    margin: 5px 0 0;
    color: var(--imat-muted);
    font-size: 12px;
}

.imat-comments__form {
    display: grid;
    gap: 17px;
}

.imat-comments__field label {
    display: block;
    margin-bottom: 8px;
    color: var(--imat-navy-900);
    font-size: 13px;
    font-weight: 800;
}

.imat-comments__field label span {
    color: #d95362;
}

.imat-comments__field input,
.imat-comments__field textarea {
    width: 100%;
    display: block;
    margin: 0;
    border: 1px solid #d6e7ea;
    border-radius: 15px;
    background: #f8fcfd;
    color: var(--imat-ink);
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.9;
    outline: 0;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.imat-comments__field input {
    min-height: 52px;
    padding: 11px 15px;
}

.imat-comments__field textarea {
    min-height: 145px;
    padding: 13px 15px;
    resize: vertical;
}

.imat-comments__field input::placeholder,
.imat-comments__field textarea::placeholder {
    color: #8ca1aa;
    opacity: 1;
}

.imat-comments__field input:focus,
.imat-comments__field textarea:focus {
    background: #fff;
    border-color: var(--imat-teal-500);
    box-shadow: 0 0 0 4px rgba(25, 178, 173, .11);
}

.imat-comments__form-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 1px;
}

.imat-comments__privacy {
    margin: 0;
    color: var(--imat-muted);
    font-size: 11px;
    line-height: 1.8;
}

.imat-comments__submit {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin: 0;
    padding: 11px 21px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--imat-teal-600), var(--imat-teal-700));
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(13, 154, 155, .24);
    transition: transform .2s ease, box-shadow .2s ease;
}

.imat-comments__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(13, 154, 155, .31);
}

.imat-comments__submit:focus-visible {
    outline: 3px solid rgba(25, 178, 173, .25);
    outline-offset: 3px;
}

.imat-comments__submit svg {
    width: 18px;
    height: 18px;
}

.imat-comments__honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.imat-comments__closed {
    padding: 18px;
    border-radius: 14px;
    background: var(--imat-cyan-50);
    color: var(--imat-muted);
    text-align: center;
    font-size: 13px;
}

.imat-comments__list-wrap {
    margin-top: 36px;
}

.imat-comments__list-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.imat-comments__list-head .imat-comments__eyebrow {
    margin-bottom: 5px;
}

.imat-comments__showing {
    flex: 0 0 auto;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--imat-cyan-50);
    color: var(--imat-muted);
    font-size: 11px;
}

.imat-comments__list {
    display: grid;
    gap: 12px;
}

.imat-comments__item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border: 1px solid var(--imat-line);
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(6, 49, 67, .035);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.imat-comments__item:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 154, 155, .31);
    box-shadow: var(--imat-shadow-sm);
}

.imat-comments__avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--imat-navy-900), var(--imat-teal-600));
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 9px 20px rgba(7, 53, 74, .16);
}

.imat-comments__item-main {
    min-width: 0;
    flex: 1;
}

.imat-comments__item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 7px;
}

.imat-comments__item-head strong {
    color: var(--imat-navy-950);
    font-size: 13px;
    font-weight: 900;
}

.imat-comments__item-head time {
    color: #899fa8;
    font-size: 11px;
    white-space: nowrap;
}

.imat-comments__content {
    color: #4d6874;
    font-size: 13px;
    line-height: 2.05;
    overflow-wrap: anywhere;
}

.imat-comments__empty {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    border: 1px dashed #cfe2e6;
    border-radius: 21px;
    background: var(--imat-cyan-50);
    text-align: center;
}

.imat-comments__empty-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 16px;
    background: var(--imat-teal-100);
    color: var(--imat-teal-700);
}

.imat-comments__empty-icon svg {
    width: 24px;
    height: 24px;
}

.imat-comments__empty strong {
    color: var(--imat-navy-950);
    font-size: 14px;
    font-weight: 900;
}

.imat-comments__empty p {
    margin: 4px 0 0;
    color: var(--imat-muted);
    font-size: 12px;
}

@media (max-width: 767px) {
    .imat-comments {
        margin: 32px auto;
    }

    .imat-comments__intro {
        align-items: flex-start;
        gap: 16px;
        padding: 23px 20px;
        border-radius: 22px;
    }

    .imat-comments__count {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
        border-radius: 19px;
    }

    .imat-comments__count strong {
        font-size: 19px;
    }

    .imat-comments__title {
        font-size: 21px;
    }

    .imat-comments__description {
        font-size: 12px;
    }

    .imat-comments__form-card {
        padding: 22px 18px;
        border-radius: 21px;
    }

    .imat-comments__form-bottom,
    .imat-comments__list-head {
        align-items: stretch;
        flex-direction: column;
    }

    .imat-comments__submit {
        width: 100%;
    }

    .imat-comments__showing {
        align-self: flex-start;
    }

    .imat-comments__item {
        padding: 16px;
    }

    .imat-comments__avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 13px;
        font-size: 15px;
    }

    .imat-comments__item-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}

@media (max-width: 430px) {
    .imat-comments__intro {
        display: block;
    }

    .imat-comments__count {
        width: auto;
        height: auto;
        min-height: 48px;
        margin-top: 16px;
        padding: 9px 14px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 7px;
        border-radius: 14px;
    }

    .imat-comments__count span {
        margin-top: 0;
    }

    .imat-comments__form-heading {
        gap: 10px;
    }

    .imat-comments__icon {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .imat-comments *,
    .imat-comments *::before,
    .imat-comments *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* =========================================================
 * FONT INHERITANCE PATCH
 * Uses the font already applied by WordPress / Elementor.
 * No custom font is declared by this plugin.
 * ========================================================= */
.imat-comments,
.imat-comments * {
    font-family: inherit !important;
}

.imat-comments input,
.imat-comments textarea,
.imat-comments button,
.imat-comments select {
    font-family: inherit !important;
}

/* Submit button: always keep label/icon white, even if theme/Elementor overrides buttons. */
.imat-comments .imat-comments__submit,
.imat-comments .imat-comments__submit:hover,
.imat-comments .imat-comments__submit:focus,
.imat-comments .imat-comments__submit:active,
.imat-comments .imat-comments__submit:visited,
.imat-comments .imat-comments__submit *,
.imat-comments .imat-comments__submit:hover *,
.imat-comments .imat-comments__submit:focus *,
.imat-comments .imat-comments__submit:active * {
    color: #ffffff !important;
    font-family: inherit !important;
}

.imat-comments .imat-comments__submit svg,
.imat-comments .imat-comments__submit svg * {
    color: #ffffff !important;
    stroke: #ffffff !important;
}
