/* =========================================================
   AVWX page (scoped)
   ========================================================= */

.avwx-wrap{
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 15px 60px;
}

.avwx-header{
  display:flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.avwx-title{
  font-size: 2.1rem;
  line-height: 1.1;
  margin: 0;
}

.avwx-subtitle{
  margin-top: 6px;
  opacity: 0.75;
  font-size: 0.95rem;
}

.avwx-refresh{
  width: auto !important;
  margin: 0 !important;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.avwx-card{
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 8px;
}

.avwx-runway-card{
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 8px;
  margin-top: 16px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.avwx-cardTitle{
  font-size: 1.05rem;
  margin-bottom: 12px;
}

/* Labels / values */
.avwx-label{
  font-size: 0.8rem;
  opacity: 0.75;
}

.avwx-value{
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: bold;
}

.avwx-muted{
  opacity: 0.75;
  font-size: 0.85rem;
}

/* METAR block */
.avwx-metar{
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(0,0,0,0.15);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================================================
   Top layout: 3 separate cards (2 + 1 + 1)
   Use HTML wrapper: <div class="avwx-top-grid"> ... 3x <section class="avwx-card">
   ========================================================= */

.avwx-top-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;                 /* spacing between the three cards */
  margin: 14px 0 18px;
}

.avwx-top-grid .span-2{
  grid-column: span 2;
}

/* UTC clock */
.avwx-utc-time{
  margin-top: 8px;
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

/* Optional: if your meta card content was previously right-aligned */
.avwx-meta{
  text-align: right;
}

/* KPIs grid */
.avwx-kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.avwx-kpi{
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
  overflow: visible;
  z-index: 5;
}

.avwx-kpiValue{
  margin-top: 8px;
  font-size: 1.6rem;
  font-weight: bold;
  z-index: 5;
}

/* Two-column grid sections */
.avwx-grid2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

/* Runways */
.avwx-runways{
  display:flex;
  gap: 16px;
  flex-wrap: wrap;
}

.avwx-runwayBlock{
  flex: 1;
  min-width: 200px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(0,0,0,0.10);
}

.avwx-runwayValue{
  margin-top: 6px;
  font-size: 1.4rem;
  font-weight: bold;
}

.avwx-footnote{
  margin-top: 14px;
}

/* Runway viz helpers */
.runway-viz-wrap{
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.runway-card{
  max-width: 800px;
  padding: 20px;
}

.runway-card h3{
  text-align: center;
  margin-bottom: 16px;
}

#rwySvg{
  height: auto;
}

#rwySvg text{
  fill: #ffffff;
  font-size: 12px;
  dominant-baseline: middle;
}

.avwx-status-link{
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.avwx-status-link:hover{
  text-decoration-style: solid;
}

.avwx-status-link{
  position: relative;
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.avwx-status-link::after{
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 125%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.avwx-status-link:hover::after{
  opacity: 1;
}

#metarmeta {
	text-align: right;
}
/* --- TL hover tooltip --- */
.tl-interactive {
    position: relative;
    cursor: pointer;
}
.tl-tooltip {
    display: none;
    position: absolute;
    top: -130px;
    left: 50% ;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    padding: 4px;
    background: #111;
    border: 1px solid #444;
    border-radius: 8px;
    z-index: 9999;
}
.tl-tooltip img {
    width: 100% ;
    height: 100% ;
    object-fit: contain;
    display: block;
}
.tl-interactive:hover .tl-tooltip {
    display: block;
}

/* --- Modal --- */
.tl-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.tl-modal-content {
  width: 600px;
  height: 600px;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}

.tl-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  cursor: pointer;
  font-size: 18px;
}

/* Responsive */
@media (max-width: 980px){
  .avwx-kpis{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avwx-grid2{ grid-template-columns: 1fr; }
  .avwx-meta{ text-align: left; }
}

@media (max-width: 900px){
  .avwx-top-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .avwx-top-grid .span-2{
    grid-column: span 2;
  }
}

@media (max-width: 600px){
  .avwx-kpis{ grid-template-columns: 1fr; }
}

@media (max-width: 560px){
  .avwx-top-grid{
    grid-template-columns: 1fr;
  }
  .avwx-top-grid .span-2{
    grid-column: span 1;
  }
}
