/* ==========================================================================
   TDSH Giallo 1.1.0-dev8: dossier reading pass (single case-file posts)
   Loaded on single posts only (inc/finish.php), after every other theme sheet. Crime Ledger
   nights (body.tdsh-ledger) are left exactly as they were. Scoped CSS only: post content,
   the posts' own stylesheets and the restyle filters are not edited.
     1. Body copy: 18px phones, about 19 to 20px desktop, line-height 1.48, tighter paragraph and
        list gaps (Helvetica Neue / Literata stacks unchanged).
     2. Headings: multi-line display headings get 1.1 leading so lines never touch; the red offset
        text-shadow stays only on large desktop H2s; masthead title, Connected Files titles and the
        Rank Math TOC title get the same treatment.
     3. Tables on phones: hand-built stacked tables (td[data-label]) fit the screen (no 720px
        minimum), their labels are readable, cells are 16px; real multi-column tables scroll inside
        a bordered box with a SWIPE hint. Never sideways page scroll.
   No motion, no radius, no gradients, no soft shadows.
   Off switch: add_filter( 'tdsh_giallo_read_css', '__return_false' ).
   ========================================================================== */

/* ---------- 1. body copy ---------- */
body.tdsh-giallo.single-post:not(.tdsh-ledger){--tdsh-body-size:clamp(18px,1.5vw,20px);--tdsh-body-lh:1.48}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content.single56__content>p{margin:0 0 .9em}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content.single56__content>:is(ul,ol){margin:0 0 1em}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content.single56__content>:is(ul,ol)>li{margin-bottom:.3em;line-height:var(--tdsh-body-lh)}
/* tg-dsk hand-built dossiers: their own sheets set 1.6 to 1.65; plain running text only
   (classless p / li / dd), labels and chips keep their own leading */
body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content :is(p,li,dd):not([class]){line-height:1.48!important}
body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content :is(.card-main,.card,.timeline-copy,.section-body,.paper,.paper-surface,.paper-card,.role-card,.stack,.hero-copy,.answer-card,.quick-answer)>p:not([class]){font-size:max(18px,1em)!important}
body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content :is(.section-body,.paper,.paper-surface)>:is(ul,ol):not([class])>li:not([class]){font-size:max(18px,1em)!important}
/* secondary prose inside the custom dossier designs (role cards, source cards, numbered notes, related
   lists, section deks, checklists, warning and hero notes) rendered 14.5 to 16.5px: lifted to 18px.
   Labels, tags, legends and data keys keep their own small type. */
body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content :is(.role-card dd,.source-card p,ol.notes>li,ul.related>li,.section-title p,.cm-c li,.warning p,.hero-note p){font-size:max(18px,1em)!important;line-height:1.45!important}
/* numbered source notes printed straight onto a dark section (not inside a paper card): the
   post's own sheet colours them near-black, which made them invisible (Manson, Hillside) */
body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content .section-body>ol.notes>li{color:var(--tg-ink-1,#f2edd8)!important;-webkit-text-fill-color:currentColor!important}

/* ---------- 2. headings ---------- */
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content :is(h1,h2,h3){line-height:1.1!important}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content :is(h4,h5,h6){line-height:1.2!important}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content :is(h3,h4,h5,h6){text-shadow:none!important}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .single56__header .single56__title{line-height:1.05!important}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .single56__bottom_posts .title56{line-height:1.1!important}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .single56__heading{line-height:1.35!important}
body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content #rank-math-toc>h2{line-height:1.1!important;text-shadow:none!important}
@media (max-width:640px){
  /* phone H2s render 24 to 40px: the offset shadow muddies them */
  body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content :is(h1,h2){text-shadow:none!important}
}

/* ---------- 3. tables ---------- */
/* stacked-card tables (the post's own CSS stacks td[data-label] cells): labels inherit a dark
   text fill on a black chip in some posts; give them their own colour and a readable size */
body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content table :is(td,th)[data-label]::before{-webkit-text-fill-color:currentColor!important}
/* phones and tablets: those tables carry a 720px minimum from the post's desktop layout, which
   pushed the stacked cards (and tablet columns) past the screen edge, where they were cut off */
@media (max-width:1023px){
  body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content table:has(td[data-label],th[data-label]){width:100%!important;min-width:0!important;max-width:100%!important;table-layout:auto!important}
  body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content table:has(td[data-label],th[data-label]) :is(thead,tbody,tr,td,th){min-width:0!important;max-width:100%!important}
  body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content table:has(td[data-label],th[data-label]) :is(td,th){overflow-wrap:anywhere}
}
@media (max-width:640px){
  body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content table :is(td,th)[data-label]::before{font-size:12px!important;line-height:1.3!important}
  /* every table cell on a phone: 16px text, 1.4 leading */
  body.tdsh-giallo.single-post:not(.tdsh-ledger) #wi-all .entry-content table :is(td,th){font-size:16px!important;line-height:1.4!important}
  /* real multi-column tables in a dedicated wrapper: scroll inside a bordered box, with a hint */
  body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content :is([class*="table-wrap"],[class*="table-scroll"]):has(>table):not(:has(td[data-label],th[data-label])){overflow-x:auto!important;max-width:100%!important;border:2px solid var(--tdsh-cream,#f2edd8)!important;-webkit-overflow-scrolling:touch}
  body.tg-dsk.single-post:not(.tdsh-ledger) #wi-all .entry-content :is([class*="table-wrap"],[class*="table-scroll"]):has(>table):not(:has(td[data-label],th[data-label]))::before{content:"Swipe the table \2192";display:block;position:sticky;left:0;padding:8px 10px;font:700 12px/1.2 var(--tg-mono,monospace);letter-spacing:.14em;text-transform:uppercase;color:var(--tg-k,#0a0a0a);background:var(--tg-y,#f5d000)}
}
