/* THW Design: blog posts, archives (category, author, tag, search), the 404 and static pages (Round 4C).
 * Needs thw-design.css. The post content is stored HTML from the block editor; block library CSS is not loaded on
 * these pages, so the blocks used in the posts (paragraphs, headings, lists, tables, images, the Rank Math table of
 * contents and FAQ) are styled here. */

/* reading column */
.thw-ds .thw-read{max-width:784px}
.thw-ds .thw-list,.thw-ds .thw-404{max-width:1040px}

/* breadcrumb: HTML only, no schema */
.thw-ds .thw-crumbs{margin:18px 0 0}
.thw-ds .thw-crumbs ol{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:2px 0;font-size:14px;line-height:1.4;color:var(--mut)}
.thw-ds .thw-crumbs li{display:inline-flex;align-items:center;min-width:0}
.thw-ds .thw-crumbs li+li::before{content:"";flex:none;width:7px;height:7px;margin:0 9px 0 7px;border-top:2px solid currentColor;border-right:2px solid currentColor;transform:rotate(45deg)}
.thw-ds .thw-crumbs a{display:inline-flex;align-items:center;min-height:44px;font-weight:600;color:var(--ink);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
.thw-ds .thw-crumbs span{min-height:44px;display:inline-flex;align-items:center}

/* post header */
.thw-ds .thw-art-head{margin:8px 0 26px}
.thw-ds .thw-catlabel{display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border-radius:9px;border:2px solid #111;background:var(--y);color:#111;font:700 14px/1 var(--body);text-decoration:none;box-shadow:3px 3px 0 var(--sh)}
.thw-ds .thw-catlabel:hover{background:var(--acc)}
.thw-ds .thw-art-title{font-size:34px;line-height:1.08;margin:16px 0 12px;overflow-wrap:anywhere}
.thw-ds .thw-meta{margin:0;font-size:15px;color:var(--mut)}
.thw-ds .thw-meta span{margin:0 4px}
.thw-ds .thw-page-prose .thw-art-title{margin:10px 0 22px}

/* article text */
.thw-ds .thw-prose{font-size:17px;line-height:1.7;overflow-wrap:break-word}
.thw-ds .thw-prose>:first-child{margin-top:0}
.thw-ds .thw-prose p{margin:0 0 18px}
.thw-ds .thw-prose h2{font-size:28px;line-height:1.12;margin:40px 0 14px}
.thw-ds .thw-prose h3{font-size:20px;margin:30px 0 10px}
.thw-ds .thw-prose h4,.thw-ds .thw-prose h5,.thw-ds .thw-prose h6{font:700 17px/1.3 var(--body);margin:24px 0 8px}
.thw-ds .thw-prose a{color:var(--ink);font-weight:500;text-decoration:underline;text-decoration-color:var(--acc);text-decoration-thickness:2px;text-underline-offset:3px}
.thw-ds .thw-prose a:hover{text-decoration-color:currentColor}
.thw-ds .thw-prose ul,.thw-ds .thw-prose ol{margin:0 0 18px;padding-left:1.4em}
.thw-ds .thw-prose li{margin:0 0 8px}
.thw-ds .thw-prose li>ul,.thw-ds .thw-prose li>ol{margin:8px 0 0}
.thw-ds .thw-prose ul>li::marker{color:var(--acc)}
.thw-ds .thw-prose ol>li::marker{font-weight:700}
.thw-ds .thw-prose strong,.thw-ds .thw-prose b{font-weight:700}
.thw-ds .thw-prose img{max-width:100%;height:auto;border-radius:12px;vertical-align:middle}
.thw-ds .thw-prose figure{margin:24px 0}
.thw-ds .thw-prose figure img{display:block;margin:0 auto;border:2.5px solid var(--line);box-shadow:5px 5px 0 var(--sh)}
.thw-ds .thw-prose figcaption{margin-top:10px;font-size:14px;color:var(--mut);text-align:center}
.thw-ds .thw-prose .aligncenter{margin-left:auto;margin-right:auto;text-align:center}
.thw-ds .thw-prose .alignleft{float:none;margin:24px 0}
.thw-ds .thw-prose .alignright{float:none;margin:24px 0}
.thw-ds .thw-prose .has-text-align-center{text-align:center}
.thw-ds .thw-prose .has-text-align-right{text-align:right}
.thw-ds .thw-prose blockquote{margin:24px 0;padding:14px 18px;border:2.5px solid var(--line);border-left-width:8px;border-left-color:var(--acc);border-radius:12px;background:var(--surf2)}
.thw-ds .thw-prose blockquote>:last-child{margin-bottom:0}
.thw-ds .thw-prose hr{border:0;border-top:2px dashed var(--tEb);margin:32px 0}
.thw-ds .thw-prose code,.thw-ds .thw-prose kbd{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em;padding:1px 5px;border-radius:5px;background:var(--surf2)}
.thw-ds .thw-prose pre{overflow-x:auto;padding:14px;border-radius:12px;background:var(--surf2);border:2px solid var(--line)}

/* tables scroll inside their own box, so the page never scrolls sideways */
.thw-ds .thw-prose table{width:100%;border-collapse:separate;border-spacing:0;font-size:15.5px;line-height:1.45;background:var(--surf)}
.thw-ds .thw-prose figure.wp-block-table{overflow-x:auto;-webkit-overflow-scrolling:touch;border:2.5px solid var(--line);border-radius:12px;box-shadow:5px 5px 0 var(--sh);background:var(--surf)}
.thw-ds .thw-prose :not(figure)>table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;border:2.5px solid var(--line);border-radius:12px;box-shadow:5px 5px 0 var(--sh);margin:24px 0}
.thw-ds .thw-prose th,.thw-ds .thw-prose td{padding:10px 12px;text-align:left;vertical-align:top;border-bottom:2px solid var(--tEb);min-width:7em}
.thw-ds .thw-prose th+th,.thw-ds .thw-prose td+td{border-left:2px solid var(--tEb)}
.thw-ds .thw-prose thead th,.thw-ds .thw-prose thead td{background:var(--surf2);font-weight:700;border-bottom:2.5px solid var(--line)}
.thw-ds .thw-prose tr:last-child>td,.thw-ds .thw-prose tr:last-child>th{border-bottom:0}
.thw-ds .thw-prose table img{border:0;box-shadow:none}

/* Rank Math table of contents (a block inside the content) */
.thw-ds .thw-prose .wp-block-rank-math-toc-block{margin:24px 0 30px;padding:16px 18px 6px;border:2.5px solid var(--line);border-radius:14px;background:var(--surf2);box-shadow:5px 5px 0 var(--sh)}
.thw-ds .thw-prose .wp-block-rank-math-toc-block>h2,.thw-ds .thw-prose .wp-block-rank-math-toc-block>h3{font:400 22px/1.1 var(--display);margin:0 0 10px}
.thw-ds .thw-prose .wp-block-rank-math-toc-block ul,.thw-ds .thw-prose .wp-block-rank-math-toc-block ol{margin:0 0 10px;padding-left:1.2em}
.thw-ds .thw-prose .wp-block-rank-math-toc-block li{margin:0}
.thw-ds .thw-prose .wp-block-rank-math-toc-block a{display:inline-block;padding:6px 0;min-height:32px;text-decoration-color:var(--line);text-decoration-thickness:1.5px}
/* Rank Math FAQ block */
.thw-ds .thw-prose .rank-math-faq-item{margin:0 0 14px;padding:14px 16px;border:2.5px solid var(--line);border-radius:12px;background:var(--surf);box-shadow:4px 4px 0 var(--sh)}
.thw-ds .thw-prose .rank-math-question{margin:0 0 6px;font:700 18px/1.3 var(--body)}
.thw-ds .thw-prose .rank-math-answer>:last-child{margin-bottom:0}
/* block editor buttons */
.thw-ds .thw-prose .wp-block-buttons{display:flex;flex-wrap:wrap;gap:12px;margin:0 0 18px}
.thw-ds .thw-prose .wp-block-button__link,.thw-ds .thw-prose .wp-element-button{display:inline-flex;align-items:center;min-height:48px;padding:0 18px;border-radius:10px;border:2.5px solid #111;background:var(--acc);color:#111;font-weight:700;text-decoration:none;box-shadow:3px 3px 0 var(--sh)}
/* Factle post (6205): its own game in a Custom HTML block puts five country buttons in a row; at phone widths the
 * long names pushed the row past the screen (also on the old template). Let the names wrap inside the buttons. */
.thw-ds .thw-prose .country-btn{min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.2}
/* in-content scroll targets clear the top edge */
.thw-ds .thw-prose [id]{scroll-margin-top:16px}

/* author box */
.thw-ds .thw-authorbox{display:grid;grid-template-columns:64px minmax(0,1fr);gap:14px;align-items:start;margin:40px 0 0;padding:18px;border:2.5px solid var(--line);border-radius:16px;background:var(--surf);box-shadow:6px 6px 0 var(--sh)}
.thw-ds .thw-authorbox-avatar img{display:block;width:64px;height:64px;border-radius:50%;border:2.5px solid #111;background:var(--blue)}
.thw-ds .thw-authorbox p{margin:0}
.thw-ds .thw-authorbox-label{font:700 13px/1.3 var(--body);text-transform:uppercase;letter-spacing:.06em;color:var(--mut)}
.thw-ds .thw-authorbox-name{font:400 24px/1.15 var(--display);margin:2px 0 6px!important}
.thw-ds .thw-authorbox-bio{font-size:15.5px;line-height:1.55;color:var(--mut)}

/* related guides */
.thw-ds .thw-related{margin-top:48px}
.thw-ds .thw-related h2,.thw-ds .thw-404-group h2{font-size:28px;margin-bottom:14px}
.thw-ds .thw-relcards{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.thw-ds .thw-relcards li{position:relative;display:flex;flex-direction:column;gap:6px;padding:14px 16px;border:2.5px solid var(--line);border-radius:14px;background:var(--surf);box-shadow:4px 4px 0 var(--sh);transition:transform .1s,box-shadow .1s}
.thw-ds .thw-relcards li:hover{transform:translate(-1px,-1px);box-shadow:6px 6px 0 var(--sh)}
.thw-ds .thw-relcards a{font-weight:700;font-size:17px;line-height:1.35;text-decoration:none}
.thw-ds .thw-relcards a::after{content:"";position:absolute;inset:0;border-radius:12px}
.thw-ds .thw-relcards a:focus-visible{outline:none}
.thw-ds .thw-relcards li:focus-within{outline:3px solid var(--blue);outline-offset:2px}
.thw-ds .thw-relcat{font-size:13.5px;color:var(--mut)}

/* archives */
.thw-ds .thw-list-title{font-size:34px;line-height:1.08;margin:10px 0 24px;overflow-wrap:anywhere}
.thw-ds .thw-404 .thw-list-title{margin-top:28px}
.thw-ds .thw-cards{list-style:none;margin:0;padding:0;display:grid;gap:16px;align-items:start}
.thw-ds .thw-card :is(img,svg,picture,figure,iframe,video){display:none}
.thw-ds .thw-card{position:relative;display:flex;flex-direction:column;padding:16px 18px;border:2.5px solid var(--line);border-radius:14px;background:var(--surf);box-shadow:5px 5px 0 var(--sh);transition:transform .1s,box-shadow .1s}
.thw-ds .thw-card:hover{transform:translate(-1px,-1px);box-shadow:7px 7px 0 var(--sh)}
.thw-ds .thw-card h2{font:700 19px/1.3 var(--body);margin:0 0 8px}
.thw-ds .thw-card h2 a{text-decoration:none}
.thw-ds .thw-card h2 a::after{content:"";position:absolute;inset:0;border-radius:12px}
.thw-ds .thw-card h2 a:focus-visible{outline:none}
.thw-ds .thw-card:focus-within{outline:3px solid var(--blue);outline-offset:2px}
.thw-ds .thw-card p{margin:0 0 10px;font-size:15.5px;line-height:1.55;color:var(--mut)}
.thw-ds .thw-card time{margin-top:auto;font-size:13.5px;font-weight:600}
.thw-ds .thw-none{font-size:17px}
.thw-ds .thw-pager{margin-top:28px}
.thw-ds .thw-pager ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:10px}
.thw-ds .thw-pager a,.thw-ds .thw-pager span{display:inline-flex;align-items:center;justify-content:center;min-width:48px;min-height:48px;padding:0 14px;border-radius:10px;border:2.5px solid var(--line);background:var(--surf);font-weight:700;text-decoration:none;box-shadow:3px 3px 0 var(--sh)}
.thw-ds .thw-pager .current{background:var(--y);color:#111;border-color:#111}
.thw-ds .thw-pager .dots{border-color:transparent;background:none;box-shadow:none}

/* 404 */
.thw-ds .thw-404-lead{font-size:18px;margin:0 0 28px;max-width:60ch}
.thw-ds .thw-404-groups{display:grid;gap:22px}
.thw-ds .thw-404-group{padding:0 18px 16px;border:2.5px solid var(--line);border-radius:16px;background:var(--surf);box-shadow:6px 6px 0 var(--sh);overflow:hidden}
.thw-ds .thw-404-group::before{content:"";display:block;height:14px;margin:0 -18px 16px;border-bottom:2.5px solid var(--line);background:var(--acc)}
.thw-ds .thw-404-group:nth-child(2)::before{background:var(--g)}.thw-ds .thw-404-group:nth-child(3)::before{background:var(--y)}
.thw-ds .thw-404-group h2{font-size:26px}
.thw-ds .thw-404-group ul{list-style:none;margin:0;padding:0;display:grid}
.thw-ds .thw-404-group a{display:flex;align-items:center;min-height:48px;font-weight:600;text-decoration:none;border-bottom:2px dashed var(--tEb)}
.thw-ds .thw-404-group li:last-child a{border-bottom:0}
.thw-ds .thw-404-group a:hover{text-decoration:underline;text-underline-offset:3px}

/* Contact (layout card): the .thw-answers group already carries its own title */
.thw-ds .thw-page-card .thw-answers{max-width:none}

@media (min-width:600px){
  .thw-ds .thw-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:960px){
  .thw-ds .thw-art-title,.thw-ds .thw-list-title{font-size:48px}
  .thw-ds .thw-prose h2{font-size:34px}
  .thw-ds .thw-authorbox{grid-template-columns:96px minmax(0,1fr);gap:20px;padding:24px}
  .thw-ds .thw-authorbox-avatar img{width:96px;height:96px}
  .thw-ds .thw-relcards{grid-template-columns:repeat(3,minmax(0,1fr))}
  .thw-ds .thw-related h2{font-size:34px}
  .thw-ds .thw-cards{gap:22px}
  .thw-ds .thw-404-groups{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
  /* the related guide cards span past the reading column at desktop widths */
  .thw-ds .thw-read .thw-related{margin-left:-120px;margin-right:-120px}
}
@media (min-width:960px) and (max-width:1100px){
  .thw-ds .thw-read .thw-related{margin-left:0;margin-right:0}
}
