/*
|--------------------------------------------------------------------------
| CTUIR Weather Widget
|--------------------------------------------------------------------------
*/

.ctuir-weather {
  --weather-card-bg: #f7f9fc;
  --weather-border: #e1e8f0;
  --weather-text: #17324d;
  --weather-muted: #64778b;

  max-width: 1050px;

  margin: 30px auto;

  color: var(--weather-text);

  font-family: inherit;
}

/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.ctuir-weather-header {
  margin-bottom: 28px;

  text-align: center;
}

.ctuir-weather-title {
  margin: 0;

  font-size: clamp(26px, 4vw, 38px);

  font-weight: 700;
  line-height: 1.15;
}

.ctuir-weather-subtitle {
  margin-top: 8px;

  color: var(--weather-muted);

  font-size: 15px;
}

/*
|--------------------------------------------------------------------------
| Grid
|--------------------------------------------------------------------------
*/

.ctuir-weather-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 20px;
}

/*
|--------------------------------------------------------------------------
| Weather Cards
|--------------------------------------------------------------------------
*/

.ctuir-weather-card {
  position: relative;

  overflow: hidden;

  min-height: 220px;

  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: center;

  padding: 30px 24px;

  background: linear-gradient(145deg, #ffffff 0%, var(--weather-card-bg) 100%);

  border: 1px solid var(--weather-border);

  border-radius: 20px;

  box-shadow: 0 8px 24px rgba(25, 55, 80, 0.08);

  text-align: center;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.ctuir-weather-card:hover {
  transform: translateY(-3px);

  box-shadow: 0 12px 30px rgba(25, 55, 80, 0.13);
}

/*
|--------------------------------------------------------------------------
| Weather Icons
|--------------------------------------------------------------------------
*/

.ctuir-weather-icon {
  width: 72px;
  height: 72px;

  display: flex;

  align-items: center;
  justify-content: center;

  margin-bottom: 16px;

  border-radius: 50%;

  font-size: 42px;
  line-height: 1;
}

.ctuir-weather-card--wind .ctuir-weather-icon {
  background: #e7f4fc;
}

.ctuir-weather-card--temp .ctuir-weather-icon {
  background: #fff1e5;
}

.ctuir-weather-card--solar .ctuir-weather-icon {
  background: #fff5ce;
}

/*
|--------------------------------------------------------------------------
| Labels
|--------------------------------------------------------------------------
*/

.ctuir-weather-label {
  margin-bottom: 8px;

  color: var(--weather-muted);

  font-size: 13px;
  font-weight: 700;

  letter-spacing: 0.08em;

  text-transform: uppercase;
}

/*
|--------------------------------------------------------------------------
| Main Reading
|--------------------------------------------------------------------------
*/

.ctuir-weather-value {
  margin: 0;

  color: var(--weather-text);

  font-size: clamp(28px, 3vw, 38px);

  font-weight: 700;

  line-height: 1.1;
}

.ctuir-weather-unit {
  font-size: 0.5em;
}

/*
|--------------------------------------------------------------------------
| Secondary Reading
|--------------------------------------------------------------------------
*/

.ctuir-weather-secondary {
  margin-top: 8px;

  color: var(--weather-muted);

  font-size: 15px;
  line-height: 1.5;
}

/*
|--------------------------------------------------------------------------
| Wind Direction
|--------------------------------------------------------------------------
*/

.ctuir-weather-direction {
  margin-top: 12px;

  color: var(--weather-text);

  font-size: 16px;
  font-weight: 600;
}

.ctuir-weather-divider {
  margin: 0 4px;
}

/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.ctuir-weather-footer {
  margin-top: 22px;

  padding-top: 18px;

  border-top: 1px solid var(--weather-border);

  color: var(--weather-muted);

  text-align: center;

  font-size: 14px;
}

.ctuir-weather-footer strong {
  color: var(--weather-text);
}

/*
|--------------------------------------------------------------------------
| Errors
|--------------------------------------------------------------------------
*/

.ctuir-weather-error {
  max-width: 700px;

  margin: 25px auto;

  padding: 18px 22px;

  background: #f7f9fb;

  border: 1px solid #e3e9ef;

  border-radius: 12px;

  color: #33485c;

  text-align: center;
}

/*
|--------------------------------------------------------------------------
| Tablet / Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 800px) {
  .ctuir-weather {
    margin: 20px 15px;
  }

  .ctuir-weather-grid {
    grid-template-columns: 1fr;
  }

  .ctuir-weather-card {
    min-height: 190px;
  }
}

/*
|--------------------------------------------------------------------------
| Very Small Screens
|--------------------------------------------------------------------------
*/

@media (max-width: 420px) {
  .ctuir-weather-card {
    padding: 25px 18px;
  }

  .ctuir-weather-icon {
    width: 64px;
    height: 64px;

    font-size: 36px;
  }
}
/*
|--------------------------------------------------------------------------
| Wind Compass
|--------------------------------------------------------------------------
*/

.ctuir-wind-compass {
  position: relative;

  width: 125px;
  height: 125px;

  margin: 4px auto 22px;

  border: 3px solid #cbd8e4;

  border-radius: 50%;

  background: radial-gradient(
    circle at center,
    #ffffff 0%,
    #f5f9fc 65%,
    #e9f1f7 100%
  );

  box-shadow:
    inset 0 0 0 5px #ffffff,
    0 6px 18px rgba(25, 55, 80, 0.1);
}

/*
|--------------------------------------------------------------------------
| Compass Direction Labels
|--------------------------------------------------------------------------
*/

.ctuir-compass-label {
  position: absolute;

  color: #64778b;

  font-size: 12px;
  font-weight: 700;

  line-height: 1;

  z-index: 3;
}

.ctuir-compass-north {
  top: 8px;
  left: 50%;

  transform: translateX(-50%);
}

.ctuir-compass-east {
  top: 50%;
  right: 8px;

  transform: translateY(-50%);
}

.ctuir-compass-south {
  bottom: 8px;
  left: 50%;

  transform: translateX(-50%);
}

.ctuir-compass-west {
  top: 50%;
  left: 8px;

  transform: translateY(-50%);
}

/*
|--------------------------------------------------------------------------
| Compass Center
|--------------------------------------------------------------------------
*/

.ctuir-compass-center {
  position: absolute;

  top: 50%;
  left: 50%;

  width: 12px;
  height: 12px;

  transform: translate(-50%, -50%);

  background: #17324d;

  border: 3px solid #ffffff;

  border-radius: 50%;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);

  z-index: 4;
}

/*
|--------------------------------------------------------------------------
| Wind Arrow
|--------------------------------------------------------------------------
*/

.ctuir-wind-arrow {
  position: absolute;

  top: 50%;
  left: 50%;

  width: 6px;
  height: 88px;

  transform: translate(-50%, -50%) rotate(0deg);

  transform-origin: 50% 50%;

  transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);

  z-index: 2;
}

/*
|--------------------------------------------------------------------------
| Arrow Shaft
|--------------------------------------------------------------------------
*/

.ctuir-wind-arrow-shaft {
  position: absolute;

  top: 22px;
  left: 50%;

  width: 4px;
  height: 42px;

  transform: translateX(-50%);

  background: #1677b8;

  border-radius: 4px;
}

/*
|--------------------------------------------------------------------------
| Arrow Head
|--------------------------------------------------------------------------
*/

.ctuir-wind-arrow-head {
  position: absolute;

  top: 8px;
  left: 50%;

  width: 0;
  height: 0;

  transform: translateX(-50%);

  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 19px solid #1677b8;
}

/*
|--------------------------------------------------------------------------
| Air Quality
|--------------------------------------------------------------------------
*/

.ctuir-air-quality {
  margin-top: 24px;

  padding: 28px;

  background: linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);

  border: 1px solid var(--weather-border);

  border-radius: 20px;

  box-shadow: 0 8px 24px rgba(25, 55, 80, 0.08);
}

/*
|--------------------------------------------------------------------------
| Air Quality Header
|--------------------------------------------------------------------------
*/

.ctuir-air-quality-header {
  margin-bottom: 20px;

  text-align: center;
}

.ctuir-air-quality-title {
  margin: 4px 0 0;

  color: var(--weather-text);

  font-size: 24px;
  font-weight: 700;
}

/*
|--------------------------------------------------------------------------
| PurpleAir Widget Container
|--------------------------------------------------------------------------
*/

.ctuir-air-quality-widget {
  display: flex;

  justify-content: center;
  align-items: center;

  width: 100%;

  min-height: 150px;
}

.ctuir-purpleair-widget {
  width: 100%;

  text-align: center;
}

/*
|--------------------------------------------------------------------------
| Wind Direction Explanation
|--------------------------------------------------------------------------
*/

.ctuir-wind-explanation {
  margin-top: 8px;

  max-width: 220px;

  color: var(--weather-muted);

  font-size: 11px;
  line-height: 1.4;

  text-align: center;
}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 800px) {
  .ctuir-air-quality {
    padding: 22px 16px;
  }
}

/*
|--------------------------------------------------------------------------
| PurpleAir Widget Alignment
|--------------------------------------------------------------------------
*/

.ctuir-air-quality-widget {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
}

.ctuir-purpleair-widget {
  display: flex;
  justify-content: center;

  width: 100%;
}

.ctuir-purpleair-widget > * {
  margin-left: auto !important;
  margin-right: auto !important;
}

/*
|--------------------------------------------------------------------------
| PurpleAir Source Attribution
|--------------------------------------------------------------------------
*/

.ctuir-air-quality-source {
  margin-top: 18px;

  color: black;

  font-size: 14px;
  line-height: 1.4;

  text-align: center;
}

.ctuir-air-quality-source a {
  color: black;

  font-weight: 600;

  text-decoration: none;
}

.ctuir-air-quality-source a:hover,
.ctuir-air-quality-source a:focus {
  text-decoration: underline;
}
