/* Individual element page styles - shares the dark theme of the periodic table */

:root {
  --bg: #0f1720;
  --panel: #182430;
  --text: #e8edf2;
  --text-dim: #9fb0c0;
  --border: rgba(255, 255, 255, 0.08);
  --link: #74c0fc;

  --c-alkali-metal: #ff6b6b;
  --c-alkaline-earth-metal: #ffa94d;
  --c-transition-metal: #ffd43b;
  --c-post-transition-metal: #a9e34b;
  --c-metalloid: #38d9a9;
  --c-nonmetal: #4dabf7;
  --c-halogen: #74c0fc;
  --c-noble-gas: #b197fc;
  --c-lanthanide: #f783ac;
  --c-actinide: #e599f7;
  --c-unknown: #adb5bd;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.25rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

a { color: var(--link); }

/* White full-width top bar holding the logo + nav buttons */
.el-topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: #fff;
  margin: -1.25rem -1.25rem 1.75rem;
  padding: 0.55rem 1.25rem;
}
.el-logo { display: inline-flex; line-height: 0; }
.el-logo img { height: 38px; width: auto; display: block; }

.el-nav-buttons { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* Buttons sit on the white bar: light background, dark text */
.el-nav-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border: 1px solid #d5dbe1;
  border-radius: 6px;
  background: #eef1f4;
  color: #1b2733;
}
.el-nav-link:hover { background: #dde3e9; }
.el-nav-link.disabled { opacity: 0.4; pointer-events: none; }

/* Header with big colored tile */
.el-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 960px;
  margin: 0 auto 1.5rem;
}
.el-tile {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #10202a;
  flex-shrink: 0;
  background: var(--c-unknown);
}
.el-tile-number { font-size: 0.9rem; font-weight: 600; }
.el-tile-symbol { font-size: 3rem; font-weight: 700; line-height: 1; }
.el-name-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.el-heading h1 { margin: 0; font-size: 2.2rem; }
.el-category { margin: 0; color: var(--text-dim); font-size: 1.05rem; }
.el-shop {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  background: var(--c-metalloid);
  color: #10202a;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}
.el-shop:hover { filter: brightness(1.08); }

/* Body: properties sidebar + prose */
.el-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  max-width: 960px;
  margin: 0 auto;
}
.el-props {
  flex: 0 0 300px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}
.el-props h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.el-props dl { margin: 0; }
.el-props .prop {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.el-props .prop:first-child { border-top: none; }
.el-props dt { color: var(--text-dim); margin: 0; }
.el-props dd { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }

.el-content { flex: 1 1 auto; min-width: 0; }
.el-section { margin-bottom: 1.75rem; }
.el-section h2 {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--border);
}
.el-section p { margin: 0 0 0.75rem; color: #d6dee6; }

/* Colored accent on the header tile per category */
.el-tile.cat-alkali-metal { background: var(--c-alkali-metal); }
.el-tile.cat-alkaline-earth-metal { background: var(--c-alkaline-earth-metal); }
.el-tile.cat-transition-metal { background: var(--c-transition-metal); }
.el-tile.cat-post-transition-metal { background: var(--c-post-transition-metal); }
.el-tile.cat-metalloid { background: var(--c-metalloid); }
.el-tile.cat-nonmetal { background: var(--c-nonmetal); }
.el-tile.cat-halogen { background: var(--c-halogen); }
.el-tile.cat-noble-gas { background: var(--c-noble-gas); }
.el-tile.cat-lanthanide { background: var(--c-lanthanide); }
.el-tile.cat-actinide { background: var(--c-actinide); }
.el-tile.cat-unknown { background: var(--c-unknown); }

.el-footer {
  max-width: 960px;
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}
.el-footer p { margin: 0 0 0.5rem; }

@media (max-width: 760px) {
  .el-body { flex-direction: column; }
  .el-props { flex-basis: auto; width: 100%; position: static; }
}
