/* =========================================================
   TECHGIC — article content (posts & pages)
   Replaces the old "Additional CSS". Scoped to .tg-content.
   TOC = Details block containing a numbered list. FAQ = any other Details block.
   ========================================================= */

.tg-content { font-size: 18px; line-height: 1.75; color: var(--tg-text); }
.tg-content > * { margin-top: 0; margin-bottom: 1.25em; }
.tg-content > *:last-child { margin-bottom: 0; }

/* headings */
.tg-content h2, .tg-content h3, .tg-content h4 { color: var(--tg-ink); font-weight: 800; letter-spacing: -.03em; scroll-margin-top: calc(var(--tg-header-h) + 28px); }
.tg-content h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.2; margin: 2.2em 0 .6em; }
.tg-content h3 { font-size: clamp(21px, 2vw, 25px); line-height: 1.3; margin: 1.8em 0 .5em; font-weight: 700; }
.tg-content h4 { font-size: 19px; margin: 1.6em 0 .4em; font-weight: 700; }
.tg-content > h2:first-child, .tg-content > h3:first-child { margin-top: 0; }

/* text */
.tg-content a:not(.wp-block-button__link) { color: var(--tg-p); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s; }
.tg-content a:not(.wp-block-button__link):hover { color: var(--tg-pd); }
.tg-content strong, .tg-content b { font-weight: 700; color: var(--tg-ink); }
.tg-content ul, .tg-content ol { padding-left: 1.3em; }
.tg-content li { margin: .35em 0; }
.tg-content li::marker { color: var(--tg-p); font-weight: 700; }
.tg-content hr { border: 0; height: 1px; background: #EAE7F2; margin: 3em 0; }
.tg-content blockquote, .tg-content .wp-block-quote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--tg-p); font-size: 20px; color: var(--tg-ink); }
.tg-content blockquote cite { display: block; font-size: 14px; color: var(--tg-muted); font-style: normal; margin-top: 8px; }
.tg-content .wp-block-pullquote { border: 0; border-top: 2px solid var(--tg-p); border-bottom: 2px solid var(--tg-p); padding: 28px 0; }
.tg-content code { font-family: var(--tg-mono) !important; font-size: .86em; background: var(--tg-soft); color: var(--tg-pd); padding: .15em .4em; border-radius: 6px; }
.tg-content pre, .tg-content .wp-block-code { font-family: var(--tg-mono) !important; background: #14152A; color: #E7E5F5; padding: 20px 22px; border-radius: var(--tg-radius); overflow-x: auto; font-size: 14px; line-height: 1.7; }
.tg-content pre code, .tg-content .wp-block-code code { background: none; color: inherit; padding: 0; font-size: inherit; }
.tg-content mark { background: color-mix(in srgb, var(--tg-p) 18%, #fff); color: inherit; padding: 0 .2em; border-radius: 3px; }

/* media */
.tg-content img { border-radius: var(--tg-radius); height: auto; }
.tg-content figure { margin-left: 0; margin-right: 0; }
.tg-content figcaption, .tg-content .wp-element-caption { font-size: 14px; color: var(--tg-muted); text-align: center; margin-top: 10px; }
.tg-content .alignwide { width: min(1000px, 100%); }
.tg-content iframe { max-width: 100%; border-radius: var(--tg-radius); }

/* buttons */
.tg-content .wp-block-buttons { margin: 2.2em 0; justify-content: center; }
.tg-content .wp-block-button__link { padding: 16px 34px; font-size: 17px; }
.tg-content .wp-block-button__link:hover { background: var(--tg-pd); transform: translateY(-2px); }
.tg-content .wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--tg-p) !important; box-shadow: inset 0 0 0 2px var(--tg-p); }

/* table of contents written inside the post (Details + numbered list) */
.tg-content .wp-block-details:has(> ol) { background: var(--tg-soft); border: 1px solid var(--tg-line); border-left: 5px solid var(--tg-p); border-radius: var(--tg-radius); padding: 22px 28px; margin: 2em 0 2.8em; }
.tg-content .wp-block-details:has(> ol) > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-size: 19px; font-weight: 700; color: var(--tg-ink); }
.tg-content .wp-block-details:has(> ol) ol { margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--tg-line); list-style: none; counter-reset: tgtoc; }
.tg-content .wp-block-details:has(> ol) li { counter-increment: tgtoc; display: flex; gap: 12px; margin: 0; padding: 6px 0; font-size: 16px; line-height: 1.45; }
.tg-content .wp-block-details:has(> ol) li::before { content: counter(tgtoc, decimal-leading-zero); font-weight: 700; color: var(--tg-p); min-width: 24px; }
.tg-content .wp-block-details:has(> ol) a { color: var(--tg-text); text-decoration: none; }
.tg-content .wp-block-details:has(> ol) a:hover { color: var(--tg-p); }
/* the sidebar already shows a table of contents, so the old one inside the post is hidden */
.tg-hide-inline-toc .tg-single .tg-content .wp-block-details:has(> ol) { display: none; }

/* FAQ dropdowns (any other Details block) */
.tg-content .wp-block-details:not(:has(> ol)) { background: #fff; border: 1px solid var(--tg-line); border-radius: var(--tg-radius); margin: 0 0 12px; padding: 0; transition: border-color .2s, box-shadow .2s; }
.tg-content .wp-block-details:not(:has(> ol)):hover, .tg-content .wp-block-details:not(:has(> ol))[open] { border-color: var(--tg-p); }
.tg-content .wp-block-details:not(:has(> ol))[open] { box-shadow: 0 6px 20px color-mix(in srgb, var(--tg-p) 12%, transparent); }
.tg-content .wp-block-details > summary::-webkit-details-marker { display: none; }
.tg-content .wp-block-details:not(:has(> ol)) > summary { list-style: none; cursor: pointer; position: relative; padding: 18px 60px 18px 22px; font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--tg-ink); }
.tg-content .wp-block-details:not(:has(> ol)) > summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--tg-soft); color: var(--tg-p); font-size: 20px; line-height: 28px; text-align: center; transition: background .2s, color .2s; }
.tg-content .wp-block-details:not(:has(> ol))[open] > summary::after { content: "–"; background: var(--tg-p); color: #fff; }
.tg-content .wp-block-details:not(:has(> ol)) > *:not(summary) { margin: 0; padding: 0 22px 20px; font-size: 16px; line-height: 1.7; }
.tg-content .wp-block-details + h2 { margin-top: 2.2em; }

/* tables (pricing, comparisons) */
.tg-content .wp-block-table { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--tg-line); border-radius: var(--tg-radius); }
.tg-content table { width: 100%; border-collapse: collapse; margin: 0; font-size: 15px; line-height: 1.5; }
.tg-content .wp-block-table table { border: 0; }
.tg-content th { background: var(--tg-soft); color: var(--tg-ink); font-weight: 700; text-align: left; }
.tg-content th, .tg-content td { border: 0; border-bottom: 1px solid var(--tg-line); padding: 12px 16px; vertical-align: top; }
.tg-content tbody tr:last-child td { border-bottom: 0; }
.tg-content tbody tr:nth-child(even) { background: color-mix(in srgb, var(--tg-p) 2%, #fff); }
.tg-content .wp-block-table figcaption { padding: 0 16px 12px; }

/* callout: add the class "is-style-note" (Advanced > Additional CSS class) to a Group or Paragraph */
.tg-content .is-style-note, .tg-content .tg-note { background: var(--tg-soft); border: 1px solid var(--tg-line); border-radius: var(--tg-radius); padding: 18px 22px; font-size: 16px; }

@media (max-width: 600px) {
	.tg-content { font-size: 17px; }
	.tg-content .wp-block-details:has(> ol) { padding: 18px; }
	.tg-content .wp-block-details:not(:has(> ol)) > summary { padding: 16px 54px 16px 16px; font-size: 16px; }
	.tg-content .wp-block-details:not(:has(> ol)) > *:not(summary) { padding: 0 16px 16px; }
	.tg-content .wp-block-button, .tg-content .wp-block-button__link { width: 100%; }
}
