/* TPG Addons – shared widget styles */
.tpg-icon { display: inline-block; vertical-align: middle; }

/* Post Title / Excerpt */
.tpg-pt, .tpg-pe { margin: 0; }

/* Featured Image */
.tpg-fi { margin: 0; }
.tpg-fi__img { display: block; width: 100%; height: auto; object-fit: cover; }

/* Post Terms */
.tpg-terms { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; gap: 10px; }
.tpg-terms__li { margin: 0; padding: 0; list-style: none; }
.tpg-terms__item { display: inline-block; text-decoration: none; color: inherit; }
.tpg-terms--text .tpg-terms__item { font-weight: 600; }
.tpg-terms--pill .tpg-terms__item { background: #F1F3F6; border-radius: 6px; padding: 4px 12px; }

/* Post Meta */
.tpg-pm { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.tpg-pm__item { display: flex; align-items: center; gap: 10px; }
.tpg-pm__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.tpg-pm__text { display: flex; flex-direction: column; line-height: 1.3; }
.tpg-pm__label { font-size: .8em; opacity: .65; }
.tpg-pm__value { font-weight: 600; }
.tpg-pm__value a { color: inherit; text-decoration: none; }

/* Share Buttons */
.tpg-share { display: flex; flex-wrap: wrap; align-items: center; }
.tpg-share__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid #E2E5EA; background: #fff; color: #111; text-decoration: none; cursor: pointer; font: inherit; box-sizing: border-box; }
.tpg-share__btn--copied { position: relative; }

/* Post Content */
.tpg-content { line-height: 1.75; }
.tpg-content > *:last-child { margin-bottom: 0; }
.tpg-content p { margin: 0 0 20px; }
.tpg-content h2, .tpg-content h3, .tpg-content h4 { scroll-margin-top: 100px; margin: 1.5em 0 .6em; }
.tpg-content blockquote { border-left: 3px solid currentColor; padding-left: 1.2em; font-style: italic; margin: 1.5em 0; }
.tpg-content img { max-width: 100%; height: auto; }
.tpg-content--dropcap > p:first-of-type::first-letter { float: left; font-size: 3.4em; line-height: .9; padding-right: .08em; font-weight: 700; }

/* Table of Contents */
.tpg-toc__title { font-weight: 700; margin-bottom: 12px; }
.tpg-toc__list { list-style: none; margin: 0; padding: 0; }
.tpg-toc__item { margin: 0 0 10px; padding-left: 14px; border-left: 2px solid transparent; }
.tpg-toc__item.tpg-toc__level-3 { padding-left: 28px; }
.tpg-toc__item.tpg-toc__level-4 { padding-left: 42px; }
.tpg-toc__link { text-decoration: none; color: inherit; opacity: .75; }
.tpg-toc__item.is-active .tpg-toc__link, .tpg-toc__item.is-active { opacity: 1; }
.tpg-toc__item.is-active { border-color: currentColor; }

/* Newsletter */
/* Post Grid */
.tpg-grid__heading { margin: 0 0 20px; }
.tpg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.tpg-card { display: flex; flex-direction: column; transition-property: transform, box-shadow, background-color; transition-duration: 250ms; transition-timing-function: ease; }
.tpg-card__wrap { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; }
.tpg-card--lift:hover { transform: translateY(-6px); }

.tpg-card__thumb { display: block; position: relative; overflow: hidden; }
.tpg-card__thumb--overlay::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.tpg-card__img { display: block; width: 100%; object-fit: cover; transition-property: transform; transition-duration: 250ms; }
.tpg-card__img--zoom { will-change: transform; }
.tpg-card__thumb:hover .tpg-card__img--zoom { transform: scale(1.06); }

.tpg-card__terms-overlay { position: absolute; left: 12px; bottom: 12px; z-index: 2; }
.tpg-card__terms-overlay .tpg-card__terms { margin: 0; }

.tpg-card__body { padding-top: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tpg-card__meta { font-size: .85em; opacity: .65; order: 1; }
.tpg-card__title { margin: 0; font-size: 1.1em; order: 2; }
.tpg-card__title a, .tpg-card__title span { color: inherit; text-decoration: none; }
.tpg-card__excerpt { margin: 0; font-size: .92em; opacity: .8; order: 3; }
.tpg-card__footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; order: 4; }
.tpg-card__terms { display: flex; gap: 8px; flex-wrap: wrap; }
.tpg-card__term { display: inline-block; font-size: .8em; padding: 3px 10px; border-radius: 4px; background: #F1F3F6; text-decoration: none; color: inherit; transition-property: background-color, color; transition-duration: 200ms; }
.tpg-card__date { font-size: .8em; opacity: .6; }
.tpg-grid__footer { margin-top: 24px; text-align: center; }
.tpg-grid__viewall { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border: 1px solid #E2E5EA; text-decoration: none; color: inherit; border-radius: 8px; transition-property: background-color, color, border-color; transition-duration: 200ms; cursor: pointer; font: inherit; }
.tpg-grid__viewall.is-loading { opacity: .6; pointer-events: none; }
.tpg-grid__pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.tpg-grid__pagenum { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border: none; background: #F1F3F6; border-radius: 6px; cursor: pointer; font: inherit; transition: background-color 150ms, color 150ms; }
.tpg-grid__pagenum[disabled] { opacity: .6; cursor: default; }

/* Post Grid – Badge style (image, colored pill over image, divider, avatar+date at bottom) */
.tpg-card--badge .tpg-card__body { flex: 1; }
.tpg-card__divider { border: none; border-top: 1px solid #EAEAEA; margin: 10px 0 0; order: 5; }
.tpg-card__meta--social { display: flex; align-items: center; gap: 10px; }
.tpg-card--badge .tpg-card__meta--social { order: 6; }
.tpg-card__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.tpg-card__meta-text { display: flex; flex-direction: column; line-height: 1.3; }
.tpg-card__author-name { font-weight: 600; font-size: .9em; }
.tpg-card__time { font-size: .8em; opacity: .6; }

/* Post Grid – Minimal style (plain text label, date + comments footer) */
.tpg-card--minimal .tpg-card__label { order: 1; font-size: .8em; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.tpg-card--minimal .tpg-card__label a { color: inherit; text-decoration: none; }
.tpg-card--minimal .tpg-card__stats { order: 6; }
.tpg-card__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: auto; padding-top: 4px; }
.tpg-card__stat { display: inline-flex; align-items: center; gap: 5px; font-size: .82em; opacity: .75; }
.tpg-card__stat .tpg-icon { width: 14px; height: 14px; flex-shrink: 0; }

/* Post Grid – Social style (author on top, excerpt + Read More, like/comment counts) */
.tpg-card--social .tpg-card__wrap { gap: 12px; }
.tpg-card--social .tpg-card__body { gap: 8px; }
.tpg-card--social .tpg-card__stats { order: 6; }
.tpg-card__readmore { text-decoration: underline; font-weight: 600; white-space: nowrap; }

@media (max-width: 1024px) { .tpg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .tpg-grid { grid-template-columns: 1fr; } }

/* Contact Form 7 */
.tpg-cf7-align { display: flex; }
.tpg-cf7 { width: 100%; box-sizing: border-box; }
.tpg-cf7 .wpcf7-form { box-sizing: border-box; }
.tpg-cf7 .wpcf7-form p { margin: 0; }

/* Grid layout mode (multi-field forms) */
.tpg-cf7--grid .wpcf7-form p:has(textarea),
.tpg-cf7--grid .wpcf7-form p:has(.wpcf7-acceptance),
.tpg-cf7--grid .wpcf7-form p:has(.wpcf7-list-item) {
	grid-column: 1 / -1;
}

/* Inline layout mode (compact field + button forms, e.g. newsletter signup) */
.tpg-cf7--inline .wpcf7-form { display: flex; flex-wrap: wrap; }
.tpg-cf7--inline .wpcf7-form p:has(input:not([type="submit"]), textarea, select) {
	flex: 1 1 220px;
	min-width: 0;
}
.tpg-cf7--inline .wpcf7-form p:has(input[type="submit"]) {
	flex: 0 0 auto;
}

.tpg-cf7 .wpcf7-response-output {
	grid-column: 1 / -1;
	display: block;
}
.tpg-cf7--inline .wpcf7-response-output { flex-basis: 100%; }

.tpg-cf7 .wpcf7-form-control { box-sizing: border-box; width: 100%; }
.tpg-cf7 .wpcf7-form-control:not([type="submit"]) { border-style: solid; border-width: 1px; }
.tpg-cf7 .wpcf7-form input[type="submit"] { cursor: pointer; border: none; white-space: nowrap; }
.tpg-cf7--hide-labels .wpcf7-form label {
	font-size: 0;
	line-height: 0;
	color: transparent;
}
.tpg-cf7--hide-labels .wpcf7-form label .wpcf7-form-control-wrap,
.tpg-cf7--hide-labels .wpcf7-form label input,
.tpg-cf7--hide-labels .wpcf7-form label textarea,
.tpg-cf7--hide-labels .wpcf7-form label select {
	font-size: initial;
	line-height: initial;
	color: initial;
}
.tpg-cf7--hide-labels .wpcf7-list-item-label {
	font-size: initial;
	line-height: initial;
	color: initial;
}
.tpg-cf7--hide-spinner .wpcf7-spinner { display: none !important; }
.tpg-cf7-admin-notice { padding: 10px 14px; background: #FDECEA; color: #D63638; border: 1px dashed #D63638; border-radius: 6px; font-size: 13px; }

/* Featured Post */
.tpg-fp { display: flex; align-items: stretch; width: 100%; box-sizing: border-box; gap: 20px; }
.tpg-fp--stacked { flex-direction: column; }
.tpg-fp__thumb { position: relative; display: block; flex: 0 0 38%; max-width: 38%; overflow: hidden; }
.tpg-fp--stacked .tpg-fp__thumb { flex-basis: auto; max-width: none; }
.tpg-fp__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tpg-fp__badge { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.tpg-fp__content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.tpg-fp__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tpg-fp__title { margin: 0; font-size: 1.15em; line-height: 1.35; }
.tpg-fp__title a { color: inherit; text-decoration: none; }
.tpg-fp__excerpt { margin: 0; font-size: .92em; opacity: .8; line-height: 1.5; }
.tpg-fp__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tpg-fp__btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0; position: relative; transition-property: background-color, color; transition-duration: 200ms; }
.tpg-fp__btn.is-copied::after { content: "Copied!"; position: absolute; top: -28px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.tpg-fp__more { position: relative; }
.tpg-fp__more summary { list-style: none; }
.tpg-fp__more summary::-webkit-details-marker { display: none; }
.tpg-fp__menu { position: absolute; top: calc(100% + 6px); right: 0; display: flex; gap: 8px; padding: 8px; border-radius: 10px; z-index: 5; }
.tpg-fp__menu a { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; }
.tpg-fp__meta { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.tpg-fp__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.tpg-fp__meta-text { font-size: .82em; opacity: .75; }
.tpg-fp__author-name { font-weight: 600; }
.tpg-fp__date::before { content: "•"; margin: 0 6px; }
.tpg-fp__meta-text .tpg-fp__date:first-child::before { content: none; margin: 0; }

@media (max-width: 700px) {
	.tpg-fp:not(.tpg-fp--stacked) { flex-direction: column; }
	.tpg-fp:not(.tpg-fp--stacked) .tpg-fp__thumb { max-width: none; }
}
