/**
 * Blog Templates Stylesheet
 *
 * Covers: single.php, archive.php, category.php, author.php, 404.php
 * and the shared post-card partial.
 * No Elementor class dependencies.
 *
 * Design tokens derived from Elementor templates 16279, 16277, 16489, 16995, 16296.
 *
 * @package Hello_Elementor_Child
 */

/* ─── Tokens ──────────────────────────────────────────────────────────────── */
:root {
    --sl-green:         #5AB237;
    --sl-green-light:   #CFEAC4;
    --sl-green-lighter: #DFF1D9;
    --sl-black:         #000000;
    --sl-muted:         #868686;
    --sl-border:        #EEEEEE;
    --sl-card-bg:       #f5f5f5;
    --sl-font:          'Open Sans', sans-serif;
    --sl-max-width:     1400px;
    --sl-radius:        25px;
}

/* ─── Shared: container ───────────────────────────────────────────────────── */
.sl-blog-container {
    max-width: var(--sl-max-width);
    margin: 0 auto;
    padding: 0 10px;
}

/* ─── Shared: post card ───────────────────────────────────────────────────── */
.sl-post-card {
    border: 2px solid var(--sl-border);
    border-radius: var(--sl-radius);
    padding: 20px;
    font-family: var(--sl-font);
    display: flex;
    flex-direction: column;
    background: #fff;
}

.sl-post-card__image {
    border-radius: var(--sl-radius);
    overflow: hidden;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.sl-post-card__image a {
    display: block;
}

.sl-post-card__image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--sl-radius);
    transition: transform 0.3s ease;
}

.sl-post-card__image a:hover img {
    transform: scale(1.02);
}

.sl-post-card__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px;
    font-family: var(--sl-font);
}

.sl-post-card__title a {
    color: var(--sl-black);
    text-decoration: none;
}

.sl-post-card__title a:hover {
    color: var(--sl-green);
}

.sl-post-card__excerpt {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
    color: #333;
    margin: 0 0 10px;
    flex: 1;
    font-family: var(--sl-font);
}

.sl-post-card__meta {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--sl-green);
    font-family: var(--sl-font);
    flex-wrap: wrap;
}

.sl-post-card__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sl-post-card__meta a {
    color: var(--sl-green);
    text-decoration: none;
}

.sl-post-card__meta a:hover {
    text-decoration: underline;
}

.sl-post-card__meta svg {
    flex-shrink: 0;
}

/* ─── Shared: posts grid ──────────────────────────────────────────────────── */
.sl-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ─── Shared: pagination ──────────────────────────────────────────────────── */
.sl-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px 0 0;
    font-family: var(--sl-font);
    flex-wrap: wrap;
}

.sl-pagination .page-numbers {
    font-size: 17px;
    font-weight: 600;
    color: var(--sl-black);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: color 0.2s;
}

.sl-pagination .page-numbers:hover,
.sl-pagination .page-numbers.current {
    color: var(--sl-green);
}

.sl-pagination .prev,
.sl-pagination .next {
    font-size: 15px;
}

/* ─── Blog archive / category: hero ──────────────────────────────────────── */
.sl-blog-hero {
    padding: 80px 10px;
    text-align: center;
}

.sl-blog-hero__title {
    font-family: var(--sl-font);
    font-size: 45px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px;
    color: var(--sl-black);
}

.sl-blog-hero__title .sl-green {
    color: var(--sl-green);
}

.sl-blog-hero__desc {
    font-family: var(--sl-font);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--sl-black);
    max-width: 860px;
    margin: 0 auto;
}

/* ─── Blog archive: body layout (filter sidebar + grid) ──────────────────── */
.sl-blog-body {
    padding: 0 10px 80px;
}

.sl-blog-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

.sl-blog-sidebar {
    width: 20%;
    flex-shrink: 0;
}

.sl-blog-sidebar__title {
    font-family: var(--sl-font);
    font-size: 26px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 16px;
}

/* Style the WPC filter widget inside the sidebar */
.sl-blog-sidebar .wpc-filters-widget input {
    border: 1px solid #eee;
    border-radius: 30px;
}

.sl-blog-sidebar .wpc-filters-widget a {
    color: #444;
}

.sl-blog-sidebar .wpc-filters-widget label:hover * {
    color: var(--sl-green);
}

.sl-blog-sidebar .wpc-filters-widget ul.children {
    padding-left: 0;
}

.sl-blog-sidebar li.wpc-term-count-0 {
    display: none;
}

.sl-blog-grid {
    flex: 1;
    min-width: 0;
}

/* ─── Category archive (full-width, no filter sidebar) ───────────────────── */
.sl-category-body {
    padding: 0 10px 80px;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

/* ─── Single post ─────────────────────────────────────────────────────────── */
.sl-single-wrap {
    padding: 50px 10px 25px;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

.sl-single-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.sl-single-main {
    width: 70%;
    min-width: 0;
}

.sl-single-sidebar {
    width: 30%;
    flex-shrink: 0;
}

.sl-single-sidebar__sticky {
    position: sticky;
    top: 20px;
}

.sl-single-sidebar__sticky a {
    display: block;
}

.sl-single-sidebar__sticky img {
    width: 100%;
    height: auto;
    border-radius: var(--sl-radius);
    display: block;
}

/* Post title */
.sl-post-title {
    font-family: var(--sl-font);
    font-size: 35px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--sl-black);
    padding: 20px;
    border-left: 4px solid var(--sl-green);
    margin: 0 0 20px;
}

/* Post meta */
.sl-post-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    font-family: var(--sl-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--sl-green);
    margin: 0 0 20px;
    flex-wrap: wrap;
}

.sl-post-meta__item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sl-post-meta a {
    color: var(--sl-green);
    text-decoration: none;
}

.sl-post-meta a:hover {
    text-decoration: underline;
}

/* Featured image */
.sl-featured-image {
    border-radius: var(--sl-radius);
    overflow: hidden;
    margin: 0 0 20px;
}

.sl-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--sl-radius);
}

/* Post content */
.sl-post-content {
    font-family: var(--sl-font);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
    color: var(--sl-black);
    margin: 0 0 30px;
}

.sl-post-content a {
    color: var(--sl-green);
}

.sl-post-content h1,
.sl-post-content h2,
.sl-post-content h3,
.sl-post-content h4 {
    font-family: var(--sl-font);
    font-weight: 700;
    line-height: 1.3;
    margin: 1.4em 0 0.6em;
}

.sl-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.sl-post-content blockquote {
    border-left: 4px solid var(--sl-green);
    padding-left: 20px;
    margin-left: 0;
    color: #444;
}

/* Share buttons */
.sl-share-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 0 30px;
    flex-wrap: wrap;
}

.sl-share-label {
    font-family: var(--sl-font);
    font-size: 17px;
    font-weight: 700;
    color: var(--sl-black);
    white-space: nowrap;
}

.sl-share-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sl-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4em;
    height: 2.4em;
    border-radius: 50%;
    background: var(--sl-black);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
    line-height: 1;
}

.sl-share-btn:hover {
    background: var(--sl-green);
    color: #fff;
}

/* Author bio box */
.sl-author-bio {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border-top: 2px solid var(--sl-green-light);
    border-bottom: 2px solid var(--sl-green-light);
    padding: 35px 20px;
    margin: 0 0 30px;
    font-family: var(--sl-font);
}

.sl-author-bio__photo {
    width: 20%;
    flex-shrink: 0;
}

.sl-author-bio__photo img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    display: block;
}

.sl-author-bio__info {
    flex: 1;
}

.sl-author-bio__name {
    font-size: 25px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 8px;
}

.sl-author-bio__desc {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
    color: var(--sl-muted);
    margin: 0 0 15px;
    letter-spacing: 0.3px;
}

/* Category tags */
.sl-post-categories {
    font-family: var(--sl-font);
    font-size: 14px;
    margin: 0 0 30px;
}

.sl-post-categories a {
    display: inline-block;
    background: var(--sl-card-bg);
    padding: 15px 35px;
    border-radius: var(--sl-radius);
    color: var(--sl-black);
    text-decoration: none;
    margin: 0 8px 12px 0;
    font-weight: 500;
    transition: background 0.2s;
}

.sl-post-categories a:hover {
    background: var(--sl-green-light);
}

/* CTA box */
.sl-cta-wrap {
    padding: 25px 10px;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

.sl-cta-box {
    background: linear-gradient(135deg, var(--sl-green-light), var(--sl-green-lighter));
    border-radius: var(--sl-radius);
    padding: 75px;
    text-align: center;
    font-family: var(--sl-font);
}

.sl-cta-box__heading {
    font-size: 35px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 8px;
    line-height: 1.2;
}

.sl-cta-box__sub {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--sl-black);
    margin: 0 0 24px;
}

/* Related / recommended section */
.sl-related-wrap {
    padding: 25px 10px 50px;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

.sl-section-title {
    font-family: var(--sl-font);
    font-size: 30px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 20px;
}

/* ─── Author archive ──────────────────────────────────────────────────────── */
.sl-author-hero {
    padding: 50px 10px;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

.sl-author-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.sl-author-header__photo {
    width: 35%;
    flex-shrink: 0;
}

.sl-author-header__photo img {
    width: 100%;
    height: auto;
    border-radius: var(--sl-radius);
    display: block;
}

.sl-author-header__info {
    width: 65%;
    font-family: var(--sl-font);
    padding-top: 10px;
}

.sl-author-header__name {
    font-size: 35px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 8px;
}

.sl-author-header__role {
    font-size: 18px;
    font-weight: 500;
    color: #555;
    margin: 0 0 16px;
}

.sl-author-header__desc {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    margin: 0;
}

.sl-author-posts-section {
    padding: 0 10px 40px;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

.sl-other-writers {
    padding: 30px 10px;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

.sl-other-writers__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sl-writer-card {
    text-align: center;
    padding: 20px;
}

.sl-writer-card a {
    text-decoration: none;
    color: inherit;
}

.sl-writer-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    display: block;
}

.sl-writer-card__name {
    font-family: var(--sl-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 4px;
}

.sl-writer-card__role {
    font-family: var(--sl-font);
    font-size: 14px;
    color: #555;
    margin: 0;
}

.sl-popular-section {
    padding: 0 10px 50px;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

/* ─── 404 page ────────────────────────────────────────────────────────────── */
.sl-404-section {
    padding: 80px 10px;
    min-height: 50vh;
    display: flex;
    align-items: center;
    max-width: var(--sl-max-width);
    margin: 0 auto;
}

.sl-404-layout {
    display: flex;
    gap: 60px;
    align-items: center;
    width: 100%;
}

.sl-404-content {
    flex: 1;
    font-family: var(--sl-font);
}

.sl-404-number {
    font-size: 100px;
    font-weight: 700;
    color: var(--sl-green);
    line-height: 1;
    margin: 0 0 8px;
}

.sl-404-subtitle {
    font-size: 35px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 20px;
    line-height: 1.2;
}

.sl-404-tagline {
    font-size: 15px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 32px;
    line-height: 1.4;
}

.sl-404-image {
    width: 40%;
    flex-shrink: 0;
}

.sl-404-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--sl-radius);
}

/* ─── Shared button styles ────────────────────────────────────────────────── */
.sl-btn {
    display: inline-block;
    font-family: var(--sl-font);
    font-weight: 500;
    border-radius: var(--sl-radius);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
}

.sl-btn-primary {
    background: var(--sl-green);
    color: #fff;
    border-color: var(--sl-green);
    padding: 15px 35px;
    font-size: 15px;
    text-transform: capitalize;
}

.sl-btn-primary:hover {
    background: #fff;
    color: var(--sl-green);
}

.sl-btn-sm {
    padding: 12px 35px;
    font-size: 14px;
}

/* ─── No-posts fallback ───────────────────────────────────────────────────── */
.sl-no-posts {
    font-family: var(--sl-font);
    font-size: 15px;
    color: #555;
    padding: 40px 0;
    text-align: center;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sl-blog-hero__title    { font-size: 35px; }
    .sl-posts-grid          { grid-template-columns: repeat(2, 1fr); }
    .sl-blog-layout         { flex-direction: column; }
    .sl-blog-sidebar        { width: 100%; }
    .sl-single-layout       { flex-direction: column; }
    .sl-single-main         { width: 100%; }
    .sl-single-sidebar      { width: 100%; }
    .sl-single-sidebar__sticky { position: static; }
    .sl-cta-box             { padding: 50px; }
    .sl-author-header       { flex-direction: column; }
    .sl-author-header__photo,
    .sl-author-header__info { width: 100%; }
    .sl-404-layout          { flex-direction: column; }
    .sl-404-image           { width: 100%; }
}

@media (max-width: 768px) {
    .sl-blog-hero           { padding: 40px 10px; }
    .sl-blog-hero__title    { font-size: 30px; }
    .sl-blog-hero__desc     { font-size: 13px; }
    .sl-posts-grid          { grid-template-columns: 1fr; }
    .sl-post-title          { font-size: 28px; }
    .sl-single-wrap         { padding: 30px 10px 20px; }
    .sl-author-bio          { flex-direction: column; }
    .sl-author-bio__photo   { width: 100%; max-width: 200px; }
    .sl-author-bio__info    { width: 100%; }
    .sl-cta-box             { padding: 40px 20px; }
    .sl-cta-box__heading    { font-size: 28px; }
    .sl-404-number          { font-size: 70px; }
    .sl-404-subtitle        { font-size: 24px; }
    .sl-other-writers__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Blog search bar (above posts, centered) ─────────────────────────────── */
.sl-blog-search-bar {
    padding: 0 10px 30px;
    text-align: center;
}

.sl-blog-search-bar .search-form {
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: 560px;
    width: 100%;
    border: 2px solid var(--sl-border);
    border-radius: 30px;
    overflow: hidden;
    background: #fff;
}

.sl-blog-search-bar .search-field {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    font-family: var(--sl-font);
    font-size: 14px;
    color: #333;
    background: transparent;
}

.sl-blog-search-bar .search-submit {
    background: var(--sl-green);
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-family: var(--sl-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.sl-blog-search-bar .search-submit:hover {
    background: #4a9a2e;
}

/* ─── Blog body: full-width centered (no sidebar) ─────────────────────────── */
.sl-blog-body .sl-blog-container {
    padding-bottom: 60px;
}

.sl-blog-layout {
    display: block !important;
}

.sl-blog-sidebar {
    display: none !important;
}

.sl-blog-grid {
    width: 100% !important;
}

/* ─── Author cards section ────────────────────────────────────────────────── */
.sl-blog-authors {
    padding: 20px 10px 80px;
    border-top: 2px solid var(--sl-border);
}

.sl-blog-authors__title {
    font-family: var(--sl-font);
    font-size: 30px;
    font-weight: 700;
    color: var(--sl-black);
    text-align: center;
    margin: 0 0 30px;
}

.sl-blog-authors__grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.sl-author-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    border: 3px solid var(--sl-green);
    border-radius: var(--sl-radius);
    overflow: hidden;
    width: 260px;
    transition: box-shadow 0.2s, transform 0.2s;
    background: #fff;
}

.sl-author-card:hover {
    box-shadow: 0 8px 24px rgba(90, 178, 55, 0.2);
    transform: translateY(-3px);
}

.sl-author-card__img-wrap {
    width: 100%;
    overflow: hidden;
}

.sl-author-card__img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.sl-author-card:hover .sl-author-card__img-wrap img {
    transform: scale(1.03);
}

.sl-author-card__body {
    padding: 16px 20px;
    text-align: center;
    width: 100%;
    background: #fff;
}

.sl-author-card__name {
    font-family: var(--sl-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--sl-black);
    margin: 0 0 4px;
}

.sl-author-card__role {
    font-family: var(--sl-font);
    font-size: 13px;
    color: #666;
    margin: 0;
}

@media (max-width: 768px) {
    .sl-blog-search-bar .search-form {
        max-width: 100%;
    }
    .sl-author-card {
        width: 100%;
        max-width: 300px;
    }
}
