/*
Theme Name: TEQ
Theme URI: https://www.teq-automotive.com
Author: TEQ SA
Description: Tema essenziale per il sito TEQ SA. Blocchi standard di WordPress, modelli di sezione TEQ, compatibile WPML.
Version: 1.0.14
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: teq
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
:where(a) { text-underline-offset: 0.15em; }
img { height: auto; max-width: 100%; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
.screen-reader-text:focus { background: #fff; clip: auto; clip-path: none; color: var(--wp--preset--color--ink); display: block; height: auto; left: 8px; padding: 12px 16px; top: 8px; width: auto; z-index: 100000; }
:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.teq-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.88); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--wp--preset--color--line); }
.admin-bar .teq-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .teq-header { top: 46px; } }
.teq-header__inner { max-width: 1024px; margin: 0 auto; padding: 0 22px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.teq-logo { display: block; line-height: 0; padding: 12px 0; }
.teq-logo img { height: 22px; width: auto; }
.teq-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 30px; }
.teq-nav li { position: relative; }
.teq-nav a { display: block; padding: 16px 0; font-size: 15px; color: #3A3D44; text-decoration: none; }
.teq-nav a:hover, .teq-nav .current-menu-item > a, .teq-nav .current-menu-ancestor > a { color: var(--wp--preset--color--ink); }
.teq-nav .sub-menu { display: none; position: absolute; left: -18px; top: 100%; min-width: 240px; padding: 10px 18px; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(17,19,23,.08); flex-direction: column; gap: 0; }
.teq-nav .sub-menu a { padding: 8px 0; font-size: 15px; }
.teq-nav li:hover > .sub-menu, .teq-nav li:focus-within > .sub-menu { display: flex; }
.teq-lang { display: flex; gap: 12px; font-size: 13px; margin: 0; padding: 0; list-style: none; }
.teq-lang a { color: #6E727C; text-decoration: none; padding: 16px 0; display: block; }
.teq-lang a[aria-current="true"] { color: var(--wp--preset--color--ink); font-weight: 600; }
.teq-mobile { display: none; }
@media (max-width: 860px) {
	.teq-header__inner > .teq-nav, .teq-header__inner > .teq-lang { display: none; }
	.teq-mobile { display: block; }
	.teq-mobile summary { list-style: none; cursor: pointer; padding: 14px 0; font-size: 14px; }
	.teq-mobile summary::-webkit-details-marker { display: none; }
	.teq-mobile[open] .teq-mobile__panel { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--wp--preset--color--line); padding: 8px 22px 24px; }
	.teq-mobile .teq-nav ul { flex-direction: column; }
	.teq-mobile .teq-nav a { font-size: 21px; padding: 10px 0; }
	.teq-mobile .teq-nav .sub-menu { display: flex; position: static; border: 0; box-shadow: none; padding: 0 0 8px 16px; }
	.teq-mobile .teq-lang a { font-size: 15px; }
}

/* ---------- Sections and blocks ---------- */
.teq-section { padding-top: clamp(64px, 9vw, 112px); padding-bottom: clamp(64px, 9vw, 112px); }
.teq-section--tight { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); }
.teq-center, .teq-center .wp-block-heading { text-align: center; }
.teq-center .teq-lead { margin-left: auto; margin-right: auto; }
.teq-eyebrow { font-size: var(--wp--preset--font-size--large); font-weight: 600; color: var(--wp--preset--color--muted); margin-bottom: 0; }
.teq-lead { font-size: clamp(21px, 2.2vw, 26px); line-height: 1.35; color: var(--wp--preset--color--muted); letter-spacing: -0.01em; max-width: 680px; }
.teq-muted { color: var(--wp--preset--color--muted); }
.teq-statement { font-size: clamp(28px, 3.4vw, 44px); font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; }
.teq-statement .teq-soft { color: #8A8F99; }
.teq-media img, .teq-media video { border-radius: 28px; width: 100%; }
.teq-media .wp-block-video, .teq-media.wp-block-video { margin: 0; }
.wp-block-video.teq-media video { aspect-ratio: 21 / 9; object-fit: cover; background: var(--wp--preset--color--surface); }

/* card / tile */
.is-style-teq-card { background: var(--wp--preset--color--surface); border-radius: 28px; padding: clamp(32px, 4vw, 56px); }
.is-style-teq-card.has-brand-background-color { color: #fff; }
.is-style-teq-card.has-brand-background-color :where(p, h2, h3) { color: inherit; }
.is-style-teq-card.has-brand-background-color .teq-muted, .is-style-teq-card.has-brand-background-color .teq-eyebrow { color: #B9C6E4; }
.is-style-teq-card img { border-radius: 16px; }
.teq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.teq-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.teq-grid > * { margin: 0 !important; }

/* stats */
.teq-stat-number { font-size: clamp(56px, 7vw, 88px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin: 0; }
.teq-stat-label { font-size: 19px; line-height: 1.4; color: var(--wp--preset--color--muted); margin-top: 14px; }

/* link list */
.teq-linklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0 24px; list-style: none; padding: 0; margin: 40px 0 0; text-align: left; }
.teq-linklist li { border-bottom: 1px solid var(--wp--preset--color--line); }
.teq-linklist a { display: block; padding: 14px 0; text-decoration: none; }

/* text button (link with chevron) */
.wp-block-button.is-style-teq-link .wp-block-button__link { background: transparent !important; color: var(--wp--preset--color--accent) !important; padding-left: 0; padding-right: 0; }
.wp-block-button.is-style-teq-link .wp-block-button__link::after { content: " ›"; }
.wp-block-button.is-style-teq-link .wp-block-button__link:hover { text-decoration: underline; }
.has-brand-background-color .wp-block-button.is-style-teq-link .wp-block-button__link { color: #fff !important; }
.has-brand-background-color .wp-block-button:not(.is-style-teq-link) .wp-block-button__link { background: #fff; color: var(--wp--preset--color--ink); }

/* compare table */
.wp-block-table.is-style-teq-compare { overflow-x: auto; }
.wp-block-table.is-style-teq-compare table { border-collapse: collapse; min-width: 640px; width: 100%; font-size: 15px; }
.wp-block-table.is-style-teq-compare :where(th, td) { border: 0; border-top: 1px solid #DDE0E5; padding: 16px; text-align: left; vertical-align: top; }
.wp-block-table.is-style-teq-compare thead th { border-top: 0; font-size: 21px; font-weight: 600; padding-bottom: 20px; }
.wp-block-table.is-style-teq-compare tbody td:first-child { color: var(--wp--preset--color--muted); font-weight: 500; padding-left: 0; }
.wp-block-table.is-style-teq-compare tbody tr:last-child :where(th, td) { border-bottom: 1px solid #DDE0E5; }

/* generic content tables converted from the old site */
.wp-block-table:not(.is-style-teq-compare) table { border-collapse: collapse; width: 100%; font-size: 15px; }
.wp-block-table:not(.is-style-teq-compare) td { border: 0; border-bottom: 1px solid var(--wp--preset--color--line); padding: 11px 12px 11px 0; height: auto !important; width: auto !important; }

/* timeline */
.teq-timeline { margin-top: 48px; border-left: 1px solid #DDE0E5; }
.teq-timeline > .teq-timeline__item { position: relative; padding: 0 0 40px 32px; margin: 0 !important; }
.teq-timeline > .teq-timeline__item::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--wp--preset--color--brand); }
.teq-timeline .teq-year { font-size: 15px; font-weight: 600; color: var(--wp--preset--color--muted); margin: 0; }
.teq-timeline h3 { margin: 4px 0 8px; font-size: 24px; }
.teq-timeline__item p:not(.teq-year) { margin: 0; color: var(--wp--preset--color--muted); }

/* page header (inner pages) */
.teq-page-header { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(24px, 4vw, 48px); }
.teq-page-header .wp-block-post-title, .teq-page-header h1 { margin: 0; }
.teq-breadcrumb { font-size: 13px; color: var(--wp--preset--color--muted); margin-bottom: 18px; }
.teq-breadcrumb a { color: inherit; }

/* converted WPBakery content: keep it readable */
.teq-converted .wp-block-columns { gap: 40px; margin-bottom: 40px; }
.teq-converted figure.wp-block-image { margin: 0 0 24px; }
.teq-converted figure.wp-block-image img { border-radius: 18px; }

/* ---------- Forms (Contact Form 7, Simple Job Board) ---------- */
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea,
.sjb-page input[type="text"], .sjb-page input[type="email"], .sjb-page input[type="tel"], .sjb-page textarea, .sjb-page select {
	width: 100%; box-sizing: border-box; font: inherit; font-size: 17px; padding: 14px 16px; border: 1px solid #D2D5DB; border-radius: 12px; background: #fff; color: var(--wp--preset--color--ink);
}
.wpcf7 input:focus, .wpcf7 textarea:focus, .sjb-page input:focus, .sjb-page textarea:focus { border-color: var(--wp--preset--color--accent); outline: 2px solid rgba(10,61,145,.15); }
.wpcf7 label { display: block; font-size: 15px; color: var(--wp--preset--color--muted); }
.wpcf7 input[type="submit"], .sjb-page input[type="submit"], .sjb-page button[type="submit"], .sjb-page .btn {
	font: inherit; font-size: 17px; background: var(--wp--preset--color--accent); color: #fff; border: 0; border-radius: 980px; padding: 13px 26px; cursor: pointer;
}
.sjb-page .list-data, .sjb-page .sjb-listing .list-data { border: 0 !important; border-bottom: 1px solid var(--wp--preset--color--line) !important; padding: 24px 0 !important; background: transparent !important; }
.sjb-page .job-title, .sjb-page h4 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Footer ---------- */
.teq-footer { background: var(--wp--preset--color--surface); font-size: 12px; line-height: 1.6; color: #6E727C; margin-top: 0; }
.teq-footer__inner { max-width: 1024px; margin: 0 auto; padding: 40px 22px 24px; }
.teq-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; padding-bottom: 24px; border-bottom: 1px solid #DDE0E5; }
.teq-footer__cols ul { list-style: none; margin: 0; padding: 0; }
.teq-footer__cols > ul.teq-footer__menu { display: contents; }
.teq-footer__menu > li > a { color: var(--wp--preset--color--ink); font-weight: 600; text-decoration: none; display: block; margin-bottom: 6px; }
.teq-footer__menu .sub-menu a { color: var(--wp--preset--color--muted); text-decoration: none; display: block; padding: 3px 0; }
.teq-footer__menu .sub-menu a:hover { text-decoration: underline; }
.teq-footer__address strong { color: var(--wp--preset--color--ink); font-weight: 600; display: block; margin-bottom: 6px; }
.teq-footer__address a { color: var(--wp--preset--color--muted); }
.teq-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 16px; }
.teq-footer__bottom a { color: var(--wp--preset--color--muted); }
.teq-footer .teq-lang a { padding: 0; }

/* ---------- 1.0.1 ---------- */
/* converted pages: section titles smaller than the page title */
.teq-converted h2.wp-block-heading { font-size: clamp(28px, 3vw, 36px); letter-spacing: -0.025em; margin-top: 2.2em; }
.teq-converted > h2.wp-block-heading:first-child { margin-top: 0; }
.teq-converted h3.wp-block-heading { font-size: 22px; }
/* job listings and job pages: no publication date */
.sjb-page .job-date, .sjb-listing .job-date, .job-date { display: none !important; }
/* WPML adds its own switcher to menus: the theme already shows EN/DE/FR/IT */
.teq-nav .wpml-ls-item, .teq-nav .wpml-ls-menu-item, .teq-footer .wpml-ls-item { display: none !important; }

/* ---------- 1.0.2: small tiles (13-tile grid on the home page) ---------- */
.teq-tile-sm { padding: 28px 28px 20px; display: flex; flex-direction: column; }
.teq-tile-sm > * { margin-block: 0 !important; }
.teq-tile-sm > * + * { margin-top: 16px !important; }
.teq-tile-sm figure.wp-block-image { margin-bottom: 4px !important; }
.teq-tile-sm figure.wp-block-image img { width: 100%; aspect-ratio: 15 / 8; object-fit: cover; border-radius: 16px; }
.teq-tile-sm h3.wp-block-heading { font-size: 21px; line-height: 1.25; letter-spacing: -0.015em; }
.teq-tile-sm h3 a { color: var(--wp--preset--color--ink); text-decoration: none; }
.teq-tile-sm h3 a:hover { text-decoration: underline; }
.teq-tile-sm .wp-block-buttons { margin-top: auto !important; padding-top: 8px; }

/* ---------- 1.0.3: solution pages (BUS Sapiens) and customer logos ---------- */
.teq-tile-sm figure.wp-block-image img { object-fit: contain; }
.is-style-teq-card h3.wp-block-heading { font-size: clamp(20px, 1.9vw, 24px); line-height: 1.25; letter-spacing: -0.015em; hyphens: auto; overflow-wrap: break-word; }
.is-style-teq-card h4.wp-block-heading { font-size: 19px; line-height: 1.3; }
.is-style-teq-card .teq-eyebrow { font-size: 17px; }
.is-style-teq-card .wp-block-columns { margin-top: 32px; gap: 32px; }
.teq-section .wp-block-list li + li { margin-top: .45em; }
.teq-section > .wp-block-list { max-width: 760px; margin-inline: auto !important; }
.teq-section .teq-stat-label { max-width: 240px; margin-inline: auto; }
.teq-logos { gap: 8px 24px; align-items: center; }
.teq-logos figure.wp-block-image { margin: 0; }
.teq-logos img { width: 100%; height: auto; }
@media (max-width: 600px) { .teq-logos { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* ---------- 1.0.8: phone field with country flag (job application form) ---------- */
.sjb-page .iti { display: block; width: 100%; }
.sjb-page .iti--allow-dropdown input[type="tel"] { padding-left: 64px; }
.sjb-page .iti__flag-container { padding: 1px; }
.sjb-page .iti--allow-dropdown .iti__selected-flag { height: 100%; display: flex; align-items: center; padding: 0 10px 0 16px; background: var(--wp--preset--color--surface); border-right: 1px solid #D2D5DB; border-radius: 12px 0 0 12px; }
.sjb-page .iti__country-list { border-radius: 12px; }
.teq-tel-hint { font-size: 14px; color: var(--wp--preset--color--muted); margin-top: 6px; }

/* ---------- 1.0.12: mobile menu can scroll when it is taller than the screen ---------- */
@media (max-width: 900px) {
	.teq-mobile[open] .teq-mobile__panel { max-height: calc(100vh - 53px); max-height: calc(100dvh - 53px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-sizing: border-box; }
	.admin-bar .teq-mobile[open] .teq-mobile__panel { max-height: calc(100vh - 99px); max-height: calc(100dvh - 99px); }
	body:has(.teq-mobile[open]) { overflow: hidden; }
	.teq-mobile .teq-nav .sub-menu a { font-size: 16px; padding: 6px 0; color: var(--wp--preset--color--muted); }
}
