/* CEPAMS: styles that recreate the old Themify Ultra look on Kadence + core blocks. */

/* Alignment helpers used by converted rows/modules */
.cep-align-center { text-align: center; }
.cep-align-right { text-align: right; }
.cep-align-center .wp-block-buttons { justify-content: center; }
.cep-align-center .wp-block-image { margin-left: auto; margin-right: auto; }

/* Text modules that had a font size in Themify: headings scale with it, as they did there */
.cep-em-headings h1 { font-size: 3.1em; }
.cep-em-headings h2 { font-size: 2.3em; }
.cep-em-headings h3 { font-size: 1.7em; }
.cep-em-headings h4 { font-size: 1.4em; }

/* Paragraph rhythm closer to the old theme */
.single-content p, .entry-content p { margin-top: 0; margin-bottom: 1.25em; }
.single-content li { margin-bottom: .5em; }

/* A block with its own text colour (e.g. white on a photo) also colours its headings */
.has-text-color :is(h1, h2, h3, h4, h5, h6),
.wp-block-cover.is-dark :is(h1, h2, h3, h4, h5, h6) { color: inherit; }
.has-text-color a:where(:not(.wp-element-button)) { color: inherit; }

/* Section headings ("News", "Publications", ...) with the short line underneath */
h2.cep-fancy { font-size: 36.8px; line-height: 1.25; margin-bottom: 1.2em; }
.cep-fancy::after { content: ""; display: block; width: 44px; height: 2px; background: currentColor; margin-top: 14px; opacity: .8; }
.cep-fancy.has-text-align-center::after { margin-left: auto; margin-right: auto; }
.cep-fancy-sub { color: var(--global-palette1); }

/* Converted rows: no extra gap between full-width sections */
.entry-content > .alignfull { margin-top: 0; margin-bottom: 0; }
.cep-row > * + * { margin-top: 1em; }
.wp-block-cover.alignfull { margin-top: 0; margin-bottom: 0; }

/* Post / publication cards (Themify "post" module) */
.cep-query .wp-block-post-template { gap: 30px; }
.cep-query .wp-block-post-featured-image { margin-bottom: 14px; }
.cep-query .wp-block-post-featured-image img { border-radius: 8px; }
.cep-card-title { font-size: 24px; line-height: 1.4; font-weight: 600; margin: 0; }
.cep-pt-post .cep-card-title a { color: #000; }
.cep-pt-publications .cep-card-title { font-size: 18px; }
.cep-card-title a { color: inherit; }
.cep-card-title:not(.has-text-color) a { color: #000; }
.cep-cols-1 .wp-block-post { padding-bottom: 30px; margin-bottom: 30px; }
.cep-cols-1 .cep-card-title { font-size: 20px; color: var(--global-palette1); margin-bottom: .5em; }
.cep-cols-1 .cep-card-title a { color: var(--global-palette1); }
.cep-cols-1 .wp-block-post-excerpt { font-size: 14px; }

/* Lab pages: round portrait overlapping the banner stays on top of it */
.entry-content > :where(.wp-block-group, .wp-block-cover) { position: relative; }
.entry-content > .wp-block-group { z-index: 2; }
.entry-content > .wp-block-cover { z-index: 1; }
.cep-img-with-caption p { font-size: 14px; margin-bottom: .5em; }

/* Themify "link block" (Portfolio): full-width grey bar */
.cep-linkblock .wp-block-button__link { background: #f2f2f2; color: #333; font-weight: 600; width: 100%; }
.cep-linkblock .wp-block-button__link:hover { background: #e6e6e6; color: #000; }
.wp-block-query-pagination { margin-top: 30px; }

/* Images never wider than their column; titles under images (Themify image module title) */
.entry-content .wp-block-image img { max-width: 100%; height: auto; }
h3.cep-img-title, h4.cep-img-title, h2.cep-img-title { font-size: 14px; line-height: 1.4; font-weight: 600; margin: .7em 0 .3em; color: var(--global-palette1); }

/* Cover blocks: only as tall as their content unless a height was set (WP default is 430px) */
.wp-block-cover:not([style*="min-height"]) { min-height: 0; }

/* Pagination like the old round number buttons */
.wp-block-query-pagination { gap: 6px; font-size: 14px; }
.wp-block-query-pagination-numbers .page-numbers { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #0960b5; }
.wp-block-query-pagination-numbers .page-numbers.current { background: #222; color: #fff; }

/* Feature module (icon in circle + title + text) */
.cep-feature-icon img { border-radius: 50%; }
.cep-feature h3 { margin-top: .6em; font-size: 14px; line-height: 1.4; }
.cep-feature p { font-size: 13px; line-height: 1.5; }

/* Buttons like Themify's (square, teal) */
.wp-block-button__link { border-radius: 0; }
.wp-block-button.is-style-outline .wp-block-button__link { border: 2px solid currentColor; }

/* Header: thin line under it like the original */
#masthead .site-header-main-section-left .site-title { letter-spacing: -0.5px; }
.site-main-header-wrap { border-bottom: 1px solid #ececec; }

/* Single post title: centred and smaller than page H1 (as on the old site) */
.single-post .entry-hero .entry-title, .single-post .entry-header .entry-title { font-size: 34px; line-height: 1.35; text-align: center; }
.single-publications .entry-header .entry-title { font-size: 30px; line-height: 1.35; }
.single-post .entry-meta { display: none; }
.single .entry-title { text-transform: none; }

/* Prev/next links and related posts under a post */
.post-navigation { border-top: 0; margin-top: 2em; }
.post-navigation a { color: #222; font-size: 15px; }
.entry-related .entry-related-title { font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--global-palette1); }
.single .entry-related .entry-header .entry-title { font-family: Georgia, serif; font-size: 15px; line-height: 1.35; text-align: left; text-transform: none; }
.entry-related .entry-title a { color: #000; }
.entry-related { background: transparent; padding-top: 1em; }

/* Archives (/publications/, categories): compact cards like the old masonry grid */
.archive .archive-description, .post-type-archive .archive-description { display: none; }
.archive .page-title, .post-type-archive .page-title { font-size: 36.8px; text-align: left; }
.archive .loop-entry .entry-title, .post-type-archive .loop-entry .entry-title { font-size: 17px; line-height: 1.45; font-weight: 600; text-transform: none; }
.archive .loop-entry .entry-title a, .post-type-archive .loop-entry .entry-title a { color: #000; }
.archive .loop-entry .entry-content-wrap, .post-type-archive .loop-entry .entry-content-wrap { padding: 12px 0 0; }
.archive .loop-entry, .post-type-archive .loop-entry { box-shadow: none; background: transparent; }
.archive .loop-entry .post-thumbnail img, .post-type-archive .loop-entry .post-thumbnail img { border-radius: 8px; }

/* Publication details under the title */
.cepams-pub-authors { color: var(--global-palette1); font-size: 22px; font-weight: 600; line-height: 1.4; }
.cepams-pub-meta { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 14px; margin: 0 0 1.5em; }
.cepams-pub-label { display: block; font-weight: 700; color: #444; }
.cepams-pub-link a { font-size: 12px; }
.single-publications .post-navigation a { color: var(--global-palette1); font-weight: 600; font-size: 17px; }

/* Sidebar "Publications" widget */
.primary-sidebar .cep-side-title { font-family: Georgia, serif; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--global-palette1); font-weight: 600; }
.primary-sidebar .wp-block-post-template { gap: 34px; }
.primary-sidebar .wp-block-post-title { font-size: 15px; line-height: 1.45; margin-top: 10px; }
.primary-sidebar .wp-block-post-title a { color: var(--global-palette-highlight, #0960b5); }

/* Footer: same padding as before */
.site-bottom-footer-wrap .site-footer-row-container-inner { padding-top: 40px; padding-bottom: 30px; }
.site-footer .footer-html { color: #fff; }
