/*
Theme Name: Help Auto Diagnostics
Theme URI: https://helpauto.ro
Author: Marvisio
Description: Temă pentru Help Auto Diagnostics — diagnoză auto, Soluția Help și mobilitate. Conținutul se editează din Gutenberg (pattern-uri incluse) sau Elementor.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: had
*/

/* =========================================================
   1. Variabile          6. Secțiuni (clase puse pe blocuri)
   2. Bază               7. Componente de conținut
   3. Butoane            8. Bandă CTA, articole
   4. Topbar & header    9. Footer & bara de pe mobil
   5. Hero-uri (Cover)  10. Responsive
   Culorile și fonturile sunt definite și în theme.json (pentru editor).
   ========================================================= */

/* ---------- 1. Variabile ---------- */
:root {
  --navy: #02112e;
  --blue: #0259cc;
  --blue-dark: #0347a8;
  --ink: #1b2333;
  --muted: #5d6676;
  --line: #dfe3ea;
  --bg: #f3f5f8;
  --white: #fff;
  --radius: 6px;
  --container: 1200px;
  --header-h: 84px;
  --font-head: "Barlow", "Arial Narrow", sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

/* ---------- 2. Bază ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font-family: var(--font-body); color: var(--ink); }
img { max-width: 100%; height: auto; }
.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 10px; top: 10px; z-index: 100; padding: 10px 16px; background: var(--white); }

/* ---------- 3. Butoane (blocul „Buton” + butoanele din temă) ---------- */
.wp-block-button__link, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px; border-radius: var(--radius); border: 2px solid transparent;
  background: var(--blue); color: var(--white);
  font: 600 1rem/1.1 var(--font-head); letter-spacing: .05em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; transition: background .2s, color .2s, border-color .2s;
}
.wp-block-button__link:hover, .btn:hover { background: var(--blue-dark); color: var(--white); }
/* stil „Contur” (din editor) */
.is-style-outline .wp-block-button__link { background: transparent; border-color: var(--navy); color: var(--navy); }
.is-style-outline .wp-block-button__link:hover { background: var(--navy); color: var(--white); }
/* stil „Contur alb” */
.is-style-outline-light .wp-block-button__link, .btn--outline-light { background: transparent; border-color: rgba(255, 255, 255, .6); color: var(--white); }
.is-style-outline-light .wp-block-button__link:hover, .btn--outline-light:hover { background: var(--white); border-color: var(--white); color: var(--navy); }
/* stil „Alb” */
.is-style-light .wp-block-button__link, .btn--white { background: var(--white); color: var(--navy); }
.is-style-light .wp-block-button__link:hover, .btn--white:hover { background: var(--navy); color: var(--white); }
.wp-block-buttons { gap: 12px; }

/* link de tip „Află mai multe ›” (paragraf cu clasa more-link) */
.more-link a { font: 600 1rem/1.3 var(--font-head); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; color: var(--blue); }
.more-link a::after { content: " ›"; font-size: 1.2em; }
.more-link a:hover { text-decoration: underline; text-underline-offset: 4px; }
.on-dark .more-link a { color: #9dbcf2; }

/* ---------- 4. Topbar & header ---------- */
.topbar { background: var(--navy); color: #aeb9cc; font-size: .92rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 42px; }
.topbar ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.topbar li { display: flex; align-items: center; gap: 8px; }
.topbar svg { width: 15px; height: 15px; color: #7fa8ee; }
.topbar a { color: var(--white); text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
.site-header.is-scrolled { box-shadow: 0 2px 12px rgba(2, 17, 46, .08); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.custom-logo-link { flex: none; display: block; }
.custom-logo { display: block; height: 34px; width: auto; }

.nav { height: 100%; }
.nav__list { display: flex; align-items: center; gap: 20px; height: 100%; list-style: none; margin: 0; padding: 0; }
.nav__list li { height: 100%; }
.nav__list a {
  display: flex; align-items: center; height: 100%; position: relative;
  color: var(--navy); text-decoration: none; white-space: nowrap;
  font: 600 .95rem/1 var(--font-head); letter-spacing: .03em; text-transform: uppercase;
}
.nav__list a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--blue); transform: scaleX(0); transition: transform .2s; }
.nav__list a:hover::after, .nav__list a[aria-current="page"]::after { transform: scaleX(1); }
.nav__list a[aria-current="page"] { color: var(--blue); }

.menu-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--navy); }
.menu-toggle svg { width: 30px; height: 30px; display: block; }

/* ---------- 5. Hero-uri (blocul „Cover” cu clasele hero / page-hero / message) ---------- */
.wp-block-cover.hero, .wp-block-cover.page-hero, .wp-block-cover.message { padding: 0; margin-block: 0; }
.hero .wp-block-cover__inner-container,
.page-hero .wp-block-cover__inner-container,
.message .wp-block-cover__inner-container { width: min(100% - 40px, var(--container)); margin-inline: auto; color: #d3dbe9; }

/* Hero mare (Acasă): strat în degrade peste poză */
.wp-block-cover.hero { min-height: 640px; }
.hero .wp-block-cover__background { background: linear-gradient(90deg, rgba(2, 17, 46, .95) 0%, rgba(2, 17, 46, .85) 40%, rgba(2, 17, 46, .2) 100%) !important; opacity: 1 !important; }
.hero .wp-block-cover__inner-container { padding-block: 80px; }
.hero .wp-block-cover__inner-container > * { max-width: 680px; }
.hero h1 { color: var(--white); }
.hero .subtitle { font: 500 1.45rem/1.4 var(--font-head); color: var(--white); }

/* Hero pagini interioare */
.wp-block-cover.page-hero { min-height: 0; }
.page-hero .wp-block-cover__inner-container { padding-block: 70px 76px; }
.page-hero .wp-block-cover__inner-container > * { max-width: 860px; }
.page-hero h1 { color: var(--white); }
.page-hero p { font-size: 1.2rem; }
.breadcrumb { margin: 0 0 18px; font-size: .95rem !important; color: #93a1bb; }
.breadcrumb a { color: #c3cde0; text-decoration: none; }
.breadcrumb a:hover { color: var(--white); text-decoration: underline; }

/* Hero simplu generat de temă (articole, pagini fără Cover) */
.page-hero--plain { background: var(--navy); color: #d3dbe9; }
.page-hero--plain .container { padding-block: 64px 70px; }
.page-hero--plain h1 { margin: 0; max-width: 860px; color: var(--white); font: 700 clamp(2rem, 4vw, 3.1rem)/1.12 var(--font-head); }

/* Bandă cu poză și mesaj mare */
.message .wp-block-cover__inner-container { padding-block: 110px; text-align: center; }
.message .wp-block-cover__inner-container > * { max-width: 900px; margin-inline: auto; }
.message .big { font: 700 clamp(2rem, 4.6vw, 3.6rem)/1.1 var(--font-head); color: var(--white); }
.message .big--sm { font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.25; }
.message .wp-block-buttons { justify-content: center; }

/* ---------- 6. Secțiuni (clase puse pe blocul „Grup”) ---------- */
.entry-content > .alignfull { margin-block: 0; }
.section { padding-block: 100px; }
.section--sm { padding-block: 64px; }
.section--bg { background: var(--bg); }
.section--dark { background: var(--navy); color: #c3cde0; }
.section--dark h2, .section--dark h3 { color: var(--white); }
.section-head { margin-bottom: 52px; }
.section-head > * { max-width: 720px; }

.kicker { font: 600 .95rem/1.2 var(--font-head) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.kicker + .wp-block-heading { margin-top: .6rem; }
.wp-block-heading + .lead, .wp-block-heading + .tagline { margin-top: .8rem; }
.wp-block-image img { display: block; }
.section--dark .kicker { color: #7fa8ee; }
.lead { font-size: 1.2rem; color: var(--muted); }
.muted { color: var(--muted); }
.note { font-size: .95rem; color: var(--muted); }
.label { font: 600 .9rem/1.3 var(--font-head) !important; letter-spacing: .05em; text-transform: uppercase; color: var(--blue); margin-bottom: -.6rem !important; }

/* Două coloane text + imagine (blocul „Coloane” cu clasa split) */
/* nucleul WP pune align-items: normal !important pe Coloane, de aceea !important aici */
.wp-block-columns.split { gap: 72px; align-items: center !important; margin: 0; }
.wp-block-columns.split--top { align-items: flex-start !important; }
.split .wp-block-image img, .services .wp-block-image img { width: 100%; object-fit: cover; border-radius: var(--radius); }
.split .wp-block-image img { aspect-ratio: 4 / 3; }
.wp-block-image { margin: 0; }

/* Bara cu 4 informații de sub hero */
.facts { border-bottom: 1px solid var(--line); }
.facts .wp-block-columns { gap: 0; margin: 0; }
.facts .wp-block-column { padding: 30px 28px; border-left: 1px solid var(--line); }
.facts .wp-block-column:first-child { border-left: 0; padding-left: 0; }
.facts .value { margin: 0; font: 700 1.7rem/1.1 var(--font-head); color: var(--navy); }
.facts .wp-block-column p:not(.value) { margin-top: 4px; color: var(--muted); font-size: 1rem; }

/* ---------- 7. Componente de conținut ---------- */
/* Coloane de servicii cu poză */
.wp-block-columns.services { gap: 28px; }
.services .wp-block-image img { aspect-ratio: 3 / 2; }
.services p:not(.label):not(.more-link) { color: var(--muted); }

/* Pași numerotați pe grilă (Acasă) */
ol.process { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; }
.process li { counter-increment: step; padding: 26px 0 34px; border-top: 2px solid var(--line); font-size: 1.08rem; }
.process li::before { content: counter(step); display: block; margin-bottom: 10px; font: 700 2.4rem/1 var(--font-head); color: var(--blue); }
.process li:last-child { border-top-color: var(--blue); }

/* Pași pe rânduri (Soluția Help): <strong> = titlul pasului */
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; border-bottom: 1px solid var(--line); }
.steps li { counter-increment: step; position: relative; padding: 30px 0 30px 90px; border-top: 1px solid var(--line); color: var(--muted); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 26px; font: 700 2.6rem/1 var(--font-head); color: var(--blue); }
.steps strong { display: block; margin-bottom: 4px; font: 600 1.4rem/1.2 var(--font-head); color: var(--navy); }

/* Listă cu marcaj pătrat albastru */
ul.list { list-style: none; padding: 0; }
.list li { position: relative; padding-left: 24px; margin-bottom: 9px; }
.list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; background: var(--blue); }
.section--dark .list li::before { background: #7fa8ee; }
.list--cols { columns: 2; column-gap: 40px; }
.list--cols li { break-inside: avoid; }

/* Listă de articole (blocul „Buclă de interogare” cu clasa rows) */
.rows .wp-block-post-template, ul.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows .wp-block-post, ul.rows li { margin: 0; border-bottom: 1px solid var(--line); }
.rows .wp-block-post-title { margin: 0; font-size: 1.3rem; }
.rows .wp-block-post-title a, ul.rows a {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 4px;
  color: var(--navy); text-decoration: none; font: 600 1.3rem/1.3 var(--font-head); transition: color .2s, padding .2s;
}
.rows .wp-block-post-title a::after, ul.rows a::after { content: "›"; font-size: 1.8rem; line-height: 1; color: var(--blue); }
.rows .wp-block-post-title a:hover, ul.rows a:hover { color: var(--blue); padding-left: 10px; }

/* Frază scoasă în evidență */
.pull { padding-left: 24px; border-left: 4px solid var(--blue); font: 500 1.45rem/1.4 var(--font-head) !important; color: var(--navy); }
.section--dark .pull { color: var(--white); }

/* Bloc gri, card cu bordură */
.panel { padding: 34px; border-radius: var(--radius); background: var(--bg); }
.card { padding: 34px; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius); background: var(--white); }
.card p:not(.label):not(.more-link) { color: var(--muted); }
.wp-block-columns.cards { gap: 28px; }

/* Bloc serviciu (pagina Servicii) */
.service + .service { margin-top: 90px !important; padding-top: 90px; border-top: 1px solid var(--line); }
.tagline { font: 600 1.35rem/1.35 var(--font-head) !important; color: var(--blue); }
.price { padding: 14px 20px; border-left: 4px solid var(--blue); background: var(--bg); font-weight: 600; color: var(--navy); }

/* Povești pro bono */
.wp-block-columns.story { gap: 56px; margin: 0; padding-block: 48px; border-top: 1px solid var(--line); }
.wp-block-columns.story:last-child { border-bottom: 1px solid var(--line); }
.story h3 { font-size: 1.8rem; }
.story p:not(.pull) { color: var(--muted); }

/* Flotă */
.wp-block-columns.fleet { gap: 0; border: 1px solid var(--line); border-radius: var(--radius); margin: 0; }
.fleet .wp-block-column { padding: 34px 28px; border-left: 1px solid var(--line); }
.fleet .wp-block-column:first-child { border-left: 0; }
.fleet p { margin: 0; font: 700 1.6rem/1.2 var(--font-head); color: var(--navy); }

/* Valori (Despre noi) */
.wp-block-columns.values { gap: 28px; }
.values .wp-block-column { padding-top: 20px; border-top: 3px solid var(--blue); }
.values h3 { font-size: 1.35rem; }
.values p { font-size: 1rem; color: #a6b3ca; }

/* Tabel date de contact */
.contact-table table { border-collapse: collapse; width: 100%; }
.contact-table td { padding: 20px 0; border: 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.contact-table tr:first-child td { border-top: 1px solid var(--line); }
.contact-table td:first-child { width: 190px; padding-right: 20px; font: 600 .95rem/1.6 var(--font-head); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.contact-table td:last-child { font: 600 1.25rem/1.5 var(--font-head); color: var(--navy); }
.contact-table a { color: var(--navy); text-decoration: none; }
.contact-table a:hover { color: var(--blue); }

/* Hartă (înlocuiți cu blocul „Încorporare” sau „HTML personalizat”) */
.map { min-height: 380px; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--muted); border: 1px dashed #c3cad6; border-radius: var(--radius); background: var(--white); }
iframe { max-width: 100%; }

/* ---------- 8. Bandă CTA, articole ---------- */
.cta { background: var(--blue); color: #e3ecfb; }
.cta.wp-block-group { padding-block: 72px; }
.cta h2 { color: var(--white); }
.cta .small { font-size: .95rem; color: #c3d6f6; }
.cta .wp-block-columns { align-items: center !important; gap: 48px; margin: 0; }
.cta .wp-block-buttons { justify-content: flex-end; }
/* varianta generată de temă (sub articole) */
.cta--php .cta__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; padding-block: 72px; }
.cta--php h2 { margin: 0 0 .4em; font: 700 clamp(1.9rem, 3.4vw, 2.6rem)/1.12 var(--font-head); }
.cta--php p { margin: 0 0 .4em; }
.cta__buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

.article { width: min(100% - 40px, 760px); margin-inline: auto; padding-block: 64px 80px; font-size: 1.15rem; }
.article__back { margin-top: 40px; }
.article__back .link { font: 600 1rem/1.3 var(--font-head); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
.article__back .link::before { content: "‹ "; }

/* ---------- 9. Footer & bara de pe mobil ---------- */
.site-footer { background: #010b1f; color: #8f9cb5; font-size: 1rem; padding-top: 72px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1.3fr 1.2fr; gap: 48px; }
.footer-logo { display: block; height: 34px; width: auto; margin-bottom: 22px; }
.site-footer h4 { margin: 0 0 18px; color: var(--white); font: 700 1.05rem/1.2 var(--font-head); letter-spacing: .06em; text-transform: uppercase; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer .footer-menu { grid-template-columns: 1fr 1fr; column-gap: 24px; }
.site-footer a { color: #c3cde0; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-block: 24px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .9rem; }

.mobile-bar { display: none; }

/* ---------- 10. Responsive ---------- */
@media (max-width: 1180px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; height: auto;
    padding: 8px 20px 20px; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(2, 17, 46, .1);
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a { height: auto; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .nav__list a::after { display: none; }
}

@media (max-width: 980px) {
  ol.process { grid-template-columns: 1fr 1fr; }
  .footer-grid, .cta--php .cta__inner { grid-template-columns: 1fr; }
  .cta__buttons, .cta .wp-block-buttons { justify-content: flex-start; }
  .topbar .hide-md { display: none; }
}

/* sub 782px blocul „Coloane” trece automat pe un rând */
@media (max-width: 781px) {
  .wp-block-columns.split, .wp-block-columns.story { gap: 32px; }
  .facts .wp-block-columns { flex-wrap: wrap !important; }
  .facts .wp-block-column { flex-basis: 50% !important; padding: 18px 0 18px 16px; }
  .facts .wp-block-column:nth-child(odd) { border-left: 0; padding-left: 0; }
  .facts .wp-block-column:nth-child(n+3) { border-top: 1px solid var(--line); }
  .facts .value { font-size: 1.3rem; }
  .fleet .wp-block-column { border-left: 0; border-top: 1px solid var(--line); }
  .fleet .wp-block-column:first-child { border-top: 0; }
}

@media (max-width: 680px) {
  :root { --header-h: 68px; }
  body:has(.mobile-bar) { padding-bottom: 64px; /* loc pentru bara de pe mobil (lipsește pe Elementor Canvas) */ }
  .admin-bar .site-header { top: 0; }
  .section { padding-block: 68px; }
  .topbar { display: none; }
  .custom-logo { height: 28px; }
  .wp-block-cover.hero { min-height: 0; }
  .hero .wp-block-cover__inner-container { padding-block: 64px 72px; }
  .hero .wp-block-cover__background { background: rgba(2, 17, 46, .86) !important; }
  ol.process { grid-template-columns: 1fr; }
  .list--cols { columns: 1; }
  .wp-block-buttons .wp-block-button { width: 100%; }
  .wp-block-buttons .wp-block-button__link, .cta__buttons .btn { width: 100%; }
  .panel, .card { padding: 26px; }
  .steps li { padding-left: 60px; }
  .contact-table td { display: block; width: auto !important; padding: 4px 0; border: 0 !important; }
  .contact-table tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .rows .wp-block-post-title a, ul.rows a { font-size: 1.15rem; }
  .message .wp-block-cover__inner-container { padding-block: 76px; }

  .mobile-bar {
    display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding-bottom: env(safe-area-inset-bottom); background: var(--navy); box-shadow: 0 -4px 16px rgba(2, 17, 46, .2);
  }
  .mobile-bar a {
    display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px 10px;
    color: var(--white); text-decoration: none; font: 600 .95rem/1 var(--font-head); letter-spacing: .05em; text-transform: uppercase;
  }
  .mobile-bar svg { width: 18px; height: 18px; }
  .mobile-bar__book { background: var(--blue); }
}
