/* Articles listing (page 64 and its translation): sections printed by inc/articles-listing.php. Loaded after program.css
 * (tokens --fp-*). Resets are scoped with :is(.entry-content, .is-root-container) so they outrank the Kadence content
 * spacing in style.css and still apply in the editor. */

/* ------------------------------------------------------------------
 * Resets and section rhythm
 * ---------------------------------------------------------------- */
:is(.entry-content, .is-root-container) > .freesia-articles-section { margin-block: 0; }
:is(.entry-content, .is-root-container) .freesia-articles-section :is(h1, h2, h3, p, figure) { margin-block: 0; }

.freesia-articles-section { box-sizing: border-box; padding-block: 3rem; background: #fff; color: var(--fp-text); }
/* The constrained section already has the site's side padding; its children only cap the width. */
.freesia-articles-section.is-layout-constrained > :not(.alignfull) { box-sizing: border-box; width: 100%; max-width: 1242px; margin-inline: auto !important; }
.freesia-articles-section :is(a, button):focus-visible { outline: 3px solid var(--fp-logo-blue); outline-offset: 3px; }

/* Date · reading time (featured card and grid cards) */
.freesia-card-meta { display: flex; flex-wrap: wrap; column-gap: 14px; margin: 0; color: var(--fp-muted); font-size: 13.5px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.freesia-card-meta span { position: relative; }
.freesia-card-meta span::before { content: ""; position: absolute; top: 50%; left: -8px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; transform: translateY(-50%); }

/* ------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------- */
.freesia-articles-section.freesia-articles-header { padding-block: 1.25rem 2.25rem; background: var(--fp-sand-50); }
.freesia-articles-header h1.freesia-articles-header__title { color: var(--fp-ink); font-size: 34px; font-weight: 700 !important; line-height: 1.3; text-align: left; }
.freesia-articles-header p.freesia-articles-header__intro { margin-top: 0.5rem; color: var(--fp-muted); font-size: 17px; line-height: 1.7; }

/* ------------------------------------------------------------------
 * Newest article (wide card)
 * ---------------------------------------------------------------- */
.freesia-articles-section.freesia-articles-latest { padding-bottom: 0; }
.freesia-articles-latest .wp-block-post-template { margin: 0; padding: 0; list-style: none; }
.freesia-articles-latest__card.wp-block-group { display: grid; gap: 1.25rem; }
.freesia-articles-latest__card > * { margin-block: 0; }
.freesia-articles-latest__image.wp-block-post-featured-image { margin: 0; overflow: hidden; border-radius: 18px; background: var(--fp-mist); }
.freesia-articles-latest__image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--fp-ease); }
.freesia-articles-latest__card:hover .freesia-articles-latest__image img { transform: scale(1.03); }
.freesia-articles-latest__body.wp-block-group { display: flex; flex-direction: column; align-items: flex-start; gap: 0.625rem; }
.freesia-articles-latest__body > * { margin-block: 0; }
.freesia-articles-latest h2.freesia-articles-latest__title { color: var(--fp-ink); font-size: 24px; line-height: 1.4; text-align: left; text-wrap: balance; }
.freesia-articles-latest__title a { color: inherit; text-decoration: none; }
.freesia-articles-latest__title a:hover { color: var(--fp-blue); }
.freesia-articles-latest__excerpt { color: var(--fp-text); font-size: 16px; line-height: 1.75; }
.freesia-articles-latest__excerpt .wp-block-post-excerpt__excerpt { margin: 0; }
.freesia-articles-latest__excerpt .wp-block-post-excerpt__more-text { display: none; }

/* ------------------------------------------------------------------
 * More articles (bloom/post-grid with load more)
 * ---------------------------------------------------------------- */
.freesia-articles-section.freesia-articles-more h2.wp-block-heading { margin-bottom: 1.5rem; color: var(--fp-brown); font-size: 24px; line-height: 1.4; text-align: left; }
.freesia-articles-more .wp-block-bloom-post-grid.freesia-articles-grid { row-gap: 2.5rem; margin: 0; }
.freesia-articles-grid .pg-card { display: flex; flex-direction: column; overflow: visible; border-radius: 0; background: transparent; box-shadow: none; }
.freesia-articles-grid .pg-image { display: block; overflow: hidden; border-radius: 14px; background: var(--fp-mist); }
.freesia-articles-grid .pg-img { transition: transform 0.5s var(--fp-ease); }
.freesia-articles-grid .pg-card:hover .pg-img { transform: scale(1.04); }
.freesia-articles-more .freesia-articles-grid .pg-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 0 0; }
.freesia-articles-more .freesia-articles-grid .pg-title { order: 2; margin: 0; color: var(--fp-ink); font-size: 18px; line-height: 1.5; }
.freesia-articles-grid .pg-title a { color: inherit; text-decoration: none; }
.freesia-articles-grid .pg-card:hover .pg-title a { color: var(--fp-blue); }
.freesia-articles-grid .freesia-card-meta { order: 1; }
.freesia-articles-more .pg-skeleton { min-height: 280px; border-radius: 14px; background: linear-gradient(100deg, var(--fp-mist) 40%, #f3f8fc 50%, var(--fp-mist) 60%) 0 0 / 200% 100%; animation: freesia-shimmer 1.4s linear infinite; }
@keyframes freesia-shimmer { to { background-position: -200% 0; } }
.freesia-articles-more .pg-more-button {
	display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 2.5rem auto 0; padding: 0 1.75em; border: 0; border-radius: 999px;
	background: #fff; color: var(--fp-blue-deep); box-shadow: inset 0 0 0 1.5px var(--fp-mist-line);
	font-family: var(--fp-display); font-size: 16px; font-weight: 500; line-height: 1.2; cursor: pointer; transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.freesia-articles-more .pg-more-button:hover { background: var(--fp-mist); box-shadow: inset 0 0 0 1.5px var(--fp-logo-blue); }
.freesia-articles-more .pg-more-button[hidden] { display: none; }

/* ------------------------------------------------------------------
 * Wider screens
 * ---------------------------------------------------------------- */
@media (min-width: 768px) {
	.freesia-articles-section { padding-block: 4rem; }
	.freesia-articles-section.freesia-articles-header { padding-block: 1.25rem 3rem; }
	.freesia-articles-header h1.freesia-articles-header__title { font-size: 42px; }
	.freesia-articles-latest h2.freesia-articles-latest__title { font-size: 30px; }
	.freesia-articles-section.freesia-articles-more h2.wp-block-heading { margin-bottom: 2rem; font-size: 28px; }
}
@media (min-width: 1024px) {
	.freesia-articles-latest__card.wp-block-group { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 3.5rem; }
	.freesia-articles-latest__excerpt { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
	.freesia-articles-latest__image img, .freesia-articles-grid .pg-img { transition: none; }
	.freesia-articles-latest__card:hover .freesia-articles-latest__image img, .freesia-articles-grid .pg-card:hover .pg-img { transform: none; }
	.freesia-articles-more .pg-skeleton { animation: none; }
}
