/*
Theme Name: C4M
Description: C4M INFRA website (www.c4m.energy). Page text and form entries are edited in the WordPress admin.
Version: 1.0
*/

/* Colours from the C4M charger screens (HMI package C4M_UI_Changes_0.0.1). Contrast (WCAG 2.2 AA) is asserted in
   tests/php/frontend_test.php from inc/colors.php:
   - ink #000 on white 21:1, on fond 13.6:1; muted text #3D4248 on white 10.1:1, on fond 6.6:1.
   - teal #3B9AA0 (brand) is 3.3:1 on white: only for large headings (24px+), icons and rules on white.
   - teal-ink #1D5C60 (the brand teal darkened) is 7.6:1 on white and 5.0:1 on fond: links and small teal text.
   - orange #DE9C53 is 2.3:1 on white: never text on white. Used for the focus ring (with a black inner ring),
     the one app button (black text on orange, 9:1) and short rules. */
:root {
  --c4m-ink: #000;
  --c4m-muted: #3d4248;
  --c4m-paper: #fff;
  --c4m-fond: #cad1d9;
  --c4m-fond-soft: #eef1f4;
  --c4m-teal: #3b9aa0;
  --c4m-teal-ink: #1d5c60;
  --c4m-orange: #de9c53;
  --c4m-rule: #cad1d9;
  --c4m-font: "Carlito", "Calibri", "Segoe UI", system-ui, sans-serif;
  --wrap: 64rem;
  --measure: 40rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --space: clamp(3rem, 8vw, 5.5rem);
  --radius: 6px;
  color-scheme: light;
}

@font-face { font-family: "Carlito"; src: url("assets/fonts/carlito-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("assets/fonts/carlito-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 7rem; }
body {
  margin: 0; background: var(--c4m-paper); color: var(--c4m-ink);
  font: 400 1.125rem/1.6 var(--c4m-font); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--c4m-teal-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--c4m-orange); outline-offset: 2px; box-shadow: 0 0 0 2px var(--c4m-ink); border-radius: 2px; }
::selection { background: var(--c4m-fond); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; z-index: 10; padding: .6rem 1rem; background: var(--c4m-paper); color: var(--c4m-ink); }
.skip:focus { left: 1rem; top: .5rem; }
.icon { width: 2rem; height: 2rem; color: var(--c4m-teal); flex: none; }

/* Header: one sticky row on wide screens; on phones the four links sit on a second row. */
.site-header { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--c4m-rule); }
.header-row { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "brand tools" "nav nav"; align-items: center; column-gap: 1rem; padding-top: .5rem; padding-bottom: 0; }
.brand { grid-area: brand; display: inline-block; }
.brand img { height: 2.1rem; width: auto; }
@media (min-width: 52rem) { .brand img { height: 2.4rem; } }
.nav { grid-area: nav; margin: .25rem calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.nav ul, .langs { display: flex; gap: clamp(.9rem, 4vw, 1.25rem); margin: 0; padding: 0; list-style: none; }
.nav a { display: block; padding: .4rem 0 .5rem; color: var(--c4m-ink); text-decoration: none; white-space: nowrap; font-size: 1rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--c4m-fond); }
.nav a[aria-current="page"] { border-bottom-color: var(--c4m-teal); }
.tools { grid-area: tools; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
.langs { gap: .1rem; font-size: .9rem; }
.langs a { display: block; padding: .35rem .4rem; color: var(--c4m-muted); text-decoration: none; letter-spacing: .04em; }
.langs a[aria-current="true"] { color: var(--c4m-ink); font-weight: 700; }
.langs a:hover { color: var(--c4m-ink); }
.btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .55rem 1.1rem; border: 1px solid var(--c4m-ink); border-radius: var(--radius);
  font: 700 1rem/1.2 var(--c4m-font); color: var(--c4m-ink); background: var(--c4m-paper); text-decoration: none; cursor: pointer; }
.btn-cta { background: var(--c4m-orange); border-color: var(--c4m-orange); min-height: 2.5rem; padding: .45rem .9rem; }
.btn-cta:hover { background: #e8ae6e; border-color: #e8ae6e; }
.btn-primary { background: var(--c4m-ink); color: var(--c4m-paper); }
.btn-primary:hover { background: #22272c; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-cta .long { display: none; }

@media (min-width: 52rem) {
  .header-row { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav tools"; padding-top: .7rem; padding-bottom: .7rem; }
  .nav { margin: 0; padding: 0 2rem 0 1.5rem; overflow: visible; }
  .nav ul { justify-content: flex-end; }
  .nav ul { gap: 1.75rem; }
  .nav a { padding: .4rem 0; }
  .btn-cta .long { display: inline; }
  .btn-cta .short { display: none; }
}

/* Sections: white, the soft blue-grey band, or white under a thin rule. */
main { display: block; }
.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 5rem); }
@media (min-width: 46rem) { .hero h1 { max-width: 20ch; } }
.hero .wrap { display: grid; align-items: center; gap: 2rem; }
.hero-art { display: none; }
@media (min-width: 60rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr) 15rem; gap: 4rem; }
  .hero-art { display: block; width: 15rem; height: auto; color: var(--c4m-teal); }
}
.hero h1::before, .page-head h1::before { content: ""; display: block; width: 3rem; height: 3px; margin-bottom: 1.25rem; background: var(--c4m-orange); }
.lead { max-width: var(--measure); font-size: clamp(1.2rem, 2.2vw, 1.4rem); line-height: 1.5; color: var(--c4m-muted); }
.page-head { padding: clamp(3rem, 8vw, 5rem) 0 1rem; }
.page-head + .section { padding-top: 2rem; }
.section { padding: var(--space) 0; }
.section-tint { background: var(--c4m-fond-soft); border-top: 1px solid var(--c4m-rule); border-bottom: 1px solid var(--c4m-rule); }
.section-rule .wrap > :first-child { padding-top: 0; }
.section-rule { border-top: 1px solid var(--c4m-rule); }
.section-tint + .section-rule, .section-tint + .section { border-top: 0; }
.section p { max-width: var(--measure); }
.small { font-size: .95rem; color: var(--c4m-muted); margin-top: 1.5rem; }

/* Three ways to charge: a row of three on wide screens, separated by thin rules. */
.ways, .steps, .features { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0; }
.ways li { padding: 1.5rem 0; border-top: 1px solid var(--c4m-rule); }
.ways li:last-child { border-bottom: 1px solid var(--c4m-rule); }
.ways .icon { margin-bottom: .9rem; }
.ways h3 { margin-bottom: .35rem; }
.ways p, .steps p, .features p { margin: 0; color: var(--c4m-muted); }
@media (min-width: 46rem) {
  .ways { grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--c4m-rule); border-bottom: 1px solid var(--c4m-rule); }
  .ways li, .ways li:last-child { border: 0; padding: 1.75rem 1.75rem 1.75rem 0; }
  .ways li + li { border-left: 1px solid var(--c4m-rule); padding-left: 1.75rem; }
}

/* How it works: numbered steps. */
.steps { counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 1.25rem 0 1.25rem 3.25rem; border-top: 1px solid var(--c4m-rule); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 1.05rem; width: 2.1rem; height: 2.1rem; border: 1px solid var(--c4m-teal-ink); border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: var(--c4m-teal-ink); }
.steps h3 { margin-bottom: .2rem; }
@media (min-width: 46rem) {
  .steps { grid-template-columns: repeat(3, 1fr); column-gap: 2rem; }
  .steps li { padding: 4rem 0 0; border-top: 0; }
  .steps li::before { top: 0; }
  .steps li::after { content: ""; position: absolute; top: 1.05rem; left: 2.9rem; right: 0; height: 1px; background: var(--c4m-rule); }
}

/* An icon beside a short block (host a station, contact). */
.split { display: grid; gap: 1rem; }
.split .icon { width: 2.5rem; height: 2.5rem; }
@media (min-width: 46rem) { .split { grid-template-columns: 4rem 1fr; gap: 1.5rem; } }
.more { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; text-decoration: none; }
.more .icon { width: 1.15rem; height: 1.15rem; color: currentColor; transition: transform .15s ease; }
.more:hover .icon { transform: translateX(3px); }
.more:hover { text-decoration: underline; }

/* Feature lists (app, business, contact). */
.features li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.4rem 0; border-top: 1px solid var(--c4m-rule); }
.features li:last-child { border-bottom: 1px solid var(--c4m-rule); }
.features h2 { font-size: 1.2rem; margin-bottom: .25rem; }
.features .icon { margin-top: .1rem; }
@media (min-width: 46rem) {
  .features { grid-template-columns: repeat(2, 1fr); column-gap: 3rem; }
  .features li:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--c4m-rule); }
}

/* Store badges, drawn in CSS: neutral, not the stores' artwork. */
.stores { margin-top: 2rem; }
.badges { display: flex; flex-wrap: wrap; gap: .75rem; }
.badge { display: inline-flex; align-items: center; gap: .6rem; padding: .5rem 1.1rem .5rem .75rem; border: 1px solid var(--c4m-ink); border-radius: 10px;
  color: var(--c4m-ink); background: var(--c4m-paper); text-decoration: none; }
.badge .icon { width: 1.6rem; height: 1.6rem; color: var(--c4m-ink); }
.badge-text { display: grid; line-height: 1.15; }
.badge small { font-size: .78rem; color: var(--c4m-muted); }
.badge strong { font-size: 1.15rem; }
a.badge:hover { background: var(--c4m-ink); color: var(--c4m-paper); }
a.badge:hover .icon, a.badge:hover small { color: var(--c4m-paper); }
.stores[data-stores="soon"] .badge { border-color: #6b737c; }
.stores-note { display: flex; align-items: center; gap: .55rem; margin: .9rem 0 0; font-size: .95rem; color: var(--c4m-muted); }
.stores-note::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c4m-orange); flex: none; }

/* FAQ: native <details>. */
.faq { max-width: 46rem; margin: 1.5rem 0 2rem; border-top: 1px solid var(--c4m-rule); }
.faq details { border-bottom: 1px solid var(--c4m-rule); }
.faq summary { position: relative; padding: 1.1rem 2.5rem 1.1rem 0; cursor: pointer; list-style: none; font-weight: 700; font-size: 1.1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .35rem; top: 50%; width: .6rem; height: .6rem; margin-top: -.45rem;
  border-right: 1.5px solid var(--c4m-teal-ink); border-bottom: 1.5px solid var(--c4m-teal-ink); transform: rotate(45deg); transition: transform .15s ease; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -.1rem; }
.faq summary:hover { color: var(--c4m-teal-ink); }
.faq details p { margin: 0 0 1.25rem; color: var(--c4m-muted); }

/* Contact form. */
.form { max-width: 36rem; margin-top: 1.5rem; display: grid; gap: 1.25rem; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.field { display: grid; gap: .35rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-weight: 700; font-size: 1rem; padding: 0; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; padding: .7rem .8rem; border: 1px solid #6b737c; border-radius: var(--radius); background: var(--c4m-paper); color: var(--c4m-ink); font: inherit; }
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--c4m-ink); }
.choices { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.choices legend { margin-bottom: .35rem; width: 100%; }
.choice { display: inline-flex; align-items: center; gap: .45rem; font-weight: 400 !important; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--c4m-teal-ink); flex: none; }
.consent { grid-template-columns: auto 1fr; align-items: start; gap: .7rem; }
.consent input { margin-top: .25rem; }
.consent label { font-weight: 400; font-size: .98rem; color: var(--c4m-muted); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-status { margin: 0; font-size: 1rem; }
.form-status[data-state="sent"] { color: var(--c4m-teal-ink); font-weight: 700; }
.form-status[data-state="error"] { color: #8a1c1c; }

/* Legal texts. */
.prose { max-width: 46rem; font-size: 1.05rem; }
.prose h2 { font-size: 1.35rem; margin: 2.25rem 0 .6rem; }
.prose h3 { font-size: 1.1rem; margin: 1.6rem 0 .4rem; }
.prose > :first-child, .prose > div > :first-child { margin-top: 0; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .98rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .55rem .8rem .55rem 0; border-bottom: 1px solid var(--c4m-rule); }
.prose th { border-bottom-color: var(--c4m-ink); }
.legal-version { color: var(--c4m-muted); font-size: .95rem; }
.legal-note { display: inline-block; margin: .5rem 0 0; padding: .5rem .8rem; border-left: 3px solid var(--c4m-orange); background: var(--c4m-fond-soft); font-size: 1rem; }

/* Footer. */
.site-footer { border-top: 1px solid var(--c4m-rule); background: var(--c4m-fond-soft); padding: 3rem 0 2rem; font-size: 1rem; }
.footer-grid { display: grid; gap: 2rem; }
.footer-brand img { height: 2rem; width: auto; margin-bottom: 1rem; }
.footer-brand p { margin: 0; color: var(--c4m-muted); }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-links a { color: var(--c4m-ink); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.site-footer .stores { margin-top: 0; }
.site-footer .badge { background: transparent; }
.footer-base { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; margin: 2.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--c4m-rule); color: var(--c4m-muted); font-size: .92rem; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 1.1fr 1fr auto; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .stores, .form { display: none; }
  .faq details > * { display: block; }
}
