/* ==========================================================================
   Certenly theme – Press and Blog
   --------------------------------------------------------------------------
   The listings (/press/, /blog/) and their articles. Loaded only there
   (functions.php); builds on main.css's tokens, .page-header and .entry-content.
   ========================================================================== */

/* Header band ------------------------------------------------------------- */
.article-hero { padding-bottom: 80px; }
.article-hero__eyebrow { margin-bottom: 20px; }
.article-hero__lead { max-width: 620px; margin-top: 24px; font-size: 18px; line-height: 1.5; letter-spacing: 0.36px; color: rgba(255, 255, 255, 0.85); }

/* An article lines its title up with the text column below it. */
.article-hero__inner { max-width: calc(800px - 2 * var(--gutter)); }
.article-hero__section { display: inline-flex; align-items: center; min-height: 24px; color: var(--gold); }
.article-hero__section:hover { text-decoration: underline !important; text-underline-position: from-font; }
.article-hero__title { font-size: 44px; line-height: 1.15; text-wrap: balance; }
.article-hero__meta { margin-top: 24px; font-weight: 500; font-size: 14px; line-height: 1.2; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }

/* Listing ----------------------------------------------------------------- */
.articles { padding: 80px var(--gutter) 120px; }
.articles__inner { max-width: 1244px; margin: 0 auto; }
.articles__title { margin-bottom: 40px; font-weight: 500; font-size: 32px; line-height: 1.2; color: var(--navy-900); }
.articles--more { padding-top: 80px; padding-bottom: 100px; background: var(--panel); }

.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; }
.article-grid__item { display: flex; }

/* Card: the title's link covers the whole card. */
.article-card {
	position: relative; display: flex; flex-direction: column; width: 100%;
	background: #fff; border: 1px solid #dfe7ee; border-radius: 20px; overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(6, 7, 29, 0.1); }
.article-card:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
/* The image is taken out of the flow, so a photo that was never cropped to 16:9 can't stretch the card. */
.article-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--grad-navy); }
/* Crops keep the upper part of a tall photo, where faces usually are. */
.article-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.article-card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; }
.article-card__placeholder img { width: 120px; height: auto; opacity: 0.9; }
.article-card__body { display: flex; flex-direction: column; flex: 1; padding: 24px 28px 28px; }
.article-card__meta { font-weight: 500; font-size: 13px; line-height: 1.2; letter-spacing: 1.3px; text-transform: uppercase; color: var(--gray-600); }
.article-card__title { margin-top: 14px; font-weight: 500; font-size: 22px; line-height: 1.3; color: var(--navy-900); }
.article-card__link:focus-visible { outline: none; }
.article-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.article-card__summary {
	margin-top: 12px; font-size: 16px; line-height: 1.5; color: var(--gray-700);
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.article-card__more { margin-top: auto; padding-top: 24px; }
.article-card:hover .article-card__more { text-decoration: underline; text-underline-position: from-font; }

/* Until the first article is published. */
.articles-empty {
	max-width: 760px; margin: 0 auto; padding: 64px 40px; text-align: center;
	background: var(--panel); border-radius: 24px;
}
.articles-empty__title { font-weight: 500; font-size: 32px; line-height: 1.2; color: var(--navy-900); }
.articles-empty__text { max-width: 520px; margin: 16px auto 0; font-size: 18px; line-height: 1.5; color: var(--gray-700); }
.articles-empty .btn { margin-top: 32px; }

/* Page numbers */
.articles .pagination { margin-top: 64px; }
.articles .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.articles .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 16px;
	border: 1px solid var(--gray-300); border-radius: 100px;
	font-weight: 600; font-size: 14px; line-height: 1; color: var(--navy-900);
}
.articles a.page-numbers:hover { border-color: var(--navy-900); }
.articles .page-numbers.current { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.articles .page-numbers.dots { border-color: transparent; }

/* Article ----------------------------------------------------------------- */
.article__image { max-width: 1088px; margin: 64px auto 0; padding: 0 var(--gutter); }
/* 16:9 like the cards, so a tall photo can't push the article down the page. */
.article__image img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 25%; border-radius: 20px; }
.article__image figcaption,
.article__content figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--gray-600); }

.article__content { padding-bottom: 48px; color: var(--gray-700); }
.article__content > :first-child { margin-top: 0; }
.article__content h2,
.article__content h3,
.article__content h4 { color: var(--navy-900); line-height: 1.25; }
.article__content h2 { margin-top: 1.8em; font-size: 30px; }
.article__content h3 { margin-top: 1.6em; font-size: 24px; }
.article__content h4 { margin-top: 1.4em; font-weight: 600; font-size: 19px; }
.article__content strong { color: var(--navy-950); }
.article__content a { text-decoration: underline !important; text-underline-position: from-font; }
.article__content a:hover { color: var(--navy-900); }
.article__content li + li { margin-top: 0.4em; }
.article__content blockquote {
	margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--amber);
	font-size: 22px; line-height: 1.45; color: var(--navy-900);
}
.article__content blockquote cite { display: block; margin-top: 12px; font-style: normal; font-size: 15px; color: var(--gray-600); }
.article__content figure { margin: 1.6em 0; }
.article__content img { border-radius: 12px; }
.article__content hr { margin: 2em 0; border: 0; border-top: 1px solid var(--gray-300); }
.article__content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.article__content th,
.article__content td { padding: 10px 12px; border-bottom: 1px solid var(--gray-300); text-align: left; vertical-align: top; }
.article__content th { color: var(--navy-900); }

.article__footer { max-width: 800px; margin: 0 auto; padding: 0 var(--gutter) 100px; }
.article__footer-inner { padding-top: 24px; border-top: 1px solid var(--gray-300); }
.article__back { min-height: 44px; }
.article__back:hover { text-decoration: underline; text-underline-position: from-font; }

/* Editors only, while the Blog is hidden (inc/post-types.php). */
.article-notice { margin: 0; padding: 10px var(--gutter); background: var(--gold); text-align: center; font-weight: 600; font-size: 14px; line-height: 1.4; color: var(--navy-950); }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1200px) {
	.article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.article-hero { padding-top: 140px; padding-bottom: 56px; }
	.page-header__title { font-size: 36px; }
	.article-hero__title { font-size: 32px; }
	.article-hero__lead { font-size: 16px; }
	.articles { padding-top: 56px; padding-bottom: 80px; }
	.articles--more { padding-top: 56px; padding-bottom: 72px; }
	.articles__title, .articles-empty__title { font-size: 26px; }
	.article__image { margin-top: 40px; }
	.article__content h2 { font-size: 26px; }
	.article__content h3 { font-size: 21px; }
	.article__content blockquote { font-size: 19px; }
}

@media (max-width: 600px) {
	.article-grid { grid-template-columns: 1fr; gap: 24px; }
	.article-card__body { padding: 20px 20px 24px; }
	.articles-empty { padding: 40px 20px; }
	.articles-empty__text { font-size: 16px; }
	.article__content { font-size: 17px; }
}
