/* ==========================================================================
   MAADANOL — Engineering Calculators page (page-specific styles)
   Loaded ONLY on /calculators/ and /en/calculators/ (see
   maadanol_enqueue_assets in functions.php) — nothing here can affect
   any other page. Reuses shared tokens from style.css, which is
   enqueued as this stylesheet's dependency.

   The .dlc-toolbar/.dlc-search/.dlc-filter/.dlc-count/.dlc-empty rules
   match downloads.css/industries.css/knowledge.css class-for-class by
   convention — safe to duplicate since these stylesheets never load
   on the same page at once.
   ========================================================================== */

.dlc-toolbar{
  display:flex; gap: 18px; flex-wrap: wrap; align-items:center; justify-content: space-between;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 18px 22px; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.dlc-search{ position: relative; flex: 1 1 240px; min-width: 200px; }
.dlc-search svg{ position:absolute; inset-inline-start: 14px; top:50%; transform: translateY(-50%); color: var(--gray-light); pointer-events:none; }
.dlc-search input{
  width:100%; padding: 12px 16px 12px 42px; border-radius: 999px; border: 1.5px solid var(--line);
  font-size: 13.5px; font-family: inherit; background: var(--bg);
}
html[dir="rtl"] .dlc-search input{ padding: 12px 42px 12px 16px; }
.dlc-search input:focus{ outline:none; border-color: var(--accent); background: var(--white); }

.dlc-filters{ display:flex; gap: 8px; flex-wrap: wrap; }
.dlc-filter{
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white);
  font-size: 13px; font-weight: 600; color: var(--gray); font-family: inherit; transition: all .2s;
  white-space: nowrap;
}
.dlc-filter:hover{ border-color: var(--primary); color: var(--primary); }
.dlc-filter.is-active{ background: var(--primary); border-color: var(--primary); color: #fff; }

.dlc-count{ font-size: 13px; color: var(--gray); margin: 0 0 18px; }
.dlc-empty{ text-align:center; padding: 60px 20px; color: var(--gray); font-size: 15px; }

/* ---------- Calculator grid ---------- */
.calc-grid{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px){ .calc-grid{ grid-template-columns: 1fr; } }

.calc-card{
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .3s var(--ease), border-color .3s;
}
.calc-card:hover{ box-shadow: var(--shadow-md); }
.calc-card.is-open{ border-color: var(--accent); }

.calc-card__head{
  width: 100%; display:flex; align-items:center; gap: 16px; padding: 20px 22px;
  background: none; border: none; text-align: start; cursor: pointer;
}
.calc-card__icon{
  width: 44px; height: 44px; border-radius: 10px; background: var(--bg); color: var(--accent-text);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.calc-card.is-open .calc-card__icon{ background: var(--primary); color: #fff; }
.calc-card__title-wrap{ flex: 1; min-width: 0; }
.calc-card__title{ display:block; font-family: var(--font-display); font-weight: 700; font-size: 15.5px; color: var(--primary); }
.calc-card__desc{ display:block; font-size: 12.5px; color: var(--gray); margin-top: 3px; }
.calc-card__chevron{ color: var(--gray-light); flex-shrink:0; transition: transform .3s var(--ease); }
.calc-card.is-open .calc-card__chevron{ transform: rotate(180deg); color: var(--accent); }

.calc-card__body{ max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.calc-card__body-inner{ padding: 0 22px 24px; border-top: 1px solid var(--line); padding-top: 20px; }

.calc-form{ display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.calc-field{ display:flex; flex-direction: column; gap: 6px; }
.calc-field label{ font-size: 12px; font-weight: 600; color: var(--gray); cursor: help; }
.calc-field__row{ display:flex; align-items:center; gap: 8px; }
.calc-field input, .calc-field select{
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  font-size: 13.5px; font-family: inherit; background: var(--bg); transition: border-color .2s;
  flex: 1; min-width: 0;
}
.calc-field__unit{
  flex-shrink: 0; font-size: 11.5px; font-weight: 700; color: var(--gray-light); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px; white-space: nowrap;
}
.calc-field__error{ font-size: 11px; color: #d64545; }
.calc-field input:focus, .calc-field select:focus{ outline:none; border-color: var(--accent); background: var(--white); }
.calc-field input.is-invalid{ border-color: #d64545; background: rgba(214,69,69,0.05); }
@media (max-width: 480px){ .calc-form{ grid-template-columns: 1fr; } }

.calc-result{
  background: var(--primary); border-radius: var(--radius-md); padding: 20px 22px; margin-bottom: 16px;
  text-align: center;
}
.calc-result__value{ display:flex; align-items:baseline; justify-content:center; gap: 8px; }
.calc-result__num{ font-family: var(--font-display); font-weight: 800; font-size: 32px; color: #fff; line-height: 1; }
.calc-result__unit{ font-size: 15px; color: var(--secondary); font-weight: 700; }
.calc-result__extra{ font-size: 12.5px; color: rgba(255,255,255,0.7); margin: 8px 0 0; }

.calc-actions{ display:flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.calc-actions .btn{ flex: 1; min-width: 100px; }

.calc-formula{ border-top: 1px dashed var(--line); padding-top: 14px; }
.calc-formula summary{ font-size: 13px; font-weight: 700; color: var(--accent-text); cursor: pointer; list-style: none; }
.calc-formula summary::-webkit-details-marker{ display:none; }
.calc-formula summary::before{ content: '+ '; }
.calc-formula[open] summary::before{ content: '− '; }
.calc-formula__eq{
  font-family: 'Courier New', monospace; font-size: 13.5px; background: var(--bg); border-radius: var(--radius-sm);
  padding: 10px 14px; margin: 10px 0 8px; color: var(--primary); direction: ltr; text-align: left;
}
.calc-formula__note{ font-size: 12.5px; color: var(--gray); margin: 0; }

/* ---------- "How This Calculator Works" (audit requirement) ---------- */
.calc-how{ border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 14px; }
.calc-how summary{ font-size: 13px; font-weight: 700; color: var(--primary); cursor: pointer; list-style: none; }
.calc-how summary::-webkit-details-marker{ display:none; }
.calc-how summary::before{ content: '+ '; }
.calc-how[open] summary::before{ content: '− '; }
.calc-how__body{ margin-top: 12px; }
.calc-how__body h4{ font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--accent-text); margin: 16px 0 6px; }
.calc-how__body h4:first-child{ margin-top: 0; }
.calc-how__body p{ font-size: 13px; line-height: 1.8; color: var(--dark); margin: 0; }
.calc-how__ref{ margin-top: 14px !important; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--gray) !important; font-size: 12px !important; }
.calc-var-table{ width: 100%; border-collapse: collapse; font-size: 12.5px; }
.calc-var-table th, .calc-var-table td{ padding: 6px 8px; border: 1px solid var(--line); text-align: start; }
.calc-var-table th{ background: var(--bg); font-weight: 700; color: var(--primary); }

/* ---------- Related downloads mini-grid ---------- */
.calc-downloads-grid{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 640px){ .calc-downloads-grid{ grid-template-columns: 1fr; } }

/* ---------- Engineering tips ---------- */
.calc-tips-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.calc-tip-card{ padding: 24px; border-radius: var(--radius-md); background: var(--bg); border-inline-start: 3px solid var(--secondary); }
.calc-tip-card h3{ font-size: 15.5px; margin: 0 0 8px; }
.calc-tip-card p{ font-size: 13.5px; color: var(--gray); margin: 0; }
@media (max-width: 900px){ .calc-tips-grid{ grid-template-columns: 1fr; } }
