/* Subject overview on the "All" tab. Markup: js/overview-render.js, placed by js/render.js renderAll().
   Loaded by index.html after css/styles.css. */

/* ---------- Layout ---------- */
.ov-layout {
  display: grid;
  grid-template-columns: minmax(0, 652px) 300px;
  grid-template-areas:
    'left side'
    'results side';
  column-gap: 40px;
  align-items: start;
  padding-top: 16px;
}

.ov-left { grid-area: left; }
.ov-results { grid-area: results; }
.ov-side { grid-area: side; padding-left: 16px; border-left: 1px solid #dadce0; }

.ov-divider { margin: 28px 0 32px; border: 0; border-top: 1px solid #dadce0; }

/* ---------- Left: label, heading ---------- */
.ov-label { display: flex; align-items: center; gap: 6px; color: #444746; font-size: 14px; }
.ov-label > svg { width: 16px; height: 16px; fill: #1a73e8; }

.ov-menu,
.ov-speak,
.ov-next {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.ov-menu { width: 32px; height: 32px; margin-left: auto; border-radius: 50%; background: none; }
.ov-menu svg { width: 20px; height: 20px; fill: #1f1f1f; }
.ov-menu:hover { background: #f1f3f4; }

.ov-heading { display: flex; align-items: center; gap: 20px; margin: 6px 0 16px; }
.ov-speak { flex-shrink: 0; width: 28px; height: 28px; margin-left: 8px; border-radius: 50%; background: #3b6fe0; }
.ov-speak svg { width: 16px; height: 16px; fill: #fff; }
.ov-title { margin: 0; font-size: 24px; font-weight: 500; color: #1f1f1f; }
.ov-subtitle { margin: 4px 0 0; font-size: 14px; color: #474747; }

/* ---------- Left: photo collage (big lead photo + 2x2 grid) ---------- */
.ov-collage {
  position: relative;
  display: grid;
  grid-template-columns: 53fr 47fr;
  gap: 3px;
  height: 222px;
  margin-bottom: 16px;
}

.ov-collage-single { grid-template-columns: 1fr; }

.ov-lead { position: relative; margin: 0; overflow: hidden; border-radius: 16px 0 0 16px; }
.ov-collage-single .ov-lead { border-radius: 16px; }
.ov-lead img,
.ov-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }

.ov-lead figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 10px 8px;
  color: #fff;
  font-size: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

.ov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  min-height: 0;
  overflow: hidden;
  border-radius: 0 16px 16px 0;
}

.ov-next {
  position: absolute;
  top: 50%;
  right: -14px;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  border: 1px solid #dadce0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.ov-next svg { width: 18px; height: 18px; fill: #1f1f1f; }

/* ---------- Left: summary + Show more ---------- */
.ov-summary { color: #5f6368; font-size: 16px; line-height: 1.6; }
.ov-summary p { margin: 0 0 12px; }
.ov-lead-text { color: #1f1f1f; }
.ov-summary mark { padding: 1px 2px; border-radius: 4px; background: #d3e3fd; color: #1f1f1f; }

/* Collapsed: about three lines, fading out at the bottom */
.ov-summary[data-collapsed='true'] {
  max-height: 5em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.ov-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-radius: 10px;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 12px;
  line-height: 20px;
  vertical-align: 1px;
  text-decoration: none;
}

.ov-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 46px;
  margin-top: 4px;
  border: 1px solid #a8c7fa;
  border-radius: 24px;
  background: #fff;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
}

.ov-more:hover { background: #f8fafd; }
.ov-more svg { width: 20px; height: 20px; fill: #0b57d0; transition: transform 0.2s; }
.ov-more.ov-open svg { transform: rotate(180deg); }

/* ---------- Right: fact cards ---------- */
.ov-facts { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid #dadce0; }
.ov-fact-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ov-fact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 16px;
  background: #f1f3f4;
  color: #1f1f1f;
  font-size: 14px;
}

.ov-fact-label { font-weight: 500; }
.ov-fact-big { font-size: 18px; }

.ov-fact-row { flex-direction: row; align-items: baseline; gap: 12px; }
.ov-fact-row .ov-fact-label { flex-shrink: 0; color: #5f6368; font-weight: 400; }

/* ---------- Right: People also search for ---------- */
.ov-related h3 { margin: 0 0 16px; font-size: 18px; font-weight: 400; color: #1f1f1f; }
.ov-related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; }

.ov-related-item { color: #1f1f1f; font-size: 13px; text-decoration: none; }
.ov-related-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: #f1f3f4; }
.ov-related-item:hover span { text-decoration: underline; }
.ov-related-item[hidden] { display: none; }

.ov-see-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: calc(100% - 24px);
  height: 30px;
  margin: 18px 12px 0;
  border: 0;
  border-radius: 16px;
  background: #f1f3f4;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
}

.ov-see-more:hover { background: #e8eaed; }
.ov-see-more svg { width: 18px; height: 18px; fill: #1f1f1f; }

/* ---------- Tablet / phone: one column - overview, facts, then results ---------- */
@media (max-width: 1100px) {
  .ov-layout {
    grid-template-columns: minmax(0, 652px);
    grid-template-areas:
      'left'
      'side'
      'results';
  }

  /* Divider in .ov-left separates overview from facts; the side's bottom border separates facts from results */
  .ov-side { padding: 0 0 8px; margin-bottom: 28px; border-left: 0; border-bottom: 1px solid #dadce0; }
  .ov-divider { margin: 20px 0 24px; }
}

@media (max-width: 480px) {
  .ov-collage { height: 180px; }
  .ov-next { right: -8px; }
  .ov-related-grid { gap: 12px 6px; }
}
