/* PWG Blog System PRO — Frontend Styles */
:root {
    --pwg-primary: #0274ff;
    --pwg-secondary: #02c7ff;
    --pwg-bg: #ffffff;
    --pwg-text: #000000;
    --pwg-muted: #5b6577;
    --pwg-line: #e6ebf2;
    --pwg-card: #ffffff;
    --pwg-card-shadow: 0 2px 14px rgba(2, 116, 255, 0.06);
    --pwg-radius: 12px;
    --pwg-sidebar-w: 320px;
}

/* ---------- Layout ---------- */
.pwg-wrap {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    color: var(--pwg-text);
    background: var(--pwg-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.pwg-layout {
    display: grid;
    gap: 32px;
    align-items: start;
}
.pwg-layout--2_column.pwg-layout--sidebar-right {
    grid-template-columns: minmax(0, 1fr) var(--pwg-sidebar-w);
}
.pwg-layout--2_column.pwg-layout--sidebar-left {
    grid-template-columns: var(--pwg-sidebar-w) minmax(0, 1fr);
}
.pwg-layout--2_column.pwg-layout--sidebar-left .pwg-main {
    order: 2;
}
.pwg-layout--2_column.pwg-layout--sidebar-left .pwg-sidebar {
    order: 1;
}
.pwg-layout--1_column {
    grid-template-columns: 1fr;
}
@media (max-width: 900px) {
    .pwg-layout--2_column.pwg-layout--sidebar-right,
    .pwg-layout--2_column.pwg-layout--sidebar-left {
        grid-template-columns: 1fr;
    }
    .pwg-layout--2_column.pwg-layout--sidebar-left .pwg-main { order: 1; }
    .pwg-layout--2_column.pwg-layout--sidebar-left .pwg-sidebar { order: 2; }
}

/* ---------- Main ---------- */
.pwg-main { min-width: 0; }
.pwg-main > * + * { margin-top: 24px; }

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

.pwg-post-title {
    font-size: 38px;
    line-height: 1.2;
    margin: 0;
    color: var(--pwg-text);
    font-weight: 700;
}

.pwg-post-info,
.pwg-el-info {
    color: var(--pwg-muted);
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
}
.pwg-post-info a, .pwg-el-info a { color: var(--pwg-primary); text-decoration: none; }
.pwg-post-info a:hover, .pwg-el-info a:hover { color: var(--pwg-secondary); }

.pwg-post-content,
.pwg-el-content {
    line-height: 1.7;
    color: var(--pwg-text);
}
.pwg-post-content p, .pwg-el-content p { margin: 0 0 14px; }
.pwg-post-content a, .pwg-el-content a { color: var(--pwg-primary); }
.pwg-post-content h1, .pwg-el-content h1 { color: var(--pwg-text); margin: 24px 0 12px; }
.pwg-post-content h2, .pwg-el-content h2 { color: var(--pwg-text); margin: 22px 0 12px; }
.pwg-post-content h3, .pwg-el-content h3 { color: var(--pwg-text); margin: 20px 0 10px; }
.pwg-post-content h4, .pwg-el-content h4 { color: var(--pwg-text); margin: 18px 0 10px; }
.pwg-post-content h5, .pwg-el-content h5 { color: var(--pwg-text); margin: 16px 0 8px; }
.pwg-post-content h6, .pwg-el-content h6 { color: var(--pwg-text); margin: 14px 0 8px; }
.pwg-el-content > *:first-child { margin-top: 0; }
.pwg-el-content > *:last-child  { margin-bottom: 0; }
.pwg-post-content img { max-width: 100%; height: auto; border-radius: var(--pwg-radius); }
.pwg-post-content blockquote {
    border-left: 4px solid var(--pwg-primary);
    padding: 8px 16px;
    background: #f6f9ff;
    border-radius: 8px;
}

/* ---------- Breadcrumbs ---------- */
.pwg-breadcrumbs {
    font-size: 13px;
    color: var(--pwg-muted);
    display: flex; flex-wrap: wrap; gap: 6px;
    align-items: center;
}
.pwg-breadcrumbs a { color: var(--pwg-primary); text-decoration: none; }
.pwg-breadcrumbs a:hover { color: var(--pwg-secondary); }
.pwg-breadcrumbs__sep { color: var(--pwg-muted); opacity: 0.7; }
.pwg-breadcrumbs__current { color: var(--pwg-text); font-weight: 500; }

/* ---------- Social Share ---------- */
.pwg-social-share {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 12px 0; border-top: 1px solid var(--pwg-line); border-bottom: 1px solid var(--pwg-line);
}
.pwg-social-share__label { font-weight: 600; margin-right: 4px; }
.pwg-social-share__btn {
    display: inline-block;
    background: var(--pwg-primary);
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    border: 0;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.pwg-social-share__btn:hover { background: var(--pwg-secondary); transform: translateY(-1px); }
.pwg-social-share__btn--copy { background: #1a1a1a; }

/* ---------- Author Box ---------- */
.pwg-author-box {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 20px;
    background: #f6f9ff;
    border: 1px solid var(--pwg-line);
    border-radius: var(--pwg-radius);
}
.pwg-author-box__avatar img { border-radius: 50%; }
.pwg-author-box__name { margin: 0 0 4px; font-size: 18px; }
.pwg-author-box__bio { margin: 0 0 8px; color: var(--pwg-muted); }
.pwg-author-box__link { color: var(--pwg-primary); text-decoration: none; font-weight: 600; }
.pwg-author-box__link:hover { color: var(--pwg-secondary); }

/* ---------- Grid / Cards ---------- */
.pwg-grid {
    display: grid;
    gap: 24px;
}
.pwg-grid--1 { grid-template-columns: 1fr; }
.pwg-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pwg-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pwg-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
    .pwg-grid--3, .pwg-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .pwg-grid--2, .pwg-grid--3, .pwg-grid--4 { grid-template-columns: 1fr; }
}

.pwg-card {
    background: var(--pwg-card);
    border: 1px solid var(--pwg-line);
    border-radius: var(--pwg-radius);
    overflow: hidden;
    box-shadow: var(--pwg-card-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.pwg-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(2, 116, 255, 0.12);
}
.pwg-card__link { text-decoration: none; color: inherit; display: block; }
.pwg-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #eef2f8; }
.pwg-card__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.pwg-card:hover .pwg-card__img { transform: scale(1.05); }
.pwg-card__img--placeholder { background: linear-gradient(135deg, #eaf2ff, #d4e7ff); }
.pwg-card__body { padding: 16px 18px 20px; }
.pwg-card__title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--pwg-text); line-height: 1.3; }
.pwg-card__meta { color: var(--pwg-muted); font-size: 12px; margin-bottom: 8px; }
.pwg-card__excerpt { margin: 0; color: var(--pwg-muted); font-size: 14px; line-height: 1.55; }

/* ---------- Related ---------- */
.pwg-related { padding-top: 16px; border-top: 1px solid var(--pwg-line); }
.pwg-related__title { margin: 0 0 16px; font-size: 22px; }

/* ---------- Pagination ---------- */
.pwg-pagination {
    display: flex; gap: 6px; flex-wrap: wrap; padding: 16px 0;
    justify-content: center;
}
.pwg-pagination .page-numbers,
.pwg-pagination a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px;
    border: 1px solid var(--pwg-line);
    border-radius: 8px;
    background: #fff;
    color: var(--pwg-text);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.pwg-pagination a:hover {
    background: var(--pwg-primary); color: #fff; border-color: var(--pwg-primary);
}
.pwg-pagination .current {
    background: var(--pwg-primary); color: #fff; border-color: var(--pwg-primary);
}

/* ---------- Sidebar ---------- */
.pwg-sidebar {
    display: flex; flex-direction: column; gap: 18px;
}
.pwg-sidebar--sticky {
    position: sticky; top: 24px;
}
.pwg-sidebar__widget {
    background: var(--pwg-card);
    border: 1px solid var(--pwg-line);
    border-radius: var(--pwg-radius);
    padding: 18px;
    box-shadow: var(--pwg-card-shadow);
}
.pwg-sidebar__title {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--pwg-text);
    border-bottom: 2px solid var(--pwg-primary);
    padding-bottom: 8px;
    display: inline-block;
}
.pwg-list { list-style: none; padding: 0; margin: 0; }
.pwg-list li { padding: 6px 0; border-bottom: 1px solid var(--pwg-line); }
.pwg-list li:last-child { border-bottom: 0; }
.pwg-list a { color: var(--pwg-text); text-decoration: none; }
.pwg-list a:hover { color: var(--pwg-primary); }

.pwg-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pwg-tags a {
    background: #f3f6fb;
    color: var(--pwg-text);
    padding: 6px 10px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s ease;
}
.pwg-tags a:hover { background: var(--pwg-primary); color: #ffffff; }
.pwg-tags a:focus-visible { outline: 2px solid var(--pwg-primary); outline-offset: 2px; }

/* ---------- Load More button ---------- */
.pwg-load-more__wrap {
    display: flex; justify-content: center; padding: 16px 0;
}
.pwg-load-more {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pwg-primary); color: #ffffff;
    border: 0; border-radius: 10px;
    padding: 12px 22px;
    font-weight: 600; font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
.pwg-load-more:hover { background: var(--pwg-secondary); transform: translateY(-1px); }
.pwg-load-more.is-loading { opacity: 0.85; cursor: wait; }
.pwg-load-more.is-done   { opacity: 0.7;  cursor: default; transform: none; }
.pwg-empty {
    padding: 24px; text-align: center;
    color: var(--pwg-muted); background: #f3f7fc;
    border-radius: var(--pwg-radius);
}

.pwg-recent { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pwg-recent__item {
    display: flex; gap: 10px; align-items: flex-start;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pwg-line);
}
.pwg-recent__item:last-child { border-bottom: 0; padding-bottom: 0; }
.pwg-recent__media img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.pwg-recent__body { display: flex; flex-direction: column; gap: 2px; }
.pwg-recent a { color: var(--pwg-text); text-decoration: none; font-weight: 600; font-size: 14px; line-height: 1.3; }
.pwg-recent a:hover { color: var(--pwg-primary); }
.pwg-recent__date { color: var(--pwg-muted); font-size: 12px; }

/* ---------- Search ---------- */
.pwg-search {
    position: relative;
    display: flex; gap: 6px;
}
.pwg-search__input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--pwg-line);
    border-radius: 8px;
    font-size: 14px;
    color: var(--pwg-text);
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}
.pwg-search__input:focus { border-color: var(--pwg-primary); }
.pwg-search__btn {
    background: var(--pwg-primary);
    color: #fff;
    border: 0;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}
.pwg-search__btn:hover { background: var(--pwg-secondary); }

.pwg-search__results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--pwg-line);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    max-height: 360px; overflow: auto;
    display: none;
    z-index: 1000;
}
.pwg-search__results.is-open { display: block; }
.pwg-search__item {
    display: flex; gap: 10px; padding: 10px 12px;
    border-bottom: 1px solid var(--pwg-line);
    text-decoration: none; color: var(--pwg-text);
}
.pwg-search__item:last-child { border-bottom: 0; }
.pwg-search__item:hover { background: #f6f9ff; }
.pwg-search__item img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.pwg-search__item-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.pwg-search__item-excerpt { color: var(--pwg-muted); font-size: 12px; margin-top: 2px; }
.pwg-search__empty { padding: 12px; text-align: center; color: var(--pwg-muted); font-size: 13px; }

/* ---------- Archive ---------- */
.pwg-archive-title { margin: 0; font-size: 30px; font-weight: 700; }

/* ---------- Comments ---------- */
.pwg-comments { padding-top: 16px; border-top: 1px solid var(--pwg-line); }
.pwg-comments .comment-list { list-style: none; padding: 0; margin: 0 0 24px; }
.pwg-comments .comment-list li { background: #f6f9ff; padding: 14px; border-radius: 10px; margin-bottom: 10px; }
.pwg-comments .comment-reply-link {
    display: inline-block; margin-top: 6px; padding: 4px 10px; background: var(--pwg-primary);
    color: #fff; text-decoration: none; border-radius: 6px; font-size: 12px;
}
.pwg-comments input[type="text"], .pwg-comments input[type="email"], .pwg-comments input[type="url"], .pwg-comments textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--pwg-line); border-radius: 8px; font-size: 14px;
}
.pwg-comments .submit { background: var(--pwg-primary); color: #fff; border: 0; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.pwg-comments .submit:hover { background: var(--pwg-secondary); }

/* ---------- Empty ---------- */
.pwg-empty { padding: 40px 16px; text-align: center; color: var(--pwg-muted); background: #f6f9ff; border-radius: var(--pwg-radius); }

/* ---------- Featured (Elementor widget) ---------- */
.pwg-el-img { display: block; }
.pwg-el-img__inner { width: 100%; height: auto; display: block; }

/* ---------- Search field upgrades ---------- */
.pwg-search__field {
    position: relative;
    display: flex; align-items: center; gap: 6px;
    flex: 1;
    background: #fff;
    border: 1px solid var(--pwg-line);
    border-radius: 8px;
    padding: 0 8px;
}
.pwg-search__field .pwg-search__input {
    border: 0;
    background: transparent;
    padding: 10px 4px;
    flex: 1;
    width: auto;
}
.pwg-search__icon-wrap {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--pwg-primary);
}
.pwg-search__icon-wrap svg { width: 1em; height: 1em; }
.pwg-search__clear {
    background: transparent; border: 0; cursor: pointer;
    color: var(--pwg-muted);
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 6px; border-radius: 6px;
}
.pwg-search__clear:hover { color: var(--pwg-text); background: #f3f6fb; }

/* Result layouts */
.pwg-search__results.is-grid {
    display: grid;
    gap: 12px;
    padding: 12px;
}
.pwg-search__results.is-cols-2 { grid-template-columns: repeat(2, 1fr); }
.pwg-search__results.is-cols-3 { grid-template-columns: repeat(3, 1fr); }
.pwg-search__results.is-cols-4 { grid-template-columns: repeat(4, 1fr); }
.pwg-search__results.is-cols-5 { grid-template-columns: repeat(5, 1fr); }
.pwg-search__results.is-cols-6 { grid-template-columns: repeat(6, 1fr); }
.pwg-search__results.is-grid .pwg-search__item {
    flex-direction: column; align-items: stretch;
    border: 1px solid var(--pwg-line); border-radius: 8px; padding: 10px;
}
.pwg-search__results.is-grid .pwg-search__item img { width: 100%; height: 100px; }
.pwg-search__results.is-compact .pwg-search__item { padding: 6px 12px; }
.pwg-search__results.is-compact .pwg-search__item img { width: 32px; height: 32px; }
.pwg-search__results.is-compact .pwg-search__item-excerpt { display: none; }

/* ---------- Recent Posts upgraded layouts ---------- */
.pwg-recent--list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pwg-recent--grid,
.pwg-recent--masonry {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(var(--pwg-rp-cols, 2), minmax(0, 1fr));
}
.pwg-recent--masonry { grid-auto-rows: 1px; }
.pwg-recent__title { font-weight: 600; color: var(--pwg-text); text-decoration: none; display: block; line-height: 1.3; }
.pwg-recent__title:hover { color: var(--pwg-primary); }
.pwg-recent__meta { color: var(--pwg-muted); font-size: 12px; margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.pwg-recent__excerpt { color: var(--pwg-muted); font-size: 13px; margin: 6px 0 0; line-height: 1.55; }

/* ---------- Card additions ---------- */
.pwg-card__cats { font-size: 12px; color: var(--pwg-primary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.pwg-card__cats a { color: var(--pwg-primary); text-decoration: none; margin-right: 6px; }
.pwg-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pwg-card__tags a { background: #f3f6fb; color: var(--pwg-text); padding: 3px 8px; border-radius: 999px; text-decoration: none; font-size: 11px; }
.pwg-card__tags a:hover { background: var(--pwg-primary); color: #fff; }
.pwg-list__count { color: var(--pwg-muted); font-size: 12px; margin-left: 4px; }

/* ---------- Social Share — Elementor-level ---------- */
.pwg-social-share {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.pwg-social-share__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--pwg-primary);
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
    border: 0;
    cursor: pointer;
    line-height: 1;
    transition: transform .25s ease, background-color .25s ease, color .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.pwg-social-share__btn i, .pwg-social-share__btn svg { display: inline-block; width: 1em; height: 1em; }
/* Shapes */
.pwg-share-shape-square .pwg-social-share__btn { border-radius: 0; }
.pwg-share-shape-round  .pwg-social-share__btn { border-radius: 8px; }
.pwg-share-shape-circle .pwg-social-share__btn { border-radius: 999px; padding: 12px; min-width: 44px; min-height: 44px; }
.pwg-share-shape-circle .pwg-social-share__btn .pwg-social-share__label-text { display: none; }
/* Hover animations */
.pwg-share-anim-lift   .pwg-social-share__btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.pwg-share-anim-sink   .pwg-social-share__btn:hover { transform: translateY(3px); }
.pwg-share-anim-grow   .pwg-social-share__btn:hover { transform: scale(1.08); }
.pwg-share-anim-shrink .pwg-social-share__btn:hover { transform: scale(0.94); }
.pwg-share-anim-rotate .pwg-social-share__btn:hover { transform: rotate(8deg); }

/* ---------- PWG Recent Posts widget alignment fix when in list ---------- */
.pwg-recent--list .pwg-recent__item { display: flex; gap: 10px; align-items: flex-start; }

/* ---------- Search Box: responsive overflow + layout safeguards ---------- */
.pwg-search {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: stretch;
}
.pwg-search * { box-sizing: border-box; }
.pwg-search__field {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
}
.pwg-search__field .pwg-search__input {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}
.pwg-search__btn {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.pwg-search__btn .pwg-search__btn-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pwg-search__btn .pwg-search__icon {
    flex-shrink: 0;
    line-height: 1;
}
/* Column layout (when Form Direction = Column) */
.pwg-search.pwg-search--col,
.pwg-search[style*="flex-direction: column"],
.pwg-search[style*="flex-direction:column"] {
    flex-direction: column;
    align-items: stretch;
}
.pwg-search.pwg-search--col .pwg-search__field,
.pwg-search.pwg-search--col .pwg-search__btn {
    width: 100%;
    max-width: 100%;
}

/* Mobile: keep button + field inside the parent container at all times. */
@media (max-width: 600px) {
    .pwg-search { flex-wrap: nowrap; gap: 6px; }
    .pwg-search__field,
    .pwg-search__btn { min-width: 0; max-width: 100%; }
    .pwg-search__btn {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pwg-search__btn .pwg-search__btn-text {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
