/* ================================================================
   Types of Nouns — interactive taxonomy map for grammar-nouns.html.
   Mirrors the six branches of the mind map, each in its own colour.
   ================================================================ */

.nt-wrap { display: grid; gap: 1rem; }

/* ---- branch rail ---- */
.nt-rail { display: flex; flex-wrap: wrap; gap: .45rem; }
.nt-branch { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .85rem; border-radius: 999px;
             min-height: 44px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
             cursor: pointer; font-weight: 600; font-size: .88rem; font-family: inherit;
             transition: border-color .15s, background .15s, transform .15s; }
.nt-branch:hover { transform: translateY(-1px); border-color: var(--c); }
.nt-branch i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); display: block; flex: none; }
.nt-branch b { color: var(--text-muted); font-weight: 700; font-size: .8rem; }
.nt-branch.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.nt-branch.on b { color: var(--text); }

/* ---- the map ---- */
.nt-group { margin-bottom: 1.1rem; }
.nt-glabel { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: .95rem;
             color: var(--c); margin-bottom: .55rem; }
.nt-glabel::after { content: ''; flex: 1; height: 2px; border-radius: 2px;
                    background: color-mix(in srgb, var(--c) 35%, transparent); }

.nt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.nt-card { text-align: left; border: 1px solid var(--border); border-top: 4px solid var(--c); border-radius: 14px;
           background: var(--surface); overflow: hidden; cursor: pointer; padding: 0; font-family: inherit;
           color: var(--text); transition: transform .18s, box-shadow .18s, border-color .18s; }
.nt-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px color-mix(in srgb, var(--c) 22%, transparent); }
.nt-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--bg-soft); }
/* spans (button content must be phrasing), so each needs to be told to stack */
.nt-body { display: block; padding: .6rem .7rem .7rem; }
.nt-name { display: block; font-weight: 700; font-size: .92rem; line-height: 1.3; }
.nt-mean { display: block; color: var(--text-muted); font-size: .8rem; margin-top: .2rem; line-height: 1.45; }
.nt-eg   { margin-top: .35rem; font-size: .8rem; padding: .22rem .5rem; border-radius: 6px; display: inline-block;
           background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); font-weight: 600; }

/* ---- lightbox ---- */
.nt-box { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 1rem;
          background: rgba(15, 12, 35, .72); backdrop-filter: blur(4px); }
.nt-box.on { display: grid; }
.nt-boxcard { background: var(--surface); border-radius: 20px; overflow: hidden; max-width: 460px; width: 100%;
              max-height: 92vh; overflow-y: auto; border-top: 6px solid var(--c); animation: ntUp .25s ease; }
@keyframes ntUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.nt-boxcard img { width: 100%; display: block; }
.nt-boxbody { padding: 1rem 1.15rem 1.2rem; }
.nt-boxfam { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.nt-boxname { font-size: 1.35rem; font-weight: 700; margin: .2rem 0 .35rem; }
.nt-boxmean { color: var(--text-muted); line-height: 1.55; }
.nt-boxeg { margin-top: .7rem; padding: .5rem .8rem; border-radius: 10px; font-weight: 600;
            background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.nt-boxnav { display: flex; gap: .5rem; margin-top: .9rem; }
.nt-btn { flex: 1; padding: .55rem .9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
          color: var(--text); font-weight: 600; cursor: pointer; font-family: inherit; font-size: .88rem; }
.nt-btn:hover { border-color: var(--c); }
.nt-btn.go { background: var(--module-grad); color: #fff; border-color: transparent; }

/* ---- guess game ---- */
.nt-game { border: 1px solid var(--border); border-radius: 18px; padding: 1.1rem 1.2rem; background: var(--surface); }
.nt-gtop { display: grid; grid-template-columns: 190px 1fr; gap: 1.1rem; align-items: center; }
@media (max-width: 560px) { .nt-gtop { grid-template-columns: 1fr; } }
.nt-gimg { width: 100%; max-width: 190px; aspect-ratio: 1/1; object-fit: cover; border-radius: 14px;
           margin: 0 auto; display: block; background: var(--bg-soft); }
.nt-gq { font-weight: 600; font-size: 1.05rem; margin-bottom: .7rem; }
.nt-gopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .45rem; }
.nt-gopt { padding: .55rem .8rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft);
           color: var(--text); font-weight: 600; cursor: pointer; font-family: inherit; font-size: .88rem; text-align: left; }
.nt-gopt:hover:not(:disabled) { border-color: var(--module); }
.nt-gopt:disabled { cursor: default; }
.nt-gopt.right { border-color: #059669; background: rgba(5, 150, 105, .12); color: #059669; }
.nt-gopt.wrong { border-color: #dc2626; background: rgba(220, 38, 38, .1); color: #dc2626; }
.nt-gv { margin-top: .75rem; font-weight: 600; line-height: 1.55; }
.nt-gv .ok { color: #059669; } .nt-gv .no { color: #dc2626; }
.nt-gscore { font-size: .85rem; color: var(--text-muted); margin-top: .45rem; }

/* ---- show more ---- */
.nt-more { display: none; width: 100%; margin-top: .8rem; padding: .7rem 1rem; min-height: 44px;
           border-radius: 14px; border: 1px dashed var(--border); background: var(--bg-soft); color: var(--text);
           font-weight: 700; font-size: .9rem; font-family: inherit; cursor: pointer; }
.nt-more:hover { border-color: var(--module); }
.nt-more.on { display: block; }
.nt-card.nt-hide, .nt-group.nt-hide { display: none; }

/* ================= mobile ================= */
@media (max-width: 700px) {
  /* two across instead of one — the single biggest saving on a phone */
  .nt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .nt-name { font-size: .84rem; }
  .nt-mean { font-size: .74rem; }
  .nt-eg   { font-size: .72rem; }
  .nt-body { padding: .5rem .55rem .6rem; }

  /* one swipeable row instead of six wrapped rows */
  .nt-rail { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity;
             -webkit-overflow-scrolling: touch; padding-bottom: .3rem;
             scrollbar-width: none; -ms-overflow-style: none;
             /* fade the right edge so it reads as scrollable */
             mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
             -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .nt-rail::-webkit-scrollbar { display: none; }
  .nt-branch { flex: none; scroll-snap-align: start; }

  /* comfortable thumb targets */
  .nt-gopt, .nt-btn { min-height: 44px; }
  .nt-boxnav { flex-wrap: wrap; }
}
