/* ============================================================
 * gramodo — front.css (task 029)
 * Page-specific styles for the homepage.
 *
 * Re-uses today.css for shared blocks: .hero-search, .loc,
 * .hero, .weather-cache-banner, .layout, .wx-main, .wx-side.
 * Owns ONLY the .home-cities block.
 * ============================================================ */

/* --- /front-only overrides of .loc -------------------------------- */
/* On /front the H1 is a generic site headline ("Current Weather and
   Forecast"), and the auto-located city is shown as subhead below it.
   On /today H1 is the city itself — markup differs, so we scope these
   styles by .loc--front. */

.loc--front .loc-place {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loc--front .loc-place__title {
  margin: 0;
  font-family: var(--font);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-1);
}

@media (max-width: 720px) {
  .loc--front .loc-place__title {
    font-size: 22px;
  }
}

.loc--front .loc-place__city {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  color: var(--ink-3);
  font-size: 14px;
}

.loc--front .loc-place__city-name {
  font-weight: 600;
  color: var(--ink-1);
  font-size: 15px;
  letter-spacing: -0.005em;
}

.loc--front .loc-place__city-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  color: var(--ink-3);
}

.loc--front .loc-place__city-meta svg {
  opacity: .55;
  flex-shrink: 0;
}

/* --- Container helpers reused from today.css -------------------- */
/* (intentionally empty — handled by today.css)                    */

/* --- Home cities section --------------------------------------- */
.home-cities {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 24px;
}

.home-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.home-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px;
}

.home-group__title {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}

/* --- Cards grid ------------------------------------------------- */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

.home-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.home-card:hover,
.home-card:focus-visible {
  border-color: var(--line);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
  outline: none;
}

[data-theme="dark"] .home-card:hover,
[data-theme="dark"] .home-card:focus-visible {
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

.home-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

.home-card__city {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .01em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.home-card__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
}

.home-card__temp {
  display: flex;
  gap: 2px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-1);
  letter-spacing: -0.02em;
}

.home-card__deg {
  font-size: 22px;
  font-weight: 500;
  color: var(--ink-2);
}

.home-card__cond {
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
  font-size: 12px;
  color: var(--ink-3);
}

.home-card__range {
  font-variant-numeric: tabular-nums;
}

.home-card__time {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  font-weight: 500;
}

/* ===== Custom Drupal block on front (admin block #1) ===== */
.front-custom-block {
  margin-top: 24px;
}
.front-custom-block__body {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}
.front-custom-block__body > *:first-child { margin-top: 0; }
.front-custom-block__body > *:last-child  { margin-bottom: 0; }
.front-custom-block__body p {
  margin: 0 0 12px;
}
.front-custom-block__body h2,
.front-custom-block__body h3,
.front-custom-block__body h4 {
  color: var(--ink-1);
  margin: 18px 0 8px;
  font-weight: 600;
  line-height: 1.3;
}
.front-custom-block__body h2 { font-size: 20px; }
.front-custom-block__body h3 { font-size: 17px; }
.front-custom-block__body h4 { font-size: 15px; }
.front-custom-block__body a {
  color: var(--accent);
  text-decoration: none;
}
.front-custom-block__body a:hover {
  text-decoration: underline;
}
.front-custom-block__body ul,
.front-custom-block__body ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
.front-custom-block__body li {
  margin: 0 0 4px;
}
.front-custom-block__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.front-custom-block__body blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
}
.front-custom-block__body code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 13px;
}
