/**
 * Digitora presentation for Tool Engine pages, archives, and categories.
 * Every rule is scoped to a Tool Engine wrapper or a tool-page body class.
 */

.tool-engine-page-wrapper {
	--te-font: Montserrat, sans-serif;
	--te-text: #4f4f4f;
	--te-heading: #2d2d2d;
	--te-pink: #cc3366;
	--te-orange: #ffac3b;
	--te-blue: #1a82e3;
	--te-purple: #6949c8;
	--te-white: #ffffff;
	--te-section: #f5f4f1;
	--te-border: #e8e5df;
	--te-navy: #111b35;
	--te-radius-card: 18px;
	--te-radius-control: 10px;
	--te-shadow: 0 12px 34px rgba(29, 39, 63, .075);

	box-sizing: border-box;
	width: 100%;
	max-width: 1300px;
	min-width: 0;
	margin: 0 auto;
	padding: clamp(20px, 3vw, 42px) clamp(16px, 3vw, 36px) clamp(44px, 5vw, 72px);
	background: var(--te-section);
	color: var(--te-text);
	font-family: var(--te-font);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
}

body.single-tool,
body.post-type-archive-tool,
body.tax-tool_category {
	background-color: var(--te-section);
}

.tool-engine-page-wrapper *,
.tool-engine-page-wrapper *::before,
.tool-engine-page-wrapper *::after { box-sizing: border-box; }

.tool-engine-main { width: 100%; max-width: none; min-width: 0; margin: 0; }
.tool-engine-single-article { min-width: 0; }

/* Widen only single tool pages and keep the breadcrumb 50px below the wrapper top. */
body.single-tool .tool-engine-page-wrapper { max-width: 1500px; padding-top: 50px; }

/* Breadcrumbs */
.tool-engine-page-wrapper .tool-engine-breadcrumbs { margin: 0 0 16px; color: #696969; font-size: 13px; }
.tool-engine-page-wrapper .tool-engine-breadcrumbs-list { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; padding: 0; list-style: none; }
.tool-engine-page-wrapper .tool-engine-breadcrumb-item { display: inline-flex; min-width: 0; align-items: center; gap: 7px; }
.tool-engine-page-wrapper .tool-engine-breadcrumb-item a { color: #5a5a5a; text-decoration: none; transition: color .3s ease; }
.tool-engine-page-wrapper .tool-engine-breadcrumb-item a:hover,
.tool-engine-page-wrapper .tool-engine-breadcrumb-item a:focus-visible { color: var(--te-blue); text-decoration: underline; text-underline-offset: 3px; }
.tool-engine-page-wrapper .tool-engine-breadcrumb-sep { color: #999; }
.tool-engine-page-wrapper .tool-engine-breadcrumb-current span { color: var(--te-heading); font-weight: 600; overflow-wrap: anywhere; }

/* Compact blue-to-purple introduction, shared by tool and archive headers. */
.tool-engine-page-wrapper .tool-engine-header,
.tool-engine-page-wrapper .tool-engine-archive-header {
	margin: 0 0 22px;
	padding: clamp(24px, 4vw, 42px);
	border-radius: var(--te-radius-card);
	background: linear-gradient(118deg, #1a82e3 0%, #5149bb 100%);
	color: var(--te-white);
	box-shadow: 0 14px 34px rgba(41, 75, 156, .16);
}

.tool-engine-page-wrapper .tool-engine-title {
	margin: 0 0 10px;
	color: var(--te-white);
	font-size: clamp(30px, 4vw, 42px);
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -.035em;
	overflow-wrap: anywhere;
}

.tool-engine-page-wrapper .tool-engine-lead { max-width: 820px; margin: 0; color: rgba(255, 255, 255, .92); font-size: 16px; line-height: 1.65; }

/* Category navigation */
.tool-engine-page-wrapper .tool-engine-category-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.tool-engine-page-wrapper .tool-engine-chip { display: inline-flex; min-height: 40px; align-items: center; padding: 8px 15px; border: 1px solid rgba(255, 255, 255, .48); border-radius: 999px; background: rgba(255, 255, 255, .12); color: var(--te-white); font-size: 13px; font-weight: 600; text-decoration: none; transition: background-color .3s ease, border-color .3s ease, color .3s ease; }
.tool-engine-page-wrapper .tool-engine-chip:hover,
.tool-engine-page-wrapper .tool-engine-chip:focus-visible,
.tool-engine-page-wrapper .tool-engine-chip.is-active { border-color: var(--te-orange); background: var(--te-orange); color: var(--te-heading); }

/* Ad placements */
.tool-engine-page-wrapper .tool-engine-ad-slot-wrap { width: 100%; margin: 20px 0; }
.tool-engine-page-wrapper .tool-engine-ad-placeholder { display: flex; min-height: 90px; align-items: center; justify-content: center; padding: 14px; border: 1px dashed #c9c5bf; border-radius: 12px; background: rgba(255, 255, 255, .72); color: #777; font-size: 12px; font-weight: 600; letter-spacing: .04em; }

/* Main tool workspace */
.tool-engine-page-wrapper .tool-engine-app-wrapper {
	width: 100%;
	min-width: 0;
	margin: 20px 0 26px;
	padding: clamp(14px, 2.2vw, 26px);
	border: 1px solid var(--te-border);
	border-radius: var(--te-radius-card);
	background: var(--te-white);
	box-shadow: var(--te-shadow);
	overflow: visible;
}

.tool-engine-page-wrapper .tool-engine-app-container { position: relative; width: 100%; min-width: 0; min-height: 0; }
.tool-engine-page-wrapper .tool-engine-app-container > :first-child { box-sizing: border-box; width: 100%; max-width: none; min-width: 0; margin-right: 0; margin-left: 0; }
.tool-engine-page-wrapper .tool-engine-app-placeholder { display: flex; min-height: 260px; align-items: center; justify-content: center; padding: 36px 20px; border-radius: 12px; background: var(--te-section); text-align: center; }
.tool-engine-page-wrapper .tool-engine-placeholder-inner { max-width: 460px; }
.tool-engine-page-wrapper .tool-engine-placeholder-icon span { width: 48px; height: 48px; margin-bottom: 12px; color: var(--te-blue); font-size: 48px; }
.tool-engine-page-wrapper .tool-engine-placeholder-title { margin: 0 0 8px; color: var(--te-heading); font-size: 20px; font-weight: 700; }
.tool-engine-page-wrapper .tool-engine-placeholder-desc { margin: 0; color: #696969; font-size: 14px; }
.tool-engine-page-wrapper .tool-engine-noscript-notice { margin: 0 0 14px; padding: 14px 16px; border: 1px solid #e7c28e; border-radius: 10px; background: #fff8ec; color: #583b12; }

/* Shared controls, preserving specialized module styles and behavior. */
.tool-engine-page-wrapper .tool-engine-app-container :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), textarea, select) {
	max-width: 100%;
	border-color: #d8d5cf;
	border-radius: var(--te-radius-control);
	color: var(--te-heading);
	font-family: inherit;
	transition: border-color .3s ease, box-shadow .3s ease;
}

.tool-engine-page-wrapper .tool-engine-app-container :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--te-blue); }
.tool-engine-page-wrapper .tool-engine-app-container button { min-height: 44px; border-radius: 999px; font-family: inherit; font-weight: 650; transition: color .3s ease, background-color .3s ease, border-color .3s ease, box-shadow .3s ease, transform .3s ease; }
.tool-engine-page-wrapper .tool-engine-app-container button[class*="primary"] { border-color: var(--te-orange); background: var(--te-orange); color: var(--te-heading); }
.tool-engine-page-wrapper .tool-engine-app-container button[class*="primary"]:hover:not(:disabled) { border-color: #f39b20; background: #f39b20; color: var(--te-heading); transform: translateY(-1px); }
.tool-engine-page-wrapper .tool-engine-app-container button[class*="secondary"] { border-color: var(--te-blue); background: var(--te-blue); color: var(--te-white); }
.tool-engine-page-wrapper .tool-engine-app-container button[class*="secondary"]:hover:not(:disabled) { border-color: #126fc5; background: #126fc5; color: var(--te-white); transform: translateY(-1px); }
.tool-engine-page-wrapper .tool-engine-app-container button:not([class*="primary"]):not([class*="secondary"]):not([class*="quiet"]):not([class*="remove"]):not(:disabled) { border-color: #d4d0c8; background: var(--te-white); color: var(--te-heading); }
.tool-engine-page-wrapper .tool-engine-app-container button:disabled { cursor: not-allowed; opacity: .58; }
.tool-engine-page-wrapper :focus-visible { outline: 3px solid var(--te-pink); outline-offset: 3px; }
.tool-engine-page-wrapper .tool-engine-app-container [aria-invalid="true"] { border-color: #b4233a; box-shadow: 0 0 0 3px rgba(180, 35, 58, .12); }
.tool-engine-page-wrapper .tool-engine-app-container :is(pre, code, output, [class*="output"], [class*="result"]) { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-wrap: break-word; }
.tool-engine-page-wrapper .tool-engine-app-container :is(img, canvas, video, iframe) { max-width: 100%; }

/* Documentation, FAQs, and related tool cards */
.tool-engine-page-wrapper .tool-engine-section { margin: 22px 0; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--te-border); border-radius: var(--te-radius-card); background: var(--te-white); box-shadow: 0 5px 18px rgba(29, 39, 63, .045); }
.tool-engine-page-wrapper .tool-engine-section-heading { margin: 0 0 17px; padding: 0 0 13px; border-bottom: 1px solid var(--te-border); color: var(--te-heading); font-size: clamp(21px, 2vw, 24px); font-weight: 700; line-height: 1.35; }
.tool-engine-page-wrapper .tool-engine-text-content { color: var(--te-text); font-size: 15px; line-height: 1.75; }
.tool-engine-page-wrapper .tool-engine-text-content p { margin: 0 0 14px; }
.tool-engine-page-wrapper .tool-engine-text-content p:last-child { margin-bottom: 0; }
.tool-engine-page-wrapper .tool-engine-faq-accordion { display: flex; flex-direction: column; gap: 10px; }
.tool-engine-page-wrapper .tool-engine-faq-item { border: 1px solid var(--te-border); border-radius: 12px; background: #faf9f7; }
.tool-engine-page-wrapper .tool-engine-faq-item[open] { border-color: #c7d9eb; background: var(--te-white); }
.tool-engine-page-wrapper .tool-engine-faq-question { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--te-heading); font-size: 15px; font-weight: 650; cursor: pointer; list-style: none; }
.tool-engine-page-wrapper .tool-engine-faq-question::-webkit-details-marker { display: none; }
.tool-engine-page-wrapper .tool-engine-faq-toggle-icon::after { color: var(--te-blue); content: "+"; font-size: 20px; }
.tool-engine-page-wrapper .tool-engine-faq-item[open] .tool-engine-faq-toggle-icon::after { content: "\2212"; }
.tool-engine-page-wrapper .tool-engine-faq-answer { padding: 0 16px 16px; color: var(--te-text); font-size: 14px; line-height: 1.7; }

.tool-engine-page-wrapper .tool-engine-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; margin-top: 18px; }
.tool-engine-page-wrapper .tool-engine-card { position: relative; display: flex; min-width: 0; flex-direction: column; padding: 22px; border: 1px solid var(--te-border); border-radius: 16px; background: var(--te-white); box-shadow: 0 4px 14px rgba(29, 39, 63, .04); color: var(--te-text); text-decoration: none; transition: border-color .35s ease, box-shadow .35s ease, transform .35s ease; }
.tool-engine-page-wrapper .tool-engine-card:hover,
.tool-engine-page-wrapper .tool-engine-card:focus-visible { transform: translateY(-3px); border-color: #b8d6f2; box-shadow: var(--te-shadow); }
.tool-engine-page-wrapper .tool-engine-card:focus-visible { outline: 3px solid var(--te-pink); outline-offset: 3px; }
.tool-engine-page-wrapper .tool-engine-card-icon { margin-bottom: 13px; }
.tool-engine-page-wrapper .tool-engine-card-icon .dashicons { width: 32px; height: 32px; color: var(--te-blue); font-size: 30px; }
.tool-engine-page-wrapper .tool-engine-custom-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid #d7e8f8; border-radius: 11px; background: #edf6ff; color: var(--te-blue); font-weight: 700; }
.tool-engine-page-wrapper .tool-engine-card-body { flex: 1; min-width: 0; }
.tool-engine-page-wrapper .tool-engine-card-title { margin: 0 0 8px; color: var(--te-heading); font-size: 16px; font-weight: 700; line-height: 1.4; }
.tool-engine-page-wrapper .tool-engine-card-desc { margin: 0 0 14px; color: #696969; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.tool-engine-page-wrapper .tool-engine-card-tag { display: inline-block; padding: 4px 10px; border: 1px solid #f4dfc0; border-radius: 999px; background: #fff7eb; color: #754b16; font-size: 12px; font-weight: 600; }
.tool-engine-page-wrapper .tool-engine-card-arrow { align-self: flex-end; color: var(--te-blue); font-size: 18px; opacity: .8; transition: transform .3s ease; }
.tool-engine-page-wrapper .tool-engine-card:hover .tool-engine-card-arrow,
.tool-engine-page-wrapper .tool-engine-card:focus-visible .tool-engine-card-arrow { transform: translateX(4px); opacity: 1; }
.tool-engine-page-wrapper .tool-engine-pagination { margin: 30px 0; text-align: center; }
.tool-engine-page-wrapper .tool-engine-empty-state { padding: 38px 20px; border: 1px dashed #c9c5bf; border-radius: 14px; background: var(--te-white); color: #696969; text-align: center; }

/* Latest blog posts at the end of a single tool page. */
.single-tool .tool-engine-blog-section { margin-top: 22px; }
.single-tool .tool-engine-blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.single-tool .tool-engine-blog-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--te-border); border-radius: 16px; background: var(--te-white); box-shadow: 0 4px 14px rgba(29, 39, 63, .04); transition: border-color .35s ease, box-shadow .35s ease, transform .35s ease; }
.single-tool .tool-engine-blog-card:hover { transform: translateY(-3px); border-color: #b8d6f2; box-shadow: var(--te-shadow); }
.single-tool .tool-engine-blog-image,
.single-tool .tool-engine-blog-image-fallback { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--te-section); }
.single-tool .tool-engine-blog-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.single-tool .tool-engine-blog-image-fallback { border-bottom: 1px solid var(--te-border); }
.single-tool .tool-engine-blog-card-content { display: flex; flex: 1; min-width: 0; flex-direction: column; padding: 20px; }
.single-tool .tool-engine-blog-date { margin: 0 0 8px; color: #696969; font-size: 12px; line-height: 1.4; }
.single-tool .tool-engine-blog-title { margin: 0 0 9px; color: var(--te-heading); font-size: 18px; font-weight: 700; line-height: 1.35; }
.single-tool .tool-engine-blog-title a { color: inherit; text-decoration: none; }
.single-tool .tool-engine-blog-title a:hover { color: var(--te-blue); }
.single-tool .tool-engine-blog-excerpt { display: -webkit-box; margin: 0 0 15px; overflow: hidden; color: var(--te-text); font-size: 14px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.single-tool .tool-engine-blog-link { align-self: flex-start; margin-top: auto; color: var(--te-blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.single-tool .tool-engine-blog-link:hover,
.single-tool .tool-engine-blog-link:focus-visible,
.single-tool .tool-engine-blog-title a:focus-visible { outline: 3px solid var(--te-pink); outline-offset: 3px; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 760px) {
	.tool-engine-page-wrapper { padding-top: 22px; }
	.tool-engine-page-wrapper .tool-engine-header,
	.tool-engine-page-wrapper .tool-engine-archive-header { padding: 26px 24px; }
	.tool-engine-page-wrapper .tool-engine-app-wrapper { padding: 14px; }
	.tool-engine-page-wrapper .tool-engine-cards-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
}

@media (max-width: 520px) {
	.tool-engine-page-wrapper { padding-right: 14px; padding-left: 14px; }
	.tool-engine-page-wrapper .tool-engine-header,
	.tool-engine-page-wrapper .tool-engine-archive-header { padding: 23px 19px; border-radius: 15px; }
	.tool-engine-page-wrapper .tool-engine-title { font-size: 30px; }
	.tool-engine-page-wrapper .tool-engine-lead { font-size: 14px; }
	.tool-engine-page-wrapper .tool-engine-section { padding: 20px 16px; }
	.tool-engine-page-wrapper .tool-engine-cards-grid { grid-template-columns: 1fr; }
	.tool-engine-page-wrapper .tool-engine-app-wrapper { padding: 11px; border-radius: 14px; }
	.tool-engine-page-wrapper .tool-engine-app-container button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
	.tool-engine-page-wrapper *,
	.tool-engine-page-wrapper *::before,
	.tool-engine-page-wrapper *::after {
		scroll-behavior: auto !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
