/* ==========================================
   Base
========================================== */

.rd-single-page {
    width: 100%;
    direction: rtl;
    background: #fff;
    color: #5f5f5f;
    margin-bottom: 0 !important;
}

.rd-single-page,
.rd-single-page * {
    box-sizing: border-box;
}

.rd-single-container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 55px 0 0;

    display: grid;
    grid-template-columns:
        minmax(0, 2.15fr)
        minmax(250px, 0.85fr);

    grid-template-areas:
        "article sidebar"
        "comments comments";

    column-gap: 64px;
    row-gap: 0;

    align-items: start;
}

.rd-single-article {
    grid-area: article;
    min-width: 0;
}

.rd-single-sidebar {
    grid-area: sidebar;
    min-width: 0;
}

.rd-comments-section {
    grid-area: comments;
}


/* ==========================================
   Featured image
========================================== */

.rd-single-featured-image {
    width: 100%;
    margin: 0 0 42px;
    overflow: hidden;
}

.rd-single-featured-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: cover;
}


/* ==========================================
   Post title and meta
========================================== */

.rd-single-header {
    margin-bottom: 34px;
}

.rd-single-title {
    margin: 0 0 10px;
    color: #007b65;
    font-size: clamp(25px, 2vw, 28px);
    font-weight: 800;
    line-height: 1.1;
}

.rd-single-meta {
    color: #00836c;
    font-size: 14px;
    font-weight: 700;
}


/* ==========================================
   Post content
========================================== */

.rd-single-content {
    color: #626262;
    font-size: 16px;
    line-height: 2;
    text-align: justify;
}

.rd-single-content > *:first-child {
    margin-top: 0;
}

.rd-single-content p {
    margin: 0 0 1px;
}

.rd-single-content h2 {
    margin: 10px 0 10px;
    color: #007b65;
    font-size: clamp(24px, 1.7vw, 25px);
    font-weight: 800;
    line-height: 1;
}

.rd-single-content h3 {
    margin: 10px 0 10px;
    color: #007b65;
    font-size: clamp(21px, 1.5vw, 22px);
    font-weight: 800;
    line-height: 1;
}

.rd-single-content h4 {
    margin: 10px 0 10px;
    color: #007b65;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

.rd-single-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px auto;
}

.rd-single-content figure {
    max-width: 100%;
    margin: 42px 0;
}

.rd-single-content figure img {
    margin: 0 auto;
}

.rd-single-content figcaption {
    margin-top: 12px;
    color: #777;
    font-size: 14px;
    text-align: center;
}

.rd-single-content ul,
.rd-single-content ol {
    margin: 2px 0;
    padding-right: 25px;
}

.rd-single-content li {
    margin-bottom: 5px;
}

.rd-single-content ul li::marker {
    color: #00836c;
}

.rd-single-content a {
    color: #00836c;
    text-decoration: none;
}

.rd-single-content a:hover {
    text-decoration: underline;
}

.rd-single-content blockquote {
    margin: 15px 0;
    padding: 22px 26px;
    border-right: 4px solid #00836c;
    background: #f5f7f7;
}

.rd-single-content table {
    width: 100%;
    margin: 15px 0;
    border-collapse: collapse;
}

.rd-single-content th,
.rd-single-content td {
    padding: 13px;
    border: 1px solid #ddd;
}

.rd-single-content th {
    color: #fff;
    background: #007b65;
}


/* ==========================================
   Tags
========================================== */

.rd-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 15px;
}

.rd-single-tags a {
    padding: 2px 5px;
    border: 1px solid #e2e2e2;
    color: #666;
    font-size: 12px;
    text-decoration: none;
}

.rd-single-tags a:hover {
    border-color: #00836c;
    color: #00836c;
}


/* ==========================================
   Sidebar
========================================== */

.rd-sidebar-widget {
    margin-bottom: 26px;
}

.rd-sidebar-title {
    margin: 0 0 10px;
    color: #555;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
}


/* Sidebar search */

.rd-sidebar-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 6px;
}

.rd-sidebar-search-form input {
    width: 100%;
    height: 43px;
    padding: 8px 13px;
    border: 1px solid #e4e4e4;
    border-radius: 0;
    outline: none;
    background: #fff;
    font: inherit;
}

.rd-sidebar-search-form input:focus {
    border-color: #00836c;
}

.rd-sidebar-search-form button {
    height: 43px;
    padding: 0 16px;
    border: 0;
    border-radius: 0;
    background: #00836c;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.rd-sidebar-search-form button:hover {
    background: #006d5a;
}


/* Recent posts */

.rd-recent-posts {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rd-recent-post {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 15px;
    align-items: start;
}

.rd-recent-post-image {
    display: block;
    width: 105px;
    height: 82px;
    overflow: hidden;
    border-radius: 10px;
}

.rd-recent-post-image img,
.rd-recent-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rd-recent-placeholder {
    background: #ededed;
}

.rd-recent-post-content {
    min-width: 0;
}

.rd-recent-post-content h3 {
    margin: 0 0 5px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.65;
}

.rd-recent-post-content h3 a {
    color: #555;
    text-decoration: none;
}

.rd-recent-post-content h3 a:hover {
    color: #00836c;
}

.rd-recent-post-content p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #666;
    font-size: 13px;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}


/* Categories */

.rd-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rd-category-list a {
    padding: 7px 12px;
    border: 1px solid #e4e4e4;
    color: #696969;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
}

.rd-category-list a:hover {
    border-color: #00836c;
    color: #00836c;
}


/* ==========================================
   Comments section
========================================== */

.rd-comments-section {
    position: relative;
    isolation: isolate;

    display: grid;
    /*grid-template-columns:
        minmax(0, 1.08fr)
        minmax(340px, 0.92fr);

    grid-template-areas: "form intro"; */

    gap: clamp(15px, 2vw, 100px);
    align-items: start;

    /*margin-top: 80px;
    padding: 75px 0 85px;*/

    direction: ltr;
    background: #f7f7f7;

    box-shadow: 0 0 0 100vmax #f7f7f7;
    clip-path: inset(0 -100vmax);
}

.rd-comments-form {
    grid-area: form;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;

}

.rd-comments-intro {
    grid-area: intro;
    min-width: 0;
    direction: rtl;
    text-align: right;
}


/* Comments intro */

.rd-comments-intro h2 {
    margin: 0 0 5px;
    color: #555;
    font-size: clamp(27px, 1.7vw, 27px);
    font-weight: 800;
    line-height: 1.25;
}

.rd-comments-intro h2 span {
    color: #00836c;
}

.rd-comments-intro p {
    max-width: 500px;
    margin: 0 0 10px;
    color: #555;
    font-size: clamp(17px, 1.55vw, 16px);
    font-weight: 400;
    line-height: 1.7;
}

.rd-comments-intro .rd-comments-note {
    font-size: clamp(17px, 1.3vw, 18px);
    line-height: 1.7;
}


/* WordPress form cleanup */

.rd-comments-form .comment-respond {
    margin: 0;
    padding: 0;
}

.rd-comments-form .comment-reply-title,
.rd-comments-form .logged-in-as,
.rd-comments-form .comment-notes,
.rd-comments-form .must-log-in,
.rd-comments-form .required-field-message {
    display: none;
}

.rd-comments-form .comment-form {
    display: flex;
    flex-direction: column;
    gap: 27px;
    margin: 0;
}
.rd-comments-form .comments-area{
    background-color: #f7f7f7 !important;
    direction: rtl;
}

.rd-comments-form .comment-form p {
    margin: 0;
    width:100%;
}

.rd-comments-form .comment-form-author {
    order: 1;
}

.rd-comments-form .comment-form-email {
    order: 2;
}

.rd-comments-form .comment-form-comment {
    order: 3;
}


.rd-comments-form .form-submit {
    order: 4;
}


/* Form labels */

.rd-comments-form label {
    display: block;
    margin: 0 0 11px;
    color: #505050;
    font-size: clamp(18px, 1.35vw, 23px);
    font-weight: 400;
    line-height: 1.5;
    text-align: right;
}

.rd-comments-form .required {
    margin-right: 2px;
    color: #505050;
}


/* Form inputs */

.rd-comments-form input[type="text"],
.rd-comments-form input[type="email"],
.rd-comments-form textarea {
    display: block;
    width: 100%;
    margin: 0;
    border: 2px solid #d0d0d0;
    border-radius: 0;
    outline: none;
    background: #fff;
    box-shadow: none;
    color: #555;
    font-family: inherit;
    font-size: 18px;
    text-align: right;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.rd-comments-form input[type="text"],
.rd-comments-form input[type="email"] {
    height: 52px;
    padding: 8px 15px;
}

.rd-comments-form textarea {
    max-height: 220px;
    padding: 14px 16px;
    resize: vertical;
    line-height: 1.9;
}

.rd-comments-form input::placeholder,
.rd-comments-form textarea::placeholder {
    color: #c7c7c7;
    opacity: 1;
}

.rd-comments-form input:focus,
.rd-comments-form textarea:focus {
    border-color: #00836c;
    box-shadow: 0 0 0 1px #00836c;
}


/* Submit */

.rd-comments-form .form-submit {
    margin-top: 4px;
    text-align: left;
}

.rd-comments-form .rd-comment-submit,
.rd-comments-form input[type="submit"] {
    width: 140px;
    min-width: 140px;
    height: 42px;
    padding: 0 28px;
    border: 0;
    border-radius: 0;
    background: #00836c;
    color: #fff;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 54px;
    text-align: center;
    cursor: pointer;
}

.rd-comments-form .rd-comment-submit:hover,
.rd-comments-form input[type="submit"]:hover {
    background: #006b58;
}


/* Existing comments */

.rd-comments-form .comments-title,
.rd-comments-form .comment-list,
.rd-comments-form .comment-navigation {
    display: none;
}

/* خنثی‌کردن Grid و Float آسترا فقط در فرم دیدگاه سفارشی */
.rd-comments-form .ast-comment-formwrap.ast-row,
.rd-comments-form .comment-textarea.ast-row {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

.rd-comments-form .ast-row::before,
.rd-comments-form .ast-row::after {
    display: none !important;
    content: none !important;
}

.rd-comments-form .ast-grid-common-col,
.rd-comments-form .ast-width-lg-33,
.rd-comments-form .ast-width-md-4,
.rd-comments-form .ast-float {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.rd-comments-form .comment-textarea,
.rd-comments-form .comment-form-comment,
.rd-comments-form .comment-form-author,
.rd-comments-form .comment-form-email {
    display: block !important;
    width: 100% !important;
    clear: both !important;
}

.rd-comments-form .comment-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 27px;
}

.rd-comments-form .ast-comment-formwrap {
    order: 1;
}

.rd-comments-form .comment-textarea {
    order: 2;
}

.rd-comments-form .form-submit {
    order: 3;
}

.rd-comments-form .ast-comment-formwrap .comment-form-author {
    margin-bottom: 27px !important;
}

.rd-comments-form .ast-comment-formwrap .comment-form-email {
    margin-bottom: 0 !important;
}


/* ==========================================
   Astra overrides
========================================== */

.single-post .site-content > .ast-container {
    max-width: none;
    padding: 0;
}

.single-post #primary {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

.single-post #secondary {
    display: none;
}

.single-post .entry-header,
.single-post .entry-content,
.single-post .entry-footer {
    max-width: none;
}




/* ==========================================
   Responsive
========================================== */

@media (max-width: 1024px) {

    .rd-single-container {
        grid-template-columns:
            minmax(0, 1.8fr)
            minmax(230px, 0.8fr);

        column-gap: 38px;
    }

    .rd-recent-post {
        grid-template-columns: 85px minmax(0, 1fr);
    }

    .rd-recent-post-image {
        width: 85px;
        height: 72px;
    }



    .rd-comments-form textarea {
        max-height: 220px;
    }
}

@media (max-width: 820px) {

    .rd-single-container {
        grid-template-columns: 1fr;

        grid-template-areas:
            "article"
            "sidebar"
            "comments";
    }

    .rd-single-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 35px;
        margin-top: 55px;
    }

    .rd-search-widget {
        grid-column: 1 / -1;
    }

    .rd-sidebar-widget {
        margin-bottom: 20px;
    }

    .rd-comments-section {
        grid-template-columns: 1fr;
        gap: 1px;
        padding: 15px 0 15px;
    }

    .rd-comments-intro p {
        max-width: none;
    }

    .rd-comments-form textarea {
        max-height: 200px;
    }

    .rd-comments-form .form-submit {
        text-align: right;
    }
}

@media (max-width: 580px) {

    .rd-single-container {
        width: min(100% - 28px, 1180px);
        padding-top: 30px;
    }

    .rd-single-sidebar {
        grid-template-columns: 1fr;
    }

    .rd-single-featured-image {
        margin-bottom: 28px;
    }

    .rd-single-title {
        font-size: 27px;
    }

    .rd-single-content {
        font-size: 16px;
        line-height: 2;
    }

    .rd-sidebar-search-form {
        grid-template-columns: minmax(0, 1fr) 80px;
    }

    .rd-comments-section {
        margin-top: 15px;
        padding: 15px 0 15px;
    }

    .rd-comments-intro h2 {
        margin-bottom: 22px;
        font-size: 32px;
    }

    .rd-comments-intro p,
    .rd-comments-intro .rd-comments-note {
        margin-bottom: 23px;
        font-size: 16px;
        line-height: 1.95;
    }

    .rd-comments-form .comment-form {
        gap: 20px;
    }

    .rd-comments-form {
        min-width: 0;
        display: flex;
        flex-direction: column-reverse;
        justify-content: center;
        align-content: center;
        flex-wrap: wrap;
    }
    .rd-comments-form label {
        font-size: 17px;
    }

    .rd-comments-form input[type="text"],
    .rd-comments-form input[type="email"] {
        height: 48px;
    }

    .rd-comments-form textarea {
        min-height: 170px;
    }

    .rd-comments-form .rd-comment-submit,
    .rd-comments-form input[type="submit"] {
        width: 140px;
        min-width: 140px;
        height: 49px;
        font-size: 19px;
        line-height: 49px;
    }
}


/* فقط روی دسکتاپ */
@media (min-width: 580px) {
  /* grid cell سایدبار به ارتفاع article کشیده بمونه (پیش‌فرض stretch) */
  .rd-single-container {
    align-items: stretch;
  }

  /* سایدبار به انتهای cell خودش می‌چسبه و از پایین viewport sticky می‌شه */
  .rd-single-sidebar {
    align-self: end;
    position: sticky;
    bottom: 0;
  }
}

.field-error{

    color:#dc2626;
    font-size:13px;
    margin-top:8px;
    display:flex;
    align-items:center;
    gap:6px;

}

.field-error::before{
    content:"⚠";
    font-size:12px;
}

.has-error{
    border:1px solid #dc2626 !important;
    background:#fff8f8;
}

