/* Disaster Grade (Beta): disaster.html and the public example (disaster-grade-example.html). The header band, cards, chips, tags, toggles, tables and notes are
   v3.css's; this file holds what that page adds: the score tabs, the fixed map-title row and the picture. */
.dg-page { max-width: 1340px; }
.dg-back { text-decoration: none; }
.dg-back:hover { background: rgba(255, 255, 255, 0.28); }
.dg-card { padding: 20px 22px 24px; }
.dg-head h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.dg-head .v3-tag { margin-left: 0; font-size: 11px; }
.dg-lead { color: var(--v3-muted); font-size: 14px; margin: 4px 0 16px; }

/* the scores: each is a button, and looks like one (border, shadow, a hover and a pressed state) */
.dg-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.dg-tab { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 10px 12px 12px; border: 1px solid #c3cbd6; border-radius: 8px; background: #fff; color: var(--cg-dark-blue);
  font-family: inherit; text-align: left; cursor: pointer; box-shadow: 0 1px 3px rgba(26, 58, 107, 0.16);
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s; }
.dg-tab:hover { border-color: var(--cg-blue); box-shadow: 0 3px 9px rgba(26, 58, 107, 0.26); transform: translateY(-1px); }
.dg-tab:focus-visible { outline: 2px solid var(--cg-blue); outline-offset: 2px; }
.dg-tab[aria-selected="true"] { border-color: var(--cg-blue); background: #eef4fc;
  box-shadow: inset 0 0 0 1px var(--cg-blue); transform: none; }
/* the chosen score points at its map */
.dg-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px;
  margin-left: -6px; background: #eef4fc; border-right: 2px solid var(--cg-blue); border-bottom: 2px solid var(--cg-blue);
  transform: rotate(45deg); }
.dg-tab-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%; }
.dg-tab-name { font-size: 13px; font-weight: 700; line-height: 1.25; }
.dg-tab-go { flex: none; color: #9aa7b8; line-height: 0; }
.dg-tab:hover .dg-tab-go, .dg-tab[aria-selected="true"] .dg-tab-go { color: var(--cg-blue); }
.dg-tab-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: auto; min-width: 0; }
.dg-tab-more { display: none; font-size: 12px; color: var(--v3-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-chip { display: inline-block; flex: none; min-width: 58px; padding: 1px 10px; border-radius: 6px; border: 1px solid transparent;
  font-size: 22px; font-weight: 800; line-height: 1.35; text-align: center; }
.dg-chip.none { flex: 0 1 auto; min-width: 0; padding: 6px 9px; font-size: 12px; font-weight: 600; line-height: 1.3; background: #eceff3;
  color: #48535f; text-align: left; }
.dg-chip.small { min-width: 34px; margin: 0 0 0 6px; padding: 0 6px; font-size: 12px; font-weight: 700; line-height: 1.5; }

.dg-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 26px; margin-top: 16px; align-items: start; }
/* title and score line left, sub-menu right; the row is this tall whether or not the tab has a sub-menu */
.dg-maphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 46px; max-width: 900px; }
.dg-mapwords { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.dg-maptitle { flex: none; font-size: 16px; font-weight: 700; color: var(--cg-dark-blue); white-space: nowrap; }
.dg-score { font-size: 15px; font-weight: 600; color: #3b4a5e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-subslot { flex: none; height: 34px; display: flex; align-items: center; }
.dg-subslot .v3-toggle button { display: inline-flex; align-items: center; padding: 6px 12px; }
.dg-figure { position: relative; width: 100%; max-width: 900px; aspect-ratio: 1800 / 1148; background: #eef1f4;
  border: 1px solid #d5dbe3; border-radius: 6px; overflow: hidden; }
.dg-figure img { display: block; width: 100%; height: 100%; }
.dg-figure .v3-spinner { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.dg-figure .dg-nopic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center; font-size: 13px; color: var(--v3-muted); }
.dg-credit { max-width: 900px; margin: 6px 0 0; line-height: 1.5; }

.dg-textcol { max-width: 900px; padding-top: 6px; }
.dg-para { font-size: 15px; line-height: 1.6; color: #222; margin: 8px 0 0; }
.dg-notes { margin-top: 10px; }
.dg-notes p { font-size: 12px; color: var(--v3-muted); line-height: 1.5; margin: 3px 0 0; }
.dg-details { margin-top: 14px; border-top: 1px solid #e6e9ee; padding-top: 10px; }
.dg-details > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--cg-blue); }
.dg-details .v3-table { margin-top: 6px; }
.dg-details .v3-table td { padding: 6px 10px 6px 0; }
.dg-details .v3-table td + td { text-align: right; padding-right: 0; white-space: nowrap; font-weight: 600; color: #222; }
.dg-sources { margin: 10px 0 0; line-height: 1.5; }
.dg-about { margin: 22px 0 0; padding-top: 12px; border-top: 1px solid #e6e9ee; line-height: 1.5; max-width: 900px; }

/* the overview (no ?id=): one row per location, one clickable score per hazard */
.dg-h1-tag { font-size: 12px; vertical-align: 6px; }
.dg-ov-row { display: grid; grid-template-columns: minmax(220px, 3fr) repeat(7, minmax(72px, 1fr)); align-items: center;
  gap: 0 6px; padding: 7px 4px; border-bottom: 1px solid #edf0f4; }
.dg-ov-head { padding-bottom: 8px; border-bottom: 2px solid #e6e9ee; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--v3-muted); }
.dg-ov-head span + span { text-align: center; }
.dg-ov-name { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: var(--cg-dark-blue); }
.dg-ov-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.dg-ov-name:hover .dg-ov-title { text-decoration: underline; }
/* each score is a button: its chip carries the shadow, and the cell answers the pointer */
.dg-ov-cell { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 4px 2px;
  border: 1px solid transparent; border-radius: 8px; text-decoration: none; transition: border-color 0.12s, background 0.12s; }
.dg-ov-cell:hover { border-color: var(--cg-blue); background: #eef4fc; }
.dg-ov-cell:focus-visible { outline: 2px solid var(--cg-blue); outline-offset: 1px; }
.dg-ov-cell .dg-chip { min-width: 54px; font-size: 16px; line-height: 1.5; box-shadow: 0 1px 3px rgba(26, 58, 107, 0.22); }
.dg-ov-cell .dg-chip.none { box-shadow: none; }
.dg-ov-label { display: none; }
.dg-ov-none { grid-column: 2 / -1; font-size: 13px; color: var(--v3-muted); }
.dg-ov + .dg-about { border-top: 0; margin-top: 10px; }

/* the public example (disaster-grade-example.html): the same card on the public pages' column, so the picture and
   the text run its full width at every size and the band's name is a second-level heading under the page's own */
.dg-example .v3-header h2 { font-size: 24px; margin: 0 0 2px; color: #fff; }
.dg-example .v3-header .dg-back { align-self: flex-start; }
.dg-example .dg-maphead, .dg-example .dg-figure, .dg-example .dg-credit, .dg-example .dg-textcol,
.dg-example .dg-about { max-width: none; }
.dg-ex-foot { margin: 18px 2px 0; font-size: 15px; color: #333; }
.dg-ex-foot a { color: var(--pb-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

/* room beside the picture: the text sits to its right, level with the title row */
@media (min-width: 1560px) {
  .dg-tab-more { display: inline; }
  .dg-panel { grid-template-columns: minmax(0, 900px) minmax(300px, 1fr); }
  .dg-textcol { padding-top: 40px; }
  .dg-example .dg-panel { grid-template-columns: minmax(0, 1fr); }
  .dg-example .dg-textcol { padding-top: 6px; }
}
@media (max-width: 1100px) {
  .dg-tabs { gap: 8px; }
  .dg-tab { padding: 9px 9px 10px; }
  .dg-tab-go { display: none; }
  .dg-chip { min-width: 50px; font-size: 19px; padding: 1px 8px; }
}
@media (max-width: 760px) {
  .dg-card { padding: 16px 14px 20px; }
  .dg-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .dg-tab { padding: 8px 7px 9px; gap: 6px; }
  .dg-tab-name { font-size: 11.5px; }
  .dg-chip { min-width: 0; font-size: 17px; padding: 1px 7px; }
  .dg-chip.none { font-size: 11px; padding: 4px 6px; }
  .dg-tab[aria-selected="true"]::after { display: none; }
  /* the overview on a phone: the location's name, then its seven scores four across, each under its hazard's name */
  .dg-ov-head { display: none; }
  .dg-ov-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 12px 0; }
  .dg-ov-name, .dg-ov-none { grid-column: 1 / -1; }
  .dg-ov-cell { flex-direction: column; gap: 3px; padding: 6px 2px; border-color: #dfe4ea; }
  .dg-ov-label { display: block; font-size: 10.5px; font-weight: 700; color: var(--cg-dark-blue); }
  .dg-ov-cell .dg-chip { min-width: 0; font-size: 15px; box-shadow: none; }
  /* three fixed rows on a phone: the title, the score line, then the sub-menu's place */
  .dg-maphead { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; height: 90px; }
  .dg-mapwords { flex-direction: column; align-items: flex-start; gap: 0; max-width: 100%; }
  .dg-maptitle { line-height: 24px; }
  .dg-score { max-width: 100%; font-size: 14px; line-height: 22px; }
}
