/*
 * Techtruthin Core: styles for the plugin's own components.
 *
 * Colours, fonts and buttons (.tt-btn) come from the Techtruthin theme.
 *
 * Contents
 * 1. Tool cards
 * 2. Promises
 * 3. Homepage preview cards
 * 4. Forms and notices
 * 5. Cookie consent banner
 * 6. Ad slots
 */

/* 1. Tool cards ([tt_tools]) */

.tt-tool-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
	gap: clamp(14px, 2vw, 20px);
	margin-bottom: 28px;
}

.tt-tool-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius);
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

.tt-tool-card:hover {
	border-color: var(--tt-border-strong);
	box-shadow: var(--tt-shadow);
}

.tt-tool-card__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	background: var(--tt-blue-tint);
	color: var(--tt-blue-ink);
	border-radius: 12px;
}

/* Card text keeps its own spacing, even inside reading text such as the Tools page. */
.tt-tool-card .tt-tool-card__name {
	margin: 4px 0 0;
	font-size: 17px;
	letter-spacing: -0.01em;
}

.tt-tool-card .tt-tool-card__desc {
	flex-grow: 1;
	margin: 0;
	color: var(--tt-muted);
	font-size: 15px;
	line-height: 1.55;
}

.tt-tool-card .tt-btn {
	min-height: 42px;
	margin-top: 6px;
	font-size: 15px;
}

/* 2. Promises ([tt_promises]) */

.tt-promises-band {
	border-bottom: 1px solid var(--tt-border);
}

.tt-promises {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px 28px;
	margin: 0;
	padding: 24px 0;
	list-style: none;
}

.tt-promise {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.tt-promise__icon {
	flex: 0 0 auto;
	margin-top: 2px;
	color: var(--tt-blue);
}

.tt-promise__title {
	display: block;
	color: var(--tt-navy);
	font-size: 15px;
}

.tt-promise__text {
	display: block;
	color: var(--tt-muted);
	font-size: 14px;
	line-height: 1.5;
}

@media (max-width: 1024px) {
	.tt-promises {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.tt-promises {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
		padding: 20px 0;
	}
}

/* 3. Homepage preview cards ([tt_hero_visual]) */

.tt-hero-visual {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.tt-demo-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--tt-border);
	border-radius: 16px;
	box-shadow: var(--tt-shadow);
}

.tt-demo-card--offset {
	margin-left: clamp(0px, 4vw, 44px);
}

.tt-demo-card__head {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--tt-navy);
	font-family: var(--tt-font-head);
	font-size: 16px;
	font-weight: 700;
}

.tt-demo-card__head .tt-tool-card__icon {
	width: 34px;
	height: 34px;
	border-radius: 10px;
}

.tt-demo-card__body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

.tt-demo-qr {
	flex: 0 0 auto;
	width: 120px;
	height: 120px;
	padding: 6px;
	background: #fff;
	border: 1px solid var(--tt-border);
	border-radius: 10px;
}

.tt-demo-card__side {
	display: flex;
	flex: 1 1 150px;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.tt-demo-label {
	color: var(--tt-muted);
	font-size: 13px;
}

.tt-demo-input {
	padding: 8px 10px;
	overflow: hidden;
	background: var(--tt-bg-tint);
	color: var(--tt-navy);
	font-size: 14px;
	white-space: nowrap;
	text-overflow: ellipsis;
	border: 1px solid var(--tt-border);
	border-radius: 8px;
}

.tt-demo-btn {
	align-self: flex-start;
	padding: 8px 14px;
	background: var(--tt-blue);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	border-radius: 8px;
}

.tt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tt-chip {
	padding: 5px 10px;
	background: var(--tt-blue-tint);
	color: var(--tt-blue-ink);
	font-size: 14px;
	border-radius: 8px;
}

@media (max-width: 560px) {
	.tt-demo-card--offset {
		margin-left: 0;
	}
}

/* 4. Forms and notices (contact form and tools) */

.tt-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 0 0 1.4em;
	padding: clamp(18px, 3vw, 32px);
	background: #fff;
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius);
	box-shadow: var(--tt-shadow);
}

.tt-form__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: 18px;
}

.tt-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tt-field label {
	color: var(--tt-navy);
	font-size: 15px;
	font-weight: 600;
}

.tt-field input,
.tt-field select,
.tt-field textarea {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	background: #fff;
	color: var(--tt-navy);
	font: 16px/1.4 var(--tt-font);
	border: 1px solid var(--tt-border-strong);
	border-radius: 10px;
}

.tt-field textarea {
	min-height: 150px;
	resize: vertical;
}

.tt-field input:focus,
.tt-field select:focus,
.tt-field textarea:focus {
	border-color: var(--tt-blue);
	outline: 3px solid var(--tt-blue-tint);
	outline-offset: 0;
}

.tt-form .tt-form__note {
	margin: 0;
	color: var(--tt-muted);
	font-size: 14px;
}

.tt-form .tt-btn {
	align-self: flex-start;
}

/* Spam trap: invisible to people, filled in only by bots. */
.tt-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.tt-notice {
	margin: 0 0 18px;
	padding: 14px 18px;
	font-weight: 500;
	border-radius: 12px;
}

.tt-notice--success {
	background: #e7f6ee;
	color: var(--tt-success);
	border: 1px solid #b7e2ca;
}

.tt-notice--error {
	background: #fdecea;
	color: var(--tt-error);
	border: 1px solid #f5c2bc;
}

@media (max-width: 560px) {
	.tt-form .tt-btn {
		align-self: stretch;
	}
}

/* 5. Cookie consent banner */

.tt-consent {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100;
	background: #fff;
	border-top: 1px solid var(--tt-border);
	box-shadow: 0 -8px 24px rgba(11, 31, 66, 0.1);
}

.tt-consent[hidden] {
	display: none;
}

.tt-consent__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	padding-block: 14px;
}

.tt-consent__text {
	flex: 1 1 420px;
	font-size: 14px;
	line-height: 1.5;
}

.tt-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tt-consent__actions .tt-btn {
	min-height: 42px;
	font-size: 15px;
}

/* A button that looks like a text link, such as "Privacy settings" in the footer. */
.tt-linklike {
	margin: 0;
	padding: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	border: 0;
	cursor: pointer;
}

.tt-linklike:hover {
	color: var(--tt-blue);
}

@media (max-width: 560px) {
	.tt-consent__actions {
		width: 100%;
	}

	.tt-consent__actions .tt-btn {
		flex: 1 1 0;
		padding: 0 10px;
	}
}

/* 6. Ad slots (inc/ads.php, filled by ads.js) */

.tt-ad {
	margin: 28px auto;
	text-align: center;
	container-type: inline-size;
}

.tt-ad[hidden] {
	display: none;
}

.tt-ad__label {
	margin: 0 0 6px;
	color: var(--tt-muted);
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.tt-ad iframe {
	display: block;
	max-width: 100%;
	margin-inline: auto;
	border: 0;
}

/* Space for the 320×50 banner, or the 728×90 one when the slot is wide enough for it. */
.tt-ad__box {
	min-height: 50px;
}

@container (min-width: 728px) {
	.tt-ad__box {
		min-height: 90px;
	}
}

/* After a guide: as wide as the article above it. */
.tt-ad--native {
	max-width: calc(var(--tt-read) + 2 * var(--tt-gutter));
	margin-top: 0;
	padding-inline: var(--tt-gutter);
}
