/*
Theme Name: Blacksmith Family
Description: Тема сайта blacksmithfamily.com — перенос с Vigbo 1:1. Контент страниц — обычные блоки редактора WordPress, контакты и получатели заявок — во «Внешний вид → Настроить → Blacksmith: контакты и заявки».
Version: 1.0.0
Author: Павел Седых
Text Domain: blacksmith
*/

:root {
	--bs-text: #626262;
	--bs-dark: #000;
	--bs-beige: #ececdf;
	--bs-menu: rgba(125, 125, 125, .77);
	--bs-head: "Montserrat Alternates", "Montserrat", Arial, sans-serif;
	--bs-body: "Montserrat", Arial, sans-serif;
	--bs-side: 65px;  /* как на Vigbo: поля секции слева и справа */
	--bs-width: 85%;  /* как на Vigbo: контент — 85% ширины секции, растёт вместе с экраном */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: #fff;
	color: #000;
	font: 400 14px/1.4 var(--bs-body);
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* ---------- Шапка ---------- */
.bs-header { background: #fff; position: relative; z-index: 20; }
.bs-header__in {
	padding: 20px var(--bs-side);
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; min-height: 92px;
}
.bs-logo { font: 700 29px/1.1 var(--bs-body); color: #000; text-decoration: none; text-align: center; white-space: nowrap; }
.bs-logo img { max-height: 90px; width: auto; }
.bs-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 50px; }
.bs-nav--right ul { justify-content: flex-end; }
.bs-nav--right { justify-self: end; text-align: right; }
.bs-nav a {
	font: 300 12px/16px "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 1.8px;
	color: var(--bs-menu); text-decoration: none;
}
.bs-nav a:hover, .bs-nav .current-menu-item > a { color: #000; }
.bs-header__left { display: flex; align-items: center; gap: 22px; }
.bs-header__right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.bs-search { color: var(--bs-menu); display: inline-flex; }
.bs-burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.bs-burger span { display: block; width: 24px; height: 2px; background: #000; margin: 5px 0; }
.bs-mobile-menu { display: none; }

/* ---------- Контент ---------- */
.bs-main { min-height: 50vh; }
.bs-content > *:not(.alignfull) { max-width: calc((100% - 2 * var(--bs-side)) * 0.85); margin-left: auto; margin-right: auto; }
.bs-content > h1:first-child { margin-top: 40px; }
/* Отступы как на Vigbo (замерено): у секции 60px сверху и снизу, между блоками 20px, у последнего блока 0 */
.bs-section { padding: 60px var(--bs-side); }
.bs-section > * { max-width: var(--bs-width); margin-left: auto !important; margin-right: auto !important; }
/* WordPress оборачивает содержимое группы в .wp-block-group__inner-container — отступы ставим детям обоих вариантов */
.bs-content .bs-section > *:not(.wp-block-group__inner-container),
.bs-content .bs-section > .wp-block-group__inner-container > *,
.bs-content .wp-block-column > *,
.bs-content .wp-block-cover__inner-container > * { margin-top: 0; margin-bottom: 20px; }
.bs-content .bs-section > .wp-block-group__inner-container > *:last-child,
.bs-content .bs-section > *:last-child,
.bs-content .wp-block-column > *:last-child { margin-bottom: 0; }

h1, h2, h3, h4, .bs-h1, .bs-h2, .bs-h3 { color: #000; margin: 0; }
h1, h2, .bs-h2 { font: 700 30px/1 var(--bs-head); }
h3, .bs-h3 { font: 400 20px/1 var(--bs-head); }
h4 { font: 700 12px/1.2 var(--bs-body); text-transform: uppercase; }
.bs-h1 { font: 300 38px/1.1 var(--bs-head); }
h1.bs-h3, h2.bs-h3 { font: 400 20px/1 var(--bs-head); }
h1.bs-h1, h2.bs-h1 { font: 300 38px/1.1 var(--bs-head); }
p { margin: 0; }
.bs-1 { font: 500 16px/1.8 var(--bs-body); }
.bs-3 { font: 300 12px/1.3 var(--bs-body); letter-spacing: .05em; }
.bs-h4, p.bs-h4 { font: 700 12px/1.2 var(--bs-body); text-transform: uppercase; color: #000; }
.bs-content ul, .bs-content ol { padding-left: 40px; }
.bs-content li { margin: 0; }
.bs-content a:not(.wp-block-button__link) { color: #000; }

/* Первый экран с фото */
.bs-hero.wp-block-cover { padding: 60px var(--bs-side); align-items: flex-end; margin-bottom: 0 !important; }
.bs-hero .wp-block-cover__inner-container { width: var(--bs-width); max-width: var(--bs-width); margin: 0 auto; color: #fff; }
.bs-hero h1, .bs-hero h2, .bs-hero h3, .bs-hero p { color: #fff; }

/* Колонки, картинки, галереи */
.wp-block-columns.bs-cols { gap: 20px; }
.bs-img img { width: 100%; height: auto; display: block; }
/* Галерея Vigbo — лента фото одной высоты с прокруткой вбок */
.wp-block-gallery.bs-gallery { display: flex; flex-wrap: nowrap !important; gap: 20px !important; overflow-x: auto; scroll-snap-type: x mandatory; }
.wp-block-gallery.bs-gallery figure.wp-block-image { flex: 0 0 auto !important; width: auto !important; max-width: none !important; margin: 0 !important; scroll-snap-align: start; }
.wp-block-gallery.bs-gallery figure.wp-block-image img { height: 400px !important; width: auto !important; max-width: none !important; object-fit: cover; }

/* Кнопки — овальные с обводкой, как на Vigbo */
.wp-block-buttons { margin: 0; }
.wp-block-button .wp-block-button__link,
.bs-btn {
	display: inline-block; padding: 16px 40px; border: 2px solid #050505; border-radius: 30px; line-height: 14px !important;
	background: transparent; color: #000; text-decoration: none; cursor: pointer;
	font: 700 12px/1.2 var(--bs-body); text-transform: uppercase; letter-spacing: .02em;
	transition: background .2s, color .2s;
}
.wp-block-button .wp-block-button__link:hover, .bs-btn:hover { background: #000; color: #fff; }
.wp-block-button.is-style-fill .wp-block-button__link { background: #000; color: #fff; }

.bs-line { border: 0; border-top: 1px solid #000; width: 163px; margin-left: auto !important; margin-right: auto !important; padding-top: 4px; opacity: 1; }
.bs-quote { border-left: 2px solid #000; padding-left: 20px; font-style: italic; }
.bs-faq { border-bottom: 1px solid #ddd; padding: 14px 0; }
.bs-faq summary { font: 700 16px/1.3 var(--bs-head); color: #000; cursor: pointer; }
.bs-map iframe { width: 100%; height: 607px; border: 0; }
.bs-video { position: relative; aspect-ratio: 16 / 9; }
.bs-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bs-price { font: 500 20px/1.3 var(--bs-body); color: #000; }

/* Соцсети */
.bs-social { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.bs-social a { width: 30px; height: 30px; border-radius: 50%; background: #8a8a8a; display: inline-flex; align-items: center; justify-content: center; }
.bs-social a:hover { background: #000; }
.bs-social svg { width: 16px; height: 16px; fill: #fff; }

/* Сетка статей блога */
.bs-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin: 20px auto; }
.bs-posts a { text-decoration: none; color: #000; }
.bs-posts .bs-card__img { aspect-ratio: 1 / 1; background: #eee center / cover no-repeat; margin-bottom: 12px; }
.bs-posts .bs-card__title { font: 400 14px/1.4 var(--bs-body); }

/* Форма заявки */
.bs-form { max-width: 520px; margin: 20px auto; display: grid; gap: 22px; }
.bs-form input, .bs-form textarea {
	width: 100%; border: 0; border-bottom: 1px solid #000; background: transparent; padding: 8px 0;
	font: 400 13px/1.4 var(--bs-body); color: #000; letter-spacing: .05em; border-radius: 0;
}
.bs-form textarea { min-height: 70px; resize: vertical; }
.bs-form .bs-btn { justify-self: center; background: #000; color: #fff; border-color: #000; padding: 15px 60px; }
.bs-form .bs-btn:hover { background: #ccc; border-color: #ccc; }
.bs-form__ok { text-align: center; color: #000; }
.bs-form__err { color: #b00; text-align: center; }
.bs-form__hp { position: absolute; left: -6000px; }

/* Подвал */
.bs-footer { margin-top: 60px; padding: 30px 20px 40px; }
.bs-footer { padding-left: var(--bs-side); padding-right: var(--bs-side); }
.bs-footer__in { max-width: 85%; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; align-items: start; font-size: 12px; color: #000; }
.bs-footer__mid { text-align: center; }
.bs-footer__right { text-align: right; }

/* Записи и страницы без своей разметки */
.bs-entry { max-width: 860px; margin: 50px auto; padding: 0 20px; }
.bs-archive { max-width: calc((100% - 2 * var(--bs-side)) * 0.85); margin: 50px auto; }

/* ---------- Телефон ---------- */
@media (max-width: 900px) {
	:root { --bs-side: 16px; --bs-width: 100%; }
	.bs-content > *:not(.alignfull), .bs-archive, .bs-footer__in { max-width: 100%; padding-left: 16px; padding-right: 16px; }
	.bs-header__in { display: flex; justify-content: space-between; min-height: 70px; padding: 12px 16px; }
	.bs-header__left, .bs-nav { display: none; }
	.bs-logo { font-size: 20px; text-align: left; white-space: normal; }
	.bs-burger { display: block; }
	.bs-mobile-menu.is-open { display: block; padding: 10px 20px 20px; border-top: 1px solid #eee; }
	.bs-mobile-menu ul { list-style: none; margin: 0; padding: 0; }
	.bs-mobile-menu a { display: block; padding: 10px 0; text-decoration: none; color: #000; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; }
	h1, h2, .bs-h2 { font-size: 24px; }
	.bs-h1 { font-size: 28px; }
	.bs-section { padding: 40px 16px; }
	.bs-hero.wp-block-cover { padding: 30px 16px; }
	.wp-block-gallery.bs-gallery figure.wp-block-image img { height: 300px !important; }
	.bs-hero.wp-block-cover { min-height: 480px !important; }
	.bs-posts { grid-template-columns: 1fr 1fr; gap: 20px; }
	.bs-footer__in { grid-template-columns: 1fr; text-align: center; }
	.bs-footer__right { text-align: center; }
}
@media (max-width: 560px) {
	.bs-posts { grid-template-columns: 1fr; }
}
