/*
Theme Name: Ertical
Theme URI: https://ertical.ir
Author: Ertical
Description: قالب دوزبانهٔ معرفی و فروش تجهیزات آزمون تأسیسات الکتریکی. فارسی راست‌چین و انگلیسی، بدون نیاز به افزونه، با فرم استعلام قیمت داخلی.
Version: 3.4.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ertical
Tags: rtl-language-support, custom-menu, one-column, full-width-template
*/

/* ==========================================================================
   The page is served in Persian (right to left) or English (left to right)
   from the same sheet. Every edge is written in logical form - inline-start,
   inline-end, padding-block - so the direction on <html> is the only thing
   that has to change, and nothing here is mirrored by hand.
   ========================================================================== */

:root{
  --red:#eb1a23;
  --red-dark:#c3131b;
  --ink:#11131a;
  --ink-2:#434a5a;
  --ink-3:#6c7486;
  --line:#e2e5ea;
  --bg:#ffffff;
  --bg-2:#f5f6f8;
  --bg-3:#eceef2;
  --dark:#0b0d12;
  --dark-2:#141822;
  --dark-line:#262c3a;
  --dark-ink:#e8ecf4;
  --dark-dim:#9aa3b5;
  --radius:14px;
  --radius-sm:9px;
  --shadow:0 1px 2px rgba(17,19,26,.05), 0 8px 28px rgba(17,19,26,.07);
  --shadow-lg:0 2px 6px rgba(17,19,26,.07), 0 22px 60px rgba(17,19,26,.12);
  --wrap:1180px;
  /* Vazirmatn is the usual Persian web face and many Iranian hosts already
     serve it. Nothing is fetched from a font CDN: inside Iran that is a slow
     or dead request, and a missing font would leave the page in a serif. */
  --font:"Vazirmatn","Vazir","IRANSans","IRANYekan","Segoe UI",Tahoma,system-ui,sans-serif;
  --mono:"Cascadia Mono",Consolas,"DejaVu Sans Mono",monospace;
}

*,*::before,*::after{box-sizing:border-box}

html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font);
  font-size:16px;
  line-height:1.85;
  -webkit-font-smoothing:antialiased;
}

img{max-width:100%;height:auto;display:block}
a{color:var(--red);text-decoration:none}
a:hover{text-decoration:underline}

h1,h2,h3,h4{line-height:1.45;margin:0 0 .6em;font-weight:700;letter-spacing:-.01em}
h1{font-size:clamp(1.9rem,1.3rem + 2.4vw,3rem)}
h2{font-size:clamp(1.5rem,1.1rem + 1.5vw,2.1rem)}
h3{font-size:1.2rem}
p{margin:0 0 1.1em}

/* A figure in ohms, volts or hertz reads left-to-right even in a Persian
   sentence; without this the browser reorders the unit onto the wrong side. */
.ltr{direction:ltr;unicode-bidi:isolate;display:inline-block}
.ert-ltr .ltr{display:inline;direction:inherit;unicode-bidi:normal}

.wrap{width:min(var(--wrap),100% - 2.5rem);margin-inline:auto}
.narrow{width:min(760px,100% - 2.5rem);margin-inline:auto}

.section{padding-block:clamp(3rem,2rem + 4vw,5.5rem)}
.section--tint{background:var(--bg-2)}
.section--dark{background:var(--dark);color:var(--dark-ink)}
.section--dark h2,.section--dark h3{color:#fff}
.section--dark p{color:var(--dark-dim)}

.eyebrow{
  display:inline-flex;align-items:center;gap:.5rem;
  font-size:.82rem;font-weight:700;letter-spacing:.04em;
  color:var(--red);margin-bottom:.7rem;
}
.eyebrow::before{content:"";width:1.6rem;height:2px;background:var(--red);border-radius:2px}

.lead{font-size:1.1rem;color:var(--ink-2);max-width:62ch}
.section--dark .lead{color:var(--dark-dim)}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.78rem 1.6rem;border-radius:999px;border:1.5px solid transparent;
  font:inherit;font-weight:700;cursor:pointer;transition:.16s ease;
  text-decoration:none !important;
}
.btn--primary{background:var(--red);color:#fff}
.btn--primary:hover{background:var(--red-dark)}
.btn--ghost{background:transparent;color:var(--ink);border-color:var(--line)}
.btn--ghost:hover{border-color:var(--ink-3)}
/* Every dark ground in one rule. The hero, the band and the page head are not
   .section--dark, so listing only that one left a near-black label on a
   near-black button in the place it is seen most. */
.section--dark .btn--ghost,
.hero .btn--ghost,
.cta .btn--ghost,
.page-head .btn--ghost{color:#fff;border-color:#ffffff3d}
.section--dark .btn--ghost:hover,
.hero .btn--ghost:hover,
.cta .btn--ghost:hover,
.page-head .btn--ghost:hover{border-color:#fff;background:#ffffff12}
.btn--lg{padding:.95rem 2.1rem;font-size:1.05rem}

/* ---------- header ---------- */
.site-header{
  position:sticky;top:0;z-index:50;
  background:rgba(11,13,18,.94);
  backdrop-filter:saturate(1.4) blur(10px);
  border-bottom:1px solid var(--dark-line);
}
.site-header__inner{display:flex;align-items:center;gap:1.4rem;min-height:70px}
.brand{display:flex;align-items:center;gap:.65rem;text-decoration:none !important}
.brand img{height:42px;width:auto}
.brand__name{color:#fff;font-size:1.15rem;font-weight:700;letter-spacing:.02em}
.brand__tag{display:block;color:var(--red);font-size:.66rem;font-weight:600;letter-spacing:.06em;line-height:1}

.nav{margin-inline-start:auto}
.nav ul{display:flex;align-items:center;gap:.3rem;list-style:none;margin:0;padding:0}
.nav a{
  display:block;padding:.5rem .85rem;border-radius:8px;
  color:var(--dark-ink);font-size:.95rem;font-weight:600;text-decoration:none !important;
}
.nav a:hover{background:#ffffff14;color:#fff}
.nav .current-menu-item > a,.nav .current_page_item > a{color:#fff;background:#ffffff1a}
.header-cta{margin-inline-start:.6rem}

.nav-toggle{
  display:none;margin-inline-start:auto;background:transparent;border:1px solid var(--dark-line);
  color:#fff;border-radius:9px;padding:.5rem .8rem;font:inherit;font-weight:600;cursor:pointer;
}

/* ---------- hero ---------- */
.hero{
  background:
    radial-gradient(1100px 520px at 82% -10%, #2a0f14 0%, transparent 62%),
    radial-gradient(760px 420px at 8% 108%, #141b2b 0%, transparent 64%),
    var(--dark);
  color:#fff;padding-block:clamp(3rem,2rem + 6vw,6rem);overflow:hidden;
}
.hero__grid{display:grid;grid-template-columns:1.05fr .95fr;gap:clamp(2rem,1rem + 3vw,4rem);align-items:center}
.hero h1{color:#fff;margin-bottom:.4em}
.hero__lead{color:#aeb7c8;font-size:1.12rem;max-width:52ch}
.hero__actions{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:1.8rem}
.hero__art{position:relative}
.hero__art img{filter:drop-shadow(0 30px 60px rgba(0,0,0,.6))}
.hero__points{
  display:flex;flex-wrap:wrap;gap:.5rem 1.6rem;margin-top:2.2rem;
  padding-top:1.5rem;border-top:1px solid #ffffff1f;list-style:none;padding-inline-start:0;
}
.hero__points li{color:#aeb7c8;font-size:.93rem;display:flex;align-items:center;gap:.5rem}
.hero__points li::before{content:"◆";color:var(--red);font-size:.62rem}

/* ---------- product cards ---------- */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:1.6rem}
.card{
  background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);
  overflow:hidden;display:flex;flex-direction:column;transition:.2s ease;
}
.card:hover{box-shadow:var(--shadow-lg);transform:translateY(-3px)}
.card__media{
  background:linear-gradient(160deg,#1b212e,#0b0d12);
  padding:2rem 1.6rem;display:flex;align-items:center;justify-content:center;min-height:230px;
}
.card__media img{max-height:200px;width:auto;filter:drop-shadow(0 14px 30px rgba(0,0,0,.5))}
.card__body{padding:1.5rem 1.6rem 1.7rem;display:flex;flex-direction:column;flex:1}
.card__body h3{margin-bottom:.35em}
.card__body p{color:var(--ink-2);font-size:.97rem}
.card__list{list-style:none;margin:0 0 1.3rem;padding:0;font-size:.94rem}
.card__list li{display:flex;gap:.6rem;padding-block:.28rem;color:var(--ink-2)}
.card__list li::before{content:"▪";color:var(--red);flex:none}
.card__foot{margin-top:auto;display:flex;gap:.6rem;flex-wrap:wrap}

/* ---------- feature grid ---------- */
.features{display:grid;grid-template-columns:repeat(auto-fit,minmax(265px,1fr));gap:1.3rem;margin-top:2.6rem}
.feature{
  background:var(--bg);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:1.4rem 1.4rem 1.5rem;
}
.section--dark .feature{background:var(--dark-2);border-color:var(--dark-line)}
.feature__icon{
  width:40px;height:40px;border-radius:10px;background:#eb1a2314;color:var(--red);
  display:grid;place-items:center;font-size:1.15rem;margin-bottom:.9rem;
}
.section--dark .feature__icon{background:#eb1a2326}
.feature h3{font-size:1.03rem;margin-bottom:.3em}
.feature p{font-size:.93rem;color:var(--ink-2);margin:0}
.section--dark .feature p{color:var(--dark-dim)}

/* ---------- spec table ---------- */
.specs{margin-top:2.2rem;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--bg)}
.specs + .specs{margin-top:1.4rem}
.specs__head{
  background:var(--bg-3);padding:.85rem 1.2rem;font-weight:700;font-size:.97rem;
  border-bottom:1px solid var(--line);
}
.specs table{width:100%;border-collapse:collapse;font-size:.95rem}
.specs td{padding:.8rem 1.2rem;border-bottom:1px solid var(--line);vertical-align:top}
.specs tr:last-child td{border-bottom:0}
.specs td:first-child{width:38%;color:var(--ink-2);font-weight:600;background:#fafbfc}
.specs td:last-child{color:var(--ink)}

.table-scroll{overflow-x:auto}

/* ---------- screen gallery ---------- */
.screens{display:grid;grid-template-columns:repeat(auto-fit,minmax(310px,1fr));gap:1.4rem;margin-top:2.6rem}
.screen figure{margin:0}
.screen img{
  border-radius:var(--radius-sm);border:1px solid var(--line);
  box-shadow:var(--shadow);background:#fff;
}
.section--dark .screen img{border-color:var(--dark-line)}
.screen figcaption{margin-top:.75rem;font-size:.92rem;color:var(--ink-2)}
.section--dark .screen figcaption{color:var(--dark-dim)}
.screen figcaption b{display:block;color:var(--ink);font-size:.98rem}
.section--dark .screen figcaption b{color:#fff}

/* ---------- the chain ---------- */
.chain{display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:1rem;margin-top:2.6rem}
.chain__step{
  background:var(--dark-2);border:1px solid var(--dark-line);border-radius:var(--radius-sm);
  padding:1.3rem 1.3rem 1.4rem;position:relative;
}
.chain__num{
  display:inline-grid;place-items:center;width:30px;height:30px;border-radius:8px;
  background:var(--red);color:#fff;font-weight:700;font-size:.9rem;margin-bottom:.8rem;
}
.chain__step h3{font-size:1rem;color:#fff;margin-bottom:.25em}
.chain__step p{font-size:.9rem;color:var(--dark-dim);margin:0}

/* ---------- notice ---------- */
.notice{
  display:flex;gap:.9rem;align-items:flex-start;
  border:1px solid var(--line);border-inline-start:4px solid var(--red);
  background:var(--bg-2);border-radius:var(--radius-sm);
  padding:1rem 1.2rem;margin-top:2rem;font-size:.94rem;color:var(--ink-2);
}
.notice__mark{color:var(--red);font-weight:700;flex:none}

/* ---------- form ---------- */
.form{margin-top:2.4rem}
.form__grid{display:grid;grid-template-columns:1fr 1fr;gap:1.1rem}
.field{display:flex;flex-direction:column;gap:.4rem}
.field--full{grid-column:1 / -1}
.field label{font-size:.93rem;font-weight:600;color:var(--ink)}
.field .req{color:var(--red)}
.field .hint{font-size:.83rem;color:var(--ink-3);font-weight:400}
.field input,.field select,.field textarea{
  font:inherit;font-size:.97rem;color:var(--ink);background:var(--bg);
  border:1.5px solid var(--line);border-radius:var(--radius-sm);
  padding:.72rem .9rem;width:100%;transition:border-color .15s;
}
.field textarea{min-height:130px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none;border-color:var(--red);box-shadow:0 0 0 3px #eb1a231f;
}
/* An error is never colour alone: the border changes, and a line of text that
   says what is wrong is printed under the field. */
.field--error input,.field--error select,.field--error textarea{border-color:var(--red);background:#fff6f6}
.field__error{font-size:.87rem;color:var(--red);font-weight:600;display:flex;gap:.4rem;align-items:flex-start}
.field__error::before{content:"!";flex:none;width:1.1rem;height:1.1rem;border-radius:50%;background:var(--red);color:#fff;font-size:.72rem;display:grid;place-items:center;margin-top:.28rem}

.form__foot{margin-top:1.6rem;display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.form__note{font-size:.88rem;color:var(--ink-3);margin:0}
.hp{position:absolute;inset-inline-start:-9999px;width:1px;height:1px;overflow:hidden}

.alert{
  border-radius:var(--radius-sm);padding:1.1rem 1.3rem;margin-bottom:1.8rem;
  display:flex;gap:.8rem;align-items:flex-start;font-size:.97rem;
}
.alert__mark{flex:none;font-weight:700}
.alert--ok{background:#edf9f3;border:1px solid #b6e3cd;color:#14603f}
.alert--ok .alert__mark{color:#1a7d52}
.alert--bad{background:#fdf0f0;border:1px solid #f2c4c4;color:#8e1d1d}
.alert--bad .alert__mark{color:var(--red)}

/* ---------- contact ---------- */
.contact-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1.3rem;margin-top:2.4rem}
.contact-card{border:1px solid var(--line);border-radius:var(--radius-sm);padding:1.4rem;background:var(--bg)}
.contact-card h3{font-size:1rem;margin-bottom:.4em}
.contact-card p{margin:0;color:var(--ink-2);font-size:.95rem}

/* ---------- cta band ---------- */
.cta{
  background:linear-gradient(135deg,#1a0a0d 0%,var(--dark) 55%);
  border-radius:var(--radius);padding:clamp(2rem,1.4rem + 2.4vw,3.2rem);
  display:flex;align-items:center;justify-content:space-between;gap:2rem;flex-wrap:wrap;
}
.cta h2{color:#fff;margin-bottom:.25em}
.cta p{color:var(--dark-dim);margin:0;max-width:52ch}

/* ---------- page header & content ---------- */
.page-head{background:var(--dark);color:#fff;padding-block:clamp(2.4rem,1.6rem + 3vw,4rem)}
.page-head h1{color:#fff;margin-bottom:.2em}
.page-head p{color:var(--dark-dim);margin:0;max-width:62ch}

.entry{padding-block:clamp(2.5rem,2rem + 2vw,4rem)}
.entry img{border-radius:var(--radius-sm)}
.entry ul,.entry ol{padding-inline-start:1.4rem}
.entry blockquote{
  margin:1.6rem 0;padding:.4rem 1.2rem;border-inline-start:4px solid var(--red);
  color:var(--ink-2);
}
.entry table{width:100%;border-collapse:collapse}
.entry th,.entry td{border:1px solid var(--line);padding:.6rem .8rem;text-align:start}

/* ---------- footer ---------- */
.site-footer{background:var(--dark);color:var(--dark-dim);padding-block:3rem 1.6rem;font-size:.93rem}
.site-footer a{color:var(--dark-ink)}
.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:2.2rem;padding-bottom:2.2rem;border-bottom:1px solid var(--dark-line)}
.footer-grid h4{color:#fff;font-size:.98rem;margin-bottom:.9em}
.footer-grid ul{list-style:none;margin:0;padding:0}
.footer-grid li{padding-block:.22rem}
.footer-brand img{height:62px;width:auto;margin-bottom:1rem}
.footer-bottom{padding-top:1.4rem;display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;font-size:.87rem}

/* ---------- small screens ---------- */
@media (max-width:980px){
  .hero__grid{grid-template-columns:1fr}
  .hero__art{order:-1;max-width:520px;margin-inline:auto}
  .footer-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:760px){
  .nav-toggle{display:block}
  .nav{
    display:none;position:absolute;inset-inline:0;top:100%;
    background:var(--dark);border-bottom:1px solid var(--dark-line);padding:.8rem 1.25rem 1.2rem;
  }
  .nav.is-open{display:block}
  .nav ul{flex-direction:column;align-items:stretch;gap:.1rem}
  .nav a{padding:.7rem .6rem}
  .site-header__inner{position:relative}
  .header-cta{display:none}
  .form__grid{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr}
  .specs td:first-child{width:42%}
}

/* Honour a reader who has asked the system to stop moving things. */
@media (prefers-reduced-motion:reduce){
  *{animation:none !important;transition:none !important}
  .card:hover{transform:none}
}

/* ---------- WordPress core classes ---------- */
.screen-reader-text{
  position:absolute !important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);
  white-space:nowrap;
}
.alignleft{float:left;margin-inline-end:1.4rem}
.alignright{float:right;margin-inline-start:1.4rem}
.aligncenter{margin-inline:auto}
.wp-caption{max-width:100%}
.wp-caption-text{font-size:.88rem;color:var(--ink-3)}
.sticky,.gallery-caption,.bypostauthor{}

.skip-link{
  position:absolute;inset-inline-start:-9999px;z-index:100;
  background:#fff;color:var(--ink);padding:.7rem 1.2rem;border-radius:0 0 8px 0;
}
.skip-link:focus{inset-inline-start:0;top:0}

/* A page that is switched off but visible to an editor. Never colour alone:
   the word «پنهان» carries the meaning, the stripe only draws the eye. */
.hidden-banner{
  background:#fff4d6;border-bottom:2px solid #eda100;color:#6b4e00;
  padding:.7rem 1.25rem;font-size:.92rem;text-align:center;
}
.hidden-banner strong{
  display:inline-block;background:#eda100;color:#2a1f00;
  padding:.05rem .6rem;border-radius:999px;font-size:.82rem;margin-inline-end:.5rem;
}

/* ---------- engineer portal ---------- */
.btn--line{background:transparent;color:#fff;border-color:#ffffff40}
.btn--line:hover{border-color:#fff;background:#ffffff14}
.header-portal{padding:.55rem 1.1rem;font-size:.92rem;font-weight:600}

.portal__inner{display:flex;align-items:center;justify-content:space-between;gap:1.6rem;flex-wrap:wrap}
.portal__inner h2{margin-bottom:.2em}
.portal__inner p{margin:0;color:var(--ink-2)}

/* The header carries brand, menu, language and two buttons. Below the desktop
   breakpoint the sign-in one goes; it is still on the system page, which is
   where someone looking for it actually goes. */
@media (max-width:1080px){ .header-portal{display:none} }

/* ---------- language switch ---------- */
.lang-switch{display:flex;align-items:center;gap:2px;background:#ffffff12;border-radius:999px;padding:3px}
.lang-switch a{
  display:block;padding:.3rem .7rem;border-radius:999px;
  color:var(--dark-dim);font-size:.82rem;font-weight:700;line-height:1.5;
  text-decoration:none !important;white-space:nowrap;
}
.lang-switch a:hover{color:#fff}
.lang-switch a.is-on{background:var(--red);color:#fff}

/* ---------- odds and ends the templates add ---------- */
.cta__actions{display:flex;flex-wrap:wrap;gap:.75rem}
.contact-card--wide{grid-column:1 / -1}
.card__media--photo{background:var(--bg-3);padding:0;min-height:0}
.card__media--photo img{max-height:none;width:100%}

/* In English the headings are latin and sit a little tighter than Persian,
   which carries its own generous line box. */
.ert-ltr h1,.ert-ltr h2{letter-spacing:-.02em}
.ert-ltr body,.ert-ltr .lead{line-height:1.7}

@media (max-width:980px){
  .lang-switch a{padding:.3rem .55rem}
}
@media (max-width:760px){
  /* The switch stays in the bar on a phone - it is how an English speaker
     gets out of a page they cannot read, so it must not hide behind the
     hamburger. */
  .lang-switch{margin-inline-start:auto;order:2}
  .nav-toggle{margin-inline-start:.6rem;order:3}
  .brand{order:1}
  .nav{order:4}
}
