/*
Theme Name: Pesat CTM
Author: Pesat CTM 3S
Description: A lightweight, accessible WordPress block theme for Pesat CTM 3S. No page builder required.
Version: 1.4.0
Requires at least: 6.6
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: pesat-ctm
*/

:root {
  --red: #dc2332;
  --ink: #182025;
  --muted: #5b6369;
  --soft: #f3f5f5;
  --line: #dee2e3;
  --section-space: clamp(48px, 6vw, 80px);
  --gutter: clamp(20px, 4vw, 40px);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #fff; font: 16px/1.65 Arial, Helvetica, sans-serif; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: #b61326; }
button, input, select, textarea { font: inherit; }
a, button, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid #b61326; }
:where(h1, h2, h3, p, figure) { margin: 0; }
h1, h2, h3 { line-height: 1.16; letter-spacing: -.035em; font-weight: 700; overflow-wrap: anywhere; }
h1 { font-size: clamp(40px, 5.4vw, 72px); }
h2 { font-size: clamp(30px, 3.4vw, 46px); }
h3 { font-size: 24px; letter-spacing: -.02em; }
p { overflow-wrap: anywhere; }
main, .wp-block-post-content { margin: 0 !important; }
.wp-site-blocks { padding: 0; }
.wp-site-blocks > *, .wp-block-post-content > * { margin-block: 0; }
.container { width: 100%; max-width: 1240px; margin-inline: auto !important; padding-inline: var(--gutter); }
/* Allow grid children to shrink to the viewport without clipping their text. */
:is(.hero-layout, .quick-grid, .car-grid, .service-grid, .form-grid, .header-row) > * { min-width: 0; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; line-height: 1.5; text-transform: uppercase; }
.brand { display: block; text-decoration: none; line-height: 1.2; }
.brand-mark { display: none; }
.brand b { font-size: 22px; letter-spacing: -.6px; }
.brand small { display: block; margin-top: 7px; font-size: 9px; letter-spacing: 1.35px; color: var(--muted); }
.container.section > :is(h1,h2,h3,p) { margin-bottom: 24px; }
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-row { min-height: 96px; padding-block: 20px; display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: center; gap: 24px; }
/* Both the editable WordPress title and the preview wordmark use this layout. */
.header-row .brand { display: block; min-width: 0; text-decoration: none; line-height: 1.2; }
.header-row .wp-block-site-title { margin: 0; font-size: 22px !important; line-height: 1.2; letter-spacing: -.6px; overflow-wrap: normal; }
.wp-block-site-title a { text-decoration: none; }
.header-row .brand > .eyebrow { margin: 7px 0 0; font-size: 9px; line-height: 1.5; letter-spacing: 1.35px; color: var(--muted); }
.header-row .brand-mark { display: none; }
.header-row .brand b { font-size: 22px; letter-spacing: -.6px; }
.header-row .brand small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; letter-spacing: 1.35px; line-height: 1.5; }
.header-row .wp-block-navigation { justify-self: end; }
.wp-block-navigation a, .nav a { font-size: 13px; font-weight: 600; text-decoration: none; }
.wp-block-navigation__container, .nav { gap: 20px; }
.nav { display: flex; align-items: center; }
.nav a { white-space: nowrap; }
.nav a[aria-current=page] { color: var(--red); }
.nav .language { border-left: 1px solid var(--line); padding-left: 16px; }
.menu-toggle { display: none; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
/* Vertical rhythm is scoped so WordPress flow layout rules cannot collapse it. */
:is(.hero-copy, .page-hero > .container, .section > .container, .steps, .service-card, .car-card) > :is(h1,h2,h3,p) { margin: 0 0 16px; }
:is(.hero-copy, .page-hero > .container, .section > .container) > .eyebrow { margin-bottom: 20px; }
:is(.hero-copy, .page-hero > .container, .section > .container) > :is(h1,h2) { margin-bottom: 24px; }
:is(.hero-copy, .page-hero > .container, .section > .container, .steps, .service-card, .car-card) > :last-child { margin-bottom: 0; }
.section { padding-block: var(--section-space); }
.section > .container > p:not(.eyebrow) { max-width: 660px; color: var(--muted); }
.hero { position: relative; background: #f0f2f2; }
.hero-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.12fr); align-items: center; gap: 32px; padding-block: 64px; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy > p:not(.eyebrow):not(.hero-note) { max-width: 440px; color: var(--muted); font-size: 17px; }
.hero-copy > .hero-note { margin: 24px 0 0; color: var(--muted); font-size: 10px; letter-spacing: 1.6px; line-height: 1.7; }
.hero-visual { position: relative; width: 100%; min-width: 0; }
.hero-visual::before { content: ""; position: absolute; inset: 8% 0; border-radius: 50%; background: #e3e8e8; }
.hero-visual .wp-block-image { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 3/2; margin: 0; }
.hero-visual .wp-block-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hero-visual .image-caption { position: relative; margin: 16px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.image-caption span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.wp-block-image img { display: block; max-width: 100%; height: auto; object-fit: contain; }
/* Pair existing, separately wrapped Buttons blocks without rewriting saved pages. */
.hero-copy > .button-row, .button-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: 12px; max-width: 440px; margin: 24px 0 0; }
.button-row > .wp-block-buttons { display: flex; align-items: stretch; width: 100%; min-width: 0; margin: 0; }
.button-row > .wp-block-buttons > .wp-block-button { display: flex; flex: 1 1 0; width: 100%; min-width: 0; margin: 0; }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.section > .container > .wp-block-buttons { margin-top: 24px; }
.wp-block-button { max-width: 100%; }
/* Match native button specificity to override core padding, color and border defaults. */
.wp-block-button .wp-block-button__link, .pesat-form .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; max-width: 100%; padding: 13px 22px;
  border: 1px solid var(--red); border-radius: 4px;
  background: var(--red); color: #fff; box-shadow: none;
  font-size: 14px; font-weight: 600; line-height: 1.45;
  text-align: center; text-decoration: none; white-space: normal; overflow-wrap: anywhere;
}
.button-row .wp-block-button .wp-block-button__link { width: 100%; padding-inline: 12px; }
.wp-block-button .wp-block-button__link:hover, .pesat-form .wp-block-button__link:hover { background: #b81728; border-color: #b81728; color: #fff; }
.wp-block-button.is-style-outline .wp-block-button__link { border: 1px solid #7b858b; background: transparent; color: var(--ink); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { border-color: var(--ink); background: #fff; color: var(--ink); }
.quick-links { border-bottom: 1px solid var(--line); }
.quick-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; padding-block: 32px; }
.quick-item { display: flex; align-items: flex-start; gap: 16px; padding-right: 24px; border-right: 1px solid var(--line); }
.quick-item:last-child { padding-right: 0; border-right: 0; }
.quick-item > .wp-block-group { min-width: 0; }
.quick-item .number { margin: 2px 0 0; color: var(--red); font-size: 12px; }
.quick-item h3 { margin: 0 0 8px; font-size: 21px; }
.quick-item p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.quick-item p:last-child { margin-bottom: 0; }
.quick-item a, .service-card a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 13px; font-weight: 600; }
.car-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin: 32px 0; }
.car-card { min-width: 0; padding: 24px; background: var(--soft); }
.car-card .wp-block-image { display: grid; place-items: center; width: 100%; aspect-ratio: 3/2; margin: 0 0 20px; }
.car-card img { width: 100%; height: 100%; object-fit: contain; }
.car-card > .eyebrow { margin-bottom: 8px; font-size: 10px; }
.car-card h3 { font-size: 34px; }
.car-card p { font-size: 14px; }
.car-card p:last-child { margin-top: 20px; }
.car-card a { display: flex; align-items: center; min-height: 44px; padding-top: 16px; border-top: 1px solid #d6dcde; font-size: 13px; font-weight: 600; }
.soft { background: var(--soft); }
.service-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; margin-top: 32px; }
.service-card { padding-top: 24px; border-top: 1px solid #cbd1d3; }
.service-card h3 { font-size: 23px; }
.service-card > p { color: var(--muted); font-size: 15px; }
.cta { border-top: 4px solid var(--red); background: var(--ink); color: #fff; }
.cta > .container > p:not(.eyebrow) { color: #c2c9cc; }
.cta h2 { max-width: 760px; }
.page-hero { padding-block: var(--section-space); background: var(--soft); }
.narrow { max-width: 1240px; }
.page-hero h1 { max-width: 900px; font-size: clamp(36px,5vw,64px); }
.page-hero p { max-width: 720px; color: var(--muted); }
.steps { max-width: 760px; padding: 8px 0 8px 24px; margin: 32px 0; border-left: 3px solid var(--red); }
.steps h3 { font-size: 23px; }
.steps p { color: var(--muted); }
.steps > p + h3 { margin-top: 28px; }
.pesat-form { width: 100%; max-width: 760px; margin-top: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.pesat-form label { display: block; font-size: 14px; font-weight: 600; }
.pesat-form :is(input:not([type=checkbox]),select,textarea) { display: block; width: 100%; min-width: 0; margin: 8px 0 24px; padding: 12px; border: 1px solid #9da8ad; border-radius: 4px; background: #fff; color: var(--ink); font-size: 16px; font-weight: 400; }
.pesat-form textarea { min-height: 152px; resize: vertical; }
.pesat-form .consent { margin-bottom: 24px; font-size: 14px; font-weight: 400; }
.pesat-form input[type=checkbox] { width: 18px; height: 18px; margin: 0 6px 0 0; vertical-align: middle; }
.pesat-form button { cursor: pointer; }
.notice { margin-bottom: 24px; padding: 20px; border-left: 3px solid var(--red); background: var(--soft); }
.hp { position: absolute; left: -10000px; }
.site-footer { padding-block: 48px 24px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 32px; }
.footer-top > * { min-width: 0; }
.footer-top .wp-block-site-title { margin: 0; font-size: 22px; line-height: 1.3; }
.footer-top p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 14px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-note { margin: 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 100; padding: 12px; background: #fff; }
.skip-link:focus { top: 12px; }
.preview-label { padding: 8px 16px; background: var(--ink); color: #cbd2d5; text-align: center; font-size: 11px; }
.preview-label a { color: #fff; }
.preview-form-note { color: var(--muted); font-size: 14px; }
@media (max-width: 1200px) {
  .header-row { grid-template-columns: minmax(0,1fr) auto; }
  .site-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
  .site-header .wp-block-navigation__responsive-container-open { display: flex !important; align-items: center; justify-content: center; width: 44px; height: 44px; }
  .site-header .wp-block-navigation__responsive-container.is-menu-open { padding: 24px; }
  .site-header .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 56px; align-items: stretch; }
  .site-header .is-menu-open .wp-block-navigation__container { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .site-header .is-menu-open .wp-block-navigation-item__content { display: flex; align-items: center; min-height: 44px; font-size: 17px; }
  .site-header .wp-block-navigation__responsive-container-close { width: 44px; height: 44px; }
  .menu-toggle { display: block; justify-self: end; }
  .nav { display: none; grid-column: 1/-1; width: 100%; padding-top: 8px; }
  .nav.open { display: flex; flex-wrap: wrap; gap: 8px 24px; }
  .nav a { display: flex; align-items: center; min-height: 44px; font-size: 15px; }
}
@media (max-width: 800px) {
  .header-row { min-height: 88px; padding-block: 18px; gap: 16px; }
  .hero-layout { grid-template-columns: minmax(0,1fr); gap: 32px; padding-block: 48px; }
  .hero-copy h1 { font-size: clamp(32px,9vw,56px); }
  .hero-copy > p:not(.eyebrow):not(.hero-note) { max-width: 600px; font-size: 16px; }
  .hero-visual { max-width: 560px; margin-inline: auto; }
  .hero-visual .image-caption { margin-top: 12px; }
  .quick-grid { grid-template-columns: minmax(0,1fr); gap: 0; padding-block: 8px; }
  .quick-item { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .quick-item:last-child { border-bottom: 0; }
  .car-grid { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .car-card { padding: 24px; }
  .car-card .wp-block-image { max-width: 440px; margin-inline: auto; }
  .service-grid { grid-template-columns: minmax(0,1fr); gap: 32px; }
  .form-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
  .footer-top { flex-direction: column; gap: 20px; }
  .site-footer { padding-top: 40px; }
  .steps { padding-left: 20px; }
}
@media (max-width: 359px) {
  .hero-copy > .button-row, .button-row { grid-template-columns: minmax(0,1fr); }
  .header-row .wp-block-site-title, .header-row .brand b { font-size: 20px !important; }
  .header-row .brand > .eyebrow { font-size: 8px; letter-spacing: 1px; }
}
@media (prefers-reduced-motion: no-preference) {
  .wp-block-button__link, .menu-toggle { transition: background-color .18s, border-color .18s, color .18s; }
}
/* Beat core flow spacing without resetting every block on the website. */
.section > .container > .car-grid { margin: 32px 0; }
.section > .container > .service-grid { margin-top: 32px; }
.section > .container > .steps { margin: 32px 0; }
.site-header .wp-block-navigation__responsive-container-close { display: grid; place-items: center; }
.section > .container > :is(.car-grid, .steps, .service-grid):last-child { margin-bottom: 0; }
/* Version 1.3: keep the marque and dealership name together at every width. */
.header-row .brand.pesat-header-brand { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 14px; align-items: center; }
.header-row .pesat-proton-logo { display: block; width: 60px; height: 45px; max-width: 100%; object-fit: contain; }
.header-row .pesat-brand-copy { min-width: 0; }
.header-row .pesat-brand-copy > .eyebrow { margin: 7px 0 0; color: var(--muted); font-size: 9px; letter-spacing: 1.35px; line-height: 1.5; }
@media (max-width: 800px) {
  .header-row .brand.pesat-header-brand { grid-template-columns: 44px minmax(0,1fr); gap: 10px; }
  .header-row .pesat-proton-logo { width: 44px; height: 33px; }
  .header-row .pesat-brand-copy > .eyebrow { font-size: 8px; letter-spacing: 1px; }
}

/* The model artwork now supplies its own angled white panel. */
.hero-visual::before { content: none; }

/* X50's generated canvas contains extra inset space. Normalize its visible
   panel height to the brochure artwork without stretching the vehicle.
   Clip only this image viewport, never page content or keyboard controls. */
.car-card .wp-block-image:has(img[src*="proton-x50-enhanced.png"]) { clip-path: inset(0); }
.car-card .wp-block-image img[src*="proton-x50-enhanced.png"] { transform: scale(1.16); transform-origin: center; }
.pesat-sales-advisor-vacancy .wp-block-buttons { margin-block: 24px; }
