/* Company page specifics. The shared vocabulary — palette, ruled sections, tables,
   markers — lives in site.css; only what is unique to a firm's sheet is here. */

/* ---------- headline figures ---------- */

.headline-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 26px 24px;
  align-items: start;
  margin: 0;
}

.headline-figures > div { display: flex; flex-direction: column; gap: 5px; }

.headline-figures dt { font-size: 12.5px; font-weight: 400; color: var(--label); }

.headline-figures dd {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.figure-note { display: block; font-size: 11.5px; color: var(--label); }

/* ---------- report download ---------- */

/* Title and downloads share the masthead row. The buttons borrow the disclosure's chrome
   below — a 1px rule and a 2px radius — rather than introducing a filled button, because
   a solid button would be the loudest thing on a page whose only colour is reserved for
   a fact that contradicts good standing. */
.company__masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.company__title { min-width: 0; }

.report-download { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.report-download__label { font-size: 13px; color: var(--label); margin-right: 3px; }

.report-download__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  font-size: 13.5px;
  white-space: nowrap;
}
.report-download__btn:hover,
.report-download__btn:focus-visible {
  border-color: var(--label);
  color: var(--ink);
  text-decoration: none;
}

@media (max-width: 720px) {
  /* Stacked under the title, the pair gets the 44px touch target the status strip already
     uses, and splits the row so neither button is a thin sliver. */
  .company__masthead { align-items: flex-start; }
  .report-download { width: 100%; }
  .report-download__btn { min-height: 44px; flex: 1 1 auto; }
}

/* ---------- disclosures ---------- */

/* The page ships no JavaScript, so every reveal is a <details>. */
.reveal { margin-top: 22px; }
.reveal + .reveal { margin-top: 12px; }


.reveal > summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  min-height: 38px;
  padding: 0 15px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary:hover { border-color: var(--label); }
.reveal > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: translateY(-3px) rotate(45deg);
}
.reveal[open] > summary::after { transform: translateY(1px) rotate(-135deg); }

/* The indicator table is a reference, not the headline: it opens from a quiet text
   affordance so the chart button stays the one obvious thing to press. */
.reveal--quiet > summary { border: 0; padding: 0; min-height: 0; color: var(--label); font-size: 13px; }
.reveal--quiet > summary:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.reveal--quiet > summary::after { width: 7px; height: 7px; border-width: 1.3px; }
.reveal__body { margin-top: 20px; }

/* A list or table that carries on behind a disclosure, rather than a block that opens
   below one. The affordance keeps the rows' own rhythm instead of the 22px a standalone
   reveal claims, and what opens resumes at that same spacing — so the seven visible rows
   and the rest read as one list interrupted by a click, not as two lists. */
/* A count belongs to its heading but is not part of its label. The section headings are
   tracked out by 0.1em, which spaces digits as widely as it spaces letters — "( 2 1 )"
   stops reading as a number — and the lighter weight keeps the label the thing you scan. */
.section-count { letter-spacing: normal; font-weight: 400; }

.reveal--more { margin-top: 14px; }
.reveal--more > .reveal__body { margin-top: 9px; }
.reveal--more .procurement-table-wrap { margin-top: 0; }

/* ---------- financial chart ---------- */

/* Two series on one axis: both are lei, so a second scale would flatter a thin margin.
   Revenue is the page's data hue; profit gets a warm partner. The pair's CVD separation
   is ΔE 12.4 and its normal-vision separation ΔE 15.3, both comfortably clear — but the
   slate sits under the dataviz chroma floor, so identity never rests on colour alone:
   the legend is always present and every hover readout names both amounts. */
.chart { margin: 24px 0 0; }
.chart__caption { margin: 0; font-size: 12.5px; color: var(--label); }

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 8px 0 4px;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.chart__key { display: flex; align-items: center; gap: 7px; }
.chart__swatch {
  flex-shrink: 0;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--data);
}
.chart__key--profit .chart__swatch, .chart__swatch--profit { background: var(--data-2); }

.chart__frame { position: relative; }
.chart__plot { display: block; width: 100%; height: auto; }
.chart__grid { stroke: var(--rule); stroke-width: 1; }
/* Only drawn when a filed loss pushes the axis below zero, where the baseline is no
   longer the zero line. */
.chart__zero { stroke: var(--rule-strong); stroke-width: 1; }
.chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--revenue { stroke: var(--data); }
.chart__line--profit { stroke: var(--data-2); }
.chart__end { stroke: var(--paper); stroke-width: 2; }
.chart__end--revenue { fill: var(--data); }
.chart__end--profit { fill: var(--data-2); }
.chart__tick, .chart__year { font-family: var(--mono); font-size: 11px; fill: var(--label); }

/* One full-height hover column per filed year, HTML over the plot rather than SVG shapes
   carrying <title> — see app/domain/chart.py. Focusable, so the amounts are reachable by
   keyboard as well as by pointer. */
.chart__hits { position: absolute; inset: 0 0 14% 0; }
.chart__hit { position: absolute; top: 0; bottom: 0; cursor: help; }
.chart__hit:hover, .chart__hit:focus-visible { background: rgba(53, 90, 112, 0.05); z-index: 5; }
.chart__hit:focus-visible { outline: none; }

.chart__tip {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  gap: 3px;
  white-space: nowrap;
  /* Light, not ink: the swatches carry the series colours, and both of those are dark
     enough that on an ink background nobody could tell which row was which. Same edge
     treatment as the search dropdown — the one other overlay on the site. */
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 6px 18px rgba(32, 30, 29, 0.1);
  font-size: 11.5px;
  line-height: 1.3;
  padding: 7px 9px;
  border-radius: 2px;
}
.chart__tip b { font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; color: var(--label); }
.chart__tip span { display: flex; align-items: center; gap: 7px; font-family: var(--mono); }
.chart__hit:hover .chart__tip, .chart__hit:focus-visible .chart__tip { display: flex; }

/* The end columns' readouts would hang off the plot if they stayed centred. */
.chart__hit:first-child .chart__tip { left: 0; transform: none; }
.chart__hit:last-child .chart__tip { left: auto; right: 0; transform: none; }

.financial-table-wrap, .procurement-table-wrap, .tva-periods-wrap, .state-aid-wrap, .court-cases-wrap { overflow-x: auto; margin-top: 16px; }
/* Fixed columns, declared by the table's own <colgroup>, because the SEAP history splits
   into two tables at the fold and the continuation hides its header row. Under auto layout
   each table sizes from its own rows — a table whose widest amount is seven figures and a
   continuation whose widest is nine come out with different columns, and the fold stops
   reading as one list. Widths ride on <col> rather than on the header cells: with fixed
   layout the first row sets the columns, and the continuation's first row is a header that
   is not in flow. */
/* The floor is the other half of it: the two declared columns come to 20rem, and a fixed
   layout divides the width it is given rather than asking for the width it needs — on a
   390px phone that leaves 30px for the counterparty, which is not a column. With the floor
   the overflow goes to the wrap's horizontal scroll, where every other wide table on this
   page already sends it. */
.procurement-history { table-layout: fixed; min-width: 32rem; }
.procurement-history__date { width: 8.5rem; }
.procurement-history__value { width: 11.5rem; }
/* The rule a table's last row drops is the section's closing rule — but a folded table is
   not at a section boundary, it is mid-list, so it keeps the rule. */
.procurement-history--folded tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
/* Bare figures, so nothing in a cell can wrap; the columns stay aligned and the table
   scrolls sideways instead of growing rows. */
.financial-history td, .financial-history th { white-space: nowrap; }
.financial-empty, .procurement-empty { margin-top: 16px; font-style: italic; color: var(--ink-soft); }
/* The ANAF mențiune is a full legal citation; let it wrap instead of forcing the
   whole table into a horizontal scroll for one long cell. */
.tva-periods td:last-child { min-width: 18rem; white-space: normal; }

/* ---------- lists ---------- */

.same-address-list, .caen ul, .change-history ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14.5px;
}

/* Peers are selected BY turnover, so their figures are near-identical by construction.
   A right-aligned rail of tabular digits is what makes that visible — ragged numbers read
   as unrelated figures. The unit sits in the header once, as in the indicator table. */
/* Full width, not narrowed: the table's own rules sit between the section rules above and
   below it, so a short table reads as a broken line rather than a tighter block. Every other
   table on the page (indicators, TVA, SEAP) spans the wrap for the same reason. */
.peer-table { table-layout: fixed; margin-top: 16px; }
/* Names wrap rather than ellipsis. The register holds names up to 172 characters, and two
   institutes sharing a 45-character prefix truncate to the same string — the row stops
   identifying the company, which is the one thing it is there to do. Wrapping costs a
   little height; the numeric rail stays aligned on the first line either way. */
.peer-table td:first-child { padding-right: 24px; }
.peer-table th:nth-child(2), .peer-table td:nth-child(2) { width: 9.5rem; }
.peer-table th:nth-child(3), .peer-table td:nth-child(3) { width: 4.5rem; }
.peer-table th:nth-child(4), .peer-table td:nth-child(4) { width: 5.5rem; padding-right: 0; }
.peer-table th:nth-child(n+2), .peer-table td:nth-child(n+2) { text-align: right; }
.peer-table td:nth-child(n+2) {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
/* Only peers that are not active are tagged, so the tag reads as an exception rather than
   as a column. Same idiom as .caen__primary-tag, same alert colour as the status strip. */
.peer-table__state {
  margin-left: 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--alert);
}
.peer-table__state--unknown { color: var(--label); }
/* Five rows do not need five rules: the numeric rail already carries the row structure,
   and the section boundary below closes the block. */
.peer-table tbody td { border-bottom: none; padding-top: 7px; padding-bottom: 7px; line-height: 1.45; }
.peer-table__unit {
  display: block;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
}

.caen li { display: flex; gap: 14px; }
.caen__code { flex-shrink: 0; width: 3.4rem; font-family: var(--mono); color: var(--label); }
.caen--primary .caen__code { color: var(--ink); font-weight: 500; }
.caen--primary .caen__label { font-weight: 500; }
.caen__primary-tag { align-self: center; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); }

.change-history li { display: flex; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.change-history time { flex-shrink: 0; width: 6.4rem; font-family: var(--mono); color: var(--label); }
.change-history li > span:first-of-type { flex-shrink: 0; width: 11.5rem; color: var(--label); }

.sectoral-ranking p, .peer-set p, .same-address p { margin: 0; font-size: 14.5px; }
.sectoral-ranking strong { font-weight: 600; }
.sectoral-ranking__basis { font-size: 13px; color: var(--label); }

.counterparty-not-in-register { display: block; font-size: 12.5px; color: var(--label); font-style: italic; }
.activity--unknown { font-style: italic; color: var(--ink-soft); }
.fiscal-detail { display: block; font-size: 13px; color: var(--label); }

/* The ANAF inactive-taxpayer badge carries the same weight as a debt warning: it is the
   one strip item that contradicts a RECOM "ACTIVĂ" next to it, so it must not read as
   another neutral chip. */
.status-strip__item--fiscal-inactive { color: var(--alert); font-weight: 700; }

@media (max-width: 720px) {
  .headline-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .change-history li > span:first-of-type, .change-history time { width: auto; }
  .caen__code { width: 3rem; }
  .reveal > summary { width: 100%; justify-content: space-between; min-height: 46px; }

  /* Fixed numeric columns cost 15rem, which on a 390px screen leaves the name so little
     room it breaks one word per line, and the "Angajați" header overruns the edge. Auto
     layout gives each column what its content needs; the numbers stay right-aligned, so
     the rail survives at whatever width it lands on. */
  .peer-table { table-layout: auto; }
  .peer-table th:nth-child(n+2), .peer-table td:nth-child(n+2) { width: auto; }
  .peer-table td:first-child { padding-right: 12px; }
}
