/* THC Notify: the Notifications section ([thc_notifications]), the sign-up form ([thc_notify_signup]) and the
   /thc-email/ page. The theme's palette presets with literal fallbacks, like THC Membership and THC Games; dark follows
   THC Core's Display switch (Core flips the presets on html[data-thc-theme="dark"]). Phone first: one column, 44px tap
   targets, the choices table becomes one card per topic below 640px. */

.thc-nt {
  --nt-canvas: var(--wp--preset--color--base, #f7f1e4);
  --nt-raised: var(--wp--preset--color--accent-5, #fcf8ef);
  --nt-muted: var(--wp--preset--color--accent-4, #ece4d9);
  --nt-border: var(--wp--preset--color--accent-6, #d9d0bc);
  --nt-text: var(--wp--preset--color--contrast, #332d25);
  --nt-leaf: var(--wp--preset--color--accent-1, #5e7d53);
  --nt-deep: var(--wp--preset--color--accent-3, #3f5c3b);
  --nt-stroke: var(--wp--preset--color--control-stroke, #8a7f66);
  --nt-on-leaf: #fff;
  --nt-bad: #a3341f;
  --nt-radius: 12px;
  color: var(--nt-text);
  overflow-wrap: anywhere;
}
:root[data-thc-theme="dark"] .thc-nt { --nt-on-leaf: #15130f; --nt-bad: #f0a49d; }
.thc-nt *, .thc-nt *::before, .thc-nt *::after { box-sizing: border-box; }
.thc-nt [hidden] { display: none !important; }
.thc-nt .screen-reader-text, .thc-nt-page .screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* ---------- the section ---------- */
.thc-nt--hub {
  background: var(--nt-raised);
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-radius);
  padding: 1.25rem 1rem 1rem;
  margin-block: 1.5rem;
  scroll-margin-top: 1.5rem;
}
@media (min-width: 640px) { .thc-nt--hub { padding: 1.5rem 1.5rem 1.25rem; } }
.thc-nt-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 1rem; }
.thc-nt-head .thc-eyebrow { margin: 0; }
.thc-nt-h { font-size: 1.35rem; margin: .1rem 0 .4rem; line-height: 1.25; }
.thc-nt-h3 { font-size: 1.1rem; margin: 1.6rem 0 .5rem; padding-top: 1.1rem; border-top: 1px solid var(--nt-border); }
.thc-nt-h4 { font-size: 1rem; margin: 1rem 0 .4rem; }
.thc-nt-lede { margin: 0 0 1rem; max-width: 46rem; }

/* ---------- buttons ---------- */
.thc-nt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .5em 1.2em; max-width: 100%;
  border: 1px solid var(--nt-leaf); border-radius: 999px;
  background: var(--nt-leaf); color: var(--nt-on-leaf);
  font: inherit; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.thc-nt-btn:hover { background: var(--nt-deep); border-color: var(--nt-deep); color: var(--nt-on-leaf); }
.thc-nt-btn--quiet { background: transparent; color: var(--nt-deep); border-color: var(--nt-stroke); }
.thc-nt-btn--quiet:hover { background: var(--nt-muted); color: var(--nt-deep); border-color: var(--nt-stroke); }
.thc-nt-btn--small { min-height: 44px; padding: .35em .95em; font-size: .95rem; }
.thc-nt-btn:disabled { opacity: .6; cursor: default; }
.thc-nt-btn:focus-visible, .thc-nt a:focus-visible, .thc-nt-link-btn:focus-visible, .thc-nt input:focus-visible {
  outline: 2px solid var(--nt-deep); outline-offset: 2px;
}
.thc-nt-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0; }

/* ---------- the list ---------- */
.thc-nt-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--nt-border); }
.thc-nt-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .85rem .25rem .85rem .9rem; border-bottom: 1px solid var(--nt-border);
  position: relative; margin: 0;
}
.thc-nt-item::before { content: ""; position: absolute; left: 0; top: .85rem; bottom: .85rem; width: 4px; border-radius: 2px; background: transparent; }
.thc-nt-item.is-unread::before { background: var(--nt-leaf); }
.thc-nt-main { flex: 1 1 auto; min-width: 0; }
.thc-nt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; margin: 0 0 .2rem; font-size: .875rem; opacity: .9; }
.thc-nt-newtag { display: inline-block; padding: 0 .5rem; border-radius: 999px; background: var(--nt-leaf); color: var(--nt-on-leaf); font-weight: 700; font-size: .75rem; line-height: 1.6; }
.thc-nt-cat { font-weight: 600; }
.thc-nt-title { margin: 0 0 .15rem; font-size: 1.05rem; line-height: 1.35; }
.thc-nt-item.is-unread .thc-nt-title { font-weight: 700; }
.thc-nt-title a { color: var(--nt-deep); text-decoration: underline; text-underline-offset: 2px; }
.thc-nt-body { margin: 0 0 .3rem; white-space: pre-line; }
.thc-nt-link-btn {
  min-height: 44px; padding: 0 .1rem; border: 0; background: none; color: var(--nt-deep);
  font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.thc-nt-img { flex: none; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--nt-border); }
.thc-nt-empty { padding: 1rem .25rem; margin: 0; opacity: .9; list-style: none; }
.thc-nt-more { margin: .6rem 0 0; }

/* ---------- choices ---------- */
.thc-nt-table { width: 100%; border-collapse: collapse; margin: 0 0 .5rem; }
.thc-nt-table th, .thc-nt-table td { text-align: left; vertical-align: middle; padding: .55rem .5rem; border-bottom: 1px solid var(--nt-border); }
.thc-nt-table thead th { font-size: .9rem; font-weight: 700; }
.thc-nt-col--inapp, .thc-nt-col--push, .thc-nt-col--email, .thc-nt-table td.thc-nt-cell { text-align: center; width: 9.5rem; }
.thc-nt-topic-name { display: block; font-weight: 600; }
.thc-nt-topic-help { display: block; font-weight: 400; font-size: .875rem; opacity: .85; }
.thc-nt-switch { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; min-width: 44px; cursor: pointer; }
.thc-nt-switch input { width: 22px; height: 22px; margin: 0; accent-color: var(--nt-leaf); cursor: pointer; }
.thc-nt-switch input:disabled { cursor: not-allowed; }
.thc-nt-switch-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.thc-nt-na { font-size: .85rem; opacity: .85; }
.thc-nt-gridnote, .thc-nt-hint, .thc-nt-small { font-size: .9rem; opacity: .9; margin: .4rem 0; }
.thc-nt-saved { min-height: 1.5em; margin: .25rem 0 0; font-weight: 600; }
.thc-nt-saved.is-ok, .thc-nt-status.is-ok { color: var(--nt-deep); }
.thc-nt-saved.is-bad, .thc-nt-status.is-bad { color: var(--nt-bad); }

@media (max-width: 639px) {
  .thc-nt-table, .thc-nt-table tbody, .thc-nt-table tr, .thc-nt-table th, .thc-nt-table td { display: block; width: auto; }
  .thc-nt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .thc-nt-table tr { border: 1px solid var(--nt-border); border-radius: 10px; background: var(--nt-canvas); padding: .5rem .75rem .25rem; margin: 0 0 .6rem; }
  .thc-nt-table th, .thc-nt-table td { border: 0; padding: .2rem 0; }
  .thc-nt-table td.thc-nt-cell { display: flex; align-items: center; justify-content: space-between; width: auto; text-align: left; border-top: 1px solid var(--nt-border); }
  .thc-nt-table td.thc-nt-cell::before { content: attr(data-label); font-size: .95rem; }
  .thc-nt-table td.thc-nt-cell .thc-nt-na { text-align: right; max-width: 60%; }
}

/* ---------- push and devices ---------- */
.thc-nt-devlist { list-style: none; margin: 0; padding: 0; }
.thc-nt-dev { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; padding: .5rem 0; border-top: 1px solid var(--nt-border); margin: 0; }
.thc-nt-dev-text { display: flex; flex-direction: column; min-width: 0; }
.thc-nt-dev-when { font-size: .9rem; opacity: .85; }
.thc-nt-hint a { color: var(--nt-deep); font-weight: 600; }

/* ---------- sign-up form ---------- */
.thc-nt-signup { display: grid; gap: .8rem; max-width: 34rem; position: relative; }
.thc-nt-field { display: grid; gap: .3rem; }
.thc-nt-field label { font-weight: 600; }
.thc-nt-field input {
  width: 100%; min-height: 44px; padding: .5rem .75rem; font: inherit;
  border: 1px solid var(--nt-stroke); border-radius: 8px; background: var(--nt-canvas); color: var(--nt-text);
}
.thc-nt-cats { border: 0; margin: 0; padding: 0; display: grid; gap: .1rem; }
.thc-nt-cats legend { font-weight: 600; padding: 0; margin-bottom: .3rem; }
.thc-nt-check { display: flex; align-items: center; gap: .6rem; min-height: 44px; cursor: pointer; }
.thc-nt-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--nt-leaf); flex: none; }
.thc-nt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thc-nt-consent { font-size: .9rem; margin: 0; opacity: .9; }
/* THC 2026-10-02 (0.1.1): the under-13 line */
.thc-nt-under13 { font-size: .85rem; margin: .35rem 0 0; opacity: .85; }
.thc-nt-status { min-height: 1.4em; margin: 0; font-weight: 600; }
.thc-nt--signup { margin-block: 1.5rem; }
/* THC 2026-10-12 (0.2.2): the one-row form ([thc_notify_signup compact="1"]): label, then field and button on one row
   (the field shrinks, the button keeps its words on one line), then the short note. Fits a 320px phone. */
.thc-nt--row { margin-block: 1rem; }
.thc-nt-signup--row { gap: .4rem; max-width: 30rem; grid-template-columns: minmax(0, 1fr); }
.thc-nt-row-label { font-weight: 600; }
.thc-nt-row { display: flex; gap: .5rem; align-items: stretch; min-width: 0; }
.thc-nt-row input[type="email"] {
  flex: 1 1 8rem; width: 100%; min-width: 0; min-height: 44px; padding: .5rem .75rem; font: inherit;
  border: 1px solid var(--nt-stroke); border-radius: 8px; background: var(--nt-canvas); color: var(--nt-text);
}
.thc-nt-row .thc-nt-btn { flex: none; white-space: nowrap; min-height: 44px; }
.thc-nt-signup--row .thc-nt-consent { font-size: .85rem; }
.thc-nt-signup--row .thc-nt-consent a { color: inherit; text-decoration: underline; }
.thc-nt-signup--row .thc-nt-status:empty { min-height: 0; }
@media (min-width: 560px) { .thc-nt-signup--compact .thc-nt-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; } .thc-nt-signup--compact .thc-nt-cats legend { grid-column: 1 / -1; } }

/* ---------- the /thc-email/ page (no theme; follows the device's light or dark setting) ---------- */
.thc-nt-page { margin: 0; background: #f7f1e4; color: #332d25; font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.thc-nt--page { max-width: 36rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.thc-nt-site { margin: 0 0 1.5rem; font-weight: 700; }
.thc-nt-site a { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; min-height: 44px; }
.thc-nt-site img { border-radius: 8px; }
.thc-nt--page a { color: #3f5c3b; }
@media (prefers-color-scheme: dark) {
  .thc-nt-page { background: #1b1915; color: #efe8da; }
  .thc-nt--page { --nt-canvas: #1b1915; --nt-raised: #25221d; --nt-muted: #302c26; --nt-border: #4a443a; --nt-text: #efe8da; --nt-leaf: #93b587; --nt-deep: #b4cfa8; --nt-stroke: #a79d88; --nt-on-leaf: #15130f; --nt-bad: #f0a49d; }
  .thc-nt--page a { color: #b4cfa8; }
}
@media (prefers-reduced-motion: no-preference) { .thc-nt-btn { transition: background-color .15s ease, border-color .15s ease; } }
