/*
 * Shared styles for the generated tool pages, and for the one generated block
 * on the homepages (the tools list).
 *
 * Loaded after /style.css, which still styles the dial, the readout pill, the
 * switches and the content cards. Everything here uses logical properties
 * (start/end, inline/block), so right-to-left pages need no overrides of their
 * own. Do not add rules here that restyle the homepage compass.
 */

:root {
  --ink: #2d3748;
  --ink-soft: #4a5568;
  --line: #e2e8f0;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --focus: #4299e1;
  --accent: #2f855a;
}

/* ---------- tools list (homepages and tool pages) ---------- */

.tools-section h2 {
  text-align: start;
}

/* /style.css indents every list (and list item) inside .content-section; this
   one is a grid of cards, not bullets, so it resets that with matching specificity. */
.content-section .tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.content-section .tools-list li {
  margin: 0;
  padding: 0;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
  text-align: start;
}

.tool-card__name {
  font-size: 16px;
  font-weight: 600;
}

.tool-card__blurb {
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.tool-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (hover: hover) {
  .tool-card:hover {
    border-color: #a0aec0;
    background: var(--surface);
  }
}

/* ---------- tool pages ---------- */

/* Latin text stays in Inter; each other script uses the fonts the device already has. */
.tool-page:lang(ar) { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', Tahoma, sans-serif; }
.tool-page:lang(he) { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Arial Hebrew', 'Noto Sans Hebrew', Arial, sans-serif; }
.tool-page:lang(bn) { font-family: 'Inter', system-ui, -apple-system, 'Kohinoor Bangla', 'Noto Sans Bengali', 'Nirmala UI', sans-serif; }
.tool-page:lang(hi) { font-family: 'Inter', system-ui, -apple-system, 'Kohinoor Devanagari', 'Noto Sans Devanagari', 'Nirmala UI', sans-serif; }
.tool-page:lang(th) { font-family: 'Inter', system-ui, -apple-system, 'Thonburi', 'Leelawadee UI', 'Noto Sans Thai', sans-serif; }
.tool-page:lang(ja) { font-family: 'Inter', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', Meiryo, 'Noto Sans JP', system-ui, sans-serif; }
.tool-page:lang(ko) { font-family: 'Inter', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif; }
.tool-page:lang(zh-cn) { font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif; }
.tool-page:lang(zh-tw) { font-family: 'Inter', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', system-ui, sans-serif; }

/* Form controls do not inherit the page font by default. */
.tool-page button,
.tool-page input,
.tool-page select {
  font-family: inherit;
}

.site-header {
  width: min(800px, 100%);
  margin: 0 auto 4px;
  display: flex;
}

.site-header__home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-inline: 8px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

/* The "back" arrow points toward the start of the line: left in LTR, right in RTL. */
.site-header__home::before {
  content: "\2190";
}

[dir="rtl"] .site-header__home::before {
  content: "\2192";
}

.site-header__home:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.tool-main {
  width: 100%;
}

.tool-page h1 {
  text-align: center;
  margin-bottom: 12px;
}

.tool-lead {
  max-width: 560px;
  margin: 0 auto 24px;
  padding-inline: 8px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

/* Content cards: text runs from the start edge, lists indent from it. */
.tool-page .content-section {
  text-align: start;
}

.tool-page .content-section ol,
.tool-page .content-section ul:not(.tools-list) {
  padding-left: 0;
  padding-right: 0;
  padding-inline-start: 22px;
}

.tool-page .content-section h2:not(:first-child) {
  margin-top: 32px;
}

.tool-page .content-section h3.faq-question {
  margin: 22px 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.table-scroll {
  overflow-x: auto;
}

.city-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  color: var(--ink);
}

.city-table th,
.city-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  font-weight: 400;
}

.city-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.city-table tbody th {
  font-weight: 600;
}

.city-table td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- footer of the generated pages ---------- */

.site-footer {
  margin-top: clamp(32px, 8vw, 48px);
  padding: clamp(20px, 5vw, 24px);
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* Each language name is in its own script; the platform font covers them all. */
.lang-switcher {
  margin-bottom: 16px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.lang-switcher a {
  display: inline-block;
  margin: 4px 8px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
  color: inherit;
  text-decoration: none;
}

.lang-switcher a[aria-current="page"] {
  background: var(--surface);
  font-weight: 600;
}

.footer-links a {
  display: inline-block;
  min-height: 44px;
  margin: 8px 12px;
  padding: 4px 0;
  line-height: 36px;
  color: inherit;
  text-decoration: none;
}

.site-footer p {
  margin-top: clamp(12px, 3vw, 16px);
}

.site-footer p a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
