/* ==========================================================
   Block-theme adjustments on top of css/style.css
   ========================================================== */

/* WordPress wrappers should not add spacing of their own */
.wp-site-blocks > *,
.wp-block-post-content > *,
:where(.is-layout-flow) > * { margin-block-start: 0; margin-block-end: 0; }
figure.wp-block-image { margin: 0; }
.wp-block-image figcaption.wp-element-caption { margin: 0; }

/* Images that fill a fixed-ratio frame */
.hero-photo.wp-block-image img,
.standards-photo.wp-block-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo.wp-block-image figcaption { position: absolute; left: 0; right: 0; bottom: 0; }
.range-img img { width: 100%; height: 100%; object-fit: cover; }
.person-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Small helpers for block content */
.step-num p, .brand-cell p { margin: 0; }
.contact-lines .btn-row { margin-top: 24px; }
.product-info h3 a { text-decoration: none; }
.product-info h3 a:hover { text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 3px; }

/* Three-column build / supply / install split */
.split.split-3 { grid-template-columns: repeat(3, 1fr); }
.section:not(.section-grey) .split-col { background: var(--panel); }

/* Seven brand cells: a clean grid that wraps */
.brand-strip.brand-strip-7 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); border-width: 2px 0 0 2px; }
.brand-strip-7 .brand-cell { border: 0; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font-size: 22px; line-height: 1.1; display: grid; place-items: center; min-height: 86px; }

/* Group companies */
.group-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 32px); }
.group-card { background: var(--paper); border-top: 4px solid var(--copper); padding: 24px 24px 28px; }
.group-card h3 { font: 700 24px/1.15 var(--font-display); margin-bottom: 10px; }
.group-card p { color: var(--steel); }

/* Projects gallery */
.project-gallery.wp-block-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; }
.project-gallery.wp-block-gallery .wp-block-image { width: auto !important; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-s); background: var(--panel); }
.project-gallery.wp-block-gallery .wp-block-image img { width: 100%; height: 100%; object-fit: cover; }

/* Contact lines with several values */
.contact-line p + p { margin-top: 4px; }
.footer-col address p + p { margin-top: 8px; }

/* Product description content */
.product-single .prose h3 { font: 700 22px/1.2 var(--font-display); margin: 6px 0 8px; }
.product-single .prose ul { padding-left: 20px; margin-bottom: 14px; }
.product-single .prose li { padding: 2px 0; }
.product-single .prose li::marker { color: var(--copper); }

/* Single product */
.product-single { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.product-single-img { aspect-ratio: 1 / 1; background: var(--panel); border-radius: var(--radius-m); overflow: hidden; display: grid; place-items: center; }
.product-single-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; mix-blend-mode: multiply; }
.product-single-info { display: flex; flex-direction: column; gap: 18px; }
.product-cat p { font-size: 15px; font-weight: 600; color: var(--copper); }
.product-cat a { text-decoration: none; }
.product-lead p { font-size: 20px; color: var(--steel); }
.product-single .prose p { font-size: 17px; }

/* Blog / generic content */
.post-list { display: grid; gap: 28px; }
.post-list .wp-block-post-title a { text-decoration: none; }
.entry-prose { max-width: 42em; }
.entry-prose p { margin-bottom: 18px; font-size: 18px; }

/* Header sits inside the template-part wrapper */
header.wp-block-template-part.site-header { position: sticky; top: 0; z-index: 50; }
.admin-bar header.site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar header.site-header { top: 0; } }

@media (max-width: 900px) {
	.product-single { grid-template-columns: minmax(0, 1fr); }
	.split.split-3, .group-grid { grid-template-columns: minmax(0, 1fr); }
	.project-gallery.wp-block-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.project-gallery.wp-block-gallery { grid-template-columns: 1fr; }
}

/* ---------- Management: photo + name + titles left, bio right ---------- */
.team-list { display: grid; }
.person-row { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); padding: 40px 0; border-bottom: 1px solid var(--line); align-items: start; }
.person-row:first-child { padding-top: 0; }
.person-row:last-child { border-bottom: 0; padding-bottom: 0; }
.person-card .person-photo { max-width: 300px; }
.person-card .person-info { padding-top: 16px; }
.person-card .person-info h3 { font: 700 26px/1.15 var(--font-display); }
.person-title p { margin-top: 6px; font: 600 20px/1.2 var(--font-display); color: var(--steel); }
.person-role p { margin-top: 4px; font-size: 15px; color: var(--steel); }
.person-bio { max-width: 46em; }
.person-bio p { margin-bottom: 16px; font-size: 17px; }
.person-bio p:last-child { margin-bottom: 0; }
.person-bio strong { color: var(--ink); font-weight: 600; }

/* ---------- Header with seven menu items ---------- */
@media (max-width: 1240px) and (min-width: 901px) {
	.main-nav a { padding: 10px 9px; font-size: 15px; }
	.header-cta .btn { padding: 0 14px; font-size: 15px; }
}
@media (max-width: 1060px) and (min-width: 901px) {
	.header-cta .btn { display: none; }
}

/* ---------- Blog ---------- */
.page-meta { margin-top: 14px; }
.page-meta p { color: var(--steel); font-size: 15px; }

.blog-cats { background: var(--paper); border-bottom: 1px solid var(--line); }
.blog-cats ul { list-style: none; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.blog-cats a { display: block; white-space: nowrap; padding: 14px; text-decoration: none; font-weight: 500; color: var(--steel); }
.blog-cats a:hover, .blog-cats a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--copper); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
.post-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.section-grey .post-card { border-color: transparent; }
.post-card-img { display: block; aspect-ratio: 16 / 10; background: var(--panel); overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .post-card-img img { transform: scale(1.03); }
.post-card-blank { width: 100%; height: 100%; background: linear-gradient(135deg, var(--panel), #d5d9d2); }
.post-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-meta { font-size: 14px; color: var(--steel); }
.post-meta a { color: var(--copper); font-weight: 600; text-decoration: none; }
.post-card h2, .post-card h3 { font: 700 23px/1.2 var(--font-display); }
.post-card h2 a, .post-card h3 a { text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 4px; }
.post-excerpt p { color: var(--steel); font-size: 16px; }
.post-more { margin-top: auto; padding-top: 6px; }
.post-more a { font-weight: 600; text-underline-offset: 4px; text-decoration-color: var(--copper); }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 48px; }
.pagination a, .pagination strong, .pagination em { min-width: 44px; height: 44px; padding: 0 14px; display: inline-grid; place-items: center; border-radius: var(--radius-s); font-style: normal; text-decoration: none; }
.pagination a { border: 2px solid var(--line); }
.pagination a:hover { border-color: var(--ink); }
.pagination strong { background: var(--ink); color: #fff; }

.post-layout { max-width: 820px; }
.post-hero { margin: 0 0 32px; border-radius: var(--radius-m); overflow: hidden; background: var(--panel); }
.post-hero img { width: 100%; height: auto; }
.post-hero figcaption { padding: 10px 14px; font-size: 14px; color: var(--steel); }
.post-toc { border-left: 3px solid var(--copper); background: var(--panel); padding: 18px 22px; margin-bottom: 32px; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.post-toc-title p { font: 700 18px/1.2 var(--font-display); margin-bottom: 8px; }
.post-toc ol { margin: 0; padding-left: 20px; }
.post-toc li { padding: 3px 0; }
.post-toc li[data-level="3"] { margin-left: 16px; list-style: circle; font-size: 15px; }
.post-toc a { text-underline-offset: 3px; }
.post-body { max-width: none; }
.post-body h2 { font: 700 clamp(26px, 3vw, 34px)/1.15 var(--font-display); margin: 40px 0 14px; scroll-margin-top: 110px; }
.post-body h3 { font: 700 23px/1.2 var(--font-display); margin: 28px 0 10px; scroll-margin-top: 110px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 22px; font-size: 18px; }
.post-body li { padding: 3px 0; }
.post-body li::marker { color: var(--copper); }
.post-body figure { margin: 24px 0; }
.post-body img { border-radius: var(--radius-s); }
.post-body blockquote { margin: 24px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--copper); font-size: 19px; }
.post-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 16px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.post-body th { background: var(--panel); }
.post-body a { text-decoration-color: var(--copper); text-underline-offset: 3px; }
.post-tags { margin-top: 32px; }
.post-tags ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; text-decoration: none; }
.post-share { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.post-share p { font-weight: 600; }
.post-share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.post-share-links a { padding: 8px 14px; border: 2px solid var(--ink); border-radius: var(--radius-s); font-weight: 600; font-size: 15px; text-decoration: none; }
.post-share-links a:hover { background: var(--ink); color: #fff; }
.blog-all { margin-top: 32px; justify-content: center; }

@media (max-width: 900px) {
	.person-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.person-card { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: end; }
	.person-card .person-info { padding-top: 0; }
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.post-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Show whole product photos instead of cropping them ---------- */
.hero-grid { align-items: center; }
.hero-photo { aspect-ratio: 4 / 3; }
.hero-photo.wp-block-image img, .hero-photo img { object-fit: contain; padding: 20px 20px 64px; mix-blend-mode: multiply; }
.range-item .range-img img, .range-img img { object-fit: contain; padding: 14px; mix-blend-mode: multiply; }
.standards-photo.wp-block-image img, .standards-photo img { object-fit: contain; padding: 18px; mix-blend-mode: multiply; }
.main-nav a { white-space: nowrap; }

/* ---------- Longer product descriptions ---------- */
.product-single .prose h2 { font: 700 26px/1.2 var(--font-display); margin: 28px 0 10px; }
.product-single .prose h2 + h3 { margin-top: 4px; }
.product-single .prose h3 { margin-top: 18px; }
.product-single .prose p { margin-bottom: 12px; }

/* Blog card images match the 1200x630 featured images, so nothing is cut off */
.post-card-img { aspect-ratio: 1200 / 630; }

/* ---------- Blog language switch ---------- */
.blog-lang { padding-top: 28px; }
.blog-lang ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.blog-lang a { display: inline-block; min-width: 110px; padding: 9px 20px; text-align: center; border: 2px solid var(--line); border-radius: var(--radius-s); font-weight: 600; text-decoration: none; color: var(--ink); background: var(--paper); }
.blog-lang a:hover { border-color: var(--ink); }
.blog-lang a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.blog-lang + .blog-list, .blog-lang + * { padding-top: 32px; }
