/* ==========================================================================
   problem.css  -  THE PROBLEM SECTION (CONTENT)
   Used by: <section id="problem"> in index.html.
   It shows cards in a row. The card you hover opens wide (js/problem.js).
   ========================================================================== */

/* The introduction paragraph of the section. */
.problem-body p { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; }
/* ACC (accordion): the row of cards. They sit side by side with a fixed height. */
.acc { display: flex; gap: 12px; height: 420px; }
/* CARD: one closed card. It is narrow and shows only its number and title (written sideways).
   The outline is the blue gradient from the "Join waitlist" button (see the GRADIENT BORDER rule in components.css);
   the inside stays a plain light colour. */
.card {
  --bw: 1.5px;
  flex: 1 1 0;
  min-width: 0;
  padding: 22px;
  background: var(--section-bg);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: flex .55s cubic-bezier(.7, 0, .2, 1), background .3s;
}
/* Closed cards have a softer outline; the open card gets the full-strength one. */
.card::before { opacity: .5; transition: opacity .3s; }
.card.on::before { opacity: 1; }
/* The open card is about 3 times wider and has a white background. */
.card.on { flex: 3.2 1 0; background: #fff; cursor: default; box-shadow: 0 12px 28px rgba(11, 18, 32, 0.06); }
/* The small number badge on a card. */
.card .num { align-self: flex-start; padding: 3px 7px; border: 1px solid var(--border-dark); font: 11.5px var(--font-mono); border-radius: 3px; }
/* The badge turns blue on the open card. */
.card.on .num { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
/* The text block of a card (title, text, drawing). On a closed card it sits at the bottom;
   on the open card it starts right under the number and the drawing grows to fill the rest,
   so there is no empty gap inside the card. */
.card > div { margin-top: auto; }
.card.on > div { margin-top: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* The card title. */
.card h3 { font-weight: 300; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.02; letter-spacing: -.035em; white-space: nowrap; writing-mode: vertical-rl; transform: rotate(180deg); }
/* On the open card the title is written normally (not sideways). */
.card.on h3 { writing-mode: horizontal-tb; transform: none; }
/* Card text is hidden when the card is closed. */
.card p { display: none; max-width: 520px; margin-top: 10px; font-size: 15.5px; line-height: 1.55; color: var(--text-body); }
/* ...and shown when the card is open. */
.card.on p { display: block; }

/* The small drawing inside the card (hidden until the card opens). It stretches to use all the room left in the card. */
.card-visual-space {
  display: none;
  flex: 1;
  min-height: 130px;
  width: 100%;
  background: var(--soft-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-top: 14px;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
/* Show the drawing when the card is open. */
.card.on .card-visual-space { display: flex; }
/* The drawing fills its space (it keeps its proportions). */
.card-visual-space svg { width: 100%; height: 100%; }

/* PHONES: cards stack on top of each other instead of side by side. */
@media (max-width: 880px) {
  .acc { flex-direction: column; height: auto; }
  .card, .card.on { flex: none; background: #fff; cursor: default; }
  .card::before { opacity: 1; }
  .card > div, .card.on > div { margin-top: 0; display: block; }
  .card h3 { writing-mode: horizontal-tb; transform: none; white-space: normal; }
  .card p { display: block; }
  .card-visual-space, .card.on .card-visual-space { display: flex; height: 140px; flex: none; }
  .card .num { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
}
