/* ============================================================
   10-layout.css
   - Default layout (tablet/desktop landscape)
   - Date / Weather / Lunar base styling
   ============================================================ */

/* ============================================================
   App root container
   ============================================================ */
.screen{
  display:flex;
  flex-direction:column;
  padding: 24px 28px calc(18px + env(safe-area-inset-bottom));
  gap: 18px;
  min-height: 0;
}

/* ============================================================
   Layout A (DEFAULT = landscape)
   ============================================================ */
.layout-a{
  flex: 1;
  min-height: 0;
  display:grid;
  grid-template-columns: 1.13fr 0.87fr;
  gap: 18px;
}

/* ---------- Common panel card ---------- */
.panel{
  height:100%;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  min-height: 0;
}

.panel-title{
  margin: 0 0 12px 0;
  font-size: 18px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.6px;
}

/* ============================================================
   Left Date Panel (DEFAULT)
   ============================================================ */
.panel-date{
  display:flex;
  flex-direction:column;
  min-height: 0;
}

.date-md{
  font-size: 22px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.8px;
}

.date-huge{
  margin-top: 10px;
  padding: 10px 0 8px;
  flex: 1;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;

  min-width: 0;
}

.mmdd{
  font-size: clamp(72px, 10vw, 130px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dow{
  margin-top: 12px;
  font-size: clamp(32px, 5.2vw, 58px);
  font-weight: 900;
  line-height: 1.0;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yyyy{
  margin-top: 10px;
  font-size: 40px;
  color: var(--muted);
  font-weight: 800;
}

.date-meta{
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);

  display:flex;
  flex-direction:column;
  gap: 10px;
}

.meta-row{
  font-size: 22px;
  line-height: 1.25;
}
.meta-row.muted{ color: var(--muted2); }
.meta-label{ color: var(--muted2); }

/* ============================================================
   Right Stack (Weather + Lunar) (DEFAULT)
   ============================================================ */
.right-stack{
  display:grid;
  grid-template-rows: 1.35fr 0.65fr;
  gap: 18px;
  min-height: 0;
}

.panel-weather,
.panel-lunar{
  display:flex;
  flex-direction:column;
  min-height: 0;
}

/* ============================================================
   Weather Panel (DEFAULT)
   ============================================================ */
.weather{
  display:flex;
  flex-direction:column;
  gap: 10px;
  flex:1;
  min-height:0;
}

.wx-main{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 6px 0 2px;
  min-width: 0;
}

.wx-icon{
  font-size: 54px;
  line-height: 1;
  width: 64px;
  text-align:center;
  opacity: 0.95;
}

.wx-text{
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 4px;

  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-temp{
  display:flex;
  align-items:baseline;
  gap: 10px;
  min-width: 0;
}

.wx-now{
  font-size: 42px;
  font-weight: 950;
  white-space: nowrap;
}

.wx-feels{
  font-size: 18px;
  color: var(--muted);

  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-grid{
  margin-top: 6px;
  display:grid;
  grid-template-columns: 1.3fr 0.85fr 0.85fr;
  gap: 10px;
  min-width: 0;
}

.wx-kv{
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  min-width: 0;
}

.wx-kv .k{
  font-size: 15px;
  color: var(--muted2);
  margin-bottom: 6px;
}

.wx-kv .v{
  font-size: 20px;
  font-weight: 900;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Trend (DEFAULT) ---- */
.wx-trend{
  margin-top: 10px;
  padding-top: 6px;
  min-width: 0;
}

.wx-trend-title{
  font-size: 14px;
  color: var(--muted2);
  font-weight: 800;
  letter-spacing: 0.3px;
  margin: 0 0 8px 0;

  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-trend-wrap{
  position: relative;
  width: 100%;
  height: 40px;
  min-width: 0;
}

.wx-trend-svg{
  width: 100%;
  height: 40px;
  display: block;
}

.wx-trend-base{ stroke: rgba(255,255,255,0.10); stroke-width: 1; }
.wx-trend-line{
  fill: none;
  stroke: rgba(255,255,255,0.55);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wx-trend-dot{ fill: rgba(255,255,255,0.95); opacity: 0.95; }
.wx-trend-dot.mid{ fill: rgba(255,255,255,0.75); opacity: 0.9; }

.wx-trend-label{
  position: absolute;
  top: 0px;
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  font-weight: 900;
  letter-spacing: 0.2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(6px);
  user-select: none;

  max-width: 46%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-trend-left{ left: 0; transform: translateX(-2px); }
.wx-trend-right{ right: 0; transform: translateX(2px); }

/* ---- Weather footer (one line) ---- */
.wx-footer{
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;

  font-size: clamp(12px, 1.2vw, 14px);
  color: var(--muted2);

  white-space: nowrap;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
}

.wx-footer-left,
.wx-footer-right{
  min-width: 0;
  flex: 1 1 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-footer-left{ max-width: 68%; }
.wx-footer-right{ max-width: 32%; text-align:right; }

/* ============================================================
   Lunar Panel (DEFAULT = landscape two columns)
   ============================================================ */
.lunar-grid{
  display: grid;
  grid-template-columns: 1fr;      /* Yi row, Ji row */
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.lunar-col{
  display: grid;
  grid-template-columns: auto 1fr; /* badge | tags */
  align-items: start;
  column-gap: 10px;
  row-gap: 6px;
  min-height: 0;
}

.lunar-head{
  grid-column: 1;
}

/* Yi / Ji badge color accents */
.badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: auto;
  padding: 6px 10px;

  border-radius: 999px;
  text-align: center;
  font-weight: 950;
  font-size: clamp(14px, 1.6vw, 18px);;
  line-height: 1;
  white-space: nowrap;

  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.badge-yi{
  background: var(--yi);
}

.badge-ji{
  background: var(--ji);
}

.items,
.items-compact{
  grid-column: 2;
  margin: 0;
  padding-left: 0;
  list-style: none;

  display: flex;
  flex-wrap: wrap;
  gap: 8px 8px;
}

.items li,
.items-compact li{
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-size: clamp(12px, 1.6vw, 16px);
  line-height: 1;
  white-space: nowrap;
}

.items li.item-more,
.items-compact li.item-more{
  border-style: dashed;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}

.hint{
  margin-top: auto;
  padding-top: 12px;
  font-size: 14px;
  color: var(--muted2);
  border-top: 1px solid var(--line);
}

/* ============================================================
   Footer (app bottom bar)
   ============================================================ */
.footer{
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:center;
  font-size: 16px;
  color: var(--muted2);
  padding: 4px 0;
}

.sep{ opacity: 0.6; }

#versionText{
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
