/*
Theme Name: Workbench Community
Theme URI: https://estwinghammer.com/
Author: Estwing Hammers & Tools Fan Club
Description: A sturdy, no-nonsense block theme built for the Estwing Hammers & Tools Fan Club — a forum-first community for people who use, collect and restore Estwing tools. Forged-steel and grip-blue palette, bold condensed headings, a ready-made home page, wpForo styling, and a one-click starter-page setup.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: workbench
Tags: block-patterns, full-site-editing, wide-blocks, custom-colors, custom-menu, editor-style, one-column, blog, community
*/

/* ---------- Base polish ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(a) { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:where(a:hover) { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--wp--preset--color--leather); outline-offset: 2px; }
img { height: auto; max-width: 100%; }

/* Sections butt up against each other; spacing lives inside each section. */
.wp-site-blocks > * { margin-block-start: 0; }

/* ---------- Header ---------- */
.wb-header { position: relative; z-index: 50; }
.wb-join .wp-block-button__link { white-space: nowrap; }
.wb-header .wp-block-navigation a { text-decoration: none; }
.wb-header .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--white); }
.wb-header .wp-block-navigation .current-menu-item > a,
.wb-header .wp-block-navigation a[aria-current="page"] { color: var(--wp--preset--color--white); box-shadow: inset 0 -3px 0 var(--wp--preset--color--leather); }
.wb-header .wp-block-loginout a { color: var(--wp--preset--color--steel-200); text-decoration: none; font-weight: 600; }
.wb-header .wp-block-loginout a:hover { color: var(--wp--preset--color--white); }
.wb-header .wb-brand a { text-decoration: none; }
.wb-header .wb-brand .wp-block-site-title a { color: var(--wp--preset--color--white); }
.wb-logo-mark { flex-shrink: 0; margin: 0 !important; }
.wb-logo-mark img { display: block; }
.wb-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--steel-900) !important; color: var(--wp--preset--color--white) !important; padding: 2rem; }

/* ---------- Hero ---------- */
.wb-hero { position: relative; overflow: hidden; }
.wb-hero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
	background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 10px);
}
.wb-hero > * { position: relative; }
.wb-hero .wb-kicker { letter-spacing: .14em; }
.wb-hero-art img { filter: drop-shadow(0 30px 40px rgba(0,0,0,.35)); }
.wb-hammer-tilt img { transform: rotate(38deg); }
.wb-hero-art .wb-hammer-tilt { margin-block: 3rem; }
.wb-logo-badge img {
	object-fit: contain; box-sizing: border-box; border-radius: 50% !important; padding: 3px;
	background: radial-gradient(circle at 45% 35%, #34404b, #161b20);
	border: 3px solid var(--wp--preset--color--leather) !important; transform: rotate(40deg);
}

/* ---------- Cards ---------- */
.wb-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; height: 100%; }
.wb-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(28,34,40,.12); border-color: var(--wp--preset--color--grip-blue) !important; }
.wb-card .wb-card-icon { width: 52px; height: 52px; }
.wb-card .wb-card-icon img { width: 52px; height: 52px; }
.wb-card a.wb-card-link { font-weight: 700; text-decoration: none; }
.wb-card a.wb-card-link::after { content: " →"; }
.wp-block-columns.wb-equal > .wp-block-column { display: flex; flex-direction: column; }

/* Rule line under section headings */
.wb-rule::after {
	content: ""; display: block; width: 64px; height: 4px; margin-top: .6rem;
	background: var(--wp--preset--color--leather);
}
.has-text-align-center.wb-rule::after { margin-left: auto; margin-right: auto; }

/* ---------- Latest forum topics ---------- */
.wb-topics { list-style: none; margin: 0; padding: 0; }
.wb-topics li { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: baseline; padding: 1rem 0; border-bottom: 1px solid var(--wp--preset--color--steel-200); }
.wb-topics li:last-child { border-bottom: 0; }
.wb-topics a { font-weight: 700; font-size: 1.1rem; color: var(--wp--preset--color--ink); text-decoration: none; }
.wb-topics a:hover { color: var(--wp--preset--color--grip-blue); text-decoration: underline; }
.wb-topics .wb-topic-meta { font-size: .9rem; color: var(--wp--preset--color--muted); white-space: nowrap; }
.wb-topics .wb-topic-forum { grid-column: 1 / -1; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--wp--preset--color--leather); order: -1; }
.wb-topics-empty { color: var(--wp--preset--color--muted); }
.wb-latest-topics .widget-title, .wb-latest-topics .wpf-widget-title { display: none; }
.wb-latest-topics ul { list-style: none; margin: 0; padding: 0; }
.wb-latest-topics ul li { padding: .9rem 0; border-bottom: 1px solid var(--wp--preset--color--steel-200); }

/* ---------- Post cards (blog) ---------- */
.wb-post-card .wp-block-post-featured-image img { aspect-ratio: 3/2; object-fit: cover; }
.wb-post-card .wp-block-post-title a { text-decoration: none; }
.wb-post-card .wp-block-post-title a:hover { color: var(--wp--preset--color--grip-blue); }

/* ---------- Footer ---------- */
.wb-footer a { color: var(--wp--preset--color--steel-200); text-decoration: none; }
.wb-footer a:hover { color: var(--wp--preset--color--white); text-decoration: underline; }
.wb-footer .wp-block-navigation .wp-block-navigation-item__content { padding: .2rem 0; }

/* ---------- Forms (contact forms, wpForo, comments) ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], input[type="tel"], input[type="number"], textarea, select {
	font: inherit; border: 1px solid var(--wp--preset--color--steel-300); border-radius: 4px; padding: .65rem .8rem; background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); max-width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--wp--preset--color--grip-blue); outline: 2px solid rgba(31,95,168,.25); outline-offset: 0; }

/* ---------- wpForo integration ---------- */
#wpforo, #wpforo #wpforo-wrap { font-family: var(--wp--preset--font-family--body) !important; }
#wpforo #wpforo-wrap { font-size: 16px; }
#wpforo #wpforo-wrap h1, #wpforo #wpforo-wrap h2, #wpforo #wpforo-wrap h3,
#wpforo #wpforo-wrap .wpforo-category .cat-title, #wpforo #wpforo-wrap .wpforo-forum-title a { font-family: var(--wp--preset--font-family--heading) !important; letter-spacing: .01em; }
#wpforo #wpforo-wrap .wpforo-category { border-radius: 6px 6px 0 0; }
#wpforo #wpforo-wrap a { text-decoration: none; }
#wpforo #wpforo-wrap .wpf-button, #wpforo #wpforo-wrap .button, #wpforo #wpforo-wrap input[type="submit"] { border-radius: 4px !important; font-weight: 700 !important; }
/* Give the forum room to breathe on the full-width template */
.wb-forum-page .entry-content > #wpforo, .wb-forum-page .wp-block-post-content > #wpforo { max-width: none; }

/* ---------- Misc ---------- */
.wb-disclaimer { opacity: .75; }
.wp-block-search__button { font-weight: 700; }
.wb-photo-frame { border: 2px dashed var(--wp--preset--color--steel-300); border-radius: 8px; }

@media (max-width: 781px) {
	.wb-header .wb-subtitle { display: none; }
	.wb-header .wp-block-site-title { font-size: 1.05rem !important; }
	.wb-header .wb-logo-mark img { width: 38px !important; height: 38px !important; }
	.wb-hero-art { display: none; }
	.wb-topics li { grid-template-columns: 1fr; }
	.wb-topics .wb-topic-meta { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.wb-card { transition: none; }
	.wb-card:hover { transform: none; }
}
