/*
Theme Name: WPFlow Base
Theme URI: https://workingplatform.ro
Description: Shared theme for the Working Platform group sites. Content (machines, prices, news) comes from WPFlow through the WPFlow Sync plugin. Each domain uses a child theme for colours, logo and contact data.
Author: Working Platform WP
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: wpflow-base
*/

:root {
  --accent: #d40e14;        /* links, buttons, headings */
  --accent-dark: #b20d19;   /* hover, footer bar */
  --ink: #333;
  --muted: #5b5b5b;
  --line: #ddd;
  --bg: #fff;
  --bg-grey: #f2f2f2;
  --footer: #4a4a4a;
  --head-band: #2b3e55;     /* category page header */
  --font: Arial, Helvetica, sans-serif;
  --radius: 5px;
  --wrap: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
.sr-only, .wpf-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: #000; color: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* ---------- Buttons & form fields ---------- */
.btn, .btn2 { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: var(--radius); font: 700 14px var(--font); cursor: pointer; text-decoration: none; }
.btn { background: var(--accent); color: #fff !important; border: 0; }
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn2 { background: #fff; color: var(--accent) !important; border: 1px solid var(--accent); padding: 0 18px; font-size: 13px; }
.btn2:hover { background: #fff5f5; text-decoration: none; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.inp { width: 100%; min-height: 38px; padding: 7px 10px; border: 0; border-radius: var(--radius); background: #ddd; color: #333; font: 14px var(--font); }
textarea.inp { min-height: 84px; resize: vertical; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid #eee; position: relative; z-index: 20; }
.header-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; }
.logo { height: 38px; width: auto; }
.logo-text { font-size: 22px; font-weight: 700; color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.nav .menu, .nav .lang { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.nav .menu a { display: inline-block; padding: 6px 0; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; border-bottom: 2px solid transparent; }
.nav .menu a:hover { text-decoration: none; border-bottom-color: var(--accent); }
.nav .menu .current-menu-item > a, .nav .menu .current-menu-ancestor > a, .nav .menu a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.nav .menu li { position: relative; }
.nav .menu .sub-menu { display: none; position: absolute; left: -12px; top: 100%; min-width: 220px; list-style: none; margin: 0; padding: 8px 0; background: #fff; border: 1px solid #eee; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.nav .menu li:hover > .sub-menu, .nav .menu li:focus-within > .sub-menu { display: block; }
.nav .menu .sub-menu a { display: block; padding: 8px 14px; border: 0; text-transform: none; font-size: 13px; }
.nav .lang { gap: 8px; margin-left: 8px; }
.nav .lang a { color: var(--ink); font-size: 12px; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav .lang a.on { border-bottom-color: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 44px; height: 44px; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding: 8px 0; }
  .nav.open { display: flex; }
  .nav .menu { flex-direction: column; gap: 0; width: 100%; }
  .nav .menu a { padding: 10px 0; font-size: 14px; }
  .nav .menu .sub-menu { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; }
  .nav .lang { margin: 8px 0 0; }
}

/* ---------- Home ---------- */
.hero { position: relative; background: var(--head-band); height: clamp(260px, 42vw, 560px); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s; }
.hero-img.on { opacity: 1; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 10px; }
.hero-dots button { width: 14px; height: 14px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.85); cursor: pointer; }
.hero-dots button.on { background: var(--accent); }
.intro { text-align: center; padding-top: 48px; padding-bottom: 40px; }
.intro-title { margin: 0 0 18px; color: var(--accent); font-size: 24px; font-weight: 400; }
.intro-text p { margin: 0 0 10px; }

.band { position: relative; display: flex; flex-wrap: wrap; border-top: 1px solid #f2d0d1; border-bottom: 1px solid #f2d0d1; }
.band-img { flex: 1 1 420px; max-width: 560px; min-width: 0; }
.band-img img { width: 100%; height: 320px; object-fit: cover; }
.band-text { position: relative; flex: 999 1 400px; min-width: 0; padding: 40px 48px; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 240px; overflow: hidden; }
.band-text h2 { margin: 0; font-size: 22px; font-weight: 400; position: relative; z-index: 1; }
.band-text h2 a { color: var(--ink); }
.band-text p { margin: 0; font-size: 17px; max-width: 640px; position: relative; z-index: 1; }
.band-text .more { position: relative; z-index: 1; font-weight: 700; }
.tri { position: absolute; width: 240px; height: 230px; background: var(--tri); pointer-events: none; }
.tri.br { right: 0; bottom: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
@media (max-width: 700px) { .band-text { padding: 28px 20px 120px; } .tri { width: 150px; height: 140px; } }

.sec { padding: 56px 0; }
.sec.grey { background: var(--bg-grey); }
.sec-title { margin: 0 0 8px; text-align: center; font-size: 21px; font-weight: 400; }
.sec-title.left { text-align: left; margin-bottom: 20px; }
.sec-lead { margin: 0 auto 32px; text-align: center; max-width: 640px; color: var(--muted); }
.sec-title + .grid { margin-top: 28px; }

.grid { display: grid; gap: 16px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tiles.feat { grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); justify-content: center; gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); }
@media (max-width: 560px) { .tiles, .tiles.feat { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile-name { font-size: 12px; } }
.tile { display: flex; flex-direction: column; text-align: center; color: var(--ink); }
.tile:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.tile img, .tile .noimg { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.tile-name { padding: 12px 10px 4px; color: var(--accent); font-weight: 700; font-size: 14px; text-transform: uppercase; }
.tile-sub { padding: 0 10px 14px; color: var(--muted); font-size: 13px; }
.noimg { display: block; background: #e9e9e9 linear-gradient(135deg, transparent 48%, #ddd 50%, transparent 52%); min-height: 160px; }
.noimg.big { aspect-ratio: 4 / 5; }

/* ---------- Page header (category, archives) ---------- */
.pagehead { position: relative; background: var(--head-band); color: #fff; overflow: hidden; }
.pagehead .wrap { position: relative; z-index: 1; padding-top: 40px; padding-bottom: 40px; }
.pagehead h1 { margin: 0; font-size: 30px; font-weight: 400; text-transform: uppercase; letter-spacing: .5px; max-width: 70%; }
.pagehead-sub { margin: 8px 0 0; font-size: 15px; color: #e3e8ee; }
.pagehead .crumbs, .pagehead .crumbs a { color: #cfd6df; }
.pagehead-diag { position: absolute; right: 0; top: 0; bottom: 0; width: 34%; background: var(--accent); clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); }
@media (max-width: 700px) { .pagehead h1 { max-width: none; font-size: 24px; } .pagehead-diag { width: 22%; opacity: .9; } }
.crumbs { margin: 0 0 6px; font-size: 12px; color: #888; }
.crumbs-row { padding-top: 18px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; }
.tab { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 12px; text-transform: uppercase; }
.tab:hover { text-decoration: none; border-color: var(--accent); }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-intro { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 48px; padding-top: 28px; padding-bottom: 28px; }
.cat-intro-img { flex: 0 1 260px; width: 260px; height: 320px; object-fit: cover; }
.cat-intro-text { flex: 999 1 420px; min-width: 0; }

.mcards { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; }
@media (max-width: 400px) { .mcards { grid-template-columns: 1fr; } }
.mcard { display: flex; flex-wrap: wrap; }
.mcard-img { flex: 1 1 150px; max-width: 100%; }
.mcard-img img, .mcard-img .noimg { width: 100%; height: 100%; min-height: 230px; max-height: 300px; object-fit: cover; }
.mcard-body { flex: 999 1 200px; min-width: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.mcard-title { margin: 0; font-size: 18px; }
.mcard-title a { color: var(--accent); }
.kicker { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.mini-specs { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; font-size: 13px; }
.mini-specs dt { color: #777; }
.mini-specs dd { margin: 0; }
.mini-specs dd:first-of-type { font-weight: 700; }
.mcard-price { margin: 0; font-weight: 700; }
.mcard .btns { margin-top: auto; }

/* ---------- Product page ---------- */
.product { display: flex; flex-wrap: wrap; gap: 32px 48px; padding-top: 20px; padding-bottom: 40px; }
.gallery { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.gallery-main { position: relative; border: 1px solid var(--line); background: #fff; }
.gallery-big { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.badge { position: absolute; left: 0; top: 16px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 12px; text-transform: uppercase; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
.thumb { padding: 0; border: 1px solid var(--line); background: #fff; cursor: pointer; aspect-ratio: 1 / 1; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on { border: 2px solid var(--accent); }
.thumb.video { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--head-band); color: #fff; font-size: 12px; }
.pinfo { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ptitle { margin: 2px 0 0; color: var(--accent); font-size: 30px; font-weight: 700; }
.psub { margin: 0; font-size: 17px; }
.pshort { color: var(--muted); }
.pshort p { margin: 0 0 6px; }
.spec { border-collapse: collapse; width: 100%; border-top: 2px solid var(--accent); }
.spec caption { text-align: left; font-weight: 700; padding: 0 0 8px; font-size: 15px; }
.spec th, .spec td { padding: 9px 12px; border-bottom: 1px solid #e4e4e4; text-align: left; font-size: 13px; vertical-align: top; }
.spec th { font-weight: 400; color: var(--muted); width: 48%; }
.spec tr:nth-child(odd) { background: #f7f7f7; }
.pprice { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--bg-grey); border-left: 3px solid var(--accent); }
.pprice-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.pprice-row strong { font-size: 18px; }
.pprice-row small { color: var(--muted); }

.prose { font-size: 15px; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 20px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 24px; }
.prose li { position: relative; padding-left: 18px; }
.prose li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--accent); }
.prose strong { color: var(--ink); }
.pdesc > p > strong:only-child { display: block; margin-top: 18px; font-size: 18px; font-weight: 400; color: var(--accent); text-transform: uppercase; }

/* ---------- Quote band (product page) ---------- */
.quote-band { position: relative; background: var(--footer); color: #fff; overflow: hidden; }
.quote-diag { position: absolute; inset: 0; background: var(--accent); clip-path: polygon(0 0, 40% 0, 34% 100%, 0 100%); }
.quote-in { position: relative; display: flex; flex-wrap: wrap; gap: 32px 64px; padding-top: 44px; padding-bottom: 44px; }
.quote-head { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.quote-head h2 { margin: 0; font-size: 24px; font-weight: 400; }
.quote-head a { color: #fff; font-weight: 700; }
.quote-in .wpf-form { flex: 2 1 420px; }
@media (max-width: 700px) { .quote-diag { clip-path: polygon(0 0, 100% 0, 100% 34%, 0 44%); } }

/* ---------- Forms ---------- */
.wpf-form { display: grid; gap: 10px 14px; font-size: 13px; }
.wpf-form p { margin: 0; }
.wpf-form label { display: block; margin-bottom: 4px; }
.wpf-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wpf-form-grid .wpf-wide { grid-column: 1 / -1; }
.wpf-form-rows .wpf-f { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 12px; }
.wpf-form-rows .wpf-f label { margin: 0; }
.wpf-form-rows .wpf-submit { grid-template-columns: 1fr auto; }
.wpf-submit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wpf-small { font-size: 12px; opacity: .85; }
.wpf-form-msg { padding: 10px 14px; border-radius: var(--radius); font-weight: 700; margin: 0 0 12px; }
.wpf-ok { background: #e7f5e1; color: #2d5a1b; }
.wpf-err { background: #fde8e8; color: #8a1313; }
@media (max-width: 560px) { .wpf-form-grid { grid-template-columns: 1fr; } .wpf-form-rows .wpf-f { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Footer ---------- */
.site-footer { position: relative; background: var(--footer); color: #fff; }
.site-footer.diag::before { content: ""; position: absolute; inset: 0; background: var(--accent); clip-path: polygon(0 0, 52% 0, 46% 100%, 0 100%); }
.foot-diamond { position: absolute; left: 50%; top: -13px; width: 26px; height: 26px; transform: translateX(-50%) rotate(45deg); background: var(--accent-dark); }
.footer-in { position: relative; display: flex; flex-wrap: wrap; gap: 40px 64px; padding-top: 44px; padding-bottom: 44px; }
.foot-contact { flex: 1 1 300px; display: flex; flex-direction: column; gap: 10px; }
.foot-logo { display: inline-flex; align-self: flex-start; background: #fff; padding: 8px 12px; }
.foot-logo .logo { height: 32px; }
.foot-company { font-size: 14px; letter-spacing: .5px; text-transform: uppercase; }
.foot-tag, .foot-addr { font-size: 13px; }
.foot-link { color: #fff; font-weight: 700; }
.foot-link:hover { color: #fff; }
.foot-menu { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.foot-menu a { color: #fff; }
.foot-form { flex: 1 1 360px; }
.foot-form-title { margin: 0 0 12px; font-size: 17px; font-weight: 400; }
.foot-cta { flex: 1 1 300px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 17px; }
.site-footer.slim .foot-diamond { display: none; }
.site-footer.slim .footer-in { padding-top: 32px; padding-bottom: 32px; }
.site-footer.slim .foot-contact { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.foot-bottom { position: relative; background: var(--accent-dark); text-align: center; padding: 12px 20px; font-size: 13px; }
@media (max-width: 760px) { .site-footer.diag::before { clip-path: polygon(0 0, 100% 0, 100% 30%, 0 38%); } }

/* ---------- Articles / pages ---------- */
.article { padding-top: 10px; padding-bottom: 56px; }
.article h1 { color: var(--accent); font-size: 28px; font-weight: 400; margin: 6px 0 18px; }
.article time { color: var(--muted); font-size: 13px; }
.article-img { margin: 0 0 20px; }
.article-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 20px 0; }
.ncards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.ncard { display: flex; flex-direction: column; color: var(--ink); }
.ncard:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.ncard img, .ncard .noimg { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.ncard-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.ncard-body time { font-size: 12px; color: var(--muted); }
.ncard-title { color: var(--accent); font-weight: 700; font-size: 16px; }
.ncard-ex { color: var(--muted); font-size: 13px; }
.more { font-weight: 700; }
.nav-links { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.nav-links .page-numbers { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; }
.nav-links .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.list-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
