/* assets/metno-widget.css */

/* Host wrapper – fyll sin container (din grid-cell) */
.metno-widget-host{
  height: 100%;
  min-height: 0;
}

/* Root – fyller sin container (inte viewport) */
.metno-widget{
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;

  padding: 16px;
  background: #0a0c10;
  color: #f2f2f2;
  border-radius: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  display: flex;
  align-items: stretch;
}

/* Neutralisera ev. fullscreen-klass */
.metno-widget.metno-fullscreen{
  min-height: 0;
}

/* Inre grid – 20% mindre och centrerad i omslutande box */
.metno-grid{
  width: 80%;
  height: 80%;
  min-height: 0;
  margin: auto;

  display: grid;
  gap: 14px;

  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}

@media (min-width: 640px){
  .metno-grid{
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
  }
}

/* Temperatur-rutan – bakgrund sätts inline av PHP */
.metno-temp{
  height: 100%;
  min-height: 0;

  border-radius: 14px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Rad som håller: ghost-badge, temp, badge.
   Ghost och badge har samma bredd så att temperaturen blir centrerad i boxen.
   Badge ligger exakt direkt efter siffran eftersom de är syskon i flex-rad. */
.metno-temp-row{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
}

/* Temperatur i stor text */
.metno-big{
  font-weight: 700;
  font-size: clamp(44px, 11vw, 96px);
  line-height: 1;
}

/* "Känns som" badge */
.metno-feels-badge{
  font-size: clamp(24px, 2.8vw, 24px);
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
  white-space: nowrap;
  opacity: 0.95;
}

/* Ghost-badge: tar plats men syns inte, så temp hålls centrerad */
.metno-feels-ghost{
  visibility: hidden;
}

/* När ingen badge finns alls (temp == feels) – håll layout symmetrisk */
.metno-feels-spacer{
  width: 0;
  height: 0;
}

/* Blåare om känns kallare */
.metno-feels-colder{
  background: rgba(80, 140, 200, 0.35);
}

/* Rödare om känns varmare */
.metno-feels-warmer{
  background: rgba(210, 80, 80, 0.35);
}

/* Risk-rutan – ljusare grå än ytterboxen */
.metno-card{
  height: 100%;
  min-height: 0;

  background: #3a3a3a;
  border-radius: 14px;
  padding: 0;

  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Risk-layout – ikon + procent på samma rad */
.metno-risk-row{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* Wrapper runt procenten så vi kan “hänga” tid-badgen till höger */
.metno-risk-value-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.metno-icon{
  width: clamp(36px, 6vw, 70px);
  height: clamp(36px, 6vw, 70px);
  flex: 0 0 auto;
}

.metno-risk-value{
  font-weight: 700;
  font-size: clamp(28px, 6vw, 58px);
  line-height: 1.1;
}

/* Tid-badge som inte påverkar placeringen av ikon + procent */
.metno-precip-time{
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 10px;

  background: #ffffff;
  color: #0e1018;

  font-size: clamp(12px, 2vw, 16px);
  font-weight: 700;
  line-height: 1;

  padding: 6px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Fel-läge */
.metno-error{
  background: #4a2a2a;
}