/* --- Small Desktop -> 1100px --- */
@media (max-width: 1100px) {
  /* Typography */
  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 17px;
  }

  /* Main Dashboard */
  .dashboard {
    width: calc(100% - 32px);
    gap: 20px;
    margin-top: 36px;
  }

  .dashboard__main {
    margin-top: 20px;
    gap: 20px;
  }

  .dashboard__primary-column {
    gap: 20px;
  }

  /* Sidebar */
  .sidebar {
    padding: 32px 14px;
  }

  .sidebar__top-buttons {
    gap: 16px;
  }

  /* Search */
  .search-box {
    gap: 12px;
    padding-inline: 20px;
  }

  .search-box img {
    width: 22px;
    height: 22px;
  }

  /* User */
  .user-profile {
    gap: 12px;
    padding-inline: 12px;
  }

  .user-profile a:nth-child(2) {
    gap: 12px;
  }

  /* Weather card */
  .weather-card {
    padding: 20px;
  }

  .weather-card__location {
    padding: 8px 14px;
  }

  .weather-card__datetime {
    gap: 6px;
  }

  .weather-card__time {
    font-size: 32px;
  }

  .weather-card__current-temperature {
    font-size: 72px;
  }

  .weather-card__high-low {
    gap: 10px;
  }

  /* Forecast card */
  .forecast {
    padding: 20px;
    gap: 20px;
  }

  .forecast__view-toggle button {
    font-size: 17px;
  }

  .forecast__temperature-panels {
    margin-top: 20px;
    gap: 12px;
    padding-bottom: 10px;
  }

  .forecast__temperature-panel {
    gap: 10px;
    padding: 10px 8px;
  }

  .forecast__temperature-panel img {
    width: 22px;
    height: 22px;
  }

  .forecast__tomorrow-card {
    margin-top: 16px;
    padding: 12px;
    gap: 8px;
  }

  .forecast__tomorrow-info {
    flex: 1;
    min-width: 0;
    gap: 4px;
  }

  .forecast__tomorrow-info h2 {
    font-size: 14px;
    white-space: nowrap;
  }

  .forecast__tomorrow-info p {
    font-size: 10px;
  }

  .forecast__tomorrow-temperature {
    display: flex;
    align-items: baseline;
    gap: 3px;
    font-size: 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .forecast__tomorrow-temperature span:last-child {
    font-size: 12px;
  }

  .forecast__tomorrow-card img {
    width: 28px;
    height: 28px;
  }

  .forecast__daylight-card {
    padding: 16px;
  }

  .forecast__timing,
  .forecast__day-length {
    gap: 6px;
  }

  .forecast__time-value,
  .forecast__day-length-value {
    font-size: 18px;
  }

  /* Highlights card */
  .highlights {
    padding: 20px;
  }

  .highlights__cards {
    margin-top: 24px;
    gap: 20px;
  }

  .highlights__column {
    gap: 20px;
  }

  .highlights__card {
    padding: 16px;
  }

  .highlights__card img {
    width: 44px;
    height: 44px;
    margin-top: 6px;
  }

  .highlights__subheading {
    font-size: 24px;
  }

  .highlights__subheading,
  .highlights__data {
    margin-top: 6px;
  }

  /* Locations card */
  .locations__cards {
    margin-top: 28px;
    gap: 16px;
  }

  .locations__card {
    padding: 24px 20px;
    gap: 8px;
  }

  .locations__temperature,
  .locations__overlay-temperature {
    font-size: 28px;
  }

  .locations__card-info {
    margin-top: 6px;
  }

  .locations__card-details img {
    width: 28px;
    height: 28px;
  }
}

/* --- Narrow desktop / tablet landscape -> 900px --- */
@media (max-width: 900px) {
  /* Typography */
  h2 {
    font-size: 23px;
  }

  /* Main Dashboard */
  .dashboard {
    gap: 16px;
    margin-top: 32px;
  }

  .dashboard__main {
    margin-top: 16px;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .dashboard__primary-column {
    gap: 16px;
  }

  .dashboard__secondary-column {
    justify-content: flex-start;
    gap: 16px;
  }

  .dashboard__header {
    gap: 16px;
  }

  /* Sidebar */
  .sidebar {
    padding: 28px 12px;
  }

  .sidebar__top-buttons {
    gap: 14px;
  }

  /* Search */
  .search-box {
    gap: 10px;
    padding-inline: 16px;
    flex: 1;
    min-width: 0;
  }

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

  /* User */
  .user-profile {
    gap: 10px;
    flex-shrink: 0;
    padding-inline: 10px;
  }

  .user-profile a:nth-child(2) {
    gap: 10px;
  }

  .user-profile__name,
  .user-profile a {
    white-space: nowrap;
  }

  /* Weather card */
  .weather-card {
    padding: 16px;
    min-height: 300px;
    height: auto;
  }

  .weather-card__location {
    padding: 6px 12px;
  }

  .weather-card__time {
    font-size: 30px;
  }

  .weather-card__date,
  .weather-card__apparent-temperature {
    font-size: 15px;
  }

  .weather-card__current-temperature {
    font-size: 68px;
  }

  .weather-card__high-low {
    gap: 8px;
  }

  .weather-card__high-low p {
    font-size: 13px;
  }

  /* Forecast card */
  .forecast {
    min-width: 0;
    padding: 16px;
    gap: 16px;
  }

  .forecast__temperature-panels {
    margin-top: 16px;
    gap: 10px;
    padding-bottom: 8px;
  }

  .forecast__temperature-panel {
    gap: 8px;
    padding: 8px 6px;
  }

  .forecast__temperature-panel p {
    font-size: 15px;
  }

  .forecast__tomorrow-card {
    margin-top: 12px;
    padding: 12px;
  }

  .forecast__tomorrow-info {
    gap: 4px;
  }

  .forecast__tomorrow-info h2 {
    font-size: 18px;
  }

  .forecast__tomorrow-info p {
    font-size: 12px;
  }

  .forecast__tomorrow-temperature {
    font-size: 18px;
  }

  .forecast__tomorrow-temperature span:last-child {
    font-size: 14px;
  }

  .forecast__tomorrow-card img {
    width: 28px;
    height: 28px;
  }

  .forecast__daylight-card {
    padding: 12px;
  }

  /* Highlights card */
  .highlights {
    padding: 16px;
  }

  .highlights__cards {
    margin-top: 16px;
    gap: 12px;
  }

  .highlights__column {
    gap: 12px;
  }

  .highlights__card {
    padding: 12px;
  }

  .highlights__card img {
    margin-top: 4px;
    width: 42px;
    height: 42px;
  }

  .highlights__data,
  .highlights__subheading {
    margin-top: 4px;
  }

  .highlights__data {
    font-size: 13px;
  }

  .highlights__subheading {
    font-size: 23px;
  }

  /* Locations card */
  .locations__cards {
    margin-top: 16px;
    gap: 12px;
  }

  .locations__card {
    padding: 16px;
    gap: 8px;
  }

  .locations__temperature,
  .locations__overlay-temperature {
    font-size: 26px;
  }

  .locations__card-info {
    margin-top: 4px;
  }
}

/* --- Tablet -> 768px --- */
@media (max-width: 768px) {
  /* Prevent horizontal overflow on smaller screens */
  html,
  body {
    overflow-x: hidden;
  }

  /* Typography */
  h2 {
    font-size: 22px;
  }

  h3 {
    font-size: 16px;
  }

  /* Main Dashboard */
  .dashboard {
    width: calc(100% - 32px);
    margin: 16px auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .dashboard__content {
    width: 100%;
    flex: none;
  }

  .dashboard__header {
    gap: 16px;
  }

  .dashboard__main {
    width: 100%;
    margin-top: 16px;
  }

  /* Sidebar */
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    align-self: stretch;
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 16px;
  }

  .sidebar__top-buttons {
    flex-direction: row;
    gap: 8px;
  }

  .sidebar__btn::after {
    left: 0;
    top: calc(100% + 2px);
    transform: none;
    z-index: 20;
  }

  .sidebar__btn img {
    width: 22px;
    height: 22px;
  }

  /* Search */
  .search-box {
    flex: 1;
    min-width: 0;
    padding-inline: 12px;
  }

  /* User */
  .user-profile {
    gap: 10px;
    padding-inline: 8px;
  }

  .user-profile__name {
    font-size: 14px;
  }

  .user-profile a {
    font-size: 12px;
  }

  /* Weather card */
  .weather-card__time {
    font-size: 28px;
  }

  .weather-card__date,
  .weather-card__apparent-temperature {
    font-size: 15px;
  }

  .weather-card__current-temperature {
    font-size: 64px;
  }

  /* Forecast card */
  .forecast__view-toggle button {
    font-size: 16px;
  }

  .forecast__temperature-panel p {
    font-size: 14px;
  }

  .forecast__time-value,
  .forecast__day-length-value {
    font-size: 18px;
  }

  /* Highlights card */
  .highlights__card img {
    width: 40px;
    height: 40px;
  }

  .highlights__subheading {
    font-size: 22px;
  }

  /* Locations card */
  .locations__overlay-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .locations__overlay-cards
    > .locations__overlay-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc((100% - 24px) / 2);
    justify-self: center;
  }

  .locations__temperature,
  .locations__overlay-temperature {
    font-size: 24px;
  }

  .locations__city {
    font-size: 14px;
  }

  /* Help panel */
  .help-panel {
    width: 50vw;
    padding: 20px 12px;
  }

  .help-panel__title-group p {
    font-size: 12px;
  }

  .help-options {
    margin-top: 20px;
    gap: 8px;
  }

  .help-option {
    gap: 12px;
    padding: 12px;
  }

  /* Help info */
  .help-info-overlay {
    right: calc(50vw + 20px);
    width: 45vw;
    padding: 16px;
  }

  .help-info-overlay p {
    margin-top: 8px;
    font-size: 14px;
  }
}

/* --- Large Mobile -> 600px --- */
@media (max-width: 600px) {
  /* Main Dashboard */
  .dashboard__header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .dashboard__main {
    margin-top: 12px;
    gap: 12px;
  }

  /* Sidebar */
  .sidebar {
    padding: 12px;
  }

  .sidebar__top-buttons {
    gap: 8px;
  }

  /* Search */
  .search-box {
    width: 100%;
    flex: none;
    gap: 8px;
    padding-inline: 10px;
  }

  /* User */
  .user-profile {
    order: -1;
    align-self: flex-end;
    gap: 8px;
    padding-inline: 8px;
  }

  /* Weather card */
  .weather-card {
    padding: 12px;
  }

  /* Forecast card */
  .forecast {
    padding: 12px;
    gap: 10px;
  }

  .forecast__temperature-panels {
    margin-top: 12px;
    gap: 8px;
    padding-bottom: 6px;
  }

  .forecast__temperature-panel {
    padding: 8px 6px;
  }

  .forecast__tomorrow-card {
    margin-top: 10px;
    padding: 10px;
  }

  .forecast__daylight-card {
    padding: 8px;
  }

  /* Highlights card */
  .highlights {
    padding: 12px;
  }

  .highlights__cards {
    margin-top: 12px;
    gap: 8px;
  }

  .highlights__column {
    gap: 8px;
  }

  .highlights__card {
    padding: 10px;
  }

  /* Locations card */
  .locations__cards {
    margin-top: 12px;
    gap: 8px;
  }

  .locations__card {
    padding: 12px;
    gap: 8px;
  }

  /* Help panel and Help info  */
  .help-panel {
    width: min(380px, 90vw);
    padding: 20px 16px;
  }

  .help-info-overlay {
    left: 50%;
    right: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(340px, calc(100% - 32px));
    padding: 20px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }
}

/* --- Mobile -> 480px --- */
@media (max-width: 480px) {
  /* Typography */
  h1 {
    font-size: 14px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 15px;
  }

  /* Main Dashboard */
  .dashboard__main {
    margin-top: 10px;
    gap: 10px;
  }

  .dashboard__primary-column {
    gap: 10px;
  }

  /* Sidebar */
  .sidebar {
    padding: 12px 8px;
  }

  .sidebar__btn img {
    width: 20px;
    height: 20px;
  }

  /* Search */
  .search-box {
    padding-inline: 8px;
  }

  .search-box img {
    width: 20px;
    height: 20px;
  }

  /* User */
  .user-profile {
    padding-inline: 6px;
  }

  /* Weather card */
  .weather-card {
    height: 240px;
    min-height: 0;
  }

  .weather-card__location {
    padding: 8px 10px;
    gap: 6px;
  }

  .weather-card__time {
    font-size: 24px;
  }

  .weather-card__date {
    max-width: 100%;
    line-height: 1.35;
  }

  .weather-card__current-temperature {
    font-size: clamp(44px, 11vw, 56px);
  }

  .weather-card__unit-button.active {
    padding: 7px 12px;
    font-size: 14px;
  }

  .weather-card__condition {
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .weather-card__icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
  }

  .weather-card__description {
    text-align: right;
  }

  .weather-card__high-low {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .weather-card__high-low p {
    font-size: 12px;
    white-space: nowrap;
  }

  /* Forecast card */
  .forecast {
    flex-direction: row;
    gap: 12px;
    padding: 16px;
  }

  .forecast__view-toggle button {
    font-size: 15px;
  }

  .forecast__temperature-panels {
    margin-top: 10px;
    gap: 6px;
    padding-bottom: 6px;
  }

  .forecast__temperature-panel {
    flex: 0 0 68px;
    padding: 10px 6px;
    gap: 6px;
  }

  .forecast__temperature-panel p {
    font-size: 13px;
  }

  .forecast__temperature-panel img {
    width: 20px;
    height: 20px;
  }

  .forecast__tomorrow-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title icon"
      "description temperature";
    align-items: center;
    column-gap: 8px;
    row-gap: 4px;
    margin-top: 8px;
    padding: 8px;
  }

  .forecast__tomorrow-info {
    display: contents;
  }

  .forecast__tomorrow-info h2 {
    grid-area: title;
    font-size: 13px;
    white-space: nowrap;
  }

  .forecast__tomorrow-info p {
    grid-area: description;
    min-width: 0;
    font-size: 11px;
  }

  .forecast__tomorrow-temperature {
    grid-area: temperature;
    display: flex;
    align-items: baseline;
    justify-self: end;
    gap: 2px;
    font-size: 14px;
    white-space: nowrap;
  }

  .forecast__tomorrow-temperature span:last-child {
    font-size: 11px;
  }

  .forecast__tomorrow-card img {
    grid-area: icon;
    justify-self: end;
    width: 24px;
    height: 24px;
  }

  .forecast__daylight-card {
    flex: 0 0 110px;
    padding: 12px;
  }

  .forecast__time-heading {
    font-size: 13px;
  }

  .forecast__time-value,
  .forecast__day-length-value {
    font-size: 17px;
  }

  /* Highlights card */
  .highlights {
    padding: 10px;
  }

  .highlights__cards {
    margin-top: 10px;
    gap: 8px;
  }

  .highlights__column {
    gap: 8px;
  }

  .highlights__card {
    padding: 8px;
  }

  .highlights__card img {
    width: 36px;
    height: 36px;
  }

  .highlights__subheading {
    font-size: 20px;
  }

  .highlights__data {
    font-size: 12px;
  }

  /* Locations card */
  .locations__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
    gap: 10px;
  }

  .locations__card {
    padding: 14px 12px;
    gap: 6px;
  }

  .locations__city {
    font-size: 14px;
  }

  .locations__condition {
    font-size: 12px;
  }

  .locations__card-details img {
    width: 26px;
    height: 26px;
  }
}

/* --- Very small phones -> 360px --- */
@media (max-width: 360px) {
  /* Typography */
  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 14px;
  }

  /* Main Dashboard */
  .dashboard {
    width: calc(100% - 16px);
    margin-top: 12px;
  }

  /* Sidebar */
  .sidebar__btn img {
    width: 18px;
    height: 18px;
  }

  /* User */
  .user-profile {
    gap: 6px;
    padding-inline: 10px;
  }

  .user-profile__name {
    font-size: 11px;
  }

  .user-profile a {
    font-size: 10px;
  }

  /* Weather card */
  .weather-card {
    padding: 8px;
    height: 200px;
    min-height: 0;
  }

  .weather-card__location {
    padding: 4px 6px;
  }

  .weather-card__time {
    font-size: 22px;
  }

  .weather-card__date {
    font-size: 11px;
  }

  .weather-card__current-temperature {
    font-size: 44px;
  }

  .weather-card__apparent-temperature {
    font-size: 12px;
  }

  .weather-card__unit-button.active {
    padding: 6px 9px;
    font-size: 12px;
  }

  .weather-card__high-low {
    gap: 4px;
  }

  .weather-card__high-low p {
    font-size: 10px;
  }

  /* Forecast card */
  .forecast {
    padding: 8px;
    gap: 6px;
  }

  .forecast__view-toggle button {
    font-size: 14px;
  }

  .forecast__temperature-panels {
    margin-top: 8px;
    gap: 6px;
  }

  .forecast__temperature-panel {
    padding: 6px 4px;
  }

  .forecast__temperature-panel p {
    font-size: 12px;
  }

  .forecast__daylight-card {
    padding: 6px;
  }

  .forecast__time-value,
  .forecast__day-length-value {
    font-size: 16px;
  }

  /* Highlights card */
  .highlights {
    padding: 8px;
  }

  .highlights__cards {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 8px;
    gap: 6px;
  }

  .highlights__column {
    gap: 6px;
  }

  .highlights__card {
    padding: 8px 6px;
  }

  .highlights__card img {
    width: 32px;
    height: 32px;
  }

  .highlights__data {
    font-size: 11px;
  }

  .highlights__subheading {
    font-size: 18px;
  }

  /* Locations card */
  .locations__cards,
  .locations__overlay-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .locations__cards {
    margin-top: 8px;
    gap: 6px;
  }

  .locations__card,
  .locations__overlay-card {
    padding: 8px;
  }

  .locations__temperature,
  .locations__overlay-temperature {
    font-size: 20px;
  }

  .locations__condition {
    font-size: 11px;
  }

  .locations__overlay-cards {
    gap: 12px;
    margin-top: 20px;
  }

  .locations__overlay-cards
    > .locations__overlay-card:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
    justify-self: stretch;
  }

  /* Settings panel */
  .settings-options {
    grid-template-columns: minmax(0, 1fr);
  }
}
