@import url('../../../css/basic-tools.css?v=20260924-3');

.moon-tool {
  max-width: 760px;
  margin: 0 auto;
}

.moon-control-panel,
.moon-section,
.moon-detail,
.moon-source {
  margin-top: 14px;
  padding: 15px;

  border: 1px solid rgba(15, 23, 42, 0.08);

  border-radius: 16px;

  background: rgba(255, 255, 255, 0.72);
}

/* =========================================================
   위치
   ========================================================= */

.moon-location-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 10px;
}

.moon-location-head strong {
  display: block;

  font-size: 14px;
}

.moon-location-head span {
  display: block;

  margin-top: 2px;

  color: #64748b;

  font-size: 12px;
}

.moon-current-btn,
.moon-now-btn {
  border: 1px solid rgba(15, 23, 42, 0.1);

  border-radius: 10px;

  background: #ffffff;

  color: inherit;

  font: inherit;
  font-size: 12px;

  cursor: pointer;
}

.moon-current-btn {
  padding: 8px 10px;
}

/* =========================================================
   검색
   ========================================================= */

.moon-search-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    72px;

  gap: 8px;
}

.moon-search-input {
  width: 100%;
  min-width: 0;

  padding: 11px 12px;

  border: 1px solid rgba(15, 23, 42, 0.13);

  border-radius: 11px;

  background: #ffffff;

  color: inherit;

  font: inherit;
  font-size: 14px;

  outline: none;
}

.moon-search-input:focus {
  border-color: rgba(37, 99, 235, 0.45);

  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.moon-search-results {
  display: grid;

  gap: 6px;

  margin-top: 8px;
}

.moon-result-item {
  width: 100%;

  padding: 9px 10px;

  text-align: left;

  border: 1px solid rgba(15, 23, 42, 0.08);

  border-radius: 10px;

  background: #ffffff;

  color: inherit;

  cursor: pointer;
}

.moon-result-item strong {
  display: block;

  font-size: 12px;
}

.moon-result-item span {
  display: block;

  overflow: hidden;

  margin-top: 2px;

  color: #64748b;

  font-size: 12px;

  text-overflow: ellipsis;

  white-space: nowrap;
}

/* =========================================================
   날짜 / 시간
   ========================================================= */

.moon-date-row {
  display: grid;

  grid-template-columns:
    1fr
    1fr
    auto;

  gap: 8px;

  margin-top: 11px;
}

.moon-date-row label span {
  display: block;

  margin-bottom: 5px;

  color: #64748b;

  font-size: 12px;
}

.moon-date-row input {
  width: 100%;

  box-sizing: border-box;

  padding: 9px 10px;

  border: 1px solid rgba(15, 23, 42, 0.1);

  border-radius: 10px;

  background: #ffffff;

  color: inherit;

  font: inherit;
}

.moon-now-btn {
  align-self: end;

  min-height: 39px;

  padding: 0 12px;
}

.moon-status {
  min-height: 18px;

  margin: 9px 0 0;

  text-align: center;

  color: #64748b;

  font-size: 12px;
}

/* =========================================================
   대표 달
   ========================================================= */

.moon-hero {
  display: grid;

  grid-template-columns:
    230px
    1fr;

  gap: 24px;

  align-items: center;

  margin-top: 14px;

  padding: 22px;

  border-radius: 20px;

  background: linear-gradient(145deg, #101827, #1f2937);

  color: #ffffff;

  overflow: hidden;
}

.moon-disc-wrap {
  display: flex;

  align-items: center;
  justify-content: center;
}

.moon-canvas {
  display: block;

  width: 210px;
  height: 210px;

  max-width: 100%;

  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
}

.moon-kicker {
  margin-bottom: 4px;

  color: #cbd5e1;

  font-size: 12px;
}

.moon-hero h2 {
  margin: 0;

  font-size: 27px;

  letter-spacing: -0.03em;
}

.moon-illumination {
  display: flex;

  align-items: baseline;

  gap: 6px;

  margin-top: 8px;
}

.moon-illumination strong {
  font-size: 34px;

  line-height: 1;
}

.moon-illumination span {
  color: #cbd5e1;

  font-size: 12px;
}

.moon-badges {
  display: flex;

  flex-wrap: wrap;

  gap: 6px;

  margin-top: 12px;
}

.moon-badge {
  padding: 5px 8px;

  border: 1px solid rgba(255, 255, 255, 0.12);

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.08);

  font-size: 12px;
}

.moon-summary {
  margin: 12px 0 0;

  color: #dbe3ee;

  font-size: 12px;

  line-height: 1.6;
}

/* =========================================================
   공통 section
   ========================================================= */

.moon-section-head {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 10px;
}

.moon-section-head h3 {
  margin: 0;

  font-size: 15px;
}

.moon-section-head span {
  color: #94a3b8;

  font-size: 12px;
}

/* =========================================================
   정보 카드
   ========================================================= */

.moon-info-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 8px;
}

.moon-info-card {
  padding: 11px 10px;

  border-radius: 12px;

  background: rgba(15, 23, 42, 0.035);

  text-align: center;
}

.moon-info-card span {
  display: block;

  color: #64748b;

  font-size: 12px;
}

.moon-info-card strong {
  display: block;

  margin-top: 4px;

  font-size: 16px;
}

.moon-info-card small {
  display: block;

  margin-top: 3px;

  color: #94a3b8;

  font-size: 12px;

  line-height: 1.35;
}

/* =========================================================
   나침반
   ========================================================= */

.moon-sky-layout {
  display: grid;

  grid-template-columns:
    180px
    1fr;

  gap: 14px;

  align-items: center;
}

.moon-compass {
  position: relative;

  width: 160px;
  height: 160px;

  margin: 0 auto;
}

.moon-compass-ring {
  position: absolute;

  inset: 16px;

  border: 1px solid rgba(15, 23, 42, 0.16);

  border-radius: 50%;

  box-shadow: inset 0 0 0 20px rgba(15, 23, 42, 0.015);
}

.moon-compass::before,
.moon-compass::after {
  content: '';

  position: absolute;

  background: rgba(15, 23, 42, 0.09);
}

.moon-compass::before {
  left: 50%;

  top: 16px;
  bottom: 16px;

  width: 1px;
}

.moon-compass::after {
  top: 50%;

  left: 16px;
  right: 16px;

  height: 1px;
}

.moon-compass > span {
  position: absolute;

  color: #64748b;

  font-size: 12px;
  font-weight: 700;
}

.moon-compass .north {
  top: 0;
  left: 50%;

  transform: translateX(-50%);
}

.moon-compass .south {
  bottom: 0;
  left: 50%;

  transform: translateX(-50%);
}

.moon-compass .east {
  right: 0;
  top: 50%;

  transform: translateY(-50%);
}

.moon-compass .west {
  left: 0;
  top: 50%;

  transform: translateY(-50%);
}

.moon-direction-needle {
  position: absolute;

  left: 50%;
  top: 50%;

  width: 2px;
  height: 58px;

  transform-origin: 50% 100%;

  transform: translate(-50%, -100%) rotate(0deg);

  background: linear-gradient(to top, rgba(37, 99, 235, 0.15), #2563eb);
}

.moon-direction-needle span {
  position: absolute;

  top: -13px;
  left: 50%;

  transform: translateX(-50%);

  font-size: 18px;
}

.moon-sky-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* =========================================================
   달 보기
   ========================================================= */

.moon-observe-card {
  display: flex;

  align-items: center;

  gap: 13px;

  padding: 13px;

  border-radius: 14px;

  background: rgba(37, 99, 235, 0.06);
}

.moon-observe-score {
  display: flex;

  flex: 0 0 58px;

  align-items: center;
  justify-content: center;

  width: 58px;
  height: 58px;

  border-radius: 50%;

  background: #1e293b;

  color: #ffffff;

  font-size: 18px;
  font-weight: 800;
}

.moon-observe-card strong {
  font-size: 14px;
}

.moon-observe-card p {
  margin: 4px 0 0;

  color: #64748b;

  font-size: 12px;

  line-height: 1.5;
}

.moon-night-timeline {
  display: flex;

  gap: 6px;

  overflow-x: auto;

  margin-top: 10px;

  padding-bottom: 4px;
}

.moon-night-card {
  flex: 0 0 66px;

  padding: 8px 5px;

  border: 1px solid rgba(15, 23, 42, 0.07);

  border-radius: 10px;

  text-align: center;
}

.moon-night-card.is-best {
  border-color: rgba(37, 99, 235, 0.24);

  background: rgba(37, 99, 235, 0.05);
}

.moon-night-card span,
.moon-night-card small {
  display: block;
}

.moon-night-card span {
  color: #64748b;

  font-size: 12px;
}

.moon-night-card strong {
  display: block;

  margin: 4px 0 2px;

  font-size: 13px;
}

.moon-night-card small {
  color: #94a3b8;

  font-size: 12px;
}

.moon-observe-note {
  margin: 8px 0 0;

  color: #94a3b8;

  font-size: 12px;

  line-height: 1.4;
}

/* =========================================================
   다음 달
   ========================================================= */

.moon-phase-events {
  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 8px;
}

.moon-phase-events article {
  padding: 11px 8px;

  border-radius: 12px;

  background: rgba(15, 23, 42, 0.035);

  text-align: center;
}

.moon-phase-events span {
  display: block;

  color: #64748b;

  font-size: 12px;
}

.moon-phase-events strong {
  display: block;

  margin-top: 5px;

  font-size: 13px;
}

.moon-phase-events small {
  display: block;

  margin-top: 3px;

  color: #2563eb;

  font-size: 12px;
  font-weight: 700;
}

/* =========================================================
   상세
   ========================================================= */

.moon-detail summary {
  cursor: pointer;

  font-size: 13px;
  font-weight: 700;
}

.moon-detail-grid {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 8px;

  margin-top: 10px;
}

.moon-detail-grid div {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 9px 10px;

  border-radius: 9px;

  background: rgba(15, 23, 42, 0.03);
}

.moon-detail-grid span {
  color: #64748b;

  font-size: 12px;
}

.moon-detail-grid strong {
  font-size: 12px;
}

/* =========================================================
   출처
   ========================================================= */

.moon-source {
  color: #64748b;

  font-size: 12px;

  line-height: 1.5;
}

.moon-source strong {
  color: inherit;
}

.moon-source p {
  margin: 5px 0 0;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {
  .moon-hero {
    grid-template-columns: 1fr;

    text-align: center;
  }

  .moon-canvas {
    width: 180px;
    height: 180px;
  }

  .moon-badges {
    justify-content: center;
  }

  .moon-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .moon-sky-layout {
    grid-template-columns: 1fr;
  }

  .moon-phase-events {
    grid-template-columns: repeat(2, 1fr);
  }

  .moon-date-row {
    grid-template-columns:
      1fr
      1fr;
  }

  .moon-now-btn {
    grid-column: 1 / -1;
  }

  .moon-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .moon-search-row {
    grid-template-columns:
      minmax(0, 1fr)
      64px;
  }

  .moon-info-grid,
  .moon-sky-grid {
    grid-template-columns:
      1fr
      1fr;
  }

  .moon-hero {
    padding: 18px;
  }
}
