/* All Tools directory (premium). Uses the --ws-* tokens; the original card markup is untouched inside each wrapper. */
body:is(.post-type-archive-won_tool, .post-type-archive-won_guide, .post-type-archive-won_use_case, .post-type-archive-won_knowledge) main.site-main { max-width: 76rem; }
body:is(.post-type-archive-won_tool, .post-type-archive-won_guide, .post-type-archive-won_use_case, .post-type-archive-won_knowledge) .archive-header { max-width: none !important; width: 100%; margin-inline: 0 !important; }
.archive-header { position: relative; display: grid; gap: var(--ws-s3); padding: var(--ws-s6) var(--ws-s6) var(--ws-s5); margin-bottom: var(--ws-s5); border-radius: var(--ws-r-lg); border: 1px solid var(--ws-border); background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--ws-primary) 16%, transparent), transparent 55%), linear-gradient(135deg, var(--ws-primary-100), var(--ws-surface) 80%); overflow: hidden; min-height: clamp(22rem, 34vw, 28rem); align-content: center; padding-block: var(--ws-s7); }
.archive-header h1 { position: relative; z-index: 1; margin: 0; max-width: min(16ch, calc(100% - 28rem)) !important; font-size: clamp(2.4rem, 5.6vw, 4.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: var(--ws-text); }
.won-dir-pill { position: relative; z-index: 1; justify-self: start; padding: .25rem .9rem; border-radius: var(--ws-r-pill); background: var(--ws-surface); color: var(--ws-primary); font-size: var(--ws-fs-xs); font-weight: var(--ws-fw-bold); letter-spacing: .06em; text-transform: uppercase; box-shadow: var(--ws-shadow-sm); }
.won-dir-heroart { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); width: min(40rem, 52%); pointer-events: none; }
.won-dir-heroart svg { display: block; width: 100%; height: auto; }
.won-dir-float { position: absolute; padding: .3rem .8rem; border-radius: var(--ws-r-pill); background: var(--ws-surface); color: var(--ws-text); font-size: var(--ws-fs-xs); font-weight: var(--ws-fw-bold); box-shadow: var(--ws-shadow-md); white-space: nowrap; }
.won-dir-float.f1 { left: 0; top: 14%; transform: rotate(-8deg); } .won-dir-float.f2 { right: -2%; top: 36%; transform: rotate(6deg); } .won-dir-float.f3 { right: 4%; bottom: 8%; transform: rotate(-6deg); }
@media (max-width: 1000px) { .archive-header h1 { max-width: none !important; } }
@media (max-width: 760px) { .won-dir-heroart { position: static; transform: none; width: min(18rem, 80%); margin: var(--ws-s3) auto 0; } .archive-header { padding: var(--ws-s5) var(--ws-s4); } .won-dir-float { display: none; } }

/* search + chips */
.won-dir-controls { margin-bottom: var(--ws-s5); display: grid; gap: var(--ws-s3); }
.won-dir-controls[hidden] { display: none; }
.won-dir-searchrow { display: flex; gap: var(--ws-s3); align-items: center; flex-wrap: wrap; }
.won-dir-search { flex: 1 1 22rem; display: flex; align-items: center; gap: var(--ws-s2); padding: .3rem .4rem .3rem var(--ws-s4); background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: var(--ws-r-pill); box-shadow: var(--ws-shadow-md); color: var(--ws-primary); max-width: 100%; box-sizing: border-box; }
.won-dir-search:focus-within { box-shadow: var(--ws-ring), var(--ws-shadow-md); }
.won-dir-search input { flex: 1 1 0; width: 0; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none; padding: .7rem .25rem !important; color: var(--ws-text); font: inherit; }
.won-dir-search input::-webkit-search-cancel-button { display: none; }
.won-dir-clear { background: transparent !important; color: var(--ws-text-muted) !important; border: 0 !important; min-width: 44px; min-height: 44px; font-size: 1.4rem; padding: 0 !important; }
.won-dir-reset { background: var(--ws-surface) !important; color: var(--ws-primary) !important; border: 1px solid var(--ws-border) !important; border-radius: var(--ws-r-pill) !important; min-height: 44px; padding: 0 1.1rem !important; font-weight: var(--ws-fw-bold); }
.won-dir-chips { display: flex; gap: var(--ws-s2); overflow-x: auto; padding: .35rem .2rem .6rem; scrollbar-width: thin; }
.won-dir-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 1.1rem !important; background: var(--ws-surface) !important; color: var(--ws-text) !important; border: 1px solid var(--ws-border) !important; border-radius: var(--ws-r-pill) !important; box-shadow: var(--ws-shadow-sm); font-weight: var(--ws-fw-medium); transition: transform var(--ws-dur) var(--ws-ease); }
.won-dir-chip:hover { transform: translateY(-1px); }
.won-dir-chip[aria-pressed="true"] { background: var(--ws-gradient) !important; color: #fff !important; border-color: transparent !important; }
.won-dir-n { font-size: var(--ws-fs-xs); opacity: .75; }
.won-dir-controls a:focus-visible, .won-dir-controls button:focus-visible, .won-dir-cta:focus-visible { outline: none; box-shadow: var(--ws-ring); }
.won-dir-empty { padding: var(--ws-s5); text-align: center; border: 1px dashed var(--ws-border); border-radius: var(--ws-r-md); color: var(--ws-text-muted); background: var(--ws-surface); }

/* sections */
.won-dir-section { margin-block: var(--ws-s5); padding: var(--ws-s5); border-radius: var(--ws-r-lg); border: 1px solid var(--ws-border); background: linear-gradient(135deg, color-mix(in srgb, var(--tone, var(--ws-primary)) 8%, var(--ws-surface)), var(--ws-surface) 70%); box-shadow: var(--ws-shadow-sm); --tone: var(--ws-primary); }
.won-dir-pickers { --tone: var(--ws-blue); } .won-dir-themed { --tone: var(--ws-orange); } .won-dir-more { --tone: var(--ws-pink); }
.won-dir-sechead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ws-s3); margin-bottom: var(--ws-s4); }
.won-dir-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: var(--ws-r-md); background: var(--ws-gradient); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--tone) 35%, transparent); }
.won-dir-pickers .won-dir-icon { background: linear-gradient(135deg, #60a5fa, var(--ws-blue)); } .won-dir-themed .won-dir-icon { background: linear-gradient(135deg, #ffb066, var(--ws-orange)); }
.won-dir-section h2 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; color: var(--ws-text); }
.won-dir-count { margin-left: auto; padding: .2rem .75rem; border-radius: var(--ws-r-pill); background: var(--ws-primary-100); color: var(--ws-primary); font-size: var(--ws-fs-xs); font-weight: var(--ws-fw-bold); }
.won-dir-section .card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: var(--ws-s4); margin: 0; }
.won-dir-section [hidden] { display: none !important; }

/* tool cards: the original <article class="card"> sits inside the wrapper */
.won-dir-card { display: flex; flex-direction: column; background: var(--ws-surface); border: 1px solid color-mix(in srgb, var(--tone) 22%, var(--ws-border)); border-radius: var(--ws-r-lg); box-shadow: var(--ws-shadow-sm); overflow: hidden; transition: transform var(--ws-dur) var(--ws-ease), box-shadow var(--ws-dur) var(--ws-ease); min-width: 0; }
.won-dir-card:hover, .won-dir-card:focus-within { transform: translateY(-4px); box-shadow: var(--ws-shadow-lg); }
.won-dir-art { height: 11rem; background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 14%, var(--ws-surface)), color-mix(in srgb, var(--ws-pink) 8%, var(--ws-surface))); }
.won-dir-art svg { display: block; width: 100%; height: 100%; }
.won-dir-card > .card { margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: var(--ws-s4) var(--ws-s4) var(--ws-s2); flex: 1 1 auto; }
.won-dir-card > .card h3 { margin: 0 0 var(--ws-s2); font-size: var(--ws-fs-lg); font-weight: 800; }
.won-dir-card > .card h3 a { color: var(--ws-text); text-decoration: none; }
.won-dir-card > .card p { color: var(--ws-text-muted); font-size: var(--ws-fs-sm); line-height: 1.55; }
.won-dir-card > .card p.won-quick { color: var(--ws-text); }
.won-dir-badges { list-style: none; margin: 0; padding: 0 var(--ws-s4); display: flex; flex-wrap: wrap; gap: var(--ws-s2); }
.won-dir-badges li { padding: .25rem .6rem; border-radius: var(--ws-r-md); background: var(--ws-surface-2); border: 1px solid var(--ws-border); color: var(--ws-text); font-size: var(--ws-fs-xs); font-weight: var(--ws-fw-medium); }
.won-dir-cta { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: var(--ws-s4); min-height: 46px; border-radius: var(--ws-r-md); background: var(--ws-gradient); color: #fff !important; font-weight: var(--ws-fw-bold); text-decoration: none; box-shadow: 0 6px 16px rgb(90 42 224 / .3); }
.won-dir-cta:hover { filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) { .won-dir * { transition: none !important; } .won-dir-card:hover { transform: none; } }

/* the existing "Quick answer" callout is inserted before the first heading by another filter: keep it above the section header row */
.won-dir-sechead > .won-quick { flex: 1 0 100%; order: -1; margin: 0 0 var(--ws-s2); max-width: none; }
.won-dir-section .card-grid { align-items: stretch; }
.won-dir-card { height: 100%; }
.won-dir-card > .card { display: block; }

/* Guides / Use Cases / Knowledge hubs: same wrapper, grid grows with the content */
.won-res { --tone: var(--ws-primary); }
.won-res-grid > .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--ws-s5); margin: 0; align-items: stretch; }
.won-res-card .won-res-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.won-res-card .won-dir-art { height: 12rem; }
.won-res-card > .card h2 { margin: 0 0 var(--ws-s2); font-size: var(--ws-fs-lg); font-weight: 800; line-height: 1.2; }
.won-res-card > .card h2 a { color: var(--ws-text); text-decoration: none; }
.won-res-card > .card p { color: var(--ws-text-muted); font-size: var(--ws-fs-sm); line-height: 1.6; }
.won-res-card > .card p.won-quick { color: var(--ws-text); }
/* the first (newest) article is featured: full width, image beside the text */
@media (min-width: 900px) {
  .won-res-grid > .card-grid > .won-res-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: 1fr auto auto; }
  .won-res-grid > .card-grid > .won-res-card:first-child .won-dir-art { grid-row: 1 / -1; height: auto; min-height: 18rem; }
  .won-res-grid > .card-grid > .won-res-card:first-child > .card { padding: var(--ws-s5); }
  .won-res-grid > .card-grid > .won-res-card:first-child > .card h2 { font-size: var(--ws-fs-xl); }
  .won-res-grid > .card-grid > .won-res-card:first-child .won-dir-badges { padding-inline: var(--ws-s5); }
  .won-res-grid > .card-grid > .won-res-card:first-child .won-dir-cta { margin: var(--ws-s4) var(--ws-s5) var(--ws-s5); justify-self: start; min-width: 14rem; }
}
.won-res .won-dir-controls { margin-top: 0; }
.pagination, .navigation.pagination { margin-top: var(--ws-s5); }
