@import url('../../../css/basic-tools.css?v=20260924-3');

.sun-tool {
  max-width: 760px;
  margin: 0 auto;
}

/* =========================================================
   공통 박스
   ========================================================= */

.sun-control-panel,
.sun-section,
.sun-detail,
.sun-source {
  margin-top: 14px;

  padding: 15px;

  border: 1px solid rgba(15, 23, 42, 0.08);

  border-radius: 16px;

  background: rgba(255, 255, 255, 0.74);
}

/* =========================================================
   위치
   ========================================================= */

.sun-location-head {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 10px;
}

.sun-location-head strong {
  display: block;

  font-size: 14px;
}

.sun-location-head span {
  display: block;

  margin-top: 2px;

  color: #64748b;

  font-size: 12px;
}

.sun-current-btn,
.sun-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;
}

.sun-current-btn {
  flex: 0 0 auto;

  padding: 8px 10px;
}

.sun-current-btn:disabled {
  opacity: 0.55;

  cursor: wait;
}

/* =========================================================
   검색
   ========================================================= */

.sun-search-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    72px;

  gap: 8px;
}

.sun-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;
}

.sun-search-input:focus {
  border-color: rgba(245, 158, 11, 0.55);

  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.09);
}

.sun-search-btn {
  min-width: 72px;
}

.sun-search-btn:disabled {
  opacity: 0.6;

  cursor: wait;
}

/* =========================================================
   검색결과
   ========================================================= */

.sun-search-results {
  display: grid;

  gap: 6px;

  margin-top: 8px;
}

.sun-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;
}

.sun-result-item:hover {
  background: rgba(245, 158, 11, 0.05);
}

.sun-result-item strong {
  display: block;

  font-size: 12px;
}

.sun-result-item span {
  display: block;

  overflow: hidden;

  margin-top: 2px;

  color: #64748b;

  font-size: 12px;

  text-overflow: ellipsis;

  white-space: nowrap;
}

.sun-search-empty {
  padding: 10px;

  border-radius: 10px;

  background: rgba(15, 23, 42, 0.035);

  color: #64748b;

  font-size: 12px;
}

/* =========================================================
   최근 위치
   ========================================================= */

.sun-recent-locations {
  margin-top: 9px;
}

.sun-recent-label {
  display: block;

  margin-bottom: 5px;

  color: #94a3b8;

  font-size: 12px;
}

.sun-recent-list {
  display: flex;

  flex-wrap: wrap;

  gap: 5px;
}

.sun-recent-chip {
  padding: 5px 8px;

  border: 1px solid rgba(15, 23, 42, 0.08);

  border-radius: 999px;

  background: rgba(15, 23, 42, 0.025);

  color: inherit;

  font: inherit;
  font-size: 12px;

  cursor: pointer;
}

/* =========================================================
   날짜 / 시간
   ========================================================= */

.sun-date-row {
  display: grid;

  grid-template-columns:
    1fr
    1fr
    auto;

  gap: 8px;

  margin-top: 11px;
}

.sun-date-row label span {
  display: block;

  margin-bottom: 5px;

  color: #64748b;

  font-size: 12px;
}

.sun-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;
}

.sun-now-btn {
  align-self: end;

  min-height: 39px;

  padding: 0 12px;
}

.sun-status {
  min-height: 18px;

  margin: 9px 0 0;

  text-align: center;

  color: #64748b;

  font-size: 12px;
}

/* =========================================================
   HERO
   ========================================================= */

.sun-hero {
  margin-top: 14px;

  padding: 20px;

  overflow: hidden;

  border-radius: 20px;

  background: linear-gradient(145deg, #fff8df 0%, #fff1bd 45%, #ffe3ad 100%);

  color: #3f3217;

  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.sun-hero-top {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 14px;
}

.sun-kicker {
  margin-bottom: 3px;

  color: #927326;

  font-size: 12px;
}

.sun-hero h2 {
  margin: 0;

  font-size: 25px;

  letter-spacing: -0.035em;
}

.sun-summary {
  margin: 7px 0 0;

  color: #76602b;

  font-size: 12px;
  line-height: 1.55;
}

.sun-state-icon {
  flex: 0 0 auto;

  font-size: 52px;

  filter: drop-shadow(0 7px 12px rgba(245, 158, 11, 0.18));
}

/* =========================================================
   일출 / 일몰
   ========================================================= */

.sun-rise-set {
  display: grid;

  grid-template-columns:
    1fr
    0.9fr
    1fr;

  align-items: stretch;

  gap: 8px;

  margin-top: 17px;
}

.sun-main-time,
.sun-daylight {
  padding: 12px 8px;

  border-radius: 13px;

  text-align: center;
}

.sun-main-time {
  background: rgba(255, 255, 255, 0.62);
}

.sun-daylight {
  background: rgba(120, 86, 15, 0.07);
}

.sun-main-time span,
.sun-daylight span {
  display: block;

  font-size: 12px;
}

.sun-main-time strong,
.sun-daylight strong {
  display: block;

  margin-top: 3px;

  font-size: 23px;
}

.sun-main-time small,
.sun-daylight small {
  display: block;

  margin-top: 3px;

  color: #806a36;

  font-size: 12px;
}

/* =========================================================
   Section Head
   ========================================================= */

.sun-section-head {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 10px;
}

.sun-section-head h3 {
  margin: 0;

  font-size: 15px;
}

.sun-section-head span {
  color: #94a3b8;

  font-size: 12px;
}

/* =========================================================
   태양 위치
   ========================================================= */

.sun-position-layout {
  display: grid;

  grid-template-columns:
    180px
    1fr;

  gap: 14px;

  align-items: center;
}

/* =========================================================
   나침반
   ========================================================= */

.sun-compass {
  position: relative;

  width: 160px;
  height: 160px;

  margin: 0 auto;
}

.sun-compass-ring {
  position: absolute;

  inset: 16px;

  border: 1px solid rgba(15, 23, 42, 0.15);

  border-radius: 50%;

  box-shadow: inset 0 0 0 20px rgba(245, 158, 11, 0.025);
}

.sun-compass::before,
.sun-compass::after {
  content: '';

  position: absolute;

  background: rgba(15, 23, 42, 0.08);
}

.sun-compass::before {
  left: 50%;

  top: 16px;
  bottom: 16px;

  width: 1px;
}

.sun-compass::after {
  top: 50%;

  left: 16px;
  right: 16px;

  height: 1px;
}

.sun-compass > span {
  position: absolute;

  color: #64748b;

  font-size: 12px;
  font-weight: 700;
}

.sun-compass .north {
  top: 0;
  left: 50%;

  transform: translateX(-50%);
}

.sun-compass .south {
  bottom: 0;
  left: 50%;

  transform: translateX(-50%);
}

.sun-compass .east {
  right: 0;
  top: 50%;

  transform: translateY(-50%);
}

.sun-compass .west {
  left: 0;
  top: 50%;

  transform: translateY(-50%);
}

.sun-direction-needle {
  position: absolute;

  left: 50%;
  top: 50%;

  width: 2px;
  height: 58px;

  transform-origin: 50% 100%;

  background: linear-gradient(to top, rgba(245, 158, 11, 0.12), #f59e0b);
}

.sun-direction-needle span {
  position: absolute;

  top: -14px;
  left: 50%;

  transform: translateX(-50%);

  font-size: 18px;
}

/* =========================================================
   정보 카드
   ========================================================= */

.sun-info-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 8px;
}

.sun-position-grid {
  grid-template-columns: repeat(2, 1fr);
}

.sun-info-card {
  padding: 10px 8px;

  border-radius: 11px;

  background: rgba(15, 23, 42, 0.035);

  text-align: center;
}

.sun-info-card span {
  display: block;

  color: #64748b;

  font-size: 12px;
}

.sun-info-card strong {
  display: block;

  margin-top: 4px;

  font-size: 15px;
}

.sun-info-card small {
  display: block;

  margin-top: 3px;

  color: #94a3b8;

  font-size: 12px;

  line-height: 1.35;
}

/* =========================================================
   태양 고도 그래프
   ========================================================= */

.sun-path-chart-wrap {
  width: 100%;

  overflow: hidden;

  border: 1px solid rgba(15, 23, 42, 0.06);

  border-radius: 13px;

  background: #ffffff;
}

.sun-path-canvas {
  display: block;

  width: 100%;
  height: 220px;
}

.sun-path-legend {
  display: flex;

  flex-wrap: wrap;

  justify-content: center;

  gap: 9px;

  margin-top: 8px;

  color: #64748b;

  font-size: 12px;
}

.sun-path-legend span {
  display: inline-flex;

  align-items: center;

  gap: 4px;
}

.sun-path-legend i {
  display: block;

  width: 9px;
  height: 9px;

  border-radius: 2px;
}

.sun-path-legend .day {
  background: #fff1b8;
}

.sun-path-legend .civil {
  background: #ffd8ad;
}

.sun-path-legend .nautical {
  background: #cbd5e1;
}

.sun-path-legend .astro {
  background: #718096;
}

.sun-path-legend .night {
  background: #273449;
}

/* =========================================================
   박명 Timeline
   ========================================================= */

.sun-timeline {
  display: grid;

  grid-template-columns: repeat(5, 1fr);

  gap: 6px;
}

.sun-timeline-item {
  padding: 9px 5px;

  border: 1px solid rgba(15, 23, 42, 0.07);

  border-radius: 10px;

  text-align: center;
}

.sun-timeline-item.is-main {
  border-color: rgba(245, 158, 11, 0.24);

  background: rgba(245, 158, 11, 0.055);
}

.sun-timeline-item span {
  display: block;

  min-height: 27px;

  color: #64748b;

  font-size: 12px;

  line-height: 1.3;
}

.sun-timeline-item strong {
  display: block;

  margin-top: 4px;

  font-size: 13px;
}

/* =========================================================
   낮 길이 비교
   ========================================================= */

.sun-day-compare {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 8px;
}

.sun-day-compare article {
  padding: 11px 8px;

  border-radius: 12px;

  background: rgba(15, 23, 42, 0.035);

  text-align: center;
}

.sun-day-compare article.today {
  background: rgba(245, 158, 11, 0.09);
}

.sun-day-compare span {
  display: block;

  color: #64748b;

  font-size: 12px;
}

.sun-day-compare strong {
  display: block;

  margin-top: 4px;

  font-size: 14px;
}

.sun-day-compare small {
  display: block;

  margin-top: 3px;

  color: #94a3b8;

  font-size: 12px;
}

/* =========================================================
   상세
   ========================================================= */

.sun-detail summary {
  cursor: pointer;

  font-size: 13px;
  font-weight: 700;
}

.sun-detail-grid {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 7px;

  margin-top: 10px;
}

.sun-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);
}

.sun-detail-grid span {
  color: #64748b;

  font-size: 12px;
}

.sun-detail-grid strong {
  font-size: 12px;
}

/* =========================================================
   출처
   ========================================================= */

.sun-source {
  color: #64748b;

  font-size: 12px;

  line-height: 1.5;
}

.sun-source p {
  margin: 5px 0 0;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {
  .sun-position-layout {
    grid-template-columns: 1fr;
  }

  .sun-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sun-rise-set {
    grid-template-columns:
      1fr
      0.8fr
      1fr;
  }

  .sun-main-time strong,
  .sun-daylight strong {
    font-size: 19px;
  }

  .sun-timeline {
    grid-template-columns: repeat(5, minmax(72px, 1fr));

    overflow-x: auto;

    padding-bottom: 4px;
  }

  .sun-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .sun-search-row {
    grid-template-columns:
      minmax(0, 1fr)
      64px;
  }

  .sun-date-row {
    grid-template-columns:
      1fr
      1fr;
  }

  .sun-now-btn {
    grid-column: 1 / -1;
  }

  .sun-hero {
    padding: 17px 14px;
  }

  .sun-state-icon {
    font-size: 43px;
  }

  .sun-rise-set {
    gap: 5px;
  }

  .sun-main-time,
  .sun-daylight {
    padding: 10px 4px;
  }

  .sun-main-time strong,
  .sun-daylight strong {
    font-size: 17px;
  }

  .sun-day-compare {
    gap: 5px;
  }
}
