/**
 * Boksiowo Portal Engine PRO — Articles module (frontend) styles.
 */

.bpe-container {
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Single article width fix — diagnosed live (not guessed): on a single
   post the real bottleneck was NOT Astra (.ast-container measured
   1640px at 1920px viewport, plenty wide) — it was two of this
   plugin's OWN rules: .bpe-container's shared 1140px cap (used by
   archive/dogs/vets pages too, so scoped here to single-article only
   via the #bpe-article-single ancestor rather than changed globally),
   and .bpe-article__content's separate 780px cap further inside. Widened
   the outer container to ~1220px and capped/centred the article itself
   at 1040px (rather than letting it fill the full 1220) so the article
   reads as a deliberately-set, centred column with visible margin on a
   wide screen — not text stretched edge-to-edge, and not the old ~650-
   780px column either. */
/* #bpe-article-single is a flex-item of Astra's .ast-container (display:
   flex) with no explicit flex-grow, so by default it shrink-to-fits its
   own content instead of filling the row — measured 1080px live even
   though .ast-container had 1640px available and .bpe-container's own
   max-width allowed 1220px. Same root cause and same fix already used
   for #bpe-homepage on the homepage (see homepage.css): pin width:100%
   so it fills its flex row instead of shrink-to-fitting. */
#bpe-article-single {
	width: 100%;
}

.bpe-article-single .bpe-container {
	max-width: 1220px;
}

.bpe-article-single .bpe-article {
	max-width: 1040px;
	margin-left: auto;
	margin-right: auto;
}

.bpe-archive-header {
	margin: 32px 0 24px;
}

.bpe-archive-title {
	margin: 0 0 8px;
}

.bpe-articles-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin-bottom: 32px;
}

.bpe-article-card {
	border: 1px solid #d9e0e7;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.bpe-article-card__thumb {
	display: block;
	width: 100%;
	align-self: stretch;
	flex-shrink: 0;
	/* A fixed height (not aspect-ratio) — the featured images across
	   articles have wildly different native proportions (landscape,
	   portrait, square), so a consistent crop height keeps the grid
	   looking uniform. aspect-ratio was tried first, but on a
	   flex-direction:column item aspect-ratio ties the cross-axis (width)
	   to the shrinkable main-axis (height): with the default flex-shrink,
	   the browser shrank the resolved *width* down to a fraction of the
	   card instead of the intended full-width, evenly-cropped thumbnail.
	   flex-shrink: 0 (this item never shrinks) plus a plain fixed height
	   sidesteps that interaction entirely. */
	/* 210px (was 190px): proportional bump to match the wider card that
	   results from the homepage container's 1200->1360px increase — kept
	   in sync with .bpe-homepage-card__thumb (homepage.css), same reasoning. */
	height: 210px;
	overflow: hidden;
}

.bpe-article-card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bpe-article-card__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bpe-article-card__title {
	margin: 0;
	font-size: 1.15rem;
	/* ETAP 3: explicit 600 (was unset, so browsers' default <h3> bold —
	   usually 700 — applied) so this matches .bpe-homepage-card__title
	   and the video card title added the same pass; one weight across
	   every card type instead of an untouched default nobody chose. */
	font-weight: 600;
	/* Clamped to 2 lines: an unclamped title was one of two reasons card
	   grid rows rendered at wildly different heights (the other was the
	   excerpt, below) — a portal's card grid reads as a grid only when
	   every card in a row is close to the same height. */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.bpe-article-card__title a {
	text-decoration: none;
}

.bpe-article-card__meta {
	font-size: 0.85rem;
	color: #46515f;
}

.bpe-article-card__excerpt {
	font-size: 0.95rem;
	color: #46515f;
	/* Was completely unclamped — a long excerpt could run past 500px of
	   text, which is what made the homepage's article grids (fixed to
	   actually BE a grid in shortcode-engine.css) still render as three
	   screen-height-tall columns instead of compact cards. 3 lines reads
	   as a "short description", matching how every other real portal
	   teases an article. */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
}

.bpe-article-card__link {
	margin-top: auto;
	font-weight: 600;
	text-decoration: none;
}

.bpe-article-card__badge {
	display: inline-block;
	align-self: flex-start;
	background: #ff6b1a;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 2px 8px;
	border-radius: 3px;
}

.bpe-pagination {
	display: flex;
	justify-content: center;
	margin-bottom: 40px;
}

.bpe-no-articles {
	padding: 40px 0;
	text-align: center;
	color: #46515f;
}

.bpe-article__header {
	margin: 32px 0 20px;
}

.bpe-article__title {
	margin: 8px 0 12px;
}

.bpe-article__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 0.9rem;
	color: #46515f;
	margin-bottom: 20px;
}

.bpe-article__thumb img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
	margin-bottom: 24px;
}

.bpe-article__content {
	/* Was 780px — a second, narrower cap sitting inside .bpe-article,
	   which is now itself the single source of truth for the column
	   width (see .bpe-article-single .bpe-article above). Left at 780
	   here would have kept the visible text column exactly as narrow as
	   before, undoing that fix. */
	max-width: 100%;
	line-height: 1.7;
	margin-bottom: 40px;
}

/* Images placed inside the article body itself (not the featured image
   above, which .bpe-article__thumb already styles) — e.g. a photo an
   editor drags into the WordPress editor mid-article. Previously
   completely unstyled: no width limit, no rounding, no centering, so an
   inserted photo could render at its full native pixel size and sit
   flush left instead of reading as a deliberate figure in the post. */
.bpe-article__content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 24px auto;
	border-radius: 8px;
}

/* Classic-editor/WP-core alignment classes (aligncenter/alignleft/
   alignright) and the caption wrapper WordPress generates around a
   captioned image — honoured here since the_content() can output any of
   these depending on how the editor inserted the image. */
.bpe-article__content .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.bpe-article__content .alignleft {
	float: left;
	margin: 4px 20px 16px 0;
	max-width: 45%;
}

.bpe-article__content .alignright {
	float: right;
	margin: 4px 0 16px 20px;
	max-width: 45%;
}

.bpe-article__content .wp-caption {
	max-width: 100%;
	margin: 24px auto;
}

.bpe-article__content .wp-caption img {
	margin: 0;
}

.bpe-article__content .wp-caption-text,
.bpe-article__content figcaption {
	margin-top: 8px;
	font-size: 0.85rem;
	color: #46515f;
	text-align: center;
}
