/* Focused BaharSEO site tweaks - only header brand, Astra breadcrumb, post comments, category archives. */

/* The existing brand is moved from the left end to the right, just before Home. */
#masthead.bseo-header .bseo-brand {
    order: 0;
    margin-inline-start: 0;
    margin-inline-end: clamp(4px,.7vw,12px);
    max-width: 98px;
    flex: 0 0 auto;
}
#masthead.bseo-header .bseo-brand .bseo-fixed-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 0;
}
#masthead.bseo-header .bseo-brand img,
#masthead.bseo-header .bseo-brand img.custom-logo {
    width: auto!important;
    height: auto!important;
    max-width: 94px!important;
    max-height: 59px!important;
    object-fit: contain;
}
#masthead.bseo-header .bseo-nav { order: 1; flex: 1 1 auto; }
#masthead.bseo-header .bseo-product-link { order: 2; }
#masthead.bseo-header .bseo-cta { order: 3; }
#masthead.bseo-header .bseo-toggle { order: 4; }
#masthead.bseo-header .bseo-header-inner { gap: clamp(9px, 1.15vw, 18px); }
@media (max-width: 1100px) {
    #masthead.bseo-header .bseo-brand { max-width: 80px; }
    #masthead.bseo-header .bseo-brand img { max-width: 78px!important; max-height: 52px!important; }
}
@media (max-width: 980px) {
    #masthead.bseo-header .bseo-brand { order:0; margin-inline-end:0; margin-inline-start:0; }
    #masthead.bseo-header .bseo-toggle { order:4; margin-inline-start:auto; }
    #masthead.bseo-header .bseo-cta { order:3; margin-inline-start:auto; }
}
@media (max-width: 560px) {
    #masthead.bseo-header .bseo-brand img { max-width: 90px!important; max-height: 51px!important; }
    #masthead.bseo-header .bseo-brand .bseo-fixed-logo { min-height: 52px; }
    #masthead.bseo-header .bseo-toggle { margin-inline-start:auto; }
}

/* Astra's visual breadcrumb is also disabled in PHP; this is a theme-specific fallback. */
body .ast-header-breadcrumb { display: none!important; }

/* Comment form: keep name, textarea, five emoji ratings and submit; remove other guest fields. */
body.single-post #respond .comment-form .bseo-simple-author {
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    gap:10px;
    flex:1 0 100%;
    width:100%!important;
    max-width:100%!important;
    margin:4px 0 23px!important;
    padding:0!important;
    float:none!important;
}
body.single-post #respond .bseo-simple-author label {
    display:block!important;
    position:static!important;
    clip:auto!important;
    clip-path:none!important;
    width:auto!important;
    height:auto!important;
    overflow:visible!important;
    margin:0!important;
    padding:0!important;
    color:#123d5b;
    font-size:14px;
    line-height:1.8;
    font-weight:850;
}
body.single-post #respond .bseo-simple-author label span { color:#12a4b8; }
body.single-post #respond .bseo-simple-author input#author {
    box-sizing:border-box;
    display:block;
    width:100%!important;
    min-height:58px;
    max-width:100%!important;
    border:1px solid #cde7f0!important;
    border-radius:15px!important;
    padding:14px 20px!important;
    background:linear-gradient(115deg,#f7fcff,#fff)!important;
    color:#153d59!important;
    font:inherit;
    font-size:15px!important;
    line-height:1.8!important;
    box-shadow:0 4px 16px rgba(12,69,107,.045)!important;
    transition:border-color .2s,box-shadow .2s,background-color .2s;
}
body.single-post #respond .bseo-simple-author input#author:focus {
    outline:0!important;
    border-color:#0db6cb!important;
    box-shadow:0 0 0 4px rgba(13,182,203,.12)!important;
    background:#fff!important;
}
body.single-post #respond .bseo-simple-author input#author::placeholder { color:#95abb9; opacity:1; }
body.single-post #respond .bseo-simple-author small {
    font-size:12px;
    color:#70889a;
    line-height:1.9;
}
body.single-post #respond .comment-form .ast-row { display:flex; flex-wrap:wrap; width:100%; }

/* Category archives only: improved reading width and responsive card layout. */
body.category { background:#f7fbfe; }
body.category #content.site-content > .ast-container {
    box-sizing:border-box;
    display:block;
    width:min(1260px,calc(100% - 42px));
    max-width:none;
    margin-inline:auto;
    padding:clamp(23px,3vw,45px) 0 clamp(60px,7vw,100px);
}
body.category #primary { box-sizing:border-box; width:100%!important; max-width:100%!important; float:none!important; }
body.category .ast-archive-description {
    box-sizing:border-box;
    position:relative;
    overflow:hidden;
    width:100%;
    margin:0 0 clamp(24px,4vw,42px)!important;
    padding:clamp(24px,4vw,46px)!important;
    background:radial-gradient(circle at 3% 0%,rgba(51,217,220,.16),transparent 39%),linear-gradient(122deg,#fff,#effaff);
    border:1px solid #d9edf5;
    border-radius:25px;
    box-shadow:0 15px 40px rgba(8,57,94,.065);
    text-align:right;
}
body.category .ast-archive-description::before {
    content:'مجله تخصصی بهارسئو';
    display:inline-flex;
    align-items:center;
    min-height:31px;
    padding:4px 13px;
    margin:0 0 15px;
    background:#e5faff;
    color:#0b829b;
    border:1px solid #c2eaf1;
    border-radius:999px;
    font-size:12px;
    line-height:1.8;
    font-weight:850;
}
body.category .ast-archive-description h1.ast-archive-title {
    max-width:900px;
    margin:0 0 12px!important;
    padding:0!important;
    font-size:clamp(26px,3.2vw,39px)!important;
    line-height:1.65!important;
    font-weight:900!important;
    letter-spacing:-.02em;
    color:#0b3152!important;
}
body.category .ast-archive-description p,
body.category .ast-archive-description .bseo-category-description {
    max-width:850px;
    margin:0!important;
    color:#4c7188!important;
    font-size:clamp(13px,1.2vw,15px)!important;
    line-height:2.2!important;
    font-weight:500!important;
}
body.category #main.site-main > .ast-row {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:24px;
    margin:0!important;
    padding:0!important;
    align-items:stretch;
}
body.category #main.site-main > .ast-row > article.ast-article-post {
    box-sizing:border-box;
    display:block;
    position:relative;
    width:100%!important;
    max-width:none!important;
    min-width:0;
    float:none!important;
    margin:0!important;
    padding:0!important;
    border:1px solid #dfebf2!important;
    border-radius:21px!important;
    background:#fff!important;
    box-shadow:0 11px 28px rgba(13,64,101,.065)!important;
    overflow:hidden;
    transition:transform .22s,box-shadow .22s,border-color .22s;
}
body.category #main.site-main > .ast-row > article.ast-article-post:hover,
body.category #main.site-main > .ast-row > article.ast-article-post:focus-within {
    transform:translateY(-4px);
    border-color:#9bdce9!important;
    box-shadow:0 20px 42px rgba(13,64,101,.12)!important;
}
body.category #main .ast-article-post .ast-article-inner,
body.category #main .ast-article-post .post-content {
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    width:100%!important;
    max-width:none!important;
    height:100%;
    padding:0!important;
    margin:0!important;
}
body.category #main .ast-article-post .ast-blog-featured-section {
    position:relative;
    display:block;
    width:100%;
    margin:0!important;
    padding:0!important;
    background:linear-gradient(135deg,#e7f8ff,#c9edf3);
    overflow:hidden;
}
body.category #main .ast-article-post .post-thumb-img-content,
body.category #main .ast-article-post .post-thumb-img-content a {
    display:block;
    width:100%;
    margin:0!important;
    padding:0!important;
}
body.category #main .ast-article-post .post-thumb-img-content img {
    display:block;
    width:100%!important;
    height:auto!important;
    max-width:none!important;
    aspect-ratio:16 / 9;
    object-fit:cover;
    transition:transform .32s;
}
body.category #main .ast-article-post:hover .post-thumb-img-content img { transform:scale(1.035); }
body.category #main .ast-article-post h2.entry-title {
    display:block;
    margin:0!important;
    padding:22px 22px 9px!important;
    text-align:right;
    font-size:clamp(16px,1.5vw,19px)!important;
    line-height:1.85!important;
    font-weight:900!important;
    color:#103653!important;
}
body.category #main .ast-article-post h2.entry-title a {
    display:-webkit-box;
    max-width:100%;
    overflow:hidden;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    color:inherit!important;
    text-decoration:none!important;
}
body.category #main .ast-article-post h2.entry-title a:hover { color:#087e9a!important; }
body.category #main .ast-article-post .ast-blog-meta-container { display:none!important; }
body.category #main .ast-article-post .ast-excerpt-container {
    display:block;
    flex:1 1 auto;
    margin:0!important;
    padding:0 22px 12px!important;
}
body.category #main .ast-article-post .ast-excerpt-container p {
    display:-webkit-box;
    overflow:hidden;
    margin:0!important;
    padding:0!important;
    -webkit-line-clamp:4;
    -webkit-box-orient:vertical;
    color:#58778c!important;
    font-size:13px!important;
    line-height:2.05!important;
    font-weight:500!important;
    text-align:right;
}
body.category #main .ast-article-post .ast-read-more-container {
    margin:auto 22px 20px!important;
    padding-top:15px!important;
    border-top:1px solid #eaf2f6;
    text-align:right;
}
body.category #main .ast-article-post .ast-read-more-container a {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:39px;
    padding:8px 16px;
    border:1px solid #bfe8f1;
    border-radius:12px;
    background:#ebfbff;
    color:#087b94!important;
    font-size:12.5px;
    font-weight:900;
    text-decoration:none!important;
    transition:background .2s,border-color .2s;
}
body.category #main .ast-article-post .ast-read-more-container a:hover,
body.category #main .ast-article-post .ast-read-more-container a:focus-visible {
    border-color:#78cddb;
    background:#ddf7fc;
    outline-offset:2px;
}
body.category #main .ast-article-post .entry-content { display:none!important; }
body.category .ast-pagination,
body.category nav.navigation.pagination { margin-top:35px!important; }
body.category .ast-pagination a,
body.category .ast-pagination span,
body.category nav.navigation.pagination .page-numbers {
    display:inline-flex;
    justify-content:center;
    align-items:center;
    min-width:38px;
    min-height:38px;
    border-radius:10px;
    border:1px solid #d2e8f1;
    background:#fff;
    color:#275572;
    margin:0 3px;
    text-decoration:none;
}
body.category .ast-pagination .current,
body.category nav.navigation.pagination .current { background:#0c83a5; border-color:#0c83a5; color:#fff; }
@media (max-width:1020px) {
    body.category #main.site-main > .ast-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:19px; }
}
@media (max-width:650px) {
    body.category #content.site-content > .ast-container { width:calc(100% - 26px); padding-top:24px; }
    body.category .ast-archive-description { padding:23px 21px!important; border-radius:18px; }
    body.category #main.site-main > .ast-row { grid-template-columns:1fr; gap:16px; }
    body.category #main .ast-article-post h2.entry-title { padding:17px 19px 8px!important; }
    body.category #main .ast-article-post .ast-excerpt-container { padding:0 19px 12px!important; }
    body.category #main .ast-article-post .ast-read-more-container { margin:0 19px 19px!important; }
}
@media (prefers-reduced-motion:reduce) {
    body.category .ast-article-post,
    body.category .ast-article-post *,
    body.single-post #respond .bseo-simple-author input#author { transition:none!important; transform:none!important; }
}
