/* Shared shell for the public content pages: the free tools (/tools,
   views/tools/) and the game and use-case pages (/games, views/pages/).
   Builds on simple.css and its tokens (felt, gold, cream; DM Serif Display /
   Hanken Grotesk / Space Mono). The class names keep their tools- prefix
   because the tools pages came first. Tool-specific rules stay in tools.css. */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* ---------- page shell ---------- */
.tools-head,
.tools-main {
  width: min(760px, 100%);
}
.tools-head {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tools-head .brand {
  width: auto;
}
.tools-crumbs {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.tools-crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.tools-crumbs a:hover {
  color: var(--gold);
}
.tools-crumb-sep {
  margin: 0 0.5em;
}
.tools-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.tools-main .card {
  width: 100%;
}
.tools-main h1 {
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  line-height: 1.1;
}
.tools-lede {
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.02rem;
  max-width: 62ch;
}
.tools-hint {
  color: var(--muted-2);
  font-size: 0.85rem;
  line-height: 1.5;
}
.tools-error {
  color: var(--cream);
  background: var(--red-soft);
  border: 1px solid rgba(224, 96, 109, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  line-height: 1.5;
}
.tools-main .card h2 {
  margin-bottom: 0.6rem;
}

/* Small inline buttons: the base `button` rule is a full-width gold bar. */
.tools-main .btn-ghost {
  width: auto;
  margin: 0;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.tools-main .btn-ghost:hover {
  border-color: var(--gold);
}
.tools-main button:focus-visible,
.tools-main a:focus-visible,
.tools-main summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.tools-main button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* ---------- explanatory text, FAQ, more tools, CTA ---------- */
.tools-about {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 0.6rem;
}
.tools-about h2 {
  font-size: 1.35rem;
  margin: 1.6rem 0 0.5rem;
}
.tools-about p {
  margin: 0 0 0.9rem;
  max-width: 68ch;
}
.tools-about ol,
.tools-about ul {
  margin: 0.4rem 0 1rem;
  padding-left: 1.3rem;
}
.tools-about li {
  margin-bottom: 0.4rem;
}
.tools-about strong {
  color: var(--cream);
}
.tools-faq details {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0;
}
.tools-faq details:last-child {
  border-bottom: 1px solid var(--line);
}
.tools-faq summary {
  cursor: pointer;
  color: var(--cream);
  font-weight: 700;
  list-style-position: outside;
}
.tools-faq details p {
  margin: 0.5rem 0 0;
}
.tools-more ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.tools-more li {
  display: flex;
  flex-direction: column;
}
.tools-more a {
  font-weight: 700;
}
.tools-more span {
  font-size: 0.9rem;
  color: var(--muted-2);
}
.tools-cta {
  margin-top: 1rem;
  padding: 1.4rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--gold-soft), transparent 60%),
    var(--surface);
}
.tools-cta h2 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}
.tools-cta p {
  color: var(--muted);
  line-height: 1.6;
  max-width: 62ch;
}
.tools-cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}
.tools-cta .action-button {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 0.8rem 1.4rem;
  text-decoration: none;
  text-align: center;
}
.tools-cta .btn-ghost {
  text-decoration: none;
  width: auto;
  font-weight: 700;
}

/* ---------- index ---------- */
.tools-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 0.8rem;
}
.tools-tile {
  position: relative;
}
.tools-tile h2 a {
  color: var(--cream);
  text-decoration: none;
}
/* The whole tile is the link's hit area. */
.tools-tile h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.tools-tile:hover,
.tools-tile:focus-within {
  border-color: var(--gold);
}
.tools-tile p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.93rem;
}
