/*
Theme Name: The Works
Theme URI: https://theworks.ie
Author: The Works
Description: Block theme for The Works, a specialist marketing partner for construction, engineering and built-environment firms. Brand colours ink, brass and warm white; Manrope throughout.
Version: 1.2.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: theworks
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
img { max-width: 100%; height: auto; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--brass); outline-offset: 2px;
}
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ---------- Header ---------- */
.tw-header { position: sticky; top: 0; z-index: 50; background: rgba(247,244,237,0.94); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid rgba(30,34,38,0.08); }
.admin-bar .tw-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tw-header { top: 0; position: relative; } }
.tw-header__inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 0.9rem 0; }
.tw-logo img { display: block; height: 44px; width: auto; }
.tw-logo { display: inline-flex; flex-direction: column; text-decoration: none; }
.tw-logo__tag { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin: 2px 0 0 4px; }
.tw-header .wp-block-navigation a { text-decoration: none; }
.tw-header .wp-block-navigation a:hover { color: var(--wp--preset--color--brass); }
.tw-header .wp-block-navigation .current-menu-item > a, .tw-header .wp-block-navigation a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--wp--preset--color--brass); }
.tw-header__actions { display: flex; align-items: center; gap: 1.5rem; }
@media (max-width: 860px) { .tw-header__cta { display: none; } .tw-logo img { height: 36px; } }

/* ---------- Typography helpers ---------- */
.tw-eyebrow { display: flex; align-items: center; gap: 0.75rem; font-size: var(--wp--preset--font-size--label) !important; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: inherit; margin-bottom: 0.25rem !important; }
.tw-eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--wp--preset--color--brass); flex: none; }
.has-text-align-center.tw-eyebrow { justify-content: center; }
.tw-lead { font-size: var(--wp--preset--font-size--lead); line-height: 1.55; color: var(--wp--preset--color--muted); max-width: 40ch; }
.has-ink-background-color .tw-lead, .tw-dark .tw-lead { color: rgba(255,255,255,0.78); }
mark.tw-hl, .tw-hl { background: linear-gradient(transparent 12%, var(--wp--preset--color--brass) 12%, var(--wp--preset--color--brass) 92%, transparent 92%); color: inherit; padding: 0 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.tw-small { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.tw-dark .tw-small, .has-ink-background-color .tw-small { color: rgba(255,255,255,0.65); }
.tw-arrow-link a, a.tw-arrow-link { font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--wp--preset--color--brass); padding-bottom: 2px; }
.tw-arrow-link a:hover { color: var(--wp--preset--color--brass); }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; border: 2px solid currentColor; color: inherit; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--ink); color: #fff; }
.tw-dark .wp-block-button.is-style-outline > .wp-block-button__link:hover, .has-ink-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--ink); border-color: #fff; }
.wp-block-button.tw-btn-ink > .wp-block-button__link { background: var(--wp--preset--color--ink); color: #fff; }
.wp-block-button.tw-btn-ink > .wp-block-button__link:hover { background: var(--wp--preset--color--brass); color: var(--wp--preset--color--ink); }
.wp-block-button__link::after { content: " \2192"; }
.tw-no-arrow .wp-block-button__link::after { content: none; }

/* ---------- Sections ---------- */
.tw-section { padding-top: var(--wp--preset--spacing--60) !important; padding-bottom: var(--wp--preset--spacing--60) !important; }
.tw-section--tight { padding-top: var(--wp--preset--spacing--50) !important; padding-bottom: var(--wp--preset--spacing--50) !important; }
.tw-dark, .tw-dark h1, .tw-dark h2, .tw-dark h3, .tw-dark h4 { color: #fff; }
.tw-dark a:not(.wp-block-button__link) { color: #fff; }

/* Photo placeholder panel: ink field with architectural grid. Add a background image in the editor to replace it. */
.tw-photo { border-radius: var(--wp--custom--radius); overflow: hidden; position: relative; }
.tw-photo:not([style*="background-image"]) {
	background-color: var(--wp--preset--color--ink) !important;
	background-image:
		linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px),
		linear-gradient(rgba(175,131,80,0.18) 1px, transparent 1px),
		linear-gradient(90deg, rgba(175,131,80,0.18) 1px, transparent 1px);
	background-size: 32px 32px, 32px 32px, 160px 160px, 160px 160px;
}
.tw-photo:not([style*="background-image"])::after {
	content: ""; position: absolute; right: 8%; bottom: 10%; width: 38%; aspect-ratio: 2 / 1;
	background: linear-gradient(135deg, transparent 49.4%, rgba(175,131,80,0.55) 49.6%, rgba(175,131,80,0.55) 50.4%, transparent 50.6%);
	pointer-events: none;
}
.tw-photo .wp-block-cover__inner-container { color: #fff; }
.tw-script { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: clamp(1.6rem, 3vw, 2.4rem) !important; line-height: 1.05 !important; color: #fff; opacity: 0.92; transform: rotate(-6deg); text-align: right; }

/* Hero */
.tw-hero { padding-top: var(--wp--preset--spacing--50) !important; padding-bottom: var(--wp--preset--spacing--50) !important; }
.tw-hero h1 { margin-top: 0.5rem; }
.tw-hero .tw-photo { min-height: 520px; }
@media (max-width: 781px) { .tw-hero .tw-photo { min-height: 280px; } }

/* Pillars / icon row */
.tw-pillars > .wp-block-column { padding: 0.5rem 1.5rem; }
.tw-pillars > .wp-block-column + .wp-block-column { border-left: 1px solid var(--wp--preset--color--concrete); }
@media (max-width: 781px) { .tw-pillars > .wp-block-column + .wp-block-column { border-left: 0; border-top: 1px solid var(--wp--preset--color--concrete); padding-top: 1.5rem; } }
.tw-icon { width: 44px; height: 44px; color: var(--wp--preset--color--brass); margin-bottom: 0.75rem; display: block; }
.tw-icon svg { width: 100%; height: 100%; }
.tw-pillars h3, .tw-pillars h4 { margin: 0 0 0.35rem; }
.tw-pillars p { margin: 0; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }

/* Client bar */
.tw-clients { gap: clamp(1.5rem, 4vw, 3.5rem) !important; }
.tw-client-name { font-size: clamp(1.25rem, 2.2vw, 1.6rem) !important; font-weight: 800; letter-spacing: -0.02em; color: #fff; opacity: 0.92; margin: 0 !important; }

/* Cards */
.tw-card { background: var(--wp--preset--color--paper); border: 1px solid rgba(30,34,38,0.09); border-radius: var(--wp--custom--radius); padding: clamp(1.5rem, 3vw, 2.25rem) !important; height: 100%; }
.tw-card--dark { background: var(--wp--preset--color--ink); color: #fff; border-color: var(--wp--preset--color--ink); }
.tw-card--dark h3, .tw-card--dark h4, .tw-card--dark .tw-price { color: #fff; }
.tw-card > *:first-child { margin-top: 0; }
.wp-block-columns.tw-equal > .wp-block-column { display: flex; flex-direction: column; }
.wp-block-columns.tw-equal > .wp-block-column > .tw-card { flex: 1; }
.tw-price { font-size: clamp(2.4rem, 4vw, 3.2rem) !important; font-weight: 800; letter-spacing: -0.03em; line-height: 1 !important; margin: 0.25rem 0 0.75rem !important; }
.tw-price small, .tw-price .tw-per { font-size: 1.05rem; font-weight: 700; letter-spacing: 0; }
.tw-badge { display: inline-block; font-size: 0.7rem !important; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; background: var(--wp--preset--color--brass); color: var(--wp--preset--color--ink); border-radius: 999px; padding: 0.3rem 0.7rem; margin: 0 0 0.5rem !important; }
.tw-plan-name { font-size: var(--wp--preset--font-size--label) !important; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 !important; }

/* Check list */
ul.tw-checks { list-style: none; padding-left: 0; margin: 1rem 0 1.5rem; }
ul.tw-checks li { position: relative; padding-left: 2rem; margin: 0.55rem 0; }
ul.tw-checks li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--wp--preset--color--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/0.8rem no-repeat; }
.tw-card--dark ul.tw-checks li::before, .tw-dark ul.tw-checks li::before { background-color: var(--wp--preset--color--brass); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%231E2226' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
ul.tw-bullets { padding-left: 1.2rem; }
ul.tw-bullets li { margin: 0.45rem 0; }
ul.tw-bullets li::marker { color: var(--wp--preset--color--brass); }

/* Steps */
.tw-steps { counter-reset: twstep; }
.tw-steps > .wp-block-column { border-top: 3px solid var(--wp--preset--color--ink); padding-top: 1.25rem; }
.tw-steps > .wp-block-column h3, .tw-steps > .wp-block-column h4 { margin: 0 0 0.35rem; }
.tw-steps > .wp-block-column h3::before, .tw-steps > .wp-block-column h4::before { counter-increment: twstep; content: counter(twstep, decimal-leading-zero); display: block; color: var(--wp--preset--color--brass); font-size: 0.85rem; letter-spacing: 0.1em; margin-bottom: 0.6rem; }
.tw-steps p { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); margin: 0; }
.tw-dark .tw-steps > .wp-block-column { border-top-color: var(--wp--preset--color--brass); }
.tw-dark .tw-steps p { color: rgba(255,255,255,0.72); }

/* Sector tiles */
.tw-tile { border-radius: var(--wp--custom--radius); min-height: 260px !important; transition: transform .2s ease; }
.tw-tile:hover { transform: translateY(-3px); }
.tw-tile h3 { font-size: 1.35rem !important; margin: 0; }
.tw-tile h3 a { color: #fff; text-decoration: none; }
.tw-tile h3 a::after { content: " \2192"; color: var(--wp--preset--color--brass); }
.tw-tile h3 a::before { content: ""; position: absolute; inset: 0; }
.tw-tile .wp-block-cover__inner-container { position: static; }
.tw-tile { position: relative; }

/* Stats */
.tw-stat-num { font-size: clamp(2.2rem, 4vw, 3rem) !important; font-weight: 800; letter-spacing: -0.03em; line-height: 1 !important; margin: 0 0 0.4rem !important; color: var(--wp--preset--color--brass); }
.tw-stat p:last-child { margin: 0; }

/* FAQ (details blocks) */
.tw-faq .wp-block-details { border-top: 1px solid var(--wp--preset--color--concrete); padding: 1.1rem 0; margin: 0; }
.tw-faq .wp-block-details:last-child { border-bottom: 1px solid var(--wp--preset--color--concrete); }
.tw-faq summary { font-weight: 700; font-size: 1.1rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.tw-faq summary::-webkit-details-marker { display: none; }
.tw-faq summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--wp--preset--color--brass); flex: none; }
.tw-faq details[open] summary::after { content: "\2212"; }
.tw-faq .wp-block-details > p { color: var(--wp--preset--color--muted); margin-top: 0.75rem; max-width: 70ch; }

/* Case studies */
.tw-case { border-top: 1px solid var(--wp--preset--color--concrete); }
.tw-tagline { font-size: var(--wp--preset--font-size--label) !important; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wp--preset--color--brass); margin: 0 !important; }
.tw-label { font-weight: 800; margin-bottom: 0.25rem !important; }

/* People */
.tw-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--wp--preset--color--ink); display: flex; align-items: center; justify-content: center; color: var(--wp--preset--color--brass); font-weight: 800; font-size: 1.6rem; margin-bottom: 1rem !important; }

/* Forms */
.tw-form { display: grid; gap: 1rem; }
.tw-form .tw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .tw-form .tw-row { grid-template-columns: 1fr; } }
.tw-form label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.35rem; }
.tw-form .tw-help { font-weight: 400; color: var(--wp--preset--color--muted); }
.tw-form input[type=text], .tw-form input[type=email], .tw-form input[type=tel], .tw-form input[type=url], .tw-form select, .tw-form textarea {
	width: 100%; box-sizing: border-box; font: inherit; color: var(--wp--preset--color--ink); background: #fff; border: 1px solid #b9b4ab; border-radius: 10px; padding: 0.8rem 0.9rem; min-height: 48px;
}
.tw-form textarea { min-height: 120px; resize: vertical; }
.tw-form input:focus, .tw-form select:focus, .tw-form textarea:focus { border-color: var(--wp--preset--color--ink); }
.tw-form button { font: inherit; font-weight: 700; background: var(--wp--preset--color--ink); color: #fff; border: 0; border-radius: 999px; padding: 0.9rem 1.75rem; cursor: pointer; justify-self: start; }
.tw-form button:hover { background: var(--wp--preset--color--brass); color: var(--wp--preset--color--ink); }
.tw-form button[disabled] { opacity: 0.6; cursor: wait; }
.tw-form .tw-consent { font-size: 0.85rem; color: var(--wp--preset--color--muted); margin: 0; }
.tw-form .tw-hp { position: absolute; left: -9999px; }
.tw-form-status { border-radius: 10px; padding: 1rem 1.1rem; font-weight: 600; }
.tw-form-status.is-success { background: #e7efe4; color: #23401b; }
.tw-form-status.is-error { background: #f6e3df; color: #6a1f12; }
.tw-admin-note { background: #fff4d6; border: 1px dashed #b58a00; border-radius: 10px; padding: 0.9rem 1rem; font-size: 0.9rem; }
.tw-booking iframe { width: 100%; min-height: 680px; border: 0; border-radius: var(--wp--custom--radius); background: #fff; }

/* Footer */
.tw-footer { background: var(--wp--preset--color--ink); color: rgba(255,255,255,0.78); font-size: 0.95rem; }
.tw-footer a { color: #fff; text-decoration: none; }
.tw-footer a:hover { color: var(--wp--preset--color--brass); }
.tw-footer h4 { color: #fff; font-size: 0.75rem !important; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; margin: 0 0 1rem; }
.tw-footer ul { list-style: none; padding: 0; margin: 0; }
.tw-footer li { margin: 0.45rem 0; }
.tw-footer__logo img { height: 46px; width: auto; display: block; }
.tw-footer__legal { border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.82rem; color: rgba(255,255,255,0.6); }
.tw-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1.3fr 1fr 1.2fr; gap: 2rem; max-width: 1200px; margin: 0 auto; }
@media (max-width: 960px) { .tw-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tw-footer__grid { grid-template-columns: 1fr; } }

/* CTA band */
.tw-cta-panel { border-radius: calc(var(--wp--custom--radius) * 1.4); position: relative; overflow: hidden; }
.tw-cta-panel::after { content: ""; position: absolute; right: -40px; top: -40px; width: 240px; height: 240px; border-right: 2px solid rgba(175,131,80,0.35); border-top: 2px solid rgba(175,131,80,0.35); transform: rotate(45deg); pointer-events: none; }

/* Prose pages (policies, posts) */
.tw-prose h2 { font-size: 1.6rem; margin-top: 2.5rem; }
.tw-prose h3 { font-size: 1.25rem; margin-top: 2rem; }
.tw-prose p, .tw-prose li { max-width: 70ch; }

/* Insights cards */
.tw-post-card { background: var(--wp--preset--color--paper); border: 1px solid rgba(30,34,38,0.09); border-radius: var(--wp--custom--radius); padding: 1.5rem; height: 100%; }
.tw-post-card .wp-block-post-title a { text-decoration: none; }

/* Mobile spacing tidy */
@media (max-width: 781px) {
	.wp-block-columns { gap: 2rem !important; }
	.tw-section { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
}

/* Additions */
@media (min-width: 861px) { .tw-nav-contact { display: none !important; } }
h1 mark.has-inline-color, h2 mark.has-inline-color { padding: 0 0.12em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.tw-headshot img { width: 140px !important; height: 140px !important; object-fit: cover; border-radius: 50%; }
.tw-headshot { margin: 0 0 1rem; }
.tw-card .tw-tagline { margin-bottom: 0.75rem !important; }
.tw-hero .tw-left { margin-left: 0 !important; }
.tw-header .wp-block-navigation__responsive-container-open, .tw-header .wp-block-navigation__responsive-container-close { color: var(--wp--preset--color--ink); }
.tw-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 4rem; font-size: 1.4rem; }
.tw-case:first-of-type { border-top: 0; }
.tw-photo.tw-tile { align-items: flex-end; padding: 1.5rem !important; }
.tw-photo.tw-tile h3 { position: relative; z-index: 2; }
.wp-block-post-content > .wp-block-group.alignfull:first-child { margin-top: 0; }
.tw-dark .tw-eyebrow, .has-ink-background-color .tw-eyebrow { color: rgba(255,255,255,0.85); }
.has-text-align-right.tw-arrow-link { text-align: right; }
.tw-intro { max-width: 900px; }
.tw-intro > * { max-width: none; }
.tw-steps.tw-nonum h3::before, .tw-steps.tw-nonum h4::before { content: none; }
.tw-dark .tw-stat-num { font-size: clamp(1.7rem, 2.6vw, 2.4rem) !important; white-space: nowrap; }
.tw-header__inner { padding-left: clamp(1rem, 4vw, 2.5rem); padding-right: clamp(1rem, 4vw, 2.5rem); box-sizing: content-box; }
@media (max-width: 1280px) { .tw-header__inner { max-width: none; } }
.wp-block-post-content > .wp-block-group.alignfull { padding-left: clamp(1.25rem, 4vw, 2.5rem) !important; padding-right: clamp(1.25rem, 4vw, 2.5rem) !important; }
@media (max-width: 781px) { .tw-hero .tw-photo { min-height: 220px !important; } h1 { font-size: clamp(2.4rem, 11vw, 3rem) !important; } }
@media (max-width: 781px) {
	.tw-pillars > .wp-block-column { padding-left: 0; padding-right: 0; }
	.tw-photo:not([style*="background-image"]):not(.tw-tile):not(.tw-photo--hero) { display: none; }
}
.tw-photo[style*="background-image"] { background-size: cover; background-position: center; }

/* 1.1: photos and client logos */
.tw-clients-band { border-top: 1px solid rgba(30,34,38,0.08); border-bottom: 1px solid rgba(30,34,38,0.08); }
.tw-clients-band .tw-client-name { color: var(--wp--preset--color--ink); opacity: 0.75; }
.tw-clients .wp-block-image.tw-client-logo { margin: 0; }
.tw-clients .tw-client-logo img { height: 40px !important; width: auto !important; filter: grayscale(1); opacity: 0.75; transition: filter .2s, opacity .2s; }
.tw-clients .tw-client-logo img:hover { filter: none; opacity: 1; }
@media (max-width: 781px) { .tw-clients .tw-client-logo img { height: 30px !important; } .tw-clients { gap: 1.25rem 2rem !important; justify-content: flex-start !important; } }
.tw-photo[style*="background-image"] { background-color: var(--wp--preset--color--ink); }
.tw-tile[style*="background-image"]::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(30,34,38,0) 35%, rgba(30,34,38,0.85) 100%); pointer-events: none; }

/* 1.2: tighter logo files (padding removed), highlight fix, showcase cards */
.tw-logo img { height: 40px !important; width: auto; }
.tw-footer__logo img { height: 36px !important; }
@media (max-width: 860px) { .tw-logo img { height: 32px !important; } }
.tw-hero h1 { line-height: 1.12; }
h1 mark.has-inline-color { background: linear-gradient(transparent 20%, #AF8350 20%, #AF8350 95%, transparent 95%) !important; padding: 0 0.1em; border-radius: 2px; }
.tw-showcase { padding-top: 0 !important; padding-bottom: var(--wp--preset--spacing--50) !important; }
.tw-showcase .tw-label { margin-bottom: 1rem !important; }
.tw-asset { display: flex; flex-direction: column; gap: 0.5rem; }
.tw-asset figure, .tw-asset .wp-block-video, .tw-asset .wp-block-embed { margin: 0 0 0.5rem; border-radius: var(--wp--custom--radius); overflow: hidden; background: var(--wp--preset--color--concrete); }
.tw-asset img, .tw-asset video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.tw-asset .wp-block-embed iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; display: block; }
.tw-asset h4 { margin: 0; font-size: 1.05rem !important; }
.tw-asset p { margin: 0; }
.tw-asset h4:empty, .tw-asset p:empty { display: none; }
