/* ========================================================================== 
   TinyHouseGrid single-post skin, phase 1.
   Loaded only for is_singular( 'post' ); every rule is also body-scoped.
   ========================================================================== */

body.single-post {
  --bg: #f4f7f4;
  --bg-cream: #f8f5ee;
  --bg-sage-2: #eef3ee;
  --panel: #ffffff;
  --ink: #1e2721;
  --heading: #21503a;
  --green: #2f7d57;
  --green-dark: #245f43;
  --muted: #66716a;
  --line: #d9e0da;
  --rust: #c2682f;
  --rust-dark: #a4521f;
  --gold: #cda85f;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 4px 14px rgba(30, 39, 33, 0.06);
}

body.single-post,
body.single-post #art-main,
body.single-post .art-sheet,
body.single-post .art-layout-wrapper,
body.single-post .art-layout-cell.art-content {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

body.single-post .art-post.type-post {
  max-width: 780px;
  margin: 0 auto;
  padding: 10px 6px 48px;
}

/* The first Artisteer article contains only previous/next navigation. */
body.single-post .art-post:not(.type-post):has(> .art-postcontent > .navigation) {
  display: none;
}

/* Hide only the parent theme's generated 128px featured-image thumbnail. */
body.single-post .art-post.type-post > .alignleft:has(img.wp-post-image) {
  display: none;
}

body.single-post h1.art-postheader {
  margin: 26px 0 10px;
  color: var(--heading);
  font-family: var(--serif);
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.18;
}

body.single-post .art-postheadericons {
  margin: 0 0 24px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
}

body.single-post .art-postheadericons img {
  display: none;
}

body.single-post .art-postheadericons .art-postdateicon::before,
body.single-post .art-postheadericons .art-postauthoricon::before,
body.single-post .art-postheadericons .art-postediticon::before {
  content: none;
}

body.single-post .art-postheadericons a,
body.single-post .art-postheadericons a:link,
body.single-post .art-postheadericons a:visited {
  color: var(--green-dark);
  text-decoration: none;
}

body.single-post .art-postcontent,
body.single-post .art-postcontent p,
body.single-post .art-postcontent li {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.7;
}

body.single-post .art-postcontent p {
  margin: 0 0 1.15em;
}

body.single-post .art-postcontent h2,
body.single-post .art-postcontent h3,
body.single-post .art-postcontent h4 {
  color: var(--heading);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
}

body.single-post .art-postcontent h2 {
  margin: 2.1em 0 0.6em;
  font-size: 1.65rem;
}

body.single-post .art-postcontent h3 {
  margin: 1.7em 0 0.5em;
  font-size: 1.28rem;
}

body.single-post .art-postcontent h4 {
  margin: 1.5em 0 0.4em;
  font-size: 1.1rem;
}

body.single-post .art-postcontent a,
body.single-post .art-postcontent a:link,
body.single-post .art-postcontent a:visited {
  color: var(--green-dark);
  font-family: var(--sans);
  text-decoration: underline;
  text-decoration-color: rgba(36, 95, 67, 0.35);
  text-underline-offset: 2px;
}

body.single-post .art-postcontent a:hover {
  color: var(--rust);
}

/*
 * Verified CTA structures:
 * 1. Price line, <br>, then <strong> containing the Amazon link.
 * 2. A standalone bold tagged link after a bold-label pros/cons paragraph.
 * Requiring THG's associate tag avoids buttonizing ordinary product links.
 */
body.single-post .art-postcontent p > br + strong:last-child > a[href*="tag=tinyhousegrid-20"]:only-child,
body.single-post .art-postcontent p > br + strong:last-child > a[href*="tag=tinyhousegrid-20"]:only-child:link,
body.single-post .art-postcontent p > br + strong:last-child > a[href*="tag=tinyhousegrid-20"]:only-child:visited,
body.single-post .art-postcontent a.thg-btn-amazon {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--rust);
  box-shadow: var(--shadow-sm);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s;
}

body.single-post .art-postcontent p > br + strong:last-child > a[href*="tag=tinyhousegrid-20"]:only-child:hover,
body.single-post .art-postcontent a.thg-btn-amazon:hover {
  background: var(--rust-dark);
  color: #ffffff;
  transform: translateY(-1px);
}

@supports selector(p:has(a)) {
  body.single-post .art-postcontent p:has(> strong:first-child) + p > a[href*="tag=tinyhousegrid-20"]:only-child:has(> strong:only-child),
  body.single-post .art-postcontent p:has(> strong:first-child) + p > a[href*="tag=tinyhousegrid-20"]:only-child:has(> strong:only-child):link,
  body.single-post .art-postcontent p:has(> strong:first-child) + p > a[href*="tag=tinyhousegrid-20"]:only-child:has(> strong:only-child):visited {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--rust);
    box-shadow: var(--shadow-sm);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, transform 0.18s;
  }

  /* Move the legacy arrow text inside the clickable pill. */
  body.single-post .art-postcontent p > br + strong:last-child:has(> a[href*="tag=tinyhousegrid-20"]:only-child) {
    font-size: 0;
  }

  body.single-post .art-postcontent p > br + strong:last-child > a[href*="tag=tinyhousegrid-20"]:only-child::before {
    content: "→ ";
  }

  body.single-post .art-postcontent p:has(> strong:first-child) + p > a[href*="tag=tinyhousegrid-20"]:only-child:has(> strong:only-child):hover {
    background: var(--rust-dark);
    color: #ffffff;
    transform: translateY(-1px);
  }
}

body.single-post .art-postcontent table {
  width: 100%;
  margin: 1.4em 0 1.6em;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-radius: var(--radius-sm);
  border-spacing: 0;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
}

body.single-post .art-postcontent th,
body.single-post .art-postcontent td {
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

body.single-post .art-postcontent tr > :last-child {
  border-right: 0;
}

body.single-post .art-postcontent table tr:last-child > * {
  border-bottom: 0;
}

body.single-post .art-postcontent thead th,
body.single-post .art-postcontent thead td,
body.single-post .art-postcontent table tr:first-child th {
  background: var(--bg-sage-2);
  color: var(--heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.single-post .art-postcontent table tr:first-child > *:first-child {
  border-top-left-radius: var(--radius-sm);
}

body.single-post .art-postcontent table tr:first-child > *:last-child {
  border-top-right-radius: var(--radius-sm);
}

body.single-post .art-postcontent tbody tr:nth-child(even) td {
  background: #fbfcfb;
}

body.single-post .art-postcontent ul {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
  list-style: disc;
}

body.single-post .art-postcontent ul > li {
  margin: 0.45em 0;
  padding-left: 0.2em;
  background: none;
}

body.single-post .art-postcontent img:not(.emoji) {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Verified disclosure structures; italic price notes do not match these. */
body.single-post .art-postcontent > p:has(> strong:only-child > em:only-child),
body.single-post .art-postcontent > p:has(> img) + p:has(> em:only-child) {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--bg-cream);
  color: var(--muted);
  font-size: 0.9rem;
}

body.single-post .art-postcontent > p:has(> strong:only-child > em:only-child) em,
body.single-post .art-postcontent > p:has(> strong:only-child > em:only-child) strong,
body.single-post .art-postcontent > p:has(> img) + p:has(> em:only-child) em {
  font-style: normal;
  font-weight: 500;
}

/* Reserved for a later, separately approved class-only content pass. */
body.single-post .thg-box,
body.single-post .thg-quick-answer {
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--bg-sage-2);
}

body.single-post .thg-pros {
  border-left-color: var(--green);
  background: #f3faf6;
}

body.single-post .thg-cons {
  border-left-color: var(--rust);
  background: var(--bg-cream);
}

body.single-post footer.art-footer,
body.single-post .art-page-footer {
  border-top: 0;
  background: #1c2b22;
  color: #c8d3cb;
  font-family: var(--sans);
}

body.single-post footer.art-footer {
  padding: 40px 24px;
  font-size: 0.92rem;
}

body.single-post .art-page-footer {
  margin: 0;
  padding: 0 24px 24px;
  color: #93a399;
  font-size: 0.8rem;
}

body.single-post .art-footer-text a,
body.single-post .art-footer-text a:link,
body.single-post .art-footer-text a:visited,
body.single-post .art-page-footer a,
body.single-post .art-page-footer a:link,
body.single-post .art-page-footer a:visited {
  color: #c8d3cb;
}

body.single-post .art-footer-text a:hover,
body.single-post .art-page-footer a:hover {
  color: var(--gold);
}

@media (max-width: 700px) {
  body.single-post h1.art-postheader {
    font-size: 1.9rem;
  }

  body.single-post .art-postcontent h2 {
    font-size: 1.45rem;
  }

  body.single-post .art-post.type-post {
    padding: 6px 14px 40px;
  }

  body.single-post .art-postcontent table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}
