/* GreenAir theme: blog styles (loaded after theme.css). Mobile first. */

/* ---------- listing heads (blog index, archives, search, 404) ---------- */
.ga-blog-head { padding-block: 22px 34px; }
.ga-blog-head .ga-breadcrumbs { margin: 0 0 18px; }
.ga-blog-head p.is-style-eyebrow { margin-top: 10px; }
.ga-blog-head h1 { margin-top: 10px; overflow-wrap: break-word; text-wrap: balance; }
.ga-blog-head .ga-lead { margin-top: 14px; }
.ga-blog-head .wp-block-term-description { margin-top: 14px; }
.ga-blog-head .wp-block-term-description p { margin: 0; }
.ga-404-head .wp-block-buttons { margin-top: 18px; }
.ga-404-ranges { font-size: var(--wp--preset--font-size--x-large); margin-bottom: 20px; }

/* search form */
.ga-search { max-width: 560px; margin-top: 22px !important; }
.ga-search .wp-block-search__inside-wrapper { gap: 8px; }
.ga-search .wp-block-search__input { min-height: 52px; min-width: 0; padding: 0 20px; border: 1.5px solid var(--ga-line); border-radius: 999px; background: #fff; color: var(--ga-ink); font: inherit; }
.ga-search .wp-block-search__input:focus { outline: 3px solid var(--ga-lime); outline-offset: 1px; border-color: var(--ga-green); }
.ga-search .wp-block-search__button { min-height: 52px; margin-left: 0; padding-inline: 22px; flex: none; }

/* ---------- article head ---------- */
.ga-post-head { padding-block: 22px 8px; background: var(--wp--preset--gradient--mist-fade); }
.ga-post-head .ga-breadcrumbs { margin: 0 0 22px; }
.ga-post-head .ga-post-cat { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ga-green); }
.ga-post-head .ga-post-cat::before { content: ""; flex: none; width: 22px; height: 3px; border-radius: 3px; background: var(--wp--preset--gradient--brand); }
.ga-post-head .ga-post-cat a { color: inherit; text-decoration: none; }
.ga-post-head .ga-post-cat a:hover { text-decoration: underline; }
.ga-post-head .ga-post-title { margin-top: 12px; font-size: clamp(1.85rem, 1.1rem + 3.2vw, 2.85rem); line-height: 1.12; overflow-wrap: break-word; text-wrap: balance; }
.ga-post-meta { display: flex; flex-wrap: wrap; row-gap: 4px; margin: 14px 0 0; font-size: .92rem; color: var(--ga-muted); }
.ga-post-meta span + span::before { content: "\00B7"; margin-inline: 10px; color: #9aaa9f; }
.ga-post-meta__by { font-weight: 600; color: var(--ga-ink); }
.ga-post-head > .ga-post-hero.alignwide { max-width: 960px; margin-top: 28px; }
.ga-post-hero img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; box-shadow: var(--ga-shadow); }
.ga-post-hero.is-product-shot img { object-fit: contain !important; padding: 20px; background: #fff; border: 1px solid var(--ga-line); box-shadow: none; }

/* ---------- article body ---------- */
.ga-article > .ga-entry { margin-top: 32px; padding-bottom: 8px; }
.ga-entry { font-size: 1.0625rem; line-height: 1.75; color: var(--ga-ink); overflow-wrap: break-word; }
.ga-article .ga-entry > * + * { margin-block-start: 1.15em; }
.ga-article .ga-entry > :first-child { margin-block-start: 0; }
.ga-article .ga-entry > p:first-child { font-size: 1.12em; line-height: 1.7; color: #24382b; }
.ga-entry p { margin-block: 0; }
.ga-entry a { font-weight: 500; }
.ga-entry strong { font-weight: 700; }

.ga-article .ga-entry > :is(h2, h3, h4) { scroll-margin-top: 100px; clear: both; }
.ga-article .ga-entry > h2 { margin-block-start: 2.1em; font-size: var(--wp--preset--font-size--x-large); line-height: 1.22; }
.ga-article .ga-entry > h3 { margin-block-start: 1.7em; font-size: 1.22rem; line-height: 1.3; }
.ga-article .ga-entry > h4 { margin-block-start: 1.5em; font-size: 1.06rem; }
.ga-article .ga-entry > :is(h2, h3, h4) + * { margin-block-start: .65em; }
.ga-entry :is(h1, h2, h3, h4) strong { font-weight: inherit; } /* old posts wrap headings in <strong> */

.ga-entry :is(ul, ol) { padding-left: 1.35em; }
.ga-entry li + li { margin-top: .5em; }
.ga-entry li::marker { color: var(--ga-green); }
.ga-entry ol > li::marker { font-weight: 700; }
.ga-entry li > :is(ul, ol) { margin-top: .5em; }

.ga-entry blockquote, .ga-entry .wp-block-quote { margin-inline: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--ga-lime); font-size: 1.08em; }
.ga-entry blockquote p { text-align: left !important; }

/* images */
.ga-article .ga-entry > :is(.wp-block-image, figure) { margin-block: 2em; }
.ga-entry .wp-block-image img { display: block; max-width: 100%; max-height: min(80vh, 680px); width: auto; height: auto; margin-inline: auto; border-radius: 16px; }
.ga-entry .wp-block-image:has(> a[href*="/product/"]) img { width: 100%; max-height: 440px; object-fit: contain; padding: 14px; background: #fff; border: 1px solid var(--ga-line); }
.ga-entry .wp-block-image:has(> a[href*="/product/"]) a { display: block; }
.ga-entry :is(.wp-block-image figcaption, .wp-caption-text, figcaption) { margin: .7em 0 0; font-size: .9rem; line-height: 1.5; color: var(--ga-muted); text-align: center; }
.ga-entry img { max-width: 100%; height: auto; border-radius: 12px; }

/* classic (pre-block) posts */
.ga-entry .alignleft, .ga-entry .alignright { display: block; float: none; margin: 1em auto; }
.ga-entry .aligncenter { display: block; margin-inline: auto; }
.ga-entry::after { content: ""; display: table; clear: both; }
.ga-entry [style*="justify"] { text-align: left !important; }
.ga-entry span[style*="color"] { color: inherit !important; }
.ga-entry .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-block: 1.6em !important; }
.ga-entry .gallery .gallery-item { float: none !important; width: auto !important; margin: 0 !important; }
.ga-entry .gallery br { display: none; }
.ga-entry .gallery img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border: 0 !important; border-radius: 10px; }
.ga-entry .gallery .gallery-caption { display: none; }

/* tables: framed, striped, scroll sideways on small screens */
.ga-article .ga-entry > .wp-block-table, .ga-entry .wp-block-table { margin-block: 1.8em; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--ga-line); border-radius: 14px; background: #fff; }
.ga-entry .wp-block-table table, .ga-entry > table { width: 100%; margin: 0; border-collapse: collapse; font-size: .94rem; line-height: 1.5; }
.ga-entry .wp-block-table table:has(tr > :nth-child(3)) { min-width: 540px; }
.ga-entry .wp-block-table :is(th, td), .ga-entry > table :is(th, td) { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--ga-line); text-align: left; vertical-align: top; overflow-wrap: normal; }
.ga-entry .wp-block-table :is(th, td) + :is(th, td) { border-left: 1px solid var(--ga-line); }
.ga-entry .wp-block-table thead { border-bottom: 0; }
.ga-entry .wp-block-table thead th, .ga-entry .wp-block-table table:not(:has(thead)) tr:first-child td { background: var(--ga-mist); color: var(--ga-ink); font-weight: 700; }
.ga-entry .wp-block-table tbody tr:nth-child(even) td { background: #f9faf7; }
.ga-entry .wp-block-table tbody tr:last-child td { border-bottom: 0; }
.ga-entry .wp-block-table figcaption { padding: 10px 14px; margin: 0; border-top: 1px solid var(--ga-line); text-align: left; }
@media (max-width: 573px) { /* wide tables scroll: say so above the table, pinned while it scrolls */
	.ga-entry .wp-block-table:has(tr > :nth-child(3))::before { content: "Swipe sideways to see the whole table \2192"; position: sticky; left: 0; display: block; padding: 8px 14px; border-bottom: 1px solid var(--ga-line); background: #fff; color: var(--ga-muted); font-size: .8rem; line-height: 1.4; }
}

/* in-article call to action: the bold paragraph and the button that follows it share one box */
.ga-article .ga-entry > p:has(+ .wp-block-buttons), .ga-article .ga-entry > p:has(+ .wp-block-buttons) + .wp-block-buttons { box-sizing: border-box; }
.ga-article .ga-entry > p:has(+ .wp-block-buttons) { margin-block-start: 2.4em; padding: 24px 22px 0; border-radius: 18px 18px 0 0; background: var(--ga-mist); font-size: 1.05em; }
.ga-article .ga-entry > p:has(+ .wp-block-buttons) + .wp-block-buttons { margin-block-start: 0; padding: 16px 22px 24px; border-radius: 0 0 18px 18px; background: var(--ga-mist); }
.ga-entry .wp-block-button .wp-block-button__link { text-decoration: none; }
.ga-entry .wp-block-button:not([class*="is-style-"]) .wp-block-button__link::after { content: ""; width: 1.05em; height: 1.05em; background: currentColor; -webkit-mask: var(--ga-i-arrow) center / contain no-repeat; mask: var(--ga-i-arrow) center / contain no-repeat; }

/* FAQ: one card per question (wrapped in inc/blog.php) */
.ga-article .ga-entry > .ga-faq-title { margin-bottom: 0; }
.ga-article .ga-entry > .ga-faq-title + .ga-faq-item { margin-block-start: 1em; }
.ga-article .ga-entry > .ga-faq-item + .ga-faq-item { margin-block-start: 12px; }
.ga-entry .ga-faq-item { padding: 18px 18px 20px; border: 1px solid var(--ga-line); border-radius: 16px; background: #fff; }
.ga-entry .ga-faq-item > h3 { display: flex; gap: 12px; align-items: flex-start; margin: 0; font-size: 1.08rem; line-height: 1.4; }
.ga-entry .ga-faq-item > h3::before { content: "Q"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -1px; border-radius: 8px; background: var(--ga-mist); color: var(--ga-green); font-size: .85rem; letter-spacing: 0; }
.ga-entry .ga-faq-item > :not(h3) { margin: 10px 0 0; font-size: .97em; line-height: 1.7; color: #33473a; }

/* ---------- cards (blog index, archives, search, latest guides) ---------- */
.ga-guides .wp-block-post { display: flex; flex-direction: column; }
.ga-guides .wp-block-post:focus-within { outline: 3px solid var(--ga-lime); outline-offset: 2px; }
.ga-guides .wp-block-post-title a:focus { outline: none; }
.ga-guides .wp-block-post-featured-image { overflow: hidden; background: var(--ga-mist); }
.ga-guides .wp-block-post-featured-image img { transition: transform .35s ease; }
.ga-guides .wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.035); }
.ga-guides .wp-block-post:hover .wp-block-post-title a { color: var(--ga-green); }
.ga-guides :is(.is-product-shot, .type-product .wp-block-post-featured-image) { background: #fff; border-bottom: 1px solid var(--ga-line); }
.ga-guides :is(.is-product-shot, .type-product .wp-block-post-featured-image) img { object-fit: contain !important; padding: 14px; }
.ga-guides .wp-block-post-terms.ga-term-fallback { color: var(--ga-green); }
.ga-guides .ga-post-card-body { display: flex; flex: 1; flex-direction: column; margin: 0; padding: 16px 18px 20px; }
.ga-guides .ga-post-card-body > * { margin: 0; }
.ga-guides .ga-post-card-body .wp-block-post-terms { margin: 0 0 6px; }
.ga-guides .ga-post-card-body .wp-block-post-title { margin: 0; line-height: 1.3; overflow-wrap: break-word; }
.ga-guides .ga-post-excerpt { display: none; }

/* blog index: the first card of each page is a wide feature card */
.ga-guides--index .wp-block-post:first-child .wp-block-post-title { font-size: 1.3rem; line-height: 1.25; }
.ga-guides--index .wp-block-post:first-child .ga-post-excerpt { display: block; margin-top: 10px; color: var(--ga-muted); font-size: .97rem; line-height: 1.6; }
.ga-guides--index .wp-block-post:first-child .ga-post-excerpt p { margin: 0; }
.ga-guides--index .wp-block-post:first-child .ga-post-card-body::after { content: "Read the guide \2192"; display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-weight: 700; color: var(--ga-green); }

/* search results on phones: compact rows (thumbnail + label + title) so mixed results scan quickly */
@media (max-width: 639px) {
	.ga-guides--search .wp-block-post-template { gap: 10px; }
	.ga-guides--search .wp-block-post { flex-direction: row; align-items: stretch; }
	.ga-guides--search .wp-block-post-featured-image { flex: none; width: 108px; height: auto; min-height: 96px; aspect-ratio: auto; border-bottom: 0 !important; border-right: 1px solid var(--ga-line); }
	.ga-guides--search .wp-block-post-featured-image img { position: absolute; inset: 0; }
	.ga-guides--search .wp-block-post-featured-image { position: relative; }
	.ga-guides--search :is(.is-product-shot, .type-product .wp-block-post-featured-image) img { padding: 8px; }
	.ga-guides--search .ga-post-card-body { justify-content: center; padding: 12px 14px; }
	.ga-guides--search .ga-post-card-body .wp-block-post-terms { font-size: .7rem; margin-bottom: 4px; }
	.ga-guides--search .ga-post-card-body .wp-block-post-title { font-size: 1rem; }
}

/* pagination */
.ga-guides .wp-block-query-pagination { gap: 8px; margin-top: 36px; flex-wrap: wrap; }
.ga-guides .wp-block-query-pagination-numbers { display: flex; flex-wrap: wrap; gap: 8px; }
.ga-guides .wp-block-query-pagination-numbers .page-numbers.dots { min-width: 24px; border: 0; }
.ga-guides .wp-block-query-pagination-numbers a.page-numbers:hover { border-color: var(--ga-green); color: var(--ga-green); }
.ga-guides :is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid var(--ga-line); border-radius: 12px; background: #fff; color: var(--ga-ink); font-size: 0; font-weight: 700; text-decoration: none; }
.ga-guides :is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next):hover { border-color: var(--ga-green); color: var(--ga-green); }
.ga-guides :is(.wp-block-query-pagination-previous-arrow, .wp-block-query-pagination-next-arrow) { margin: 0; font-size: 1.1rem; }

/* empty states */
.ga-empty { max-width: 640px; margin-inline: auto; padding: 36px 22px; border: 1px dashed #c9d6c8; border-radius: 20px; background: var(--ga-sand); text-align: center; }
.ga-empty h2 { margin: 0; font-size: var(--wp--preset--font-size--x-large); }
.ga-empty > * + * { margin-top: 14px; }
.ga-empty .ga-pills, .ga-empty .wp-block-buttons { justify-content: center; }
.ga-empty .ga-pills a { background: #fff; }

/* ---------- tablet ---------- */
@media (min-width: 640px) {
	.ga-post-hero img { aspect-ratio: 16 / 9; border-radius: 20px; }
	.ga-entry .alignleft { float: left; max-width: 45%; margin: .35em 1.6em 1em 0; }
	.ga-entry .alignright { float: right; max-width: 45%; margin: .35em 0 1em 1.6em; }
	.ga-entry .gallery { grid-template-columns: repeat(4, 1fr); }
	.ga-entry .ga-faq-item { padding: 20px 24px 22px; }
	.ga-entry .ga-faq-item > :not(h3) { margin-left: 40px; }
	.ga-article .ga-entry > p:has(+ .wp-block-buttons) { padding: 28px 30px 0; }
	.ga-article .ga-entry > p:has(+ .wp-block-buttons) + .wp-block-buttons { padding: 18px 30px 28px; }

	.ga-guides--index .wp-block-post:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
	.ga-guides--index .wp-block-post:first-child .wp-block-post-featured-image { aspect-ratio: auto; min-height: 260px; height: 100%; }
	.ga-guides--index .wp-block-post:first-child .ga-post-card-body { justify-content: center; padding: 28px 30px; }

	.ga-guides :is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next) { padding: 0 16px; font-size: .95rem; }
}

/* ---------- desktop ---------- */
@media (min-width: 960px) {
	.ga-blog-head { padding-block: 30px 46px; }
	.ga-post-head { padding-top: 30px; }
	.ga-article > .ga-entry { margin-top: 44px; }
	.ga-entry { font-size: 1.125rem; }
	.ga-guides--index .wp-block-post:first-child { grid-template-columns: 1.35fr 1fr; }
	.ga-guides--index .wp-block-post:first-child .ga-post-card-body { padding: 40px 44px; }
	.ga-guides--index .wp-block-post:first-child .wp-block-post-title { font-size: 1.75rem; }
}
