/* ==========================================================================
   Documentation
   ========================================================================== */

/* Docs home */
.wptm-docs-hero { position: relative; background: radial-gradient(60% 80% at 50% 0%, var(--wp--preset--color--brand-soft), transparent 70%), var(--wp--preset--color--bg); border-bottom: 1px solid var(--wptm-line); }
.wptm-docs-hero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: radial-gradient(var(--wptm-line) 1px, transparent 1px); background-size: 22px 22px;
	-webkit-mask-image: radial-gradient(50% 70% at 50% 0%, #000, transparent 75%); mask-image: radial-gradient(50% 70% at 50% 0%, #000, transparent 75%);
}
.wptm-docs-hero > * { position: relative; }
.wptm-docs-hero h1 { margin-top: 12px; }
.wptm-docs-hero .wptm-docs-search { margin-top: 28px; }
.wptm-docs-popular { margin-top: 18px !important; color: var(--wptm-muted); }
.wptm-docs-popular a { display: inline-block; margin: 4px 3px; padding: 4px 11px; border-radius: 999px; background: var(--wptm-surface); border: 1px solid var(--wptm-line); color: var(--wptm-ink); text-decoration: none !important; transition: border-color .2s, color .2s; }
.wptm-docs-popular a:hover { border-color: var(--wptm-brand); color: var(--wptm-brand); }
.wptm-docs-cats > .alignwide:first-child { align-items: flex-end; margin-bottom: 24px; }
.wptm-docs-cats h2, .wptm-docs-cats > .alignwide p { margin: 0; }

/* Search */
.wptm-docs-search { position: relative; display: flex; align-items: center; background: var(--wptm-surface); border: 1.5px solid var(--wptm-line); border-radius: 14px; box-shadow: var(--wp--preset--shadow--card); transition: border-color .2s, box-shadow .2s; }
.wptm-docs-search:focus-within { border-color: var(--wptm-brand); box-shadow: 0 0 0 4px rgba(13,122,92,.12), var(--wp--preset--shadow--card); }
.wptm-docs-search__icon { position: absolute; left: 18px; color: var(--wptm-muted); pointer-events: none; }
.wptm-docs-search input[type="search"] { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; color: var(--wptm-ink); padding: 18px 54px; font-size: 1.0625rem; }
.wptm-docs-search input::-webkit-search-cancel-button { display: none; }
.wptm-docs-search__kbd { position: absolute; right: 16px; font: 600 12px/1 var(--wp--preset--font-family--mono); color: var(--wptm-muted); border: 1px solid var(--wptm-line); border-bottom-width: 2px; border-radius: 6px; padding: 4px 7px; background: var(--wptm-soft); }
.wptm-docs-search--small { border-radius: 10px; box-shadow: none; margin-bottom: 18px; }
.wptm-docs-search--small input[type="search"] { padding: 11px 38px 11px 40px; font-size: .9375rem; }
.wptm-docs-search--small .wptm-docs-search__icon { left: 13px; width: 17px; height: 17px; }
.wptm-docs-search--small .wptm-docs-search__kbd { right: 10px; }
.wptm-docs-search__results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; background: var(--wptm-surface); border: 1px solid var(--wptm-line); border-radius: 12px; box-shadow: var(--wp--preset--shadow--window); padding: 6px; max-height: 360px; overflow: auto; text-align: left; }
.wptm-docs-search__results a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--wptm-ink); text-decoration: none !important; }
.wptm-docs-search__results a:hover, .wptm-docs-search__results a.is-active { background: var(--wptm-soft); }
.wptm-docs-search__results a strong { display: block; font-size: .9375rem; }
.wptm-docs-search__results a span { display: block; font-size: .8125rem; color: var(--wptm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wptm-docs-search__results .is-empty { padding: 12px; color: var(--wptm-muted); font-size: .875rem; }
.wptm-docs-search__results mark { background: var(--wptm-mark); color: inherit; border-radius: 2px; }

/* Category cards */
.wptm-docs-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .wptm-docs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .wptm-docs-grid { grid-template-columns: 1fr; } }
.wptm-doc-card { display: flex; flex-direction: column; background: var(--wptm-surface); border: 1px solid var(--wptm-line); border-radius: var(--wptm-r-lg); padding: 24px; transition: transform .35s var(--wptm-ease), box-shadow .35s, border-color .35s; }
.wptm-doc-card:hover { transform: translateY(-4px); box-shadow: var(--wp--preset--shadow--window); border-color: color-mix(in srgb, var(--wptm-brand) 35%, var(--wptm-line)); }
.wptm-doc-card__head { display: flex; gap: 14px; align-items: center; }
.wptm-doc-card__icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--wptm-brand-soft); color: var(--wptm-brand); transition: transform .35s var(--wptm-ease); }
.wptm-doc-card:hover .wptm-doc-card__icon { transform: rotate(-6deg) scale(1.05); }
.wptm-doc-card__title { margin: 0; font-size: 1.1875rem !important; }
.wptm-doc-card__title a { color: inherit; text-decoration: none !important; }
.wptm-doc-card__count { font-size: .8125rem; color: var(--wptm-muted); }
.wptm-doc-card__desc { margin: 14px 0 0; color: var(--wptm-muted); font-size: .9375rem; }
.wptm-doc-card__list { list-style: none; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--wptm-line); display: grid; gap: 2px; }
.wptm-doc-card__list a { display: flex; gap: 9px; align-items: center; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; color: var(--wptm-ink); font-size: .9375rem; text-decoration: none !important; transition: background .2s, color .2s; }
.wptm-doc-card__list a svg { color: var(--wptm-muted); flex: none; }
.wptm-doc-card__list a:hover { background: var(--wptm-soft); color: var(--wptm-brand); }
.wptm-doc-card__more { margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9375rem; text-decoration: none !important; transition: gap .2s; }
.wptm-doc-card__more:hover { gap: 10px; }
.wptm-docs-empty { padding: 40px; text-align: center; border: 1.5px dashed var(--wptm-line); border-radius: var(--wptm-r-lg); color: var(--wptm-muted); }
.wptm-docs-help { border-radius: var(--wptm-r-lg); padding: 24px 28px; gap: 20px; }
.wptm-docs-help p { margin: 0; }

/* Layout: sidebar | article | on this page */
.wptm-docs-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr) 220px;
	gap: clamp(24px, 4vw, 56px);
	max-width: 1280px; margin: 0 auto;
	padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) clamp(4rem, 8vw, 6rem);
	align-items: start;
}
.wptm-docs-layout.is-two-col { grid-template-columns: 260px minmax(0, 1fr); }
.wptm-docs-layout > * { margin: 0 !important; }
.wptm-docs-layout__side, .wptm-docs-layout__toc { position: sticky; top: calc(var(--wp--custom--header--height, 72px) + 24px); max-height: calc(100vh - 120px); overflow: auto; scrollbar-width: thin; }
.admin-bar .wptm-docs-layout__side, .admin-bar .wptm-docs-layout__toc { top: calc(var(--wp--custom--header--height, 72px) + 56px); }
.wptm-docs-layout__main { min-width: 0; max-width: 780px; }
.wptm-docs-layout.is-two-col .wptm-docs-layout__main { max-width: 860px; }
@media (max-width: 1180px) {
	.wptm-docs-layout { grid-template-columns: 240px minmax(0, 1fr); }
	.wptm-docs-layout__toc { display: none; }
}
@media (max-width: 860px) {
	.wptm-docs-layout, .wptm-docs-layout.is-two-col { grid-template-columns: 1fr; }
	.wptm-docs-layout__side { position: static; max-height: none; overflow: visible; }
}

/* Sidebar nav */
.wptm-docs-nav { font-size: .9375rem; }
.wptm-docs-nav__toggle { display: none; width: 100%; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--wptm-line); border-radius: 10px; background: var(--wptm-surface); font: 600 .9375rem/1 var(--wp--preset--font-family--body); color: var(--wptm-ink); cursor: pointer; }
@media (max-width: 860px) {
	.wptm-docs-nav__toggle { display: flex; }
	.wptm-docs-nav__panel { display: none; margin-top: 10px; padding: 12px; border: 1px solid var(--wptm-line); border-radius: 12px; }
	.wptm-docs-nav.is-open .wptm-docs-nav__panel { display: block; }
}
.wptm-docs-nav__home { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--wptm-ink); font-weight: 600; text-decoration: none !important; margin-bottom: 6px; }
.wptm-docs-nav__home:hover, .wptm-docs-nav__home.is-current { background: var(--wptm-soft); }
.wptm-docs-nav__group { border: 0 !important; padding: 0 !important; margin: 0 0 4px; }
.wptm-docs-nav__group summary { list-style: none; display: flex; gap: 8px; align-items: center; cursor: pointer; padding: 8px 10px; border-radius: 8px; font-weight: 700; color: var(--wptm-ink); }
.wptm-docs-nav__group summary::-webkit-details-marker { display: none; }
.wptm-docs-nav__group summary:hover { background: var(--wptm-soft); }
.wptm-docs-nav__group summary > svg:first-child { color: var(--wptm-brand); }
.wptm-docs-nav__group summary span { flex: 1; }
.wptm-docs-nav__chev { color: var(--wptm-muted); transition: transform .25s var(--wptm-ease); }
.wptm-docs-nav__group[open] .wptm-docs-nav__chev { transform: rotate(90deg); }
.wptm-docs-nav__group ul { list-style: none; margin: 2px 0 10px 18px; padding: 0 0 0 12px; border-left: 1px solid var(--wptm-line); }
.wptm-docs-nav__group li a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--wptm-muted); text-decoration: none !important; line-height: 1.4; position: relative; transition: color .2s, background .2s; }
.wptm-docs-nav__group li a:hover { color: var(--wptm-ink); background: var(--wptm-soft); }
.wptm-docs-nav__group li a.is-current { color: var(--wptm-brand); background: var(--wptm-brand-soft); font-weight: 600; }
.wptm-docs-nav__group li a.is-current::before { content: ""; position: absolute; left: -13px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--wptm-brand); }
.wptm-docs-nav__empty { padding: 6px 10px; color: var(--wptm-muted); font-size: .8125rem; font-style: italic; }

/* Article */
.wptm-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .84375rem; color: var(--wptm-muted); margin-bottom: 14px; }
.wptm-crumbs a { color: var(--wptm-muted); text-decoration: none !important; }
.wptm-crumbs a:hover { color: var(--wptm-brand); }
.wptm-crumbs svg { opacity: .55; }
.wptm-crumbs span { color: var(--wptm-ink); font-weight: 600; }
.wptm-doc-title { font-size: clamp(2rem, 4vw, 2.75rem) !important; margin: 0; }
.wptm-doc-lead { margin-top: 14px; }
.wptm-doc-lead p { margin: 0; }
.wptm-doc-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 20px 0 0; padding-bottom: 22px; border-bottom: 1px solid var(--wptm-line); font-size: .84375rem; color: var(--wptm-muted); }
.wptm-doc-meta > * { display: inline-flex; gap: 6px; align-items: center; }
.wptm-doc-meta a { color: var(--wptm-brand); text-decoration: none; font-weight: 600; }

.wptm-doc-content { margin-top: 32px; font-size: 1.0625rem; line-height: 1.75; }
.wptm-doc-content > * + * { margin-top: 1.1em; }
.wptm-doc-content h2 { font-size: 1.625rem !important; margin-top: 2.4em; padding-top: .2em; scroll-margin-top: 110px; }
.wptm-doc-content h3 { font-size: 1.25rem !important; margin-top: 1.9em; scroll-margin-top: 110px; }
.wptm-doc-content h2 .wptm-anchor, .wptm-doc-content h3 .wptm-anchor { margin-left: 8px; color: var(--wptm-line); text-decoration: none !important; opacity: 0; transition: opacity .2s, color .2s; font-weight: 400; }
.wptm-doc-content h2:hover .wptm-anchor, .wptm-doc-content h3:hover .wptm-anchor { opacity: 1; }
.wptm-doc-content .wptm-anchor:hover { color: var(--wptm-brand); }
.wptm-doc-content ol:not([class]) { counter-reset: step; list-style: none; padding-left: 0; }
.wptm-doc-content ol:not([class]) > li { counter-increment: step; position: relative; padding-left: 42px; margin-bottom: 14px; }
.wptm-doc-content ol:not([class]) > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--wptm-brand-soft); color: var(--wptm-brand); font-weight: 700; font-size: .875rem; }
.wptm-doc-content img { border-radius: 12px; border: 1px solid var(--wptm-line); }
.wptm-doc-content table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.wptm-doc-content th, .wptm-doc-content td { border-bottom: 1px solid var(--wptm-line); padding: 10px 12px; text-align: left; }
.wptm-doc-content th { background: var(--wptm-soft); font-weight: 700; }
.wptm-doc-content pre.wp-block-code { position: relative; overflow: auto; }
.wptm-copy-code { position: absolute; top: 10px; right: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: var(--wp--preset--color--code-fg); border-radius: 7px; padding: 5px 9px; font: 600 11.5px/1 var(--wp--preset--font-family--body); cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; }
.wptm-doc-content pre:hover .wptm-copy-code, .wptm-copy-code:focus { opacity: 1; }
.wptm-copy-code:hover { background: rgba(255,255,255,.14); }

/* Callouts */
.wptm-callout { position: relative; border-radius: 12px; padding: 16px 18px 16px 50px !important; border: 1px solid; font-size: .96875rem; }
.wptm-callout p { margin: 0; }
.wptm-callout::before { content: ""; position: absolute; left: 17px; top: 18px; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ico) center/contain no-repeat; mask: var(--ico) center/contain no-repeat; }
.wptm-callout.is-tip { background: var(--wptm-brand-soft); border-color: color-mix(in srgb, var(--wptm-brand) 25%, transparent); color: #0a4d3a; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3Z'/%3E%3C/svg%3E"); }
.wptm-callout.is-note { background: #eef4ff; border-color: #c9d8f5; color: #1e3a6e; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8v.01'/%3E%3C/svg%3E"); }
.wptm-callout.is-warning { background: var(--wp--preset--color--pro-bg); border-color: #f3d79b; color: var(--wp--preset--color--pro-fg); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3 2 20h20L12 3Z'/%3E%3Cpath d='M12 10v4M12 17v.01'/%3E%3C/svg%3E"); }

/* Feedback + pager */
.wptm-feedback { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 56px; padding: 18px 20px; border: 1px solid var(--wptm-line); border-radius: 12px; background: var(--wptm-soft); }
.wptm-feedback p { margin: 0; font-weight: 600; }
.wptm-feedback__btns { display: flex; gap: 8px; }
.wptm-feedback button { border: 1px solid var(--wptm-line); background: var(--wptm-surface); border-radius: 9px; padding: 8px 16px; font: 600 .875rem/1 var(--wp--preset--font-family--body); cursor: pointer; transition: border-color .2s, color .2s, transform .2s var(--wptm-ease); }
.wptm-feedback button:hover { border-color: var(--wptm-brand); color: var(--wptm-brand); transform: translateY(-1px); }
.wptm-feedback.is-done .wptm-feedback__btns, .wptm-feedback.is-done .wptm-feedback__q { display: none; }
.wptm-feedback__thanks { color: var(--wptm-brand); }
.wptm-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.wptm-pager__link { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--wptm-line); border-radius: 12px; text-decoration: none !important; color: var(--wptm-ink); transition: border-color .2s, transform .2s var(--wptm-ease); }
.wptm-pager__link:hover { border-color: var(--wptm-brand); transform: translateY(-2px); }
.wptm-pager__link small { display: inline-flex; align-items: center; gap: 5px; font-size: .78125rem; color: var(--wptm-muted); }
.wptm-pager__link span { font-weight: 700; }
.wptm-pager__link.is-next { text-align: right; justify-items: end; }
@media (max-width: 560px) { .wptm-pager { grid-template-columns: 1fr; } }

/* On this page */
.wptm-toc { font-size: .875rem; }
.wptm-toc__title { margin: 0 0 10px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--wptm-muted); }
.wptm-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--wptm-line); }
.wptm-toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--wptm-muted); text-decoration: none !important; line-height: 1.4; transition: color .2s, border-color .2s; }
.wptm-toc li.is-h3 a { padding-left: 26px; font-size: .8125rem; }
.wptm-toc li a:hover { color: var(--wptm-ink); }
.wptm-toc li a.is-active { color: var(--wptm-brand); border-left-color: var(--wptm-brand); font-weight: 600; }
.wptm-toc-help { margin-top: 28px; padding: 16px; border-radius: 12px; background: var(--wptm-soft); border: 1px solid var(--wptm-line); }
.wptm-toc-help p { margin: 0; color: var(--wptm-muted); }
.wptm-toc-help p + p { margin-top: 10px; }
.wptm-toc-help strong { color: var(--wptm-ink); }

/* Category & search listings */
.wptm-doc-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.wptm-doc-row { position: relative; padding: 18px 48px 18px 20px; border: 1px solid var(--wptm-line); border-radius: 12px; background: var(--wptm-surface); transition: border-color .2s, transform .2s var(--wptm-ease), box-shadow .2s; }
.wptm-doc-row::after { content: "→"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--wptm-muted); transition: right .2s, color .2s; }
.wptm-doc-row:hover { border-color: var(--wptm-brand); box-shadow: var(--wp--preset--shadow--card); }
.wptm-doc-row:hover::after { right: 16px; color: var(--wptm-brand); }
.wptm-doc-row h3 { margin: 0; font-size: 1.0625rem !important; }
.wptm-doc-row h3 a { color: inherit; text-decoration: none !important; }
.wptm-doc-row h3 a::before { content: ""; position: absolute; inset: 0; }
.wptm-doc-row .wp-block-post-excerpt { margin-top: 4px; }
.wptm-doc-row .wp-block-post-excerpt p { margin: 0; }
