/* Post Showcase Widgets v1.7.0
   Breakpoints:
     Desktop  : > 1024px  — 2-col side-by-side
     Tablet   : 601-1024px — featured full-width + list below (1 card per row, image+text)
     Mobile   : ≤ 600px   — single column stack, full-width cards
*/

/* ── scoped reset ──────────────────────────────── */
.psw-trending-articles *,
.psw-stories *,
.psw-latest-articles *,
.psw-blog-hero *,
.psw-search-wrap * { box-sizing: border-box; }

/* ── shared helpers ────────────────────────────── */
.psw-heading {
  font-size: 1.75rem; font-weight: 800;
  line-height: 1.2; margin: 0 0 20px; color: #0f2d5c;
}
.psw-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.psw-tag  {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #1558d6; background: #e8f0fe;
  border-radius: 4px; padding: 2px 8px; line-height: 1.6;
  display: inline-block; white-space: nowrap;
}
.psw-meta        { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.psw-meta-date   { font-size: .78rem; color: #6b7280; }
.psw-meta-author { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #374151; font-weight: 500; }
.psw-avatar      { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.psw-noimg       { background: linear-gradient(135deg,#e5e7eb,#d1d5db); }
.psw-empty       { color: #9ca3af; font-style: italic; padding: 1.5rem 0; }

.psw-cta-btn, .psw-view-all {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid #1558d6; color: #1558d6;
  border-radius: 9999px; padding: 10px 28px;
  font-size: .875rem; font-weight: 600;
  text-decoration: none; background: transparent;
  transition: background .2s, color .2s, transform .15s;
}
.psw-cta-btn:hover,
.psw-view-all:hover { background: #1558d6; color: #fff; transform: translateY(-1px); }

/* ════════════════════════════════════════════════
   WIDGET 1 — TRENDING ARTICLES GRID
════════════════════════════════════════════════ */
.psw-trending-articles { width: 100%; }

.psw-ta-grid  { display: grid; gap: 20px; }
.psw-cols-1   { grid-template-columns: 1fr; }
.psw-cols-2   { grid-template-columns: repeat(2,1fr); }
.psw-cols-3   { grid-template-columns: repeat(3,1fr); }
.psw-cols-4   { grid-template-columns: repeat(4,1fr); }

.psw-ta-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease;
}
.psw-ta-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.12); }

.psw-ta-img-wrap { display: block; overflow: hidden; flex-shrink: 0; }
.psw-ta-img      { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform .36s ease; }
.psw-ta-card:hover .psw-ta-img { transform: scale(1.05); }

.psw-ta-body    { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.psw-ta-title   { font-size: .97rem; font-weight: 700; line-height: 1.4; margin: 0; flex: 1; }
.psw-ta-title a { text-decoration: none; color: #111827; transition: color .18s; }
.psw-ta-title a:hover { color: #1558d6; }
.psw-ta-excerpt { font-size: .83rem; color: #6b7280; margin: 0; line-height: 1.55; }
.psw-ta-meta    { margin-top: auto; padding-top: 8px; border-top: 1px solid #f3f4f6; }

/* ════════════════════════════════════════════════
   WIDGET 2 — SUCCESS STORIES SLIDER
════════════════════════════════════════════════ */
.psw-stories { background: #eef4ff; padding: 40px 24px 28px; width: 100%; overflow: hidden; }

.psw-st-wrap  { overflow: hidden; }
.psw-st-track {
  display: flex; gap: 16px;
  transition: transform .42s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.psw-st-card {
  position: relative; flex: 0 0 calc(25% - 12px);
  min-height: 320px; border-radius: 14px; overflow: hidden; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,.22), 0 1px 4px rgba(0,0,0,.10);
  transition: transform .22s ease, box-shadow .22s ease;
  background: #1e3a5f;
}
.psw-st-card:hover { transform: translateY(-5px); box-shadow: 0 14px 40px rgba(0,0,0,.3); }

.psw-st-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .36s ease; }
.psw-st-card:hover .psw-st-bg { transform: scale(1.05); }
.psw-st-placeholder { background: linear-gradient(160deg,#1e3a5f 0%,#0f1e40 100%); }

.psw-st-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(10,20,60,0) 0%, rgba(10,20,60,.90) 100%);
}
.psw-st-badge {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  background: #fff; border-radius: 10px; padding: 6px;
  display: flex; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.psw-st-badge img { width: 28px; height: 28px; object-fit: contain; }

.psw-st-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px 16px 16px; z-index: 3; }
.psw-st-title   { font-size: .85rem; color: rgba(255,255,255,.85); margin: 0 0 4px; font-weight: 500; line-height: 1.35; }
.psw-st-price   { font-size: 1.1rem; font-weight: 800; color: #fff; margin: 0 0 3px; }
.psw-st-date    { font-size: .85rem; color: #93c5fd; margin: 0 0 12px; font-weight: 600; }

.psw-st-btn {
  display: inline-flex; align-items: center;
  border: 1.5px solid rgba(255,255,255,.6); border-radius: 50px; padding: 6px 16px;
  font-size: .78rem; font-weight: 600; color: #fff; text-decoration: none; background: transparent;
  transition: background .2s, border-color .2s;
}
.psw-st-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.85); }

.psw-st-nav { display: flex; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.psw-nav-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid #d1d5db; background: #fff;
  cursor: pointer; font-size: 1.3rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: #374151; padding: 0;
  transition: border-color .2s, background .2s, transform .15s;
}
.psw-nav-btn:hover { border-color: #1558d6; background: #eff6ff; color: #1558d6; transform: scale(1.08); }
.psw-nav-btn:disabled { opacity: .35; cursor: default; transform: none; }
.psw-st-cta { text-align: center; margin-top: 14px; }

/* ════════════════════════════════════════════════
   WIDGET 3 — LATEST ARTICLES
   Desktop : featured (left) + sidebar thumb-list (right)
   Tablet  : featured full-width + thumb-list below (1 col)
   Mobile  : full-width cards stacked vertically
════════════════════════════════════════════════ */
.psw-latest-articles { width: 100%; }

/* ── Desktop 2-col grid ── */
.psw-la-layout {
  display: grid;
  grid-template-columns: 1fr 1fr; /* overridden by inline style from PHP */
  gap: 32px;
  align-items: start;
}

/* Featured */
.psw-la-featured { display: flex; flex-direction: column; gap: 10px; }

.psw-la-feat-wrap { display: block; border-radius: 10px; overflow: hidden; line-height: 0; }
.psw-la-feat-img  {
  width: 100%; height: auto; display: block; border-radius: 10px;
  transition: transform .35s ease;
}
.psw-la-feat-wrap:hover .psw-la-feat-img { transform: scale(1.02); }

.psw-la-feat-title     { font-size: 1.2rem; font-weight: 800; line-height: 1.35; margin: 6px 0 0; }
.psw-la-feat-title a   { text-decoration: none; color: #111827; transition: color .18s; }
.psw-la-feat-title a:hover { color: #1558d6; }
.psw-la-excerpt { font-size: .87rem; color: #6b7280; margin: 2px 0 0; line-height: 1.6; }

/* Sidebar stack */
.psw-la-sidebar { display: flex; flex-direction: column; gap: 16px; }

/* ── Sidebar Card — image LEFT (fixed width), text RIGHT ── */
.psw-la-side-card {
  background: #fff; border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.psw-la-side-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }

.psw-la-side-inner { display: flex; align-items: stretch; }

.psw-la-side-img-wrap {
  display: block; flex-shrink: 0;
  overflow: hidden; line-height: 0;
  width: 130px; min-width: 130px;
}
.psw-la-side-img-thumb {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .32s ease;
}
.psw-la-side-card:hover .psw-la-side-img-thumb { transform: scale(1.05); }

.psw-la-side-body {
  padding: 10px 14px 12px;
  display: flex; flex-direction: column; gap: 5px;
  flex: 1; min-width: 0;
}
.psw-la-side-title     { font-size: .9rem; font-weight: 700; line-height: 1.4; margin: 0; }
.psw-la-side-title a   { text-decoration: none; color: #111827; transition: color .18s; }
.psw-la-side-title a:hover { color: #1558d6; }

.psw-la-cta { text-align: center; margin-top: 24px; }

/* ════════════════════════════════════════════════
   WIDGET 4 — BLOG HERO
   Desktop : featured (left col) + thumb-list (right col)
   Tablet  : featured full-width + thumb-list below (1 col)
   Mobile  : full-width card stack
════════════════════════════════════════════════ */
.psw-blog-hero { width: 100%; }

.psw-bh-hero {
  font-size: 2rem; font-weight: 800; line-height: 1.2;
  color: #0f2d5c; margin: 0 0 20px;
}

.psw-bh-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.psw-bh-tab {
  font-size: .8rem; font-weight: 600; cursor: pointer;
  padding: 6px 18px; border: none; outline: none;
  background: #f3f4f6; color: #374151;
  border-radius: 9999px;
  transition: background .18s, color .18s; white-space: nowrap;
}
.psw-bh-tab:hover { background: #e5e7eb; }
.psw-bh-tab.psw-tab-active { background: #1558d6; color: #fff; }
.psw-bh-tab:focus-visible { outline: 2px solid #1558d6; outline-offset: 2px; }

.psw-bh-main { display: grid; grid-template-columns: 5fr 7fr; gap: 28px; align-items: start; }

/* Featured */
.psw-bh-featured { display: flex; flex-direction: column; gap: 10px; }
.psw-bh-feat-wrap { display: block; border-radius: 12px; overflow: hidden; line-height: 0; }
.psw-bh-feat-img  { width: 100%; height: auto; display: block; border-radius: 12px; transition: transform .35s ease; }
.psw-bh-feat-wrap:hover .psw-bh-feat-img { transform: scale(1.02); }
.psw-bh-feat-title     { font-size: 1.25rem; font-weight: 800; line-height: 1.35; margin: 6px 0 0; }
.psw-bh-feat-title a   { text-decoration: none; color: #111827; transition: color .18s; }
.psw-bh-feat-title a:hover { color: #1558d6; }
.psw-bh-excerpt { font-size: .87rem; color: #6b7280; margin: 2px 0 0; line-height: 1.6; }

/* Sidebar list — vertical stack of horizontal cards */
.psw-bh-list { display: flex; flex-direction: column; gap: 14px; }

/* Card — image LEFT (32% width), text RIGHT */
.psw-bh-card {
  background: #fff; border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transition: transform .2s ease, box-shadow .2s ease;
}
.psw-bh-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }

.psw-bh-card-inner { display: flex; align-items: stretch; }

.psw-bh-card-img-wrap {
  display: block; flex-shrink: 0;
  overflow: hidden; line-height: 0;
  width: 32%; min-width: 100px;
}
.psw-bh-card-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .32s ease;
}
.psw-bh-card:hover .psw-bh-card-img { transform: scale(1.04); }

.psw-bh-card-body {
  padding: 10px 14px 12px;
  display: flex; flex-direction: column; gap: 5px;
  flex: 1; min-width: 0;
}
.psw-bh-card-title     { font-size: .88rem; font-weight: 700; line-height: 1.4; margin: 0; }
.psw-bh-card-title a   { text-decoration: none; color: #111827; transition: color .18s; }
.psw-bh-card-title a:hover { color: #1558d6; }

/* Tab filter hidden state */
.psw-bh-card[aria-hidden="true"],
.psw-bh-featured[aria-hidden="true"] { display: none; }

.psw-bh-cta { text-align: center; margin-top: 24px; }

/* ════════════════════════════════════════════════
   WIDGET 5 — SITE SEARCH BAR
════════════════════════════════════════════════ */
.psw-search-wrap { width: 100%; display: flex; }

.psw-search-form {
  width: 100%; max-width: 640px;
  background: #fff; border-radius: 9999px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  overflow: hidden; position: relative;
}
.psw-search-inner { display: flex; align-items: center; position: relative; }

.psw-search-input {
  flex: 1; border: none; outline: none;
  background: transparent; font-size: .95rem; color: #111827;
  padding: 14px 16px 14px 24px; min-width: 0;
  border-radius: 9999px 0 0 9999px; -webkit-appearance: none;
}
.psw-search-input::placeholder { color: #9ca3af; }
.psw-search-input::-webkit-search-decoration,
.psw-search-input::-webkit-search-cancel-button { display: none; }

.psw-search-btn {
  flex-shrink: 0; border: none; cursor: pointer;
  width: 46px; height: 46px;
  background: #3d4de8; color: #fff; border-radius: 50%;
  margin: 4px 4px 4px 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s, transform .12s;
}
.psw-search-btn:hover  { background: #2d3bd0; }
.psw-search-btn:active { transform: scale(.95); }
.psw-search-btn:not(.psw-btn-icon) {
  width: auto; border-radius: 9999px;
  padding: 0 22px; font-size: .875rem; font-weight: 600;
}

/* ════════════════════════════════════════════════
   RESPONSIVE — TABLET  (601px – 1024px)
   • Latest Articles: featured FULL WIDTH on top, sidebar cards below in 1 column, each card shows full image
   • Blog Hero: featured FULL WIDTH on top, list below in 1 column
   • Trending: 2-col grid
   • Stories: 2 cards visible at once
════════════════════════════════════════════════ */
@media (min-width: 601px) and (max-width: 1024px) {

  /* ── Trending ── */
  .psw-cols-3, .psw-cols-4 { grid-template-columns: repeat(2,1fr); }

  /* ── Stories slider ── */
  /* JS handles visible count via data-vis, CSS just ensures cards look right */

  /* ── Latest Articles — stack vertically ── */
  .psw-la-layout {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  /* Featured image: taller, hero-like */
  .psw-la-feat-img { border-radius: 12px; }
  .psw-la-feat-title { font-size: 1.4rem; }

  /* Sidebar cards on tablet: each card is a full-width horizontal row
     but with a TALLER image so it "shows the whole picture" as requested */
  .psw-la-sidebar { gap: 14px; }

  .psw-la-side-img-wrap {
    width: 200px;
    min-width: 200px;
  }
  /* Let the card height be driven by content, image fills it */
  .psw-la-side-img-thumb { min-height: 130px; }

  /* ── Blog Hero — stack vertically ── */
  .psw-bh-main {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  .psw-bh-feat-title { font-size: 1.4rem; }

  /* Sidebar list on tablet: 1 card per row, image is wider so picture shows fully */
  .psw-bh-list { flex-direction: column; gap: 14px; }
  .psw-bh-card { width: 100%; }

  .psw-bh-card-img-wrap {
    width: 220px;
    min-width: 220px;
  }

}

/* ════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 600px)
   • ALL widgets: single column, full-width cards stacked
   • Latest Articles: featured top, then each sidebar card becomes a vertical card (image full width on top, text below)
   • Blog Hero: same — featured then vertical cards stacked
   • Trending: 1 col
   • Stories: 1 card at a time (JS handles)
════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* Shared */
  .psw-heading { font-size: 1.35rem; }

  /* ── Trending ── */
  .psw-cols-2, .psw-cols-3, .psw-cols-4 { grid-template-columns: 1fr; }
  .psw-ta-img { height: 180px; }

  /* ── Stories ── */
  .psw-st-card { flex: 0 0 100% !important; min-height: 280px; }
  .psw-stories { padding: 24px 16px 20px; }

  /* ── Latest Articles ── */
  .psw-la-layout {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  /* Featured: full width, normal */
  .psw-la-feat-title { font-size: 1.15rem; }

  /* Sidebar cards on mobile: flip to VERTICAL layout
     image full-width on top, text below — like a standard blog card */
  .psw-la-side-inner {
    flex-direction: column;
  }
  .psw-la-side-img-wrap {
    width: 100% !important;
    min-width: 0 !important;
    height: 180px;
  }
  .psw-la-side-img-thumb {
    height: 180px;
    width: 100%;
    border-radius: 0;
  }
  .psw-la-side-body { padding: 12px 14px 14px; }
  .psw-la-side-title { font-size: .92rem; }

  /* ── Blog Hero ── */
  .psw-bh-main {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  .psw-bh-hero { font-size: 1.4rem; }
  .psw-bh-feat-title { font-size: 1.15rem; }

  /* Sidebar cards on mobile: vertical — full-width image on top */
  .psw-bh-list { flex-direction: column; gap: 14px; }
  .psw-bh-card { width: 100%; }

  .psw-bh-card-inner { flex-direction: column; }

  .psw-bh-card-img-wrap {
    width: 100% !important;
    min-width: 0 !important;
    height: 180px;
  }
  .psw-bh-card-img {
    height: 180px;
    width: 100%;
    border-radius: 0;
  }
  .psw-bh-card-body { padding: 12px 14px 14px; }
  .psw-bh-card-title { font-size: .9rem; }

  /* ── Filter tabs: scroll horizontally on tiny screens ── */
  .psw-bh-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .psw-bh-tabs::-webkit-scrollbar { display: none; }

  /* ── Search bar ── */
  .psw-search-form { border-radius: 12px; }
  .psw-search-input { border-radius: 12px 0 0 12px; }
  .psw-search-btn   { border-radius: 0 12px 12px 0; width: 48px; }

  /* ── View All button — full width on mobile ── */
  .psw-la-cta .psw-view-all,
  .psw-bh-cta .psw-view-all { width: 100%; max-width: 320px; }
}
