/*
Theme Name: HB Auto & AC v2
Theme URI: https://www.hbautoandac.com/
Author: Rolando Cornejo
Description: Custom lightweight theme for HB Auto & AC, Huntington Beach. Single facts file, built-in schema graph, service-page template, offers and reviews post types, redirect map, photo gallery, and seeded page content. No page builder.
Version: 2.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: Proprietary
Text Domain: hbauto
*/

/* ---------- Tokens ---------- */
:root {
  --navy: #293b7e;        /* sampled from the classic HB logo */
  --navy-deep: #18244f;
  --red: #c8102e;         /* the shop's counter and wall red; buttons only */
  --red-dark: #a30d25;
  --ink: #15181f;
  --muted: #535b6b;
  --bay: #f1f3f7;         /* cool concrete grey */
  --line: #d6dae4;
  --white: #fff;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --gap: clamp(1rem, 3vw, 2rem);
  --section: clamp(3rem, 7vw, 5.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; font-family: var(--body); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 0.15em; }
a:hover { color: var(--navy-deep); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-style: italic; font-weight: 700; color: var(--navy); line-height: 1.12; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; margin: 0 0 1.2em; }
li { margin-bottom: 0.35em; }
.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.narrow { max-width: 46rem; }
.section { padding-block: var(--section); }
.section-bay { background: var(--bay); }
.section-navy { background: var(--navy-deep); color: #e8ebf5; }
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy a { color: var(--white); }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--ink); max-width: 44rem; }
.muted { color: var(--muted); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--white); padding: 0.75rem 1rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* The shop floor: the one decorative motif on the site */
.checker { height: 24px; background: conic-gradient(var(--ink) 25%, var(--white) 0 50%, var(--ink) 0 75%, var(--white) 0) 0 0 / 24px 24px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.7rem 1.4rem; border-radius: 4px; font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid var(--red); background: var(--red); color: var(--white); cursor: pointer; font-family: var(--body); }
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }
.btn-ghost { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-ghost:hover { background: var(--navy); border-color: var(--navy); color: var(--white); }
.section-navy .btn-ghost { border-color: var(--white); color: var(--white); }
.section-navy .btn-ghost:hover { background: var(--white); color: var(--navy-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--white); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; }
.site-logo img { width: 190px; height: auto; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-phone { font-weight: 700; text-decoration: none; white-space: nowrap; font-size: 1.1rem; }
.nav-toggle { display: none; background: none; border: 2px solid var(--navy); color: var(--navy); border-radius: 4px; min-height: 44px; padding: 0 0.9rem; font-weight: 700; font-size: 1rem; }
.site-nav ul { list-style: none; display: flex; gap: 0.2rem; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { display: block; padding: 0.6rem 0.7rem; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.98rem; border-radius: 4px; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current_page_item > a { color: var(--navy); background: var(--bay); }
.nav-bar { border-top: 1px solid var(--line); }
@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .header-actions .btn, .header-phone { display: none; }
  .nav-bar { display: none; }
  .nav-bar.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding-block: 0.5rem; }
  .site-nav a { padding: 0.85rem 0.25rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-logo img { width: 150px; }
}

/* ---------- Mobile action bar ---------- */
.action-bar { display: none; }
@media (max-width: 899px) {
  .action-bar { display: grid; grid-template-columns: 1fr 1fr; position: fixed; inset: auto 0 0 0; z-index: 60; box-shadow: 0 -2px 12px rgba(21, 24, 31, 0.18); }
  .action-bar a { display: flex; align-items: center; justify-content: center; min-height: 56px; font-weight: 800; text-decoration: none; font-size: 1.05rem; padding-bottom: env(safe-area-inset-bottom, 0); }
  .action-bar .ab-call { background: var(--navy); color: var(--white); }
  .action-bar .ab-book { background: var(--red); color: var(--white); }
  body { padding-bottom: 56px; }
}

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1fr; }
.hero-text { padding: clamp(2rem, 6vw, 4.5rem) var(--gap); max-width: 40rem; margin-inline: auto; width: 100%; }
.hero-since { font-family: var(--display); font-style: italic; font-size: 1.15rem; color: var(--muted); margin-bottom: 0.6rem; }
.hero-brand { margin-top: 1.75rem; font-weight: 700; color: var(--navy); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: stretch; min-height: 34rem; }
  .hero-text { margin: 0 0 0 auto; padding-left: max(var(--gap), calc((100vw - var(--wrap)) / 2)); max-width: none; align-self: center; }
  .hero-media { clip-path: polygon(9% 0, 100% 0, 100% 100%, 0 100%); } /* the slant of the italic logo */
  .hero-media img { aspect-ratio: auto; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-block: clamp(2rem, 5vw, 3.5rem); background: var(--bay); }
.page-hero-grid { display: grid; gap: var(--gap); align-items: center; }
.page-hero-media img { border-radius: 4px; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (min-width: 900px) { .page-hero-grid.has-media { grid-template-columns: 1.15fr 1fr; } }
.crumbs { font-size: 0.9rem; margin-bottom: 1rem; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--line); }

/* ---------- Trust bar ---------- */
.trust { border-block: 1px solid var(--line); padding-block: 1.5rem; background: var(--white); }
.trust ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; align-items: center; }
.trust li { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.trust img { height: 84px; width: auto; }
.trust .since-mark { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--navy); height: 84px; display: flex; align-items: center; }
@media (min-width: 760px) { .trust ul { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Service list ---------- */
.svc-grid { display: grid; gap: 0; grid-template-columns: 1fr; border-top: 2px solid var(--navy); }
.svc { display: block; padding: 1.25rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.svc h3 { margin: 0 0 0.3rem; }
.svc p { margin: 0; color: var(--muted); font-size: 1rem; }
.svc:hover h3 { text-decoration: underline; }
@media (min-width: 700px) { .svc-grid { grid-template-columns: repeat(2, 1fr); column-gap: var(--gap); } }
@media (min-width: 1040px) { .svc-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Split sections ---------- */
.split { display: grid; gap: var(--gap); align-items: center; }
.split img { border-radius: 4px; width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); } .split.flip > :first-child { order: 2; } }
.ticks { list-style: none; padding: 0; }
.ticks li { padding-left: 1.6rem; position: relative; margin-bottom: 0.6rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.7rem; height: 0.7rem; background: var(--navy); transform: skewX(-12deg); }

/* ---------- Process (a real sequence, so it is numbered) ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.5rem; }
.steps li { counter-increment: step; margin: 0; padding-top: 1rem; border-top: 2px solid rgba(255, 255, 255, 0.35); }
.steps li::before { content: counter(step); font-family: var(--display); font-style: italic; font-weight: 700; font-size: 2.2rem; line-height: 1; display: block; color: var(--white); margin-bottom: 0.4rem; }
.steps h3 { margin-bottom: 0.3rem; }
.steps p { margin: 0; font-size: 0.98rem; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Vehicles ---------- */
.veh { display: grid; gap: 1.5rem var(--gap); grid-template-columns: 1fr; }
.veh h3 { margin-bottom: 0.25rem; }
.veh p { margin: 0; color: var(--muted); }
@media (min-width: 700px) { .veh { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .veh { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Offers ---------- */
.offers { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.offer { border: 2px dashed var(--navy); border-radius: 4px; padding: 1.25rem 1.4rem; background: var(--white); display: flex; flex-direction: column; }
.offer h3 { font-size: 1.45rem; margin-bottom: 0.5rem; }
.offer .terms { font-size: 0.88rem; color: var(--muted); margin: 0 0 1rem; }
.offer .expires { font-size: 0.88rem; font-weight: 700; margin: 0 0 1rem; }
.offer .btn { margin-top: auto; align-self: flex-start; }
@media (min-width: 700px) { .offers { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .offers { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Reviews ---------- */
.reviews { display: grid; gap: 1.5rem; }
.review { margin: 0; padding: 0 0 0 1.25rem; border-left: 4px solid var(--navy); }
.review blockquote { margin: 0 0 0.6rem; font-size: 1.08rem; }
.review figcaption { font-weight: 700; font-size: 0.95rem; }
.review figcaption span { font-weight: 400; color: var(--muted); }
@media (min-width: 900px) { .reviews.cols { grid-template-columns: repeat(3, 1fr); } }
.review-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Team ---------- */
.team { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.team li { padding: 0.9rem 0; border-top: 1px solid var(--line); margin: 0; }
.team strong { font-family: var(--display); font-style: italic; font-size: 1.3rem; color: var(--navy); display: block; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 2px solid var(--navy); }
.faq summary { cursor: pointer; padding: 1.1rem 2rem 1.1rem 0; font-weight: 700; font-size: 1.08rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--navy); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0 1.2rem; max-width: 46rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Content ---------- */
.entry { max-width: 46rem; }
.entry h2 { margin-top: 1.8em; }
.entry h2:first-child { margin-top: 0; }
.entry-badge { float: right; margin: 0 0 1rem 1.5rem; width: 180px; }
.related ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
.related li { margin: 0; }
.related a { display: inline-block; padding: 0.55rem 1rem; border: 1px solid var(--navy); border-radius: 4px; text-decoration: none; font-weight: 600; }
.related a:hover { background: var(--navy); color: var(--white); }
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.post-list h2 { font-size: 1.5rem; margin-bottom: 0.3rem; }

/* ---------- Location ---------- */
.nap { font-style: normal; font-size: 1.1rem; line-height: 1.7; }
.nap strong { font-family: var(--display); font-style: italic; font-size: 1.5rem; color: var(--navy); }
.hours { border-collapse: collapse; margin: 1rem 0; }
.hours th, .hours td { text-align: left; padding: 0.3rem 1.5rem 0.3rem 0; font-weight: 400; }
.hours th { font-weight: 700; }
.map { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 4px; background: var(--bay); }

/* ---------- Forms ---------- */
.hb-form { display: grid; gap: 1rem; max-width: 36rem; }
.hb-form label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.hb-form input, .hb-form textarea { width: 100%; padding: 0.75rem 0.85rem; border: 1px solid #8891a5; border-radius: 4px; font: inherit; background: var(--white); color: var(--ink); min-height: 48px; }
.hb-form textarea { min-height: 8rem; }
.hb-form .hp { position: absolute; left: -9999px; }
.hb-form .hint { font-size: 0.88rem; color: var(--muted); font-weight: 400; }
.notice { padding: 1rem 1.2rem; border-left: 4px solid var(--navy); background: var(--bay); margin-bottom: 1.5rem; font-weight: 600; }
.notice.error { border-color: var(--red); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--navy); color: var(--white); padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.cta-band h2 { color: var(--white); margin-bottom: 0.3rem; }
.cta-band p { margin: 0; color: #dfe4f3; }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta-band .btn-ghost { border-color: var(--white); color: var(--white); }
.cta-band .btn-ghost:hover { background: var(--white); color: var(--navy); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #d5daea; padding-block: 3rem 2rem; font-size: 0.97rem; }
.site-footer a { color: var(--white); }
.footer-grid { display: grid; gap: 2rem; }
.site-footer h2 { font-size: 1.15rem; color: var(--white); margin-bottom: 0.7rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.footer-name { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1.7rem; color: var(--white); margin-bottom: 0.4rem; }
.footer-legal { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

/* ---------- Gallery (v2) ---------- */
.g-jump ul { list-style: none; padding: 0; margin: 0 0 2.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.g-jump li { margin: 0; }
.g-jump a { display: inline-block; padding: 0.5rem 0.9rem; border: 1px solid var(--navy); border-radius: 4px; text-decoration: none; font-weight: 600; font-size: 0.95rem; min-height: 44px; }
.g-jump a:hover { background: var(--navy); color: var(--white); }
.g-section { margin-bottom: 3rem; scroll-margin-top: 8rem; }
.g-section h2 { border-bottom: 2px solid var(--navy); padding-bottom: 0.4rem; margin-bottom: 1.25rem; }
.g-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.g-grid li { margin: 0; }
.g-grid figure { margin: 0; }
.g-item { display: block; border-radius: 4px; overflow: hidden; background: var(--bay); }
.g-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.25s ease; }
.g-item:hover img, .g-item:focus-visible img { transform: scale(1.04); }
.g-grid figcaption { font-size: 0.9rem; color: var(--muted); padding-top: 0.45rem; line-height: 1.4; }
@media (min-width: 700px) { .g-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .g-grid { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; } }

.g-box { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; background: rgba(13, 16, 28, 0.96); color: var(--white); }
.g-box[open] { display: grid; grid-template-rows: auto 1fr; }
.g-box::backdrop { background: rgba(13, 16, 28, 0.9); }
.g-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem; }
.g-count { margin: 0; font-weight: 600; }
.g-tools { display: flex; gap: 0.5rem; }
.g-box button { font: inherit; font-weight: 700; color: var(--white); background: transparent; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 4px; min-height: 44px; padding: 0 0.9rem; cursor: pointer; }
.g-box button:hover { background: var(--white); color: var(--ink); }
.g-box :focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }
.g-stage { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding: 0 3.75rem 1rem; }
.g-photo { max-width: 100%; max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); width: auto; height: auto; object-fit: contain; border-radius: 2px; }
.g-caption { padding-top: 0.75rem; text-align: center; font-size: 1rem; max-width: 46rem; }
.g-box .g-prev, .g-box .g-next { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; padding: 0; font-size: 2rem; line-height: 1; }
.g-prev { left: 0.4rem; }
.g-next { right: 0.4rem; }
@media (max-width: 699px) { .g-stage { padding: 0 0.5rem 5rem; } .g-box .g-prev, .g-box .g-next { top: auto; bottom: 0.75rem; transform: none; } .g-prev { left: 25%; } .g-next { right: 25%; } }
.g-box button, .g-count { white-space: nowrap; }
@media (max-width: 699px) { .g-box button { padding: 0 0.6rem; font-size: 0.92rem; } }
