/* ==========================================================================
   APH guides stylesheet
   Shared by /guides/ (index) and every /guides/<slug>/ page.

   Enqueue this from the Astra child guide template, the same way DayStayed's
   template-guide.php enqueues its guide.css. The <link> tag left in each HTML
   file is a fallback so the markup previews correctly on its own; remove those
   once the template enqueue is in place.

   Everything is scoped under .aph-guide so nothing leaks into the theme.
   ========================================================================== */

.aph-guide{
  --ink:#12211a;
  --muted:#5a6b62;
  --line:#dfe6e2;
  --accent:#1a6b4a;
  --accent-dark:#14563b;
  --accent-soft:#eef6f2;
  --warn:#8a5a00;
  --warn-soft:#fdf6e7;
  --err:#8a1c1c;
  --err-soft:#fdeeee;
  max-width:46rem;
  margin:0 auto;
  color:var(--ink);
  font-size:1.0625rem;
  line-height:1.65;
}

/* Index pages run wider than article pages */
.aph-guide.is-index{max-width:60rem}

/* --- Typography ---------------------------------------------------------- */
.aph-guide h1{font-size:2.1rem;line-height:1.2;margin:0 0 .75rem}
.aph-guide h2{font-size:1.45rem;line-height:1.3;margin:2.75rem 0 .75rem;padding-top:1.25rem;border-top:1px solid var(--line)}
.aph-guide h3{font-size:1.1rem;margin:1.75rem 0 .5rem}
.aph-guide p{margin:0 0 1.1rem}
.aph-guide .lede{font-size:1.15rem}
.aph-guide .kick{display:block;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--accent);font-weight:700;margin-bottom:.4rem}
.aph-guide code{background:#f2f5f4;padding:.1rem .3rem;border-radius:3px;font-size:.92em}
/* The chrome sets `a { text-decoration: none !important }` site-wide, which kills
   underlines on in-prose links where they aid scanning. Restate with !important
   to win, then opt the card, button, and breadcrumb links back out. */
.aph-guide a{color:var(--accent);text-decoration:underline !important}
.aph-guide a:hover{color:var(--accent-dark)}
.aph-guide .gcard,.aph-guide .btn,.aph-guide .breadcrumb a{text-decoration:none !important}
.aph-guide .gcard{color:var(--ink)}
.aph-guide strong{font-weight:600}
.aph-guide em{font-style:italic}

/* template-guide.php opens with a global `* { margin:0; padding:0 }` reset, so
   prose elements have to restate their own spacing here or they collapse. */
.aph-guide ul,.aph-guide ol{margin:0 0 1.1rem;padding-left:1.4rem}
.aph-guide li{margin-bottom:.4rem}
.aph-guide li>ul,.aph-guide li>ol{margin:.4rem 0 0}
.aph-guide blockquote{margin:1.5rem 0;padding:.25rem 0 .25rem 1.15rem;border-left:3px solid var(--line);color:var(--muted)}
.aph-guide hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
.aph-guide sub,.aph-guide sup{line-height:0}
.aph-guide img{max-width:100%;height:auto}

/* --- Breadcrumb ---------------------------------------------------------- */
/* .aph-guide-bc is the template-generated breadcrumb wrapper. It is deliberately
   NOT .aph-guide: a second .aph-guide element in the DOM breaks the calculator
   scripts, which resolve their root by class. It needs the layout vars, so it
   restates them rather than inheriting. */
.aph-guide-bc{--muted:#5a6b62;--line:#dfe6e2;--accent:#1a6b4a;max-width:60rem;margin:0 auto}
.aph-guide .breadcrumb,.aph-guide-bc .breadcrumb{font-size:.85rem;color:var(--muted);margin:0 0 1.25rem}
.aph-guide .breadcrumb ol,.aph-guide-bc .breadcrumb ol{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.4rem}
.aph-guide .breadcrumb li+li::before,.aph-guide-bc .breadcrumb li+li::before{content:"/";margin-right:.4rem;color:var(--line)}
.aph-guide-bc .breadcrumb a{color:var(--accent);text-decoration:none !important}

/* --- Callouts ------------------------------------------------------------ */
.aph-guide .answer{background:var(--accent-soft);border-left:3px solid var(--accent);padding:1.1rem 1.25rem;margin:0 0 1.75rem;border-radius:0 4px 4px 0}
.aph-guide .answer p:last-child{margin-bottom:0}
.aph-guide .note{background:var(--warn-soft);border-left:3px solid var(--warn);padding:1rem 1.15rem;margin:1.5rem 0;border-radius:0 4px 4px 0;font-size:.97rem}
.aph-guide .note p:last-child{margin-bottom:0}

/* --- Formulas ------------------------------------------------------------ */
.aph-guide .formula{background:#f7f9f8;border:1px solid var(--line);border-radius:6px;padding:1.25rem;margin:1.25rem 0;text-align:center;font-size:1.05rem}
.aph-guide .formula .frac{display:inline-block;vertical-align:middle;text-align:center;margin:0 .2rem}
.aph-guide .formula .frac .num{display:block;padding:0 .5rem .25rem}
.aph-guide .formula .frac .den{display:block;border-top:1.5px solid var(--ink);padding:.25rem .5rem 0}

/* --- Tables -------------------------------------------------------------- */
.aph-guide table{width:100%;border-collapse:collapse;margin:1.25rem 0;font-size:.95rem}
.aph-guide th,.aph-guide td{text-align:left;padding:.6rem .7rem;border-bottom:1px solid var(--line);vertical-align:top}
.aph-guide th{font-weight:600;background:#f7f9f8}
.aph-guide td.num,.aph-guide th.num{text-align:right;font-variant-numeric:tabular-nums}

/* --- Buttons ------------------------------------------------------------- */
.aph-guide .btn{display:inline-block;background:var(--accent);color:#fff;border:0;border-radius:5px;padding:.7rem 1.25rem;font-size:1rem;font-weight:600;font-family:inherit;cursor:pointer;text-decoration:none}
.aph-guide .btn:hover{background:var(--accent-dark);color:#fff}
.aph-guide .btn-ghost{background:transparent;color:var(--accent);border:1px solid var(--line);font-weight:500;padding:.5rem .8rem}
.aph-guide .btn-ghost:hover{background:#f7f9f8;color:var(--accent)}

/* --- Calculators --------------------------------------------------------- */
.aph-guide .calc{border:1px solid var(--line);border-radius:8px;padding:1.5rem;margin:1.75rem 0;background:#fff}
.aph-guide .calc h3{margin-top:0}
.aph-guide .calc label{display:block;font-size:.85rem;font-weight:600;color:var(--muted);margin-bottom:.3rem}
.aph-guide .calc input{width:100%;padding:.55rem .65rem;border:1px solid var(--line);border-radius:4px;font-size:1rem;font-family:inherit;box-sizing:border-box}
.aph-guide .grid2{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1rem}
.aph-guide .flow-row{display:grid;grid-template-columns:1fr 1fr auto;gap:.75rem;align-items:end;margin-bottom:.75rem}
.aph-guide .pt-head,.aph-guide .pt-row{display:grid;grid-template-columns:1.1fr 1fr 1fr auto;gap:.75rem;align-items:end;margin-bottom:.75rem}
.aph-guide .pt-head{margin-bottom:.35rem}
.aph-guide .pt-head span{font-size:.85rem;font-weight:600;color:var(--muted)}

.aph-guide .result{margin-top:1.25rem;padding:1.1rem 1.25rem;background:var(--accent-soft);border-radius:6px}
.aph-guide .result .big{font-size:2rem;font-weight:700;color:var(--accent);display:block;line-height:1.1;font-variant-numeric:tabular-nums}
.aph-guide .result .detail{font-size:.9rem;color:var(--muted);margin-top:.5rem}
.aph-guide .result table{margin:.85rem 0 0;font-size:.88rem}
.aph-guide .result th,.aph-guide .result td{padding:.35rem .5rem;border-bottom:1px solid #d7e5dd}
.aph-guide .result.err{background:var(--err-soft);color:var(--err)}
.aph-guide .result.err .big{color:var(--err);font-size:1.05rem;font-weight:600}
/* Answer-size result, for pickers that return a sentence rather than a number.
   .big is sized for a percentage and wraps badly at prose length. */
.aph-guide .result .verdict{font-size:1.15rem;font-weight:700;color:var(--accent);display:block;line-height:1.35}

/* --- Decision picker ------------------------------------------------------ */
/* Lives inside .calc, so it has to out-specify .calc label (display:block,
   muted, 600) and .calc input (width:100%, which stretches a radio into a bar).
   Three classes beats two-classes-plus-element, which is why .opt is nested
   under .picker rather than used on its own. */
.aph-guide .picker .q{margin-bottom:1.35rem}
.aph-guide .picker .qt{font-weight:600;font-size:1rem;color:var(--ink);margin:0 0 .5rem}
.aph-guide .picker .opt{display:flex;align-items:flex-start;gap:.6rem;font-size:.97rem;font-weight:400;color:var(--ink);margin-bottom:.45rem;cursor:pointer}
.aph-guide .picker .opt input[type="radio"],
.aph-guide .picker .opt input[type="checkbox"]{width:auto;flex:0 0 auto;margin:.4rem 0 0;padding:0}
/* Gap list inside a picker result. Plain <ul> inherits the article's list
   styling, which is sized for prose and too loose against .detail text. */
.aph-guide .result .gaps{margin:.6rem 0 0;padding-left:1.1rem;font-size:.9rem;color:var(--muted)}
.aph-guide .result .gaps li{margin-bottom:.3rem}

/* --- Index cards --------------------------------------------------------- */
.aph-guide .cluster{margin:0 0 2.5rem}
.aph-guide .cluster-head{margin-bottom:1.25rem}
.aph-guide .cluster-head h2{margin:0 0 .35rem;padding-top:0;border-top:0}
.aph-guide .cluster-head p{margin:0;color:var(--muted);font-size:.97rem}
/* Fixed two columns, not auto-fill. Auto-fill at minmax(17rem,1fr) resolved to
   three columns inside the 60rem index, which broke a four-card cluster into
   3 + 1 and left the two-card compliance cluster as two narrow cards with a
   third column of dead space. Two columns gives every card the same width in
   every cluster: 4 cards read as 2x2, 2 cards as a single row. */
.aph-guide .cards{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}
.aph-guide .gcard{display:block;padding:1.25rem 1.35rem;border:1px solid var(--line);border-radius:8px;text-decoration:none;color:var(--ink);background:#fff;transition:border-color .15s,box-shadow .15s}
.aph-guide .gcard:hover{border-color:var(--accent);box-shadow:0 2px 10px rgba(18,33,26,.07);color:var(--ink)}
/* rk / rt / rd are <span>, not <div>, on purpose. A block-level element inside an
   inline <a> makes content filters (wpautop) close a paragraph mid-anchor, which
   browsers repair by splitting the <a> into fragments. display:block gives the
   same layout without the fragile nesting. Do not change these back to divs. */
.aph-guide .gcard .rk{display:block;font-size:.72rem;letter-spacing:.07em;text-transform:uppercase;color:var(--accent);font-weight:700;margin-bottom:.45rem}
.aph-guide .gcard .rt{display:block;font-weight:600;font-size:1.02rem;line-height:1.35;margin-bottom:.4rem}
.aph-guide .gcard .rd{display:block;font-size:.9rem;color:var(--muted);line-height:1.5}
.aph-guide .gcard.wide{grid-column:1/-1}

/* --- CTA, related, footer ------------------------------------------------ */
.aph-guide .cta{border:1px solid var(--line);border-radius:8px;padding:1.5rem;margin:2rem 0;background:#f7f9f8}
.aph-guide .cta p{margin-bottom:1rem}
/* The CTA button gets its own <p class="cta-action"> in the markup. display:table
   is the safety net: it is a block-level shrink-to-fit box, so the button breaks
   onto its own line even if an editor absorbs the anchor into the paragraph
   above, which is what happened on /guides/ 2026-07-29 and left "Start a free
   trial" sitting mid-sentence. block would stretch it the full card width.
   Scoped to .cta so the calculator buttons stay inline-block. */
.aph-guide .cta .cta-action{margin:0 0 .25rem}
.aph-guide .cta .btn{display:table; margin: 20px 0 20px 0;}
.aph-guide .cta .fine{font-size:.85rem;color:var(--muted);margin:.75rem 0 0}
.aph-guide .related{margin:2rem 0 0;padding:1.25rem 1.5rem;border:1px solid var(--line);border-radius:8px}
.aph-guide .related h3{margin:0 0 .6rem;font-size:.8rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.aph-guide .related ul{margin:0;padding-left:1.1rem}
.aph-guide .related li{margin-bottom:.35rem}
.aph-guide .disclaimer{font-size:.85rem;color:var(--muted);border-top:1px solid var(--line);padding-top:1.25rem;margin-top:2.5rem}

/* --- Responsive ---------------------------------------------------------- */
@media(max-width:620px){
  .aph-guide h1{font-size:1.65rem}
  .aph-guide .grid2,.aph-guide .flow-row{grid-template-columns:1fr}
  .aph-guide .pt-head{display:none}
  .aph-guide .pt-row{grid-template-columns:1fr;padding-bottom:.75rem;border-bottom:1px solid var(--line)}
  .aph-guide .cards{grid-template-columns:1fr}
}
