/* ==========================================================
   WeatherDiff - style.css（最終完全版）
========================================================== */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --sub: #555555;
  --border: #e5e5e5;
  --card-bg: #fafafa;
  --accent: #111111;

  --radius: 14px;
  --shadow-card: 0 2px 5px rgba(0,0,0,0.06);

  --red: #d9534f;
  --blue: #0275d8;
  --blue-dark: #014c8c;
  --gray-diff: #999;
}

/* ------------------------------
   Base
------------------------------ */
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.6;
}

.wd-sub {
  font-size: 11.5px;
  color: var(--gray-diff);
  opacity: 0.55;
  white-space: nowrap;
  line-height: 1.3;
}

.hidden { display: none !important; }

/* ------------------------------
   Header
------------------------------ */
.wd-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 16px 0;
}

.wd-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wd-title { font-size: 24px; }
.wd-subtitle { font-size: 14px; color: var(--sub); }

.wd-lang-switch { display: flex; gap: 8px; }

.wd-lang-btn {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: #f7f7f7;
  border-radius: 8px;
  cursor: pointer;
}
.wd-lang-btn.is-active {
  background: var(--accent);
  color: #fff;
}

/* ------------------------------
   Main
------------------------------ */
.wd-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.wd-intro {
  margin-bottom: 12px;
  color: var(--sub);
}

.wd-usage-link { margin: 0; }

.wd-usage-link a {
  color: var(--accent);
  font-weight: 600;
}

.wd-section { margin-bottom: 32px; }

.wd-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f9f9f9;
}

.wd-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5e5e5, #cfcfcf, #e5e5e5);
  background-size: 200% 100%;
}

.wd-progress-bar.is-animating {
  animation: wd-progress-slide 1.2s linear infinite;
}

.wd-progress-text { margin: 0; font-size: 13px; color: var(--sub); }

/* ------------------------------
   Input
------------------------------ */
.wd-label { margin-bottom: 8px; display: block; }

.wd-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#locationInput {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wd-btn {
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  background: #f3f3f3;
  white-space: nowrap;
  transition: 0.15s;
}
.wd-btn:hover { background: #e5e5e5; }

/* ------------------------------
   Warning / Location
------------------------------ */
.wd-warning {
  background: #fff7d9;
  border: 1px solid #ffe7a5;
  padding: 6px 10px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 12.5px;
  line-height: 1.4;
}

.wd-location-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#locMeta { font-size: 13.5px; line-height: 1.4; color: var(--sub); }

/* ------------------------------
   Card
------------------------------ */
.wd-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.wd-card-title {
  margin-bottom: 12px;
  font-size: 16px;
}

/* ------------------------------
   API Grid (OM/MET)
------------------------------ */
.wd-api-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

/* API内部（スマホ：縦、600px～：横） */
.wd-weather-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-direction: column;
}

.wd-weather-row:last-child { margin-bottom: 0; }

.wd-day-label {
  margin: 0;
  font-size: 13px;
  color: var(--sub);
  font-weight: 600;
  min-width: 36px;
  flex-shrink: 0;
}

/* 600px以上で横並び */
@media (min-width: 600px) {
  .wd-weather-row { flex-direction: row; align-items: center; }
}

.wd-weather-icon { display: flex; align-items: center; }
.wd-weather-icon span { font-size: 40px; }

.wd-weather-info p {
  margin: 2px 0;
  line-height: 1.35;
}

.wd-temp-min {
  color: var(--gray-diff);
  opacity: 0.55;
}

.wd-temp-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--gray-diff);
  opacity: 0.55;
}

@media (max-width: 599px) {
  .wd-weather-row { gap: 8px; }
  .wd-weather-icon { margin-bottom: 2px; }
  .wd-weather-info p { line-height: 1.3; }
  .wd-day-label { margin-bottom: -2px; }
}

/* ------------------------------
   Diff Grid（常に2カラム）
------------------------------ */
.wd-diff-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

.wd-diff-day p { margin: 4px 0; }

/* Diff 色 */
.diff-gray { color: var(--gray-diff); }
.diff-red { color: var(--red); }
.diff-blue { color: var(--blue); }
.diff-blue-dark { color: var(--blue-dark); }

/* 注意文 */
.wd-diff-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--sub);
}

@keyframes wd-progress-slide {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ------------------------------
   Links Grid（2→3カラム）
------------------------------ */
.wd-links-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.wd-links-grid a {
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
  color: var(--accent);
  font-size: 14px;
  transition: background 0.15s;
  height: auto;
}
.wd-links-grid a:hover { background: #f1f1f1; }

/* 600px以上で3カラム */
@media (min-width: 600px) {
  .wd-links-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ------------------------------
   Footer
------------------------------ */
.wd-footer {
  border-top: 1px solid var(--border);
  padding: 32px 16px;
  text-align: center;
}

.wd-donate-msg { margin-bottom: 12px; color: var(--sub); }

.wd-donate-buttons { display: flex; justify-content: center; gap: 14px; margin-bottom: 16px; }

.wd-donate-btn {
  padding: 8px 16px;
  background: #f3f3f3;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--accent);
  transition: background 0.15s;
}
.wd-donate-btn:hover { background: #e7e7e7; }

.wd-footer-links a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 4px;
}

.wd-footer-copy a { text-decoration: none; color: inherit; }

/* ------------------------------
   Responsive 強化（900px〜）
------------------------------ */
@media (min-width: 900px) {
  .wd-input-wrap { flex-wrap: nowrap; }
  #locationInput { max-width: 460px; }
}
