/* Garage Door Guides — component styles.
   Colours, fonts and spacing come from theme.json presets. */

:root {
	--gdg-radius-sm: 8px;
	--gdg-radius-md: 14px;
	--gdg-radius-lg: 18px;
	--gdg-shadow: 0 10px 28px rgba(30, 35, 40, 0.08);
}

/* ---------- Base ---------- */

body {
	-webkit-font-smoothing: antialiased;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

img {
	height: auto;
	max-width: 100%;
}

.gdg-eyebrow {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 8px !important;
}

.gdg-lead {
	font-size: 20px;
	color: #444C55;
	max-width: 720px;
}

/* ---------- Header and footer ---------- */

.gdg-site-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--ground);
}

.gdg-site-header .wp-block-site-title a::before {
	content: "";
	display: inline-block;
	width: 28px;
	height: 28px;
	margin-right: 10px;
	vertical-align: -5px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-6 9 6v10H3V10z'/%3E%3Cpath d='M7 20v-8h10v8M7 15h10M7 18h10'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-6 9 6v10H3V10z'/%3E%3Cpath d='M7 20v-8h10v8M7 15h10M7 18h10'/%3E%3C/svg%3E") center / contain no-repeat;
}

.gdg-site-header .wp-block-navigation .wp-block-navigation-item.gdg-nav-cta > a {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--surface);
	padding: 10px 18px;
	border-radius: var(--gdg-radius-sm);
}

.gdg-site-header .wp-block-navigation .wp-block-navigation-item.gdg-nav-cta > a:hover {
	background: var(--wp--preset--color--accent-dark);
}

.gdg-site-footer {
	border-top: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.gdg-site-footer .wp-block-site-title {
	font-size: 18px;
}

/* ---------- Block styles (choose them in the editor's Styles panel) ---------- */

.wp-block-group.is-style-gdg-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-md);
	padding: 24px;
}

.wp-block-group.is-style-gdg-info {
	background: var(--wp--preset--color--sky);
	border: 1px solid #9DB6D3;
	border-radius: var(--gdg-radius-lg);
	padding: clamp(24px, 4vw, 36px);
}

.wp-block-group.is-style-gdg-warning {
	position: relative;
	background: var(--wp--preset--color--warning-bg);
	border: 2px solid var(--wp--preset--color--warning-line);
	border-radius: var(--gdg-radius-md);
	padding: 20px 24px 20px 64px;
	color: var(--wp--preset--color--warning-ink);
}

.wp-block-group.is-style-gdg-warning::before {
	content: "";
	position: absolute;
	left: 22px;
	top: 22px;
	width: 26px;
	height: 26px;
	background-color: #8A5A00;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l10 18H2L12 3z'/%3E%3Cpath d='M12 10v5M12 18v.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l10 18H2L12 3z'/%3E%3Cpath d='M12 10v5M12 18v.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wp-block-group.is-style-gdg-warning :where(p, li) {
	color: var(--wp--preset--color--warning-ink);
}

.wp-block-group.is-style-gdg-warning > * {
	margin-block: 0;
}

.wp-block-group.is-style-gdg-warning > * + * {
	margin-top: 8px;
}

.wp-block-group.is-style-gdg-dark {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ground);
	border-radius: var(--gdg-radius-lg);
	padding: clamp(28px, 4vw, 40px);
}

.wp-block-group.alignfull.is-style-gdg-dark {
	border-radius: 0;
}

.wp-block-group.is-style-gdg-dark :where(h1, h2, h3, h4) {
	color: var(--wp--preset--color--ground);
}

.wp-block-group.is-style-gdg-dark p {
	color: var(--wp--preset--color--on-dark);
}

.wp-block-group.is-style-gdg-dark a:not(.wp-element-button) {
	color: #A9C7EC;
}

ul.is-style-gdg-checklist {
	list-style: none;
	padding-left: 0;
}

ul.is-style-gdg-checklist li {
	position: relative;
	padding-left: 32px;
	margin-bottom: 8px;
}

ul.is-style-gdg-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 4px;
	width: 20px;
	height: 20px;
	background-color: var(--wp--preset--color--accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.5 2.5L16 9.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.5 2.5L16 9.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Homepage: symptom tiles ---------- */

.gdg-tile {
	position: relative;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-md);
	padding: 22px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.gdg-tile:hover {
	border-color: var(--wp--preset--color--accent);
	box-shadow: var(--gdg-shadow);
	transform: translateY(-2px);
}

.gdg-tile h3 {
	margin: 0 0 4px;
	font-size: 21px;
	font-weight: 700;
}

.gdg-tile h3 a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

/* The heading link stretches over the whole tile. */
.gdg-tile h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.gdg-tile p {
	margin: 0;
	font-size: 16px;
	color: var(--wp--preset--color--muted);
}

/* ---------- Estimator teaser ---------- */

.gdg-estimate-card {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	border-radius: var(--gdg-radius-lg);
	padding: 26px;
}

.gdg-estimate-card p {
	color: var(--wp--preset--color--ink) !important;
}

.gdg-estimate-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px;
	padding-bottom: 12px;
	border-bottom: 1px solid #ECEAE3;
	margin: 0 0 12px !important;
}

.gdg-estimate-total {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 20px;
}

/* ---------- Post cards (archives, blog, related) ---------- */

.gdg-post-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-md);
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.gdg-post-card .wp-block-post-featured-image {
	margin: 0;
}

.gdg-post-card .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
	width: 100%;
}

.gdg-post-card-body {
	padding: 20px 22px 24px;
	flex: 1;
}

.gdg-post-card .wp-block-post-title {
	font-size: 21px;
	font-weight: 700;
	margin: 0 0 8px;
}

.gdg-post-card .wp-block-post-excerpt {
	color: var(--wp--preset--color--muted);
	font-size: 16px;
	margin: 0;
}

.gdg-post-card .wp-block-post-excerpt__more-text {
	margin-top: 10px;
	font-weight: 600;
}

.gdg-post-card .wp-block-post-terms a {
	text-decoration: none;
}

.wp-block-post-template.is-layout-grid > li {
	margin: 0;
}

/* ---------- Single posts and pages ---------- */

.gdg-article-header .wp-block-post-title {
	margin-bottom: 12px;
}

.gdg-article-meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.gdg-article-meta > * {
	margin: 0;
}

.gdg-featured .wp-block-post-featured-image img {
	border-radius: var(--gdg-radius-lg);
}

.gdg-content > :where(h2) {
	margin-top: 1.6em;
}

.gdg-content > :where(h3) {
	margin-top: 1.4em;
}

.gdg-content :where(ol, ul):not(.is-style-gdg-checklist) li {
	margin-bottom: 6px;
}

.gdg-content table {
	width: 100%;
	border-collapse: collapse;
	background: var(--wp--preset--color--surface);
	font-size: 16px;
}

.gdg-content :where(th, td) {
	border: 1px solid var(--wp--preset--color--line);
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
}

.gdg-content th {
	background: #ECEAE3;
	font-weight: 600;
}

.gdg-content figure.wp-block-table {
	overflow-x: auto;
}

.gdg-content .wp-block-image img {
	border-radius: var(--gdg-radius-md);
}

.gdg-author-box {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: center;
}

.gdg-author-box .wp-block-avatar img {
	border-radius: 999px;
}

/* ---------- Archive header, pagination, search ---------- */

.gdg-archive-header .wp-block-query-title {
	margin-bottom: 8px;
}

.gdg-archive-header .wp-block-term-description {
	color: var(--wp--preset--color--muted);
	max-width: 720px;
}

.wp-block-query-pagination {
	gap: 8px;
	font-weight: 600;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	display: inline-block;
	min-width: 44px;
	padding: 10px 14px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-sm);
	background: var(--wp--preset--color--surface);
	text-align: center;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}

.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--surface);
}

.wp-block-search__input {
	font-size: 18px;
	padding: 12px 14px;
	border: 1px solid #8A939C;
	border-radius: var(--gdg-radius-sm);
	font-family: inherit;
}

.wp-block-search__button {
	margin-left: 8px;
}

/* ---------- Problem solver ---------- */

.gdg-solver {
	max-width: 880px;
	margin: 0 auto;
}

.gdg-solver[hidden],
.gdg-solver [hidden] {
	display: none !important;
}

.gdg-progress {
	height: 8px;
	background: #E1DED5;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 28px;
}

.gdg-progress span {
	display: block;
	height: 100%;
	width: 33%;
	background: var(--wp--preset--color--accent);
	border-radius: 999px;
	transition: width 0.25s ease;
}

.gdg-step-count {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	margin: 0 0 8px;
}

.gdg-solver h2 {
	margin: 0 0 10px;
}

.gdg-solver fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 28px;
}

.gdg-solver legend {
	font-weight: 600;
	font-size: 19px;
	margin-bottom: 12px;
	padding: 0;
}

.gdg-choices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 12px;
}

.gdg-choices.gdg-choices--inline {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}

.gdg-choice {
	display: block;
	margin: 0;
}

.gdg-choice {
	position: relative;
}

.gdg-choice input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.gdg-choice span {
	display: block;
	box-sizing: border-box;
	min-height: 48px;
	padding: 14px 18px;
	border: 2px solid #C9C5BA;
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	font-weight: 600;
	font-size: 17px;
	line-height: 1.35;
	cursor: pointer;
}

.gdg-choice input:checked + span {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--surface);
}

.gdg-choice input:focus-visible + span {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.gdg-btn {
	display: inline-block;
	min-height: 52px;
	padding: 14px 30px;
	font: 600 18px/1.3 var(--wp--preset--font-family--body);
	border-radius: 10px;
	border: 2px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--surface);
	cursor: pointer;
	text-decoration: none;
}

.gdg-btn:hover {
	background: var(--wp--preset--color--accent-dark);
	border-color: var(--wp--preset--color--accent-dark);
	color: var(--wp--preset--color--surface);
}

.gdg-btn--ghost {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border-color: #C9C5BA;
	min-height: 48px;
	font-size: 17px;
	padding: 12px 20px;
}

.gdg-btn--ghost:hover {
	background: #ECEAE3;
	border-color: #C9C5BA;
	color: var(--wp--preset--color--ink);
}

.gdg-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	margin-top: 28px;
}

.gdg-callout {
	border-radius: var(--gdg-radius-md);
	padding: 18px 22px;
	margin: 0 0 20px;
}

.gdg-callout strong {
	display: block;
	font-size: 18px;
	margin-bottom: 4px;
}

.gdg-callout p {
	margin: 0;
}

.gdg-callout--pro {
	background: var(--wp--preset--color--warning-bg);
	border: 2px solid var(--wp--preset--color--warning-line);
	color: var(--wp--preset--color--warning-ink);
}

.gdg-callout--diy {
	background: var(--wp--preset--color--sky);
	border: 2px solid var(--wp--preset--color--accent);
	color: #163F70;
}

.gdg-result-table {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-md);
	padding: 8px 22px;
	margin: 0;
}

.gdg-result-table div {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 0;
	font-size: 18px;
}

.gdg-result-table div + div {
	border-top: 1px solid #ECEAE3;
}

.gdg-result-table dt {
	margin: 0;
}

.gdg-result-table dd {
	margin: 0;
	font-weight: 600;
}

.gdg-form {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-lg);
	padding: clamp(20px, 4vw, 28px);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 18px;
}

.gdg-form .gdg-span-all {
	grid-column: 1 / -1;
}

.gdg-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.gdg-field label {
	font-weight: 600;
	font-size: 15px;
}

.gdg-field input,
.gdg-field textarea,
.gdg-field select {
	font: inherit;
	font-size: 18px;
	padding: 12px 13px;
	border: 1px solid #8A939C;
	border-radius: var(--gdg-radius-sm);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
}

.gdg-consent {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: 15px;
	line-height: 1.5;
}

.gdg-consent input {
	width: 22px;
	height: 22px;
	margin-top: 2px;
	flex: none;
}

.gdg-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.gdg-error {
	color: #9B2C1F;
	font-weight: 600;
}

.gdg-done {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-lg);
	padding: 40px 24px;
	text-align: center;
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
	.wp-block-group.is-style-gdg-warning {
		padding-left: 24px;
		padding-top: 56px;
	}

	.gdg-btn {
		width: 100%;
		text-align: center;
	}
}


/* ---------- Boxed ZIP call to action ([gdg_zip_cta]) ---------- */

.gdg-cta-box,
.gdg-zip-cta {
	font-family: var(--wp--preset--font-family--body);
	white-space: normal;
}

.gdg-cta-box br,
.gdg-zip-cta br {
	display: none;
}

.gdg-cta-box p:empty {
	display: none;
}

.gdg-cta-box {
	background: var(--wp--preset--color--sky);
	border: 1px solid #9DB6D3;
	border-radius: var(--gdg-radius-lg);
	padding: clamp(22px, 4vw, 32px);
	margin-block: 0;
}

/* If the shortcode sits inside a Preformatted or paragraph block, strip that
   wrapper's own padding, border and margins so only the box shows. */
:where(pre, p):has(> .gdg-cta-box) {
	padding: 0;
	border: 0;
	background: none;
	white-space: normal;
	font: inherit;
}

/* Empty paragraphs WordPress adds around the shortcode. */
p:empty:has(+ .gdg-cta-box),
.gdg-cta-box + p:empty,
p:empty:has(+ :where(pre, p) > .gdg-cta-box) {
	display: none;
}

.gdg-cta-box__title {
	margin: 0 0 6px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: clamp(22px, 3vw, 26px);
	line-height: 1.2;
	color: var(--wp--preset--color--ink);
}

.gdg-cta-box__text {
	margin: 0 0 18px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 17px;
	line-height: 1.5;
	color: #33404E;
}

.gdg-cta-box .gdg-zip-cta {
	max-width: 560px;
}

.gdg-cta-box__note {
	margin: 12px 0 0;
	font-size: 15px;
	color: #33404E;
}


/* ---------- Contact form ([gdg_contact_form]) ---------- */

.gdg-contact {
	font-family: var(--wp--preset--font-family--body);
	white-space: normal;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-lg);
	padding: clamp(22px, 4vw, 32px);
	max-width: 720px;
}

.gdg-contact br {
	display: none;
}

:where(pre, p):has(> .gdg-contact) {
	padding: 0;
	border: 0;
	background: none;
	white-space: normal;
	font: inherit;
}

.gdg-contact__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.gdg-contact__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.gdg-contact__intro {
	margin: 0 0 16px;
}

.gdg-contact__small {
	margin: 0;
	font-size: 15px;
	color: var(--wp--preset--color--muted);
}

.gdg-contact .gdg-btn {
	align-self: flex-start;
}

.gdg-contact__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.gdg-contact__notice {
	border-radius: var(--gdg-radius-md);
	padding: 16px 18px;
	margin-bottom: 16px;
}

.gdg-contact__notice p {
	margin: 0;
}

.gdg-contact__notice--ok {
	background: var(--wp--preset--color--sky);
	border: 1px solid #9DB6D3;
	margin-bottom: 0;
}

.gdg-contact__notice-title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 22px;
	margin-bottom: 6px !important;
}

.gdg-contact__notice--error {
	background: var(--wp--preset--color--warning-bg);
	border: 1px solid var(--wp--preset--color--warning-line);
	color: var(--wp--preset--color--warning-ink);
}


/* ---------- Category pages (templates/category.html) ---------- */

.gdg-category-header .wp-block-term-description {
	max-width: none;
	font-size: 18px;
	line-height: 1.65;
}

.gdg-category-header .wp-block-term-description p {
	margin: 0 0 12px;
}

.gdg-category-header {
	margin-bottom: var(--wp--preset--spacing--40);
}

/* ---------- New-door estimator ([gdg_door_estimator]) ---------- */

.gdg-estimator {
	margin: 0;
}

.gdg-estimator__row {
	align-items: center;
}

.gdg-estimator__row label {
	font-size: 17px;
}

.gdg-estimator__row select {
	font: inherit;
	font-weight: 700;
	font-size: 16px;
	max-width: 100%;
	flex: 0 1 270px;
	padding: 9px 36px 9px 12px;
	border: 1px solid #8A939C;
	border-radius: var(--gdg-radius-sm);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}

.gdg-estimator .gdg-estimate-total {
	align-items: baseline;
}

.gdg-estimator__quote {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	margin-top: 18px;
}

.gdg-estimator__quote .gdg-field {
	flex: 1 1 150px;
	margin: 0;
}

.gdg-estimate-card .gdg-estimator__small {
	margin: 12px 0 0 !important;
	font-size: 15px;
	color: var(--wp--preset--color--muted) !important;
}

.gdg-estimator__small a {
	color: var(--wp--preset--color--accent) !important;
}

.gdg-estimate-card :where(pre, p):has(> .gdg-estimator) {
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	white-space: normal;
	font: inherit;
}

@media (max-width: 600px) {
	.gdg-estimator__row select {
		flex: 1 1 100%;
	}
}

/* ---------- Old-content images (small captioned photos from the old site) ----------
   Shown as a tidy grid of cards inside the text column. Works with the
   constrained layout because each figure keeps the column's auto margins. */

.gdg-content :where(figure, div).wp-caption,
.gdg-content figure.wp-block-image:is(.size-medium, .size-thumbnail) {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 16px;
	align-items: center;
	width: auto !important;
	padding: 10px;
	margin-top: 0 !important;
	margin-bottom: 12px !important;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--gdg-radius-sm, 6px);
}

.gdg-content :where(figure, div).wp-caption img,
.gdg-content figure.wp-block-image:is(.size-medium, .size-thumbnail) img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.gdg-content .wp-caption :where(figcaption, .wp-caption-text),
.gdg-content figure.wp-block-image:is(.size-medium, .size-thumbnail) figcaption {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	font-style: normal;
	text-align: left;
	color: var(--wp--preset--color--ink);
}

.gdg-content img.alignleft {
	float: left;
	margin: 4px 20px 12px 0;
}

.gdg-content img.alignright {
	float: right;
	margin: 4px 0 12px 20px;
}

.gdg-content img.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.gdg-content :where(h2, h3) {
	clear: both;
}

@media (max-width: 480px) {
	.gdg-content :where(figure, div).wp-caption,
	.gdg-content figure.wp-block-image:is(.size-medium, .size-thumbnail) {
		grid-template-columns: 120px 1fr;
		gap: 12px;
	}
}

/* ---------- Featured image: always 16:9, never taller than the screen allows ---------- */

.gdg-featured.wp-block-post-featured-image {
	max-width: min(var(--wp--style--global--wide-size, 1200px), 100%);
	margin-left: auto;
	margin-right: auto;
	overflow: hidden;
	border-radius: var(--gdg-radius-lg);
}

.gdg-featured.wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto !important;
	aspect-ratio: 16 / 9;
	max-height: 70vh;
	object-fit: cover;
	object-position: center;
}

/* ---------- AdSense units ---------- */

.gdg-ad {
	clear: both;
	margin: 32px auto !important;
	padding-top: 6px;
	text-align: center;
	border-top: 1px solid var(--wp--preset--color--line);
	min-height: 120px;
}

.gdg-ad__label {
	display: block;
	margin-bottom: 6px;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.gdg-ad ins.adsbygoogle[data-ad-status="unfilled"] {
	display: none !important;
}

.gdg-ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
	display: none !important;
}

/* ---------- Placeholder for cards without a featured image ---------- */

.gdg-thumb-placeholder {
	margin: 0;
}

.gdg-thumb-placeholder a {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 10;
	background: var(--wp--preset--color--sky);
	color: #9DB6D3;
}

.gdg-thumb-placeholder svg {
	width: 28%;
	max-width: 120px;
	height: auto;
}
