/*
 * Oprafix blog: post cards (Blogs page widget + archives) and the single post layout.
 * Colours and fonts follow the Elementor Global Colours/Fonts (with brand fallbacks).
 */

.opx-post-grid, .opx-single, .opx-blog-archive {
	--opx-navy: var(--e-global-color-accent, #0b1a3f);
	--opx-blue: var(--e-global-color-primary, #043cb7);
	--opx-green: var(--e-global-color-secondary, #02b441);
	--opx-text: var(--e-global-color-text, #4a5568);
	--opx-light: var(--e-global-color-opx_light, #eef4ff);
	--opx-line: var(--e-global-color-opx_border, #e2e8f0);
	--opx-head-font: var(--e-global-typography-opx_label-font-family, "Poppins"), sans-serif;
}
.opx-ico { flex: none; fill: currentColor; vertical-align: -3px; }

/* ---------- Cards ---------- */
.opx-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.opx-post-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--opx-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 4px 14px rgba(11, 26, 63, 0.06);
	transition: transform .25s ease, box-shadow .25s ease;
}
.opx-post-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(11, 26, 63, 0.12); }
.opx-post-card__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--opx-light); }
.opx-post-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.opx-post-card:hover .opx-post-card__media img { transform: scale(1.04); }
.opx-post-card__placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: linear-gradient(135deg, var(--opx-blue), #071a45); }
.opx-post-card__placeholder img { width: 72px !important; height: 72px !important; object-fit: contain !important; padding: 10px; border-radius: 16px; background: #fff; transform: none !important; }
.opx-post-card__body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px 22px 24px; }
.opx-post-chip {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(2, 180, 65, 0.12);
	color: #0b7a36;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.4;
	text-decoration: none;
	text-transform: uppercase;
}
.opx-post-chip:hover, .opx-post-chip:focus { background: var(--opx-green); color: #fff; }
.opx-post-card__title { margin: 0; font-family: var(--opx-head-font); font-size: 20px; font-weight: 600; line-height: 1.35; }
.opx-post-card__title a { color: var(--opx-navy); text-decoration: none; }
.opx-post-card__title a:hover, .opx-post-card__title a:focus { color: var(--opx-blue); }
.opx-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: #64748b; font-size: 14px; line-height: 1.5; }
.opx-post-meta__sep { margin: 0 2px; }
.opx-post-card__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--opx-text);
	font-size: 15px;
	line-height: 1.65;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}
.opx-post-card__more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; color: var(--opx-blue); font-weight: 600; text-decoration: none; }
.opx-post-card__more .opx-ico { transition: transform .2s ease; }
.opx-post-card__more:hover .opx-ico, .opx-post-card__more:focus .opx-ico { transform: translateX(3px); }

.opx-post-empty { padding: 48px 24px; border: 1px dashed #cbd5e1; border-radius: 16px; background: #fff; text-align: center; color: var(--opx-text, #4a5568); }
.opx-post-empty__title { margin: 0 0 6px; font-family: var(--e-global-typography-opx_label-font-family, "Poppins"), sans-serif; font-size: 20px; font-weight: 600; color: var(--e-global-color-accent, #0b1a3f); }
.opx-post-empty p:last-child { margin-bottom: 0; }

.opx-post-pagination { margin-top: 40px; }
.opx-post-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.opx-post-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid var(--e-global-color-opx_border, #e2e8f0); border-radius: 10px; background: #fff; color: var(--e-global-color-accent, #0b1a3f); font-weight: 600; text-decoration: none; }
.opx-post-pagination .page-numbers.current, .opx-post-pagination a.page-numbers:hover { border-color: var(--e-global-color-primary, #043cb7); background: var(--e-global-color-primary, #043cb7); color: #fff; }

/* ---------- Single post + archive header ---------- */
.opx-article__head { padding: 56px 24px 64px; background: linear-gradient(180deg, var(--opx-light) 0%, #f7faff 100%); }
.opx-article__wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; max-width: 820px; margin: 0 auto; }
.opx-crumbs { display: flex; flex-wrap: wrap; align-self: stretch; gap: 8px; min-width: 0; max-width: 100%; color: #64748b; font-size: 14px; }
.opx-crumbs a { color: var(--opx-blue); text-decoration: none; }
.opx-crumbs a:hover { text-decoration: underline; }
.opx-crumbs [aria-current] { flex: 1 1 0; min-width: 0; max-width: 100%; overflow: hidden; color: #64748b; text-overflow: ellipsis; white-space: nowrap; }
.opx-article__title { margin: 0; color: var(--opx-navy); font-family: var(--opx-head-font); font-size: clamp(30px, 4.2vw, 46px); font-weight: 700; line-height: 1.18; letter-spacing: -0.01em; }
.opx-archive-desc { max-width: 680px; color: var(--opx-text); font-size: 17px; line-height: 1.7; }
.opx-archive-desc p { margin: 0; }
.opx-archive-body { max-width: 1200px; margin: 0 auto; padding: 48px 24px 88px; }

.opx-article__image { max-width: 1040px; margin: -32px auto 0; padding: 0 24px; }
.opx-article__image img { display: block; width: 100%; height: auto; max-height: 560px; border-radius: 18px; object-fit: cover; box-shadow: 0 18px 40px rgba(11, 26, 63, 0.14); }
.opx-article__image figcaption { margin-top: 10px; color: #64748b; font-size: 14px; text-align: center; }

/* Readable article body (block editor content). */
.opx-article__content { max-width: 760px; margin: 0 auto; padding: 44px 24px 8px; color: var(--opx-text); font-size: 18px; line-height: 1.8; }
.opx-article__content.is-elementor { max-width: none; padding: 32px 0 0; }
.opx-article__content > * { margin-top: 0; margin-bottom: 1.25em; }
.opx-article__content h2, .opx-article__content h3, .opx-article__content h4 { margin: 1.7em 0 0.6em; color: var(--opx-navy); font-family: var(--opx-head-font); font-weight: 600; line-height: 1.3; }
.opx-article__content h2 { font-size: clamp(24px, 2.6vw, 30px); }
.opx-article__content h3 { font-size: clamp(20px, 2.1vw, 24px); }
.opx-article__content h4 { font-size: 19px; }
.opx-article__content a { color: var(--opx-blue); text-decoration: underline; text-underline-offset: 3px; }
.opx-article__content strong { color: var(--opx-navy); }
.opx-article__content ul, .opx-article__content ol { padding-left: 1.3em; }
.opx-article__content li { margin-bottom: 0.45em; }
.opx-article__content li::marker { color: var(--opx-green); }
.opx-article__content blockquote { position: relative; margin-left: 0; margin-right: 0; padding: 22px 24px 22px 60px; border: 0; border-radius: 14px; background: var(--opx-light); color: var(--opx-navy); font-family: var(--opx-head-font); font-size: 19px; font-style: normal; line-height: 1.55; }
.opx-article__content blockquote::before { content: "\201C"; position: absolute; top: 10px; left: 20px; color: var(--opx-green); font-family: Georgia, serif; font-size: 48px; line-height: 1; }
.opx-article__content blockquote p:last-child { margin-bottom: 0; }
.opx-article__content img { max-width: 100%; height: auto; border-radius: 12px; }
.opx-article__content figure { margin-left: 0; margin-right: 0; }
.opx-article__content figcaption { color: #64748b; font-size: 14px; text-align: center; }
.opx-article__content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.opx-article__content th, .opx-article__content td { padding: 10px 12px; border: 1px solid var(--opx-line); text-align: left; }
.opx-article__content th { background: var(--opx-light); color: var(--opx-navy); }

/* In-article enquiry box (Group block with class opx-inline-cta). */
.opx-article__content .opx-inline-cta { margin: 2.2em 0; padding: 26px 28px; border: 1px solid #d6e2fb; border-radius: 16px; background: linear-gradient(135deg, var(--opx-light) 0%, #f6fbf8 100%); }
.opx-article__content .opx-inline-cta > * { margin: 0 0 10px; }
.opx-article__content .opx-inline-cta__title { font-family: var(--opx-head-font); font-size: 21px; line-height: 1.35; }
.opx-article__content .opx-inline-cta p:not(.opx-inline-cta__title) { font-size: 16.5px; line-height: 1.65; }
.opx-article__content .opx-inline-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0 !important; }
.opx-article__content .opx-inline-cta__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 10px; font-family: var(--opx-head-font); font-size: 15px; font-weight: 600; text-decoration: none; transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s ease, background-color .2s ease; }
.opx-article__content .opx-inline-cta__btn.is-call { background: var(--opx-blue); color: #fff; }
.opx-article__content .opx-inline-cta__btn.is-wa { background: var(--opx-green); color: #fff; }
.opx-article__content .opx-inline-cta__btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(7, 26, 69, 0.55); color: #fff; }

.opx-article__foot { display: flex; flex-direction: column; gap: 28px; max-width: 760px; margin: 0 auto; padding: 24px 24px 64px; }
.opx-post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.opx-post-tags a { display: inline-block; padding: 6px 12px; border: 1px solid var(--opx-line); border-radius: 999px; color: var(--opx-navy); font-size: 14px; text-decoration: none; }
.opx-post-tags a:hover { border-color: var(--opx-blue); color: var(--opx-blue); }
.opx-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 28px; border-top: 1px solid var(--opx-line); }
.opx-post-nav__link { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--opx-line); border-radius: 12px; color: var(--opx-navy); font-family: var(--opx-head-font); font-weight: 600; line-height: 1.4; text-decoration: none; }
.opx-post-nav__link span { color: #64748b; font-family: inherit; font-size: 13px; font-weight: 500; }
.opx-post-nav__link.is-next { grid-column: 2; text-align: right; }
.opx-post-nav__link:hover { border-color: var(--opx-blue); color: var(--opx-blue); }
.opx-back-link { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 12px 20px; border-radius: 8px; background: var(--opx-light); color: var(--opx-blue); font-weight: 600; text-decoration: none; }
.opx-back-link:hover, .opx-back-link:focus { background: var(--opx-blue); color: #fff; }

@media (max-width: 1024px) {
	.opx-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.opx-post-grid { grid-template-columns: 1fr; }
	.opx-article__head { padding: 36px 16px 48px; }
	.opx-article__image { margin-top: -24px; padding: 0 16px; }
	.opx-article__image img { border-radius: 14px; }
	.opx-article__content { padding: 32px 16px 4px; font-size: 17px; }
	.opx-article__foot { padding: 20px 16px 48px; }
	.opx-archive-body { padding: 32px 16px 64px; }
	.opx-post-nav { grid-template-columns: 1fr; }
	.opx-post-nav__link.is-next { grid-column: auto; }
	.opx-post-card__body { padding: 18px 18px 20px; }
	.opx-article__content .opx-inline-cta { padding: 20px 18px; }
	.opx-article__content .opx-inline-cta__btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.opx-post-card, .opx-post-card__media img { transition: none; }
	.opx-post-card:hover { transform: none; }
}
