/*
Theme Name: HIPAA Compliant Wiki
Theme URI: https://hipaacompliant.wiki
Description: Block child theme of Twenty Twenty-Five for hipaacompliant.wiki: a reference directory look in the Chanty family (Figtree, blue accent) but its own voice — verdict badges, wide data tables, sources block, no product CTAs. Managed by the content panel.
Template: twentytwentyfive
Version: 0.1.1
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: hipaa-wiki
*/

/* ---------- layout ---------- */
.entry-content > * { max-width: var(--wp--style--global--content-size); margin-left: auto; margin-right: auto; }
.hw-wide .entry-content > * { max-width: var(--wp--style--global--wide-size); }
.entry-content a:not(.wp-element-button) { color: var(--wp--preset--color--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content a:not(.wp-element-button):hover { color: var(--wp--preset--color--accent-dark); }
.entry-content h2 { margin-top: 2.2em; padding-top: 0.2em; }
.entry-content h3 { margin-top: 1.6em; }
.entry-content > p:first-of-type { font-size: 1.15rem; color: var(--wp--preset--color--muted); }
.wp-block-post-title { max-width: var(--wp--style--global--wide-size); margin: 0.2em auto 0.6em; }

/* ---------- header ---------- */
.hw-header { background: var(--wp--preset--color--base); position: sticky; top: 0; z-index: 20; }
.hw-wordmark { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.1rem; color: var(--wp--preset--color--ink); text-decoration: none; letter-spacing: -0.01em; }
.hw-wordmark .hw-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--wp--preset--color--ink); color: #fff; font-size: 0.8rem; font-weight: 800; letter-spacing: 0; }
.hw-wordmark .hw-wiki { color: var(--wp--preset--color--accent); font-weight: 600; }
.hw-header .wp-block-navigation a { color: var(--wp--preset--color--contrast); }
.hw-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent); }
.hw-search { display: flex; }
.hw-search input { border: 1px solid var(--wp--preset--color--line); border-radius: 8px; padding: 0.45rem 0.7rem; font: inherit; font-size: 0.92rem; width: 11rem; }
.hw-search button { border: 0; background: var(--wp--preset--color--ink); color: #fff; border-radius: 8px; padding: 0.45rem 0.8rem; margin-left: 0.4rem; font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; }

@media (min-width: 901px) { .hw-header > .wp-block-group { flex-wrap: nowrap; } .hw-header .wp-block-navigation, .hw-header .wp-block-navigation__container { flex-wrap: nowrap; margin-right: 0.5rem; } }

/* ---------- breadcrumbs, meta ---------- */
.hw-crumbs { font-size: 0.9rem; color: var(--wp--preset--color--muted); display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: var(--wp--style--global--wide-size); margin: 0 auto 0.4rem; }
.hw-crumbs a { color: var(--wp--preset--color--muted); text-decoration: none; }
.hw-crumbs a:hover { color: var(--wp--preset--color--accent); }
.hw-crumbs span { color: var(--wp--preset--color--line); }

/* ---------- verdict box (blockquote that starts with "Verdict") ---------- */
.hw-verdict { border: 1px solid var(--wp--preset--color--line); border-left: 6px solid var(--wp--preset--color--unknown); border-radius: 10px; padding: 1rem 1.25rem; margin: 1.5rem auto; background: var(--wp--preset--color--soft); font-size: 0.98rem; }
.hw-verdict p { margin: 0.25rem 0; }
.hw-verdict--yes { border-left-color: var(--wp--preset--color--yes); }
.hw-verdict--conditional { border-left-color: var(--wp--preset--color--conditional); }
.hw-verdict--no { border-left-color: var(--wp--preset--color--no); }
.hw-badge { display: inline-block; padding: 0.1em 0.6em; border-radius: 999px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: #fff; background: var(--wp--preset--color--unknown); vertical-align: middle; }
.hw-badge--yes { background: var(--wp--preset--color--yes); }
.hw-badge--conditional { background: var(--wp--preset--color--conditional); }
.hw-badge--no { background: var(--wp--preset--color--no); }

/* ---------- tables ---------- */
.entry-content .wp-block-table, .entry-content table { max-width: var(--wp--style--global--wide-size); }
.entry-content figure.wp-block-table { overflow-x: auto; }
.entry-content table { font-size: 0.9rem; border-collapse: collapse; width: 100%; }
.entry-content table th, .entry-content table td { padding: 0.6em 0.75em; border: 1px solid var(--wp--preset--color--line); vertical-align: top; text-align: left; }
.entry-content table th { background: var(--wp--preset--color--soft); font-weight: 600; }
.entry-content table tr:nth-child(even) td { background: #fbfcfe; }
.entry-content table td:first-child { font-weight: 600; white-space: nowrap; }

/* ---------- table of contents ---------- */
.hw-toc { border: 1px solid var(--wp--preset--color--line); border-radius: 10px; padding: 0.9rem 1.2rem; margin: 1.5rem auto; background: #fff; font-size: 0.93rem; }
.hw-toc strong { display: block; margin-bottom: 0.4rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--wp--preset--color--muted); }
.hw-toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.hw-toc li { margin: 0.15rem 0; break-inside: avoid; }
.hw-toc a { text-decoration: none; }

/* ---------- sources, last verified ---------- */
.hw-sources { background: var(--wp--preset--color--soft); border-radius: 10px; padding: 1rem 1.25rem; font-size: 0.92rem; }
.hw-sources ul { margin: 0.4rem 0 0; }
.hw-verified { font-family: var(--wp--preset--font-family--mono); font-size: 0.82rem; color: var(--wp--preset--color--muted); }

/* ---------- category cards on hubs ---------- */
.hw-hub .entry-content ul:not(.hw-plain) { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
.hw-hub .entry-content ul:not(.hw-plain) > li { border: 1px solid var(--wp--preset--color--line); border-radius: 10px; padding: 0.9rem 1.1rem; background: #fff; }
.hw-hub .entry-content ul:not(.hw-plain) > li a { font-weight: 600; text-decoration: none; }
.hw-hub .entry-content ul:not(.hw-plain) > li:hover { border-color: var(--wp--preset--color--accent); }

/* ---------- footer ---------- */
.hw-footer { font-size: 0.92rem; }
.hw-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.hw-footer-col h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--wp--preset--color--muted); margin: 0 0 0.6rem; }
.hw-footer-col ul { list-style: none; padding: 0; margin: 0; }
.hw-footer-col li { margin: 0.3rem 0; }
.hw-footer a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.hw-footer a:hover { color: var(--wp--preset--color--accent); }
.hw-footer-disclosure { color: var(--wp--preset--color--muted); max-width: 32rem; }
.hw-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--wp--preset--color--line); color: var(--wp--preset--color--muted); font-size: 0.85rem; }

@media (max-width: 900px) {
  .hw-footer-grid { grid-template-columns: 1fr 1fr; }
  .hw-toc ol { columns: 1; }
  .hw-search input { width: 9rem; }
}
@media (max-width: 600px) {
  .hw-footer-grid { grid-template-columns: 1fr; }
  .hw-search { display: none; }
}

/* ---------- front page hero ---------- */
.hw-front .wp-block-post-title { display: none; }
.hw-hero { position: relative; overflow: hidden; padding: 4.5rem 1rem 3.5rem; border-bottom: 1px solid var(--wp--preset--color--line); }
.hw-hero-bg { position: absolute; inset: 0; z-index: 0; background:
  radial-gradient(60rem 28rem at 85% -10%, rgba(24,105,236,0.16), transparent 60%),
  radial-gradient(30rem 20rem at 0% 110%, rgba(24,105,236,0.08), transparent 60%),
  linear-gradient(var(--wp--preset--color--line) 1px, transparent 1px) 0 0 / 100% 48px,
  linear-gradient(90deg, var(--wp--preset--color--line) 1px, transparent 1px) 0 0 / 48px 100%; opacity: 0.35; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.hw-hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; }
.hw-eyebrow { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--wp--preset--color--accent); font-weight: 700; margin: 0 0 0.8rem; }
.hw-hero h1 { font-size: clamp(2.3rem, 4.5vw, 3.4rem); line-height: 1.08; margin: 0 0 1rem; letter-spacing: -0.02em; }
.hw-hero-lead { font-size: 1.15rem; color: var(--wp--preset--color--muted); max-width: 34rem; margin: 0 0 1.5rem; }
.hw-hero-search { display: flex; gap: 0.5rem; max-width: 34rem; }
.hw-hero-search input { flex: 1; border: 1px solid var(--wp--preset--color--line); border-radius: 10px; padding: 0.8rem 1rem; font: inherit; font-size: 1rem; background: #fff; }
.hw-hero-search button { border: 0; background: var(--wp--preset--color--ink); color: #fff; border-radius: 10px; padding: 0.8rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.hw-hero-search button:hover { background: var(--wp--preset--color--accent); }
.hw-hero-stats { list-style: none; padding: 0; margin: 1.8rem 0 0; display: flex; gap: 2rem; flex-wrap: wrap; }
.hw-hero-stats li:last-child span { max-width: 12rem; }
.hw-hero-stats li { display: flex; flex-direction: column; }
.hw-hero-stats strong { font-size: 1.6rem; font-weight: 700; color: var(--wp--preset--color--ink); line-height: 1; }
.hw-hero-stats span { font-size: 0.85rem; color: var(--wp--preset--color--muted); margin-top: 0.3rem; }
.hw-hero-art { position: relative; height: 340px; }
.hw-card { position: absolute; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(15,27,51,0.10); padding: 0.9rem 1rem; width: 250px; font-size: 0.86rem; }
.hw-card-1 { right: 0; top: 10px; width: 270px; z-index: 3; }
.hw-card-2 { left: 0; top: 120px; z-index: 2; transform: rotate(-3deg); }
.hw-card-3 { right: 40px; bottom: 0; width: 220px; z-index: 1; transform: rotate(2deg); }
.hw-card-head { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.hw-card-head .hw-badge { margin-left: auto; }
.hw-card-logo { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--wp--preset--color--accent); color: #fff; font-weight: 800; font-size: 0.8rem; }
.hw-card-logo--green { background: var(--wp--preset--color--yes); }
.hw-card-logo--red { background: var(--wp--preset--color--no); }
.hw-card-row { display: flex; justify-content: space-between; padding: 0.3rem 0; border-top: 1px dashed var(--wp--preset--color--line); color: var(--wp--preset--color--muted); }
.hw-card-row b { color: var(--wp--preset--color--contrast); font-weight: 600; }
.hw-card-foot { margin-top: 0.5rem; font-family: var(--wp--preset--font-family--mono); font-size: 0.72rem; color: var(--wp--preset--color--muted); }
.hw-hero-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.7; }
.hw-front .hw-hub { margin-top: 2.5rem; }
@media (max-width: 900px) {
  .hw-hero-inner { grid-template-columns: 1fr; }
  .hw-hero-art { height: 300px; margin-top: 1rem; }
  .hw-card-1 { right: 0; } .hw-card-2 { left: 0; top: 110px; } .hw-card-3 { right: 10px; }
}
@media (max-width: 600px) {
  .hw-hero { padding: 2.5rem 1rem 2rem; }
  .hw-hero-search { flex-direction: column; }
  .hw-hero-art { display: none; }
}

/* ---------- sticky table of contents on wide screens ---------- */
@media (min-width: 1100px) {
  main:not(.hw-hub):not(.hw-front) .entry-content:has(.hw-toc) { display: grid; grid-template-columns: minmax(0, 1fr) 250px; column-gap: 3rem; align-items: start; }
  main:not(.hw-hub):not(.hw-front) .entry-content:has(.hw-toc) > * { grid-column: 1; margin-left: 0 !important; margin-right: 0 !important; justify-self: stretch; width: 100%; }
  main:not(.hw-hub):not(.hw-front) .entry-content:has(.hw-toc) > :not(figure):not(table):not(.hw-verdict):not(.hw-sources):not(h2) { max-width: 780px; }
  main:not(.hw-hub):not(.hw-front) .entry-content > .hw-toc { grid-column: 2; grid-row: 1 / span 400; position: sticky; top: 84px; margin: 0; max-width: none; padding: 0 0 0 1rem; border: 0; border-left: 2px solid var(--wp--preset--color--line); border-radius: 0; background: transparent; max-height: calc(100vh - 100px); overflow: auto; }
  main:not(.hw-hub):not(.hw-front) .entry-content > .hw-toc ol { columns: 1; padding-left: 0; list-style: none; }
  main:not(.hw-hub):not(.hw-front) .entry-content > .hw-toc li { margin: 0.35rem 0; line-height: 1.35; }
  main:not(.hw-hub):not(.hw-front) .entry-content > .hw-toc a { color: var(--wp--preset--color--muted); display: block; padding-left: 0.6rem; margin-left: calc(-1rem - 2px); border-left: 2px solid transparent; }
  main:not(.hw-hub):not(.hw-front) .entry-content > .hw-toc a:hover { color: var(--wp--preset--color--accent); }
  main:not(.hw-hub):not(.hw-front) .entry-content > .hw-toc a.is-active { color: var(--wp--preset--color--ink); font-weight: 600; border-left-color: var(--wp--preset--color--accent); }
  main:not(.hw-hub):not(.hw-front) .entry-content > .hw-toc .hw-toc-meta { margin-top: 1rem; font-size: 0.8rem; color: var(--wp--preset--color--muted); }
}

/* ---------- verdict chips and sortable headers ---------- */
.hw-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.75rem; max-width: var(--wp--style--global--wide-size); }
.hw-chip { border: 1px solid var(--wp--preset--color--line); background: #fff; border-radius: 999px; padding: 0.35rem 0.8rem; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--wp--preset--color--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; }
.hw-chip:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--ink); }
.hw-chip.is-on { background: var(--wp--preset--color--ink); color: #fff; border-color: var(--wp--preset--color--ink); }
.hw-chip .hw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wp--preset--color--unknown); }
.hw-chip--yes .hw-dot { background: var(--wp--preset--color--yes); }
.hw-chip--conditional .hw-dot { background: var(--wp--preset--color--conditional); }
.hw-chip--no .hw-dot { background: var(--wp--preset--color--no); }
.entry-content table th.hw-sortable { cursor: pointer; user-select: none; padding-right: 1.4em; position: relative; }
.entry-content table th.hw-sortable::after { content: "↕"; position: absolute; right: 0.5em; top: 0.6em; font-size: 0.8em; color: var(--wp--preset--color--line); }
.entry-content table th.hw-sortable:hover::after { color: var(--wp--preset--color--accent); }
.entry-content table th.hw-sortable[data-dir="asc"]::after { content: "↑"; color: var(--wp--preset--color--accent); }
.entry-content table th.hw-sortable[data-dir="desc"]::after { content: "↓"; color: var(--wp--preset--color--accent); }

/* ---------- forms ---------- */
.hw-form { display: grid; gap: 0.9rem; max-width: 640px; margin: 1.2rem 0 2rem; padding: 1.25rem; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; background: var(--wp--preset--color--soft); }
.hw-form label { display: grid; gap: 0.3rem; font-size: 0.9rem; font-weight: 600; color: var(--wp--preset--color--ink); }
.hw-form input[type="text"], .hw-form input[type="url"], .hw-form input[type="email"], .hw-form select, .hw-form textarea { font: inherit; font-weight: 400; font-size: 0.95rem; padding: 0.55rem 0.7rem; border: 1px solid var(--wp--preset--color--line); border-radius: 8px; background: #fff; width: 100%; }
.hw-form textarea { resize: vertical; }
.hw-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.hw-form .hw-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.hw-form button { justify-self: start; }
.hw-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.hw-form-ok { background: #e6f4ec; border: 1px solid var(--wp--preset--color--yes); border-radius: 8px; padding: 0.7rem 1rem; margin: 0; }
.hw-form-err { background: #fbeae8; border: 1px solid var(--wp--preset--color--no); border-radius: 8px; padding: 0.7rem 1rem; margin: 0; }
@media (max-width: 600px) { .hw-form-row { grid-template-columns: 1fr; } }

.hw-planned { color: inherit; }
