/* components.css: shared components used by the layout and blocks (docs/DESIGN-PLAN.md §2.12).
   One button family, radii only from tokens, shadows only on layers, icons always bare. */

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: transparent;
  --btn-bg-hover: var(--bg-alt);
  --btn-bg-press: var(--bg-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--control-h);
  padding: 0 var(--sp-5);
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-ui);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.btn:hover { background: var(--btn-bg-hover); text-decoration: none; }
.btn:active { background: var(--btn-bg-press); }
.btn .i { transition: transform var(--dur-2) var(--ease); }
.btn:hover .i--arrow, .btn:focus-visible .i--arrow { transform: translateX(3px); }
.btn[aria-disabled="true"], .btn:disabled { --btn-bg: var(--line); --btn-fg: var(--muted); --btn-bg-hover: var(--line); cursor: default; }

.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bg-hover: var(--accent-hover); --btn-bg-press: var(--accent-press); }
.btn--secondary { --btn-bg: var(--secondary); --btn-fg: #FFFFFF; --btn-bg-hover: var(--secondary-hover); --btn-bg-press: var(--secondary-press); }
.btn--outline { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--ink); --btn-bg-hover: var(--bg-alt); }
.btn--light { --btn-bg: #FFFFFF; --btn-fg: var(--ink); --btn-bg-hover: var(--bg-tint); --btn-bg-press: var(--line); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--on-band); --btn-bd: var(--on-band); --btn-bg-hover: var(--band-raised); --btn-bg-press: var(--band-deep); }
.btn--sm { min-height: var(--control-h-sm); padding: 0 var(--sp-4); font-size: .9375rem; }
.btn--lg { min-height: var(--control-h-lg); font-size: 1.0625rem; }
.btn--block { width: 100%; }

/* Door button: the two audience CTAs (find a station / get a station installed). */
.btn--door { min-height: var(--control-h-lg); padding: 0 var(--sp-3) 0 var(--sp-5); justify-content: space-between; gap: var(--sp-4); }
.btn--door .door-tile {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent-hover);
  flex: none;
}
.btn--secondary.btn--door .door-tile { background: var(--accent); }
.btn--door .door-tile .i { width: 18px; height: 18px; stroke-width: 2; transition: transform var(--dur-2) var(--ease); }
.btn--door:hover .door-tile .i, .btn--door:focus-visible .door-tile .i { transform: translateX(3px); }

/* ---------- Text link ---------- */
.link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--ink);
  font-weight: var(--fw-semibold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-1) var(--ease);
}
.link:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
.link .i { width: 18px; height: 18px; transition: transform var(--dur-2) var(--ease); }
.link:hover .i { transform: translateX(2px); }
.section--navy .link, .on-band .link { color: var(--on-band); }
.section--navy .link:hover, .on-band .link:hover { color: var(--on-band); }

/* ---------- Section head: H2 left, "see all" link on the same baseline ---------- */
.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-6);
  margin-block-end: var(--section-head-gap);
}
.sec-head h2 { max-width: 28ch; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-5);
}
@media (min-width: 768px) { .card { padding: var(--sp-6); } }
.card--tint { background: var(--bg-tint); border-color: transparent; }
.card--navy { background: var(--band); border-color: transparent; color: var(--on-band-muted); }
.card--navy :is(h2, h3, h4) { color: var(--on-band); }
.card--link { transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.card--link:hover { border-color: var(--line-hover); box-shadow: var(--shadow-2); transform: translate3d(0, -3px, 0); }
/* The whole card is clickable through its single link. */
.card--link .card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card--link .card-link { text-decoration: none; }
.card--link:hover .card-link { text-decoration: underline; text-decoration-thickness: 1px; }
.card--link:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.card--link .card-link:focus-visible { outline: none; }

/* ---------- Chips, tags, badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--chip-h);
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
/* 44 px touch area around a 36 px chip. */
.chip::before { content: ""; position: absolute; inset: -4px 0; }
a.chip:hover { background: var(--bg-alt); border-color: var(--ink); }
.chip--static { border-color: var(--line-hover); color: var(--ink-2); cursor: default; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tag--ac { background: var(--ac-bg, var(--bg-tint)); color: var(--ac-fg, var(--ink)); box-shadow: inset 0 0 0 1px var(--ac-line, var(--ink)); }
.tag--dc { background: var(--dc-bg, var(--ink)); color: var(--dc-fg, #FFFFFF); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent-on-tint);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

/* ---------- Live data line: "● Canlı · 10:15" (dot is static, no pulse) ---------- */
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  line-height: 1.33;
  color: var(--live);
  font-variant-numeric: tabular-nums;
}
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live-fill); flex: none; }
/* On navy the live colours are lightened to keep 4.5:1 (green #7FD8B0, amber #F2C66D on #1C2538). */
:is(.section--navy, .card--navy, .on-band) .live { color: #7FD8B0; }
:is(.section--navy, .card--navy, .on-band) .live::before { background: #3CC48A; }

/* ---------- Stripe meter: segmented progress (district coverage, .meter--steps in blocks.css) ---------- */
.meter {
  display: flex;
  gap: var(--meter-gap, 2px);
  height: var(--meter-h, 10px);
  width: 100%;
}
.meter > span { display: block; height: 100%; border-radius: 2px; min-width: 3px; }

/* ---------- Power tag (CLAUDE.md "Güç etiketleri"): map, station, area and report pages ---------- */
/* AC / DC power chip (DESIGN-PLAN §2.2 class code, same glyphs as the map pins): AC a light navy tinted
   pill with the Type 2 face, DC a solid navy pill with the bolt. The glyph is a mask, so it takes the
   text colour. Class, a hairline and the power with tabular figures ("AC | 22 kW"). */
.ptag {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px 0 6px;
  border-radius: var(--r-pill);
  font-size: .78125rem;
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
  vertical-align: middle;
}
.ptag--ac { background: var(--ac-bg, #E8EDF6); color: var(--ac-fg, #1C2538); box-shadow: inset 0 0 0 1px rgba(var(--shadow-tint), .16); }
.ptag--dc { background: var(--dc-bg, #1C2538); color: var(--dc-fg, #FFFFFF); }
.ptag-glyph {
  flex: none;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}
.ptag--ac .ptag-glyph { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.4 2.84A6.2 6.2 0 1 0 12.6 2.84Z' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cg fill='%23000'%3E%3Ccircle cx='6.2' cy='5' r='.95'/%3E%3Ccircle cx='9.8' cy='5' r='.95'/%3E%3Ccircle cx='4.7' cy='7.3' r='.95'/%3E%3Ccircle cx='8' cy='7.3' r='.95'/%3E%3Ccircle cx='11.3' cy='7.3' r='.95'/%3E%3Ccircle cx='6.2' cy='9.6' r='.95'/%3E%3Ccircle cx='9.8' cy='9.6' r='.95'/%3E%3C/g%3E%3C/svg%3E"); }
.ptag--dc .ptag-glyph { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9.2 1.4 3.6 9.1h3.9l-.8 5.5 5.8-7.9H8.6z' fill='%23000'/%3E%3C/svg%3E"); }
.ptag-type { font-weight: var(--fw-bold); letter-spacing: .02em; }
.ptag-kw { display: inline-flex; align-items: center; font-weight: var(--fw-medium); }
.ptag-kw::before { content: ""; width: 1px; height: 11px; margin-right: 6px; background: currentColor; opacity: .3; }
.ptag-n { font-weight: var(--fw-medium); opacity: .75; }

/* ---------- Accordion (<details>) ---------- */
.acc { border-top: 1px solid var(--line); }
.acc > details { border-bottom: 1px solid var(--line); }
.acc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 56px;
  padding: var(--sp-3) 0;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .i { width: 20px; height: 20px; color: var(--ink); transition: transform var(--dur-2) var(--ease); }
.acc details[open] > summary .i { transform: rotate(180deg); }
.acc summary:hover { color: var(--accent-hover); }
.acc .acc-body { padding: 0 0 var(--sp-5); color: var(--ink-2); }
.acc .acc-body p + p { margin-top: var(--sp-3); }

/* ---------- App store badges (official artwork) ---------- */
.store-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.store-badges a { display: block; border-radius: var(--r-sm); line-height: 0; }
.store-badges img { height: 44px; width: auto; }
@media (min-width: 768px) { .store-badges img { height: 48px; } }

/* ---------- Media ---------- */
.media { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--bg-tint); }
.media img { width: 100%; height: 100%; object-fit: cover; }
/* Empty media slot, e.g. a station without photos (docs/MOTION.md §18): a calm tint panel with the bare
   charging-pile icon. Never a stock or generated picture; the drawn Epsis totem (DESIGN-PLAN §2.9 #2)
   replaces the icon once it exists. */
.media--empty { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--gray-400, var(--line-strong)); }
.media--empty > .i { width: 48px; height: 48px; stroke-width: 1.25; }
.media--empty.media--sm > .i { width: 28px; height: 28px; stroke-width: 1.5; }

/* ---------- Numbers ---------- */
.stat-num { font-size: var(--fs-stat); font-weight: var(--fw-bold); line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.stat-label { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--muted); }
