/* Outil « âge du chien en âge humain » (inc/age-tool.php, assets/js/age-tool.js)
   Chargé seulement sur /age-chien-humain et sur les fiches /races/{race}/esperance-vie */

.agetool-section { padding: 40px 0 8px; }
.agetool-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.agetool { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 32px; align-items: start; }
.agetool-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.agetool-field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.agetool-field > label, .agetool-field > legend { font-size: 0.8rem; font-weight: 600; color: var(--dark); padding: 0; margin-bottom: 6px; }
.agetool select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); color: var(--text); font: inherit; font-size: 1rem; }
.agetool select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-color: var(--green); }
.agetool-age-row { display: flex; gap: 12px; }
.agetool-age-part { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 0.9rem; color: var(--muted); }
.agetool-age-part select { flex: 1; }
.agetool .agetool-size { margin: 0; font-size: 0.82rem; line-height: 1.55; color: var(--muted); }
.agetool .agetool-size a { color: var(--green); }

.agetool-result { min-width: 0; }
.agetool-result p { margin: 0 0 10px; line-height: 1.6; font-size: 0.92rem; color: var(--text); }
.agetool-main { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; margin-bottom: 12px; background: var(--green-light); border-radius: var(--radius); }
.agetool-main-n { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; color: var(--green); line-height: 1.1; }
.agetool-main-l { font-size: 0.85rem; color: var(--dark); line-height: 1.45; }
.agetool-result .agetool-msg { color: var(--muted); }

/* Tableau de correspondance */
.agetool-table-section { padding: 40px 0 8px; }
.agetool-table-title { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.25; color: var(--dark); margin: 0 0 8px; }
.agetool-table-intro { color: var(--muted); line-height: 1.65; margin: 0 0 16px; max-width: 760px; }
.agetool-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); max-width: 760px; }
.agetool-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.agetool-table thead th { background: var(--green); color: var(--white); text-align: left; font-weight: 600; padding: 10px 12px; }
.agetool-table tbody th, .agetool-table td { padding: 8px 12px; border-top: 1px solid var(--border); text-align: left; }
.agetool-table tbody th { font-weight: 600; white-space: nowrap; }
.agetool-table thead th .agetool-th-range { display: block; font-weight: 400; font-size: 0.75rem; opacity: 0.9; }
.agetool-table tbody tr:nth-child(even) th, .agetool-table tbody tr:nth-child(even) td { background: var(--green-pale); }
.agetool-table-note { font-size: 0.78rem; color: var(--muted); line-height: 1.6; margin: 10px 0 0; max-width: 760px; }
.agetool-table-note a { color: var(--green); }

/* Encart des fiches espérance de vie */
.entry-content .agetool-box { margin: 28px 0; padding: 18px; background: var(--green-pale); border: 1px solid var(--border); border-radius: 14px; }
.entry-content .agetool-box-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--dark); margin: 0 0 12px; }
.agetool--compact { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
.agetool--compact .agetool-main-n { font-size: 1.8rem; }
.entry-content .agetool-more { margin: 0; font-size: 0.85rem; }

@media (max-width: 768px) {
  .agetool { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .agetool-section, .agetool-table-section { padding-top: 28px; }
  .agetool-table-title { font-size: 1.3rem; }
  .agetool-table { font-size: 0.84rem; }
  .agetool-table thead th, .agetool-table tbody th, .agetool-table td { padding: 8px; }
}
