/**
 * Global baseline for alatinidza.
 *
 * Only rules that theme.json cannot express cleanly belong here.
 * Colors, typography, spacing and element styles live in theme.json.
 * Component styles are added later, in separate files, when justified.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* Long product names, SKUs and URLs must not force horizontal scrolling. */
body {
	overflow-wrap: break-word;
}

img,
video {
	max-width: 100%;
	height: auto;
}

/*
 * Form controls inherit the theme typography.
 * WooCommerce or component-specific styles may still override individual controls.
 */
button,
input,
select,
textarea {
	font: inherit;
}

/*
 * Visible keyboard focus everywhere; mouse clicks do not trigger it.
 * Buttons get their ring from theme.json (styles.elements.button[":focus-visible"]),
 * because currentColor would be the light button text. :where() keeps the
 * specificity of this rule unchanged.
 */
:focus-visible:where(:not(.wp-element-button, .wp-block-button__link)) {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Visually hidden text that stays available to assistive technology (WordPress convention). */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/*
 * Information pages (tools/create-local-pages.php content, patterns
 * brand-list and tips-list): the "in preparation" note, the brand links and
 * the buying-tips list.
 */
.alatinidza-page-notice {
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--surface);
	border-inline-start: 4px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--preset--border-radius--control);
}

/*
 * Kontakt page: the Contact Form 7 form inside [alatinidza_contact_form]
 * (alatinidza-core) and its notes. CF7 sets size="40" on fields, so the
 * width is set here; the submit button matches the theme.json button.
 */
.alatinidza-contact-form {
	max-width: 40rem;
}

.alatinidza-contact-form label {
	display: block;
	font-weight: 600;
}

.alatinidza-contact-form .wpcf7-form-control:not([type="submit"]):not(.wpcf7-turnstile) {
	box-sizing: border-box;
	width: 100%;
	min-height: var(--wp--custom--control-height);
	margin-block-start: var(--wp--preset--spacing--10);
	padding: 0.5rem 0.75rem;
	font: inherit;
	font-weight: 400;
	color: var(--wp--preset--color--contrast);
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--contrast-muted);
	border-radius: var(--wp--preset--border-radius--control);
}

.alatinidza-contact-form textarea.wpcf7-form-control {
	min-height: 10rem;
	resize: vertical;
}

.alatinidza-contact-form .wpcf7-submit {
	min-height: var(--wp--custom--control-height);
	padding: 0.75rem 1.25rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.2;
	color: var(--wp--preset--color--base);
	cursor: pointer;
	background-color: var(--wp--preset--color--primary);
	border: 0;
	border-radius: var(--wp--preset--border-radius--control);
}

.alatinidza-contact-form .wpcf7-submit:hover {
	background-color: var(--wp--preset--color--graphite);
}

.alatinidza-contact-form__preview,
.alatinidza-contact-form__soon {
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--surface);
	border-inline-start: 4px solid var(--wp--preset--color--primary);
	border-radius: var(--wp--preset--border-radius--control);
}

.alatinidza-brand-list,
.alatinidza-tips {
	margin: 0;
	padding: 0;
	list-style: none;
}

.alatinidza-brand-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.alatinidza-brand-list a {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--touch-target);
	padding: 0.5rem 1rem;
	font-weight: 600;
	text-decoration: none;
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--control);
}

.alatinidza-brand-list a:hover {
	text-decoration: underline;
	border-color: var(--wp--preset--color--primary);
}

/*
 * Buying tips (inc/tips.php cards on the tips page and the homepage) and the
 * single post template (templates/single.html). One column on phones; the
 * tips page and the homepage show 2 and 3 columns from 600px and 1024px.
 */
.alatinidza-tips {
	display: grid;
	gap: var(--wp--preset--spacing--50);
}

.alatinidza-tips__item {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--control);
}

.alatinidza-tips__media {
	aspect-ratio: 3 / 2;
	background-color: var(--wp--preset--color--base);
}

.alatinidza-tips__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.alatinidza-tips__body {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--40);
}

.alatinidza-tips__body > * {
	margin: 0;
}

.alatinidza-tips__title {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.25;
}

.alatinidza-tips__title a {
	text-decoration: none;
}

.alatinidza-tips__title a:hover,
.alatinidza-tips__title a:focus-visible {
	text-decoration: underline;
}

.alatinidza-tips__date,
.alatinidza-tips__excerpt {
	color: var(--wp--preset--color--contrast-muted);
}

.alatinidza-tips__date {
	font-size: var(--wp--preset--font-size--small);
}

@media (min-width: 600px) {
	.alatinidza-tips {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.alatinidza-tips--grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.alatinidza-post__back a {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
	min-height: var(--wp--custom--touch-target);
	font-weight: 600;
}

.alatinidza-post__back .alatinidza-icon {
	width: 1.125rem;
	height: 1.125rem;
}

.alatinidza-post__date {
	color: var(--wp--preset--color--contrast-muted);
	font-size: var(--wp--preset--font-size--small);
}

.alatinidza-post__image img {
	width: 100%;
	height: auto;
	max-height: 28rem;
	object-fit: contain;
	background-color: var(--wp--preset--color--base);
	border-radius: var(--wp--preset--border-radius--control);
}
