@media (max-width: 359px) {

  html { font-size: 14px; }

  .hero-section {
    padding-right: 10px;
    padding-left: 10px;
  }

  .weather-main-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .temp-value {
    font-size: 3rem;
  }

  .weather-card-body {
    grid-template-columns: 1fr;
  }

  .weather-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .forecast-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .btn-search,
  .btn-location {
    height: 48px;
    padding: 0 14px;
    font-size: 0.8rem;
  }

  .search-input {
    height: 48px;
    font-size: 0.85rem;
    padding: 0 44px 0 14px;
  }

  .search-icon { right: 14px; }

  .city-name { font-size: 1.2rem; }

  .current-time { font-size: 1.4rem; }

  .nav-logo-text { font-size: 1.1rem; }
  .nav-logo-icon { font-size: 1.3rem; }

  .theme-toggle, .unit-toggle {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .sun-times {
    flex-wrap: wrap;
    gap: 10px;
  }

  .sun-progress-container {
    display: none;
  }

  .scroll-top-btn {
    bottom: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    font-size: 0.95rem;
  }

  .preloader-title { font-size: 1.8rem; }
  .preloader-bar { width: 220px; }
  .preloader-icon { width: 90px; height: 90px; }
  .cloud { font-size: 3.5rem; }
  .sun-rays { font-size: 2rem; }

  .hourly-card {
    min-width: 70px;
    padding: 8px 6px;
  }

  .weather-main-icon { font-size: 3rem; }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .btn-search span,
  .btn-location span {
    display: none;
  }

  .btn-search,
  .btn-location {
    width: 48px;
    padding: 0;
    justify-content: center;
  }
}

@media (min-width: 360px) and (max-width: 479px) {

  .weather-card-body {
    grid-template-columns: 1fr;
  }

  .temp-section {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  }

  .weather-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .forecast-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .sun-progress-container { display: none; }

  .scroll-top-btn {
    bottom: 20px;
    left: 20px;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .astro-card {
    grid-column: 1 / -1;
  }
}

@media (min-width: 480px) and (max-width: 767px) {

  .weather-card-body {
    grid-template-columns: 1fr;
  }

  .temp-section {
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  }

  .weather-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .forecast-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .astro-card {
    grid-column: 1 / -1;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {

  .weather-card-body {
    grid-template-columns: 1fr 1.8fr;
  }

  .weather-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .forecast-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .preloader-icon { width: 140px; height: 140px; }
}

@media (min-width: 1024px) {

  .weather-card-body {
    grid-template-columns: 1fr 2fr;
  }

  .weather-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .forecast-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-wrapper {
    flex-wrap: nowrap;
  }

  .sun-progress-container {
    display: block;
  }
}

@media (min-width: 1400px) {

  .hero-section {
    max-width: 1400px;
  }

  .weather-stats-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .temp-value { font-size: 7rem; }
}

@media (max-height: 500px) and (orientation: landscape) {

  .hero-section {
    padding-top: calc(var(--navbar-height) + 16px);
  }

  .weather-main-card {
    padding: 16px;
  }

  .weather-card-body {
    grid-template-columns: 1fr 2fr;
  }

  .temp-value { font-size: 3.5rem; }
  .weather-main-icon { font-size: 2.5rem; }

  .sun-progress-container { display: none; }
  .extra-info { display: none; }

  .preloader-icon { width: 80px; height: 80px; }
  .cloud { font-size: 3rem; }
  .sun-rays { font-size: 1.8rem; }
}

@media (hover: none) and (pointer: coarse) {

  .stat-card:hover,
  .hourly-card:hover,
  .forecast-card:hover,
  .info-card:hover {
    transform: none;
  }

  .scroll-btn {
    width: 44px;
    height: 44px;
  }

  .theme-toggle, .unit-toggle {
    width: 48px;
    height: 48px;
  }

  .scroll-top-btn {
    width: 56px;
    height: 56px;
  }

  .stat-card:active,
  .hourly-card:active,
  .forecast-card:active {
    transform: scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
}

@media (prefers-contrast: high) {
  :root {
    --bg-glass: rgba(255, 255, 255, 0.98);
    --text-muted: #555;
  }

  .weather-main-card {
    border: 2px solid var(--primary);
  }

  .stat-card {
    border: 1px solid var(--primary);
  }
}

@media print {

  .preloader,
  .navbar,
  .search-container,
  .scroll-top-btn,
  .hourly-section,
  .weather-bg,
  .bg-overlay,
  .bg-particles,
  .scroll-controls,
  .btn-search,
  .btn-location {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .weather-main-card {
    background: white;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .forecast-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-section {
    padding: 0;
  }
}

@media (max-width: 280px) {
  .search-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .search-wrapper {
    flex-direction: column;
  }

  .search-input-group {
    width: 100%;
  }

  .weather-stats-grid,
  .forecast-grid {
    grid-template-columns: 1fr;
  }

  .temp-value { font-size: 2.5rem; }
  .city-name { font-size: 1.1rem; }
  .current-time { font-size: 1.3rem; }

  .extra-info { display: none; }
  .sun-times { flex-direction: column; gap: 8px; }
  .sun-progress-container { display: none; }
  .footer-update { display: none; }
}

@media (min-width: 2560px) {
  html { font-size: 18px; }

  .hero-section {
    max-width: 1600px;
  }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .scroll-top-btn {
    bottom: calc(30px + env(safe-area-inset-bottom));
  }

  .site-footer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}


@media (max-width: 520px){
  .climate-hero{padding:18px}
  .climate-meta{gap:8px 12px}
}




.nav-container {
  gap: 12px;
}

.nav-logo {
  min-width: 0;
  flex: 0 1 auto;
}

.nav-logo-text {
  min-width: 0;
  white-space: nowrap;
}

.nav-controls {
  min-width: 0;
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

@media (max-width: 900px) {
  .nav-container {
    padding-inline: 14px;
    gap: 8px;
  }

  .nav-controls {
    gap: 7px;
  }

  .nav-climate-link {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .nav-climate-link span,
  .favorites-toggle > span:not(.favorites-count),
  .about-toggle > span {
    display: none;
  }

  .favorites-toggle,
  .about-toggle {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }
}

@media (max-width: 600px) {
  :root {
    --navbar-height: 62px;
  }

  .navbar {
    height: var(--navbar-height);
  }

  .nav-container {
    padding-inline: 10px;
    gap: 6px;
  }

  .nav-logo {
    gap: 7px;
  }

  .nav-logo-text {
    font-size: clamp(0.95rem, 4vw, 1.15rem);
    letter-spacing: 0;
  }

  .nav-logo-text small {
    font-size: 0.42rem;
  }

  .nav-logo-icon {
    font-size: 1.25rem;
  }

  .nav-controls {
    gap: 5px;
  }

  .nav-climate-link,
  .theme-toggle,
  .favorites-toggle,
  .about-toggle,
  .unit-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .favorites-count {
    top: -4px;
    left: -4px;
  }
}

@media (max-width: 400px) {
  .nav-container {
    padding-inline: 7px;
  }

  .nav-logo {
    gap: 5px;
  }

  .nav-logo-text {
    font-size: 0.9rem;
  }

  .nav-logo-text small {
    display: none;
  }

  .nav-logo-icon {
    font-size: 1.15rem;
  }

  .nav-controls {
    gap: 4px;
  }

  .nav-climate-link,
  .theme-toggle,
  .favorites-toggle,
  .about-toggle,
  .unit-toggle {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .theme-toggle,
  .unit-toggle {
    font-size: 0.82rem;
  }
}

@media (max-width: 340px) {
  .nav-logo-text {
    display: none;
  }

  .nav-logo {
    flex: 0 0 auto;
  }
}




:root {
  --navbar-height: 72px;
  --section-nav-height: 50px;
}

.navbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  width: 100%;
}

body {
  padding-top: var(--navbar-height);
}

.section-nav {
  position: fixed;
  top: var(--navbar-height);
  inset-inline: 0;
  z-index: 90;
}

html {
  scroll-padding-top: calc(var(--navbar-height) + var(--section-nav-height) + 12px);
}

@media (max-width: 900px) {
  :root {
    --navbar-height: 62px;
    --section-nav-height: 46px;
  }

  html {
    scroll-padding-top: calc(var(--navbar-height) + var(--section-nav-height) + 10px);
  }
}

@media (max-width: 600px) {
  :root {
    --navbar-height: 62px;
    --section-nav-height: 44px;
  }

  html {
    scroll-padding-top: calc(var(--navbar-height) + var(--section-nav-height) + 8px);
  }
}

@media (max-width: 360px) {
  :root {
    --navbar-height: 60px;
    --section-nav-height: 42px;
  }

  html {
    scroll-padding-top: calc(var(--navbar-height) + var(--section-nav-height) + 8px);
  }
}


.section-nav {
  height: var(--section-nav-height);
  padding: 6px clamp(10px, 2vw, 24px);
  background: color-mix(in srgb, var(--bg-secondary) 86%, transparent);
  border-bottom: 1px solid rgba(128, 128, 128, .16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.section-nav-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.section-nav-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  white-space: nowrap;
}

.section-nav-links {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-inline: 2px;
}

.section-nav-links::-webkit-scrollbar { display: none; }

.section-nav-link {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.section-nav-link:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  transform: translateY(-1px);
}

.section-nav-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 2px;
}

.section-nav-link.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 28%, transparent);
}

@media (max-width: 700px) {
  .section-nav {
    padding-inline: 8px;
  }

  .section-nav-inner {
    gap: 7px;
  }

  .section-nav-label {
    min-width: 38px;
    padding-inline: 9px;
    font-size: .72rem;
  }

  .section-nav-link {
    min-height: 32px;
    padding-inline: 10px;
    font-size: .76rem;
  }
}

@media (max-width: 430px) {
  .section-nav-label {
    position: relative;
    min-width: 34px;
    width: 34px;
    padding: 0;
    font-size: 0;
  }

  .section-nav-label::before {
    content: '☰';
    font-size: 15px;
    line-height: 1;
  }

  .section-nav-link {
    min-height: 30px;
    padding-inline: 9px;
    font-size: .72rem;
  }

  .section-nav-links {
    gap: 5px;
  }
}

@media (max-width: 340px) {
  .section-nav {
    padding-inline: 6px;
  }

  .section-nav-link {
    padding-inline: 8px;
    font-size: .69rem;
  }
}

.simple-weather-cta {
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(63,127,116,.055), var(--bg-glass));
}

.simple-weather-cta-header {
  align-items: center;
  margin-bottom: 0 !important;
}

.simple-weather-cta-header > div:first-child {
  min-width: 0;
  max-width: 780px;
}

.simple-weather-cta-description {
  margin: 7px 0 0;
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: .9rem;
}

.simple-weather-cta .section-title {
  margin-bottom: 0;
}

.simple-weather-cta .section-title i {
  flex: 0 0 auto;
}

.simple-weather-cta-button {
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.simple-weather-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 25%, transparent);
  filter: brightness(1.04);
}

.simple-weather-cta-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 3px;
}

@media (max-width: 700px) {
  .simple-weather-cta {
    margin-bottom: 20px;
  }

  .simple-weather-cta-header {
    align-items: stretch;
  }

  .simple-weather-cta-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .simple-weather-cta {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 20px;
  }

  .simple-weather-cta-description {
    font-size: .84rem;
    line-height: 1.7;
  }

  .simple-weather-cta-button {
    min-height: 42px;
    font-size: .88rem;
  }
}
