/* ════════════════════════════════════════════════════════════════
   AgencyDir Tools: archive, single tool page, live widgets
   Uses the theme's --hd-* tokens. Class prefix: .at-
   ════════════════════════════════════════════════════════════════ */

/* ── Hero ───────────────────────────────────────────────────── */
.at-hero {
	background:
		radial-gradient(900px 360px at 10% -10%, color-mix(in srgb, var(--hd-primary) 25%, transparent), transparent 60%),
		radial-gradient(700px 320px at 100% 0%, color-mix(in srgb, var(--hd-accent) 18%, transparent), transparent 60%),
		linear-gradient(180deg, var(--hd-primary-dark) 0%, var(--hd-primary) 60%, #312e81 100%);
	color: #fff;
	padding: 64px 0 52px;
}
.at-hero__inner { max-width: 820px; margin: 0 auto; text-align: center; }
.at-hero__eyebrow {
	display: inline-block; padding: 5px 14px; border-radius: 999px;
	background: rgba(255,255,255,.14); color: #fff; font-size: 13px; font-weight: 600;
	letter-spacing: .02em; text-decoration: none;
}
a.at-hero__eyebrow:hover { background: rgba(255,255,255,.24); text-decoration: none; color: #fff; }
.at-hero__eyebrow--dark { background: var(--hd-primary-light); color: var(--hd-primary); }
.at-hero__title { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; margin: 16px 0 12px; color: #fff; }
.at-hero__title--left { margin-top: 12px; }
.at-hero__sub { font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.86); max-width: 640px; margin: 0 auto; }
.at-hero__sub--left { margin: 0; }
.at-search { max-width: 520px; margin: 28px auto 0; }
.at-search input {
	width: 100%; padding: 15px 20px; border-radius: var(--hd-radius); border: 0;
	font: inherit; font-size: 16px; box-shadow: var(--hd-shadow-lg); color: var(--hd-text);
}
.at-search input:focus { outline: 3px solid color-mix(in srgb, var(--hd-accent) 60%, transparent); }

/* ── Category chips ─────────────────────────────────────────── */
.at-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 28px; }
.at-chip {
	padding: 8px 16px; border-radius: 999px; background: var(--hd-white);
	border: 1px solid var(--hd-border); color: var(--hd-text); font-size: 14px; font-weight: 500;
}
.at-chip span { color: var(--hd-text-muted); margin-left: 4px; }
.at-chip:hover { border-color: var(--hd-primary); text-decoration: none; color: var(--hd-primary); }
.at-chip.is-active { background: var(--hd-primary); border-color: var(--hd-primary); color: #fff; }
.at-chip.is-active span { color: rgba(255,255,255,.8); }

/* ── Card grid ──────────────────────────────────────────────── */
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.at-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.at-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.at-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.at-card {
	background: var(--hd-white); border: 1px solid var(--hd-border); border-radius: var(--hd-radius);
	box-shadow: var(--hd-shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s;
}
.at-card[hidden] { display: none; }
.at-card:hover { box-shadow: var(--hd-shadow-lg); transform: translateY(-2px); border-color: var(--hd-primary); }
.at-card__link { display: flex; flex-direction: column; gap: 10px; padding: 22px; height: 100%; color: inherit; text-decoration: none !important; }
.at-card__icon {
	width: 48px; height: 48px; border-radius: 12px; background: var(--hd-primary-light);
	display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.at-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.at-badge {
	font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
	background: var(--hd-bg); color: var(--hd-text-muted);
}
.at-badge--live { background: var(--hd-accent-light); color: #b45309; }
.at-card__title { font-size: 18px; font-weight: 700; color: var(--hd-text); }
.at-card__text { font-size: 14.5px; line-height: 1.55; color: var(--hd-text-muted); flex: 1; }
.at-card__more { font-size: 14px; font-weight: 600; color: var(--hd-primary); }
.at-empty { text-align: center; color: var(--hd-text-muted); padding: 48px 0; }

/* ── Homepage strip ─────────────────────────────────────────── */
.at-home { background: var(--hd-white); border-top: 1px solid var(--hd-border); border-bottom: 1px solid var(--hd-border); }
.at-home__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.at-home__title { font-size: clamp(24px, 3vw, 32px); font-weight: 800; margin-top: 10px; }

/* ── Single tool: header ────────────────────────────────────── */
.at-hero--single { padding: 48px 0 44px; text-align: left; }
.at-single-head { display: flex; gap: 28px; align-items: flex-start; }
.at-single-head__icon {
	flex: 0 0 auto; width: 96px; height: 96px; border-radius: 22px; background: rgba(255,255,255,.14);
	display: flex; align-items: center; justify-content: center; font-size: 48px;
}
.at-single-head__body { min-width: 0; }
.at-single-head__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.at-single-head__meta { margin-top: 14px; font-size: 14px; color: rgba(255,255,255,.75); }
.at-btn-light { color: #fff !important; border-color: rgba(255,255,255,.4); }
.at-btn-light:hover { background: rgba(255,255,255,.12) !important; }
.at-btn-soon { background: rgba(255,255,255,.16); color: #fff; cursor: default; border-color: transparent; }
.at-side-card .at-btn-soon { background: var(--hd-bg); color: var(--hd-text-muted); }
.at-btn-block { display: flex; justify-content: center; width: 100%; }

/* ── Single tool: body ──────────────────────────────────────── */
.at-single { padding-top: 8px; padding-bottom: 72px; }
.at-single__layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; margin-top: 8px; }
.at-block {
	background: var(--hd-white); border: 1px solid var(--hd-border); border-radius: var(--hd-radius);
	padding: 28px; margin-bottom: 20px;
}
.at-block h2 { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.at-features { display: grid; gap: 12px; }
.at-features li { position: relative; padding-left: 32px; line-height: 1.55; }
.at-features li::before {
	content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
	background: color-mix(in srgb, var(--hd-gold) 20%, white); color: #047857; font-size: 13px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
}
.at-steps { counter-reset: step; display: grid; gap: 14px; }
.at-steps li { counter-increment: step; position: relative; padding-left: 44px; line-height: 1.55; }
.at-steps li::before {
	content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
	background: var(--hd-primary); color: #fff; font-weight: 700; font-size: 14px;
	display: flex; align-items: center; justify-content: center;
}
.at-faq details { border-top: 1px solid var(--hd-border); padding: 14px 0; }
.at-faq details:first-child { border-top: 0; padding-top: 0; }
.at-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.at-faq summary::-webkit-details-marker { display: none; }
.at-faq summary::after { content: "+"; font-size: 20px; color: var(--hd-primary); line-height: 1; }
.at-faq details[open] summary::after { content: "−"; }
.at-faq p { margin-top: 10px; color: var(--hd-text-muted); line-height: 1.6; }

/* ── Sidebar ────────────────────────────────────────────────── */
.at-single__side { position: sticky; top: calc(var(--hd-header-height) + 20px); display: grid; gap: 16px; }
.at-side-card { background: var(--hd-white); border: 1px solid var(--hd-border); border-radius: var(--hd-radius); padding: 22px; }
.at-side-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.at-side-card--note { background: var(--hd-accent-light); border-color: #fcd9b6; }
.at-side-card--note p { font-size: 14px; line-height: 1.55; }
.at-facts { margin-top: 16px; display: grid; gap: 10px; }
.at-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.at-facts dt { color: var(--hd-text-muted); }
.at-facts dd { font-weight: 600; text-align: right; }
.at-perms { display: grid; gap: 12px; }
.at-perms li { display: grid; gap: 2px; font-size: 14px; }
.at-perms span { color: var(--hd-text-muted); line-height: 1.45; }
.at-related { margin-top: 24px; }
.at-related h2 { font-size: 22px; font-weight: 700; margin-bottom: 18px; }

/* ── Live widgets ───────────────────────────────────────────── */
.at-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.at-input {
	width: 100%; padding: 12px 14px; border: 1px solid var(--hd-border); border-radius: var(--hd-radius-sm);
	font: inherit; font-size: 15px; background: #fff; color: var(--hd-text);
}
textarea.at-input { resize: vertical; min-height: 140px; }
.at-input:focus { outline: 2px solid var(--hd-primary); border-color: transparent; }
.at-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 14px 0; font-size: 14px; }
.at-controls label { display: inline-flex; align-items: center; gap: 8px; }
.at-controls select { padding: 7px 10px; border: 1px solid var(--hd-border); border-radius: var(--hd-radius-sm); font: inherit; }
.at-meta { font-size: 13px; color: var(--hd-text-muted); margin: 10px 0; }
.at-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-top: 16px; }
.at-stats div { background: var(--hd-bg); border-radius: var(--hd-radius-sm); padding: 14px; text-align: center; }
.at-stats dt { font-size: 12px; color: var(--hd-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.at-stats dd { font-family: var(--font-heading); font-size: 24px; font-weight: 700; color: var(--hd-primary); margin-top: 4px; }
.at-table-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--hd-border); border-radius: var(--hd-radius-sm); }
.at-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.at-table th, .at-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--hd-border); }
.at-table th { background: var(--hd-bg); position: sticky; top: 0; font-weight: 600; }
.at-table td:nth-child(n+2), .at-table th:nth-child(n+2) { text-align: right; width: 100px; }
.at-table__empty { text-align: center !important; color: var(--hd-text-muted); width: auto !important; }
.at-qr-actions { display: flex; gap: 10px; margin: 6px 0 16px; }
.at-qr-actions button:disabled { opacity: .5; cursor: not-allowed; }
.at-qr-out { min-height: 60px; }
.at-qr-out canvas { max-width: 100%; height: auto; border: 1px solid var(--hd-border); border-radius: var(--hd-radius-sm); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.at-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
	.at-single__layout { grid-template-columns: 1fr; }
	.at-single__side { position: static; }
}
@media (max-width: 640px) {
	.at-hero { padding: 44px 0 36px; }
	.at-single-head { flex-direction: column; gap: 16px; }
	.at-single-head__icon { width: 72px; height: 72px; font-size: 36px; border-radius: 18px; }
	.at-block { padding: 20px; }
	.at-grid--cols-2, .at-grid--cols-3, .at-grid--cols-4 { grid-template-columns: 1fr; }
}
