/* 緯度経度と座標の変換ツール WordPress v1 */
.lxcalc,
.lxcalc * {
  box-sizing: border-box;
}

.lxcalc {
  --lx-bg: #f4f7fb;
  --lx-card: #ffffff;
  --lx-text: #172033;
  --lx-muted: #5d677a;
  --lx-line: #d9e0ea;
  --lx-primary: #1769aa;
  --lx-primary-dark: #0f4f83;
  --lx-soft: #eaf3fb;
  --lx-success: #16784d;
  --lx-success-bg: #e8f7ef;
  --lx-danger: #b42318;
  --lx-danger-bg: #fff0ee;
  --lx-warning: #9a6700;
  --lx-warning-bg: #fff7d6;
  color: var(--lx-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.65;
  width: 100%;
  container-name: lxcalc-tool;
  container-type: inline-size;
}

.lxcalc input,
.lxcalc select,
.lxcalc button {
  font: inherit;
}

/* サイト全体の grid.css が input・select に margin-bottom: 15px を付ける。
   このツールは項目の間隔を gap で決めているので、上乗せされると
   単位の箱（em）がその 15px まで伸びて入力欄の下へはみ出し、
   ラジオボタンも字より上へずれる（2026-09-24 に実測: 入力欄 48px・箱 63px）。 */
.lxcalc input,
.lxcalc select {
  margin: 0;
}

.lxcalc__screen {
  background: var(--lx-bg);
  border: 1px solid var(--lx-line);
  border-radius: 18px;
  padding: clamp(16px, 3vw, 32px);
}

.lxcalc__hero {
  margin-bottom: 22px;
}

.lxcalc__hero--result {
  margin-bottom: 18px;
}

.lxcalc__eyebrow {
  color: var(--lx-primary);
  font-size: 0.875rem; /* 0.82rem から。添え書きは 14px 以上（シニアにも優しいサイト。2026-09-29） */
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.lxcalc__title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.3;
  margin: 0;
}

.lxcalc__lead {
  color: var(--lx-muted);
  margin: 8px 0 0;
}

.lxcalc__card {
  background: var(--lx-card);
  border: 1px solid var(--lx-line);
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(25, 45, 75, 0.05);
  margin-top: 16px;
  padding: clamp(16px, 2.4vw, 24px);
}

.lxcalc__section-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.4;
  margin: 0 0 14px;
}

.lxcalc__grid {
  display: grid;
  gap: 14px;
}

.lxcalc__grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lxcalc__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lxcalc__label {
  font-size: 1rem; /* 0.9rem から。読む字は 16px 以上（シニアにも優しいサイト。2026-09-29） */
  font-weight: 700;
}

.lxcalc input[type="number"],
.lxcalc input[type="text"],
.lxcalc select {
  background: #fff;
  border: 1px solid #bfc9d8;
  border-radius: 9px;
  color: var(--lx-text);
  min-height: 44px;
  padding: 9px 11px;
  width: 100%;
}

.lxcalc input:focus,
.lxcalc select:focus,
.lxcalc button:focus-visible {
  outline: 3px solid rgba(23, 105, 170, 0.22);
  outline-offset: 2px;
}

.lxcalc__input-unit {
  align-items: stretch;
  display: flex;
  min-width: 0;
}

.lxcalc__input-unit input,
.lxcalc__input-unit select {
  border-radius: 9px 0 0 9px;
  min-width: 0;
}

.lxcalc__input-unit em {
  align-items: center;
  background: #edf1f6;
  border: 1px solid #bfc9d8;
  border-left: 0;
  border-radius: 0 9px 9px 0;
  color: #475467;
  display: flex;
  font-size: 0.875rem; /* 0.84rem から。添え書きは 14px 以上（シニアにも優しいサイト。2026-09-29） */
  font-style: normal;
  padding: 0 10px;
  white-space: nowrap;
}

.lxcalc__radio-group {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lxcalc__radio {
  align-items: center;
  background: #fff;
  border: 1px solid #bfc9d8;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  gap: 9px;
  padding: 11px 13px;
}

.lxcalc__radio input {
  height: 17px;
  width: 17px;
}

.lxcalc__radio span {
  font-weight: 700;
}

.lxcalc__radio:has(input:checked) {
  background: var(--lx-soft);
  border-color: var(--lx-primary);
}

.lxcalc__note {
  color: var(--lx-muted);
  font-size: 1rem; /* 0.8rem から。読む字は 16px 以上（シニアにも優しいサイト。2026-09-29） */
  margin: 2px 0 0;
  min-height: 1.1em;
}

.lxcalc__help {
  color: var(--lx-muted);
  font-size: 1rem; /* 0.86rem から。読む字は 16px 以上（シニアにも優しいサイト。2026-09-29） */
  margin: 10px 0 0;
}

.lxcalc__button {
  align-items: center;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 9px 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lxcalc__button:hover {
  transform: translateY(-1px);
}

.lxcalc__button--primary {
  background: var(--lx-primary);
  color: #fff;
}

.lxcalc__button--primary:hover {
  background: var(--lx-primary-dark);
  box-shadow: 0 5px 16px rgba(23, 105, 170, 0.25);
}

.lxcalc__button--secondary {
  background: #e8edf4;
  color: #263247;
}

.lxcalc__button--large {
  min-width: min(100%, 280px);
  padding: 13px 26px;
}

.lxcalc__actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.lxcalc__actions--between {
  border-bottom: 1px solid var(--lx-line);
  border-top: 1px solid var(--lx-line);
  padding: 18px 0;
}

.lxcalc__actions--bottom {
  margin-top: 28px;
}

.lxcalc__alert {
  border-radius: 10px;
  margin: 14px 0;
  padding: 14px 16px;
}

.lxcalc__alert--error {
  background: var(--lx-danger-bg);
  border: 1px solid #f4b4ae;
  color: var(--lx-danger);
}

.lxcalc__alert--warning {
  background: var(--lx-warning-bg);
  border: 1px solid #efd67a;
  color: #6f4b00;
}

.lxcalc__alert ul {
  margin: 6px 0 0;
  padding-left: 1.25rem;
}

.lxcalc__summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lxcalc__summary-card {
  background: var(--lx-soft);
  border: 1px solid #bcd6ea;
  border-radius: 13px;
  padding: 18px;
  text-align: center;
}

.lxcalc__summary-label {
  color: var(--lx-muted);
  font-size: 1rem; /* 0.86rem から。読む字は 16px 以上（シニアにも優しいサイト。2026-09-29） */
  font-weight: 700;
  margin: 0;
}

.lxcalc__summary-value {
  color: var(--lx-primary-dark);
  font-size: clamp(1.3rem, 3.2vw, 1.8rem);
  font-weight: 900;
  line-height: 1.35;
  margin: 6px 0 2px;
}

.lxcalc__summary-sub {
  color: var(--lx-muted);
  font-size: 1rem; /* 0.82rem から。読む字は 16px 以上（シニアにも優しいサイト。2026-09-29） */
  margin: 0;
}

.lxcalc__table-wrap {
  overflow-x: auto;
  width: 100%;
}

.lxcalc__table {
  border-collapse: collapse;
  font-size: 1rem; /* 0.86rem から。読む字は 16px 以上（シニアにも優しいサイト。2026-09-29） */
  min-width: 420px;
  width: 100%;
}

.lxcalc__table th,
.lxcalc__table td {
  border: 1px solid var(--lx-line);
  padding: 8px 9px;
  text-align: right;
  vertical-align: middle;
}

.lxcalc__table th {
  background: #edf2f7;
  color: #344054;
  font-weight: 800;
  white-space: nowrap;
}

.lxcalc__table th:first-child,
.lxcalc__table td:first-child,
.lxcalc__text-left {
  text-align: left;
}

@media (max-width: 900px) {
  .lxcalc__grid--2,
  .lxcalc__radio-group,
  .lxcalc__summary-grid {
    grid-template-columns: 1fr;
  }
}

@container lxcalc-tool (max-width: 900px) {
  .lxcalc__grid--2,
  .lxcalc__radio-group,
  .lxcalc__summary-grid {
    grid-template-columns: 1fr;
  }
}

@container lxcalc-tool (max-width: 600px) {
  /* スマホでは外側の枠を外す。記事のカード → この枠 → 項目のカード → 入力欄と
     4 重に入れ子になり、幅 390 で入力欄が 220px まで細くなっていた（2026-09-24）。
     項目のカード（__card）の枠で区切りは見える。 */
  .lxcalc__screen {
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
  /* 計算諸元は「項目｜値」の 2 列。420px の下限があると幅 390 で値の列が
     切れて見えない。狭いときは外して折り返させる（長い値だけ横に流れる）。 */
  .lxcalc__table {
    min-width: 0;
  }
  /* 値（座標）は長く折り返しにくいので、そのままだと項目の列が 1 行 2 字まで
     押しつぶされ、右寄せの値（計算された X・Y 座標）は右端で切れる。
     項目の列に 6 字ぶんの下限を置き、値は必要なら塊の途中でも折り返させる。 */
  .lxcalc__table td:first-child,
  .lxcalc__table th:first-child {
    min-width: 6em;
  }
  .lxcalc__table td {
    overflow-wrap: anywhere;
  }
}

.lxcalc__map-wrap {
  border: 1px solid var(--lx-line);
  border-radius: 12px;
  margin-top: 12px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.lxcalc__map-wrap::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.lxcalc__map-wrap iframe {
  border: 0;
  height: 100%;
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 100%;
}

.lxcalc__map-pin {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -100%);
  z-index: 2;
}

.lxcalc__axis-note {
  align-items: flex-start;
  background: var(--lx-warning-bg);
  border: 1px solid #efd67a;
  border-radius: 10px;
  color: #6f4b00;
  display: flex;
  font-size: 1rem; /* 0.88rem から。読む字は 16px 以上（シニアにも優しいサイト。2026-09-29） */
  font-weight: 700;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
}

.lxcalc [hidden] {
  display: none !important;
}
