/*
Theme Name: Astra Child
Theme URI: https://www.rkendall.com
Description: Child theme for rkendall.com. Custom CSS lives here so Astra updates never overwrite it.
Author: Rick Kendall
Template: astra
Version: 1.0.0
Text Domain: astra-child
*/

/* ---------------------------------------------------------------
   rkendall.com
   All fonts are system fonts - nothing is fetched from a CDN.
   --------------------------------------------------------------- */

:root {
	--rk-accent: #a8480f;
	--rk-accent-dark: #7e360b;
	--rk-ink: #121614;
	--rk-body: #3a403c;
	--rk-muted: #6b6f6c;
	--rk-rule: #e2ded5;
	--rk-surface: #ffffff;
	--rk-page: #fbfaf7;
	--rk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Comfortable reading measure on long-form posts. */
.single-post .entry-content > *:not(.elementor):not(figure):not(.wp-block-embed) {
	max-width: 68ch;
}

/* --- Headings ------------------------------------------------- */

.entry-content h2,
.entry-content h3 {
	margin-top: 1.9em;
	margin-bottom: 0.5em;
}

.entry-title a {
	color: var(--rk-ink);
	text-decoration: none;
}

.entry-title a:hover {
	color: var(--rk-accent);
}

/* --- Links ---------------------------------------------------- */

.entry-content a {
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
}

.entry-content a:hover {
	text-decoration-thickness: 2px;
}

/* --- Code, for the smart-home and project write-ups ----------- */

.entry-content code,
.entry-content kbd {
	font-family: var(--rk-mono);
	font-size: 0.875em;
	background: var(--rk-page);
	border: 1px solid var(--rk-rule);
	border-radius: 3px;
	padding: 0.1em 0.35em;
}

.entry-content pre {
	font-family: var(--rk-mono);
	font-size: 0.85em;
	line-height: 1.55;
	background: #171c19;
	color: #e8e6e1;
	border-radius: 6px;
	padding: 1.1rem 1.25rem;
	overflow-x: auto;
	max-width: 100%;
}

.entry-content pre code {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	font-size: 1em;
}

.entry-content blockquote {
	border-left: 3px solid var(--rk-accent);
	padding-left: 1.1rem;
	margin-left: 0;
	color: var(--rk-muted);
	font-style: normal;
}

/* --- Responsive video: YouTube embeds keep their aspect ratio -- */

.wp-block-embed__wrapper,
.entry-content .wp-embed-aspect-16-9 .wp-block-embed__wrapper {
	position: relative;
}

.entry-content iframe[src*="youtube"],
.entry-content iframe[src*="youtu.be"],
.entry-content iframe[src*="vimeo"] {
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
	border-radius: 6px;
}

/* --- [rk_latest] post list ------------------------------------ */

.rk-latest {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rk-latest__item {
	padding: 1.15rem 0;
	border-bottom: 1px solid var(--rk-rule);
}

.rk-latest__item:first-child {
	padding-top: 0;
}

.rk-latest__item:last-child {
	border-bottom: 0;
}

.rk-latest__link {
	display: block;
	font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--rk-ink);
	text-decoration: none;
}

.rk-latest__link:hover {
	color: var(--rk-accent);
}

.rk-latest__meta {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.8rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--rk-muted);
}

.rk-latest__meta a {
	color: var(--rk-muted);
	text-decoration: none;
}

.rk-latest__meta a:hover {
	color: var(--rk-accent);
}

.rk-latest__excerpt {
	margin: 0.5rem 0 0;
	color: var(--rk-body);
}

.rk-latest__empty {
	color: var(--rk-muted);
	font-style: italic;
}

/* --- Home page section cards ---------------------------------- */

.rk-card {
	background: var(--rk-surface);
	border: 1px solid var(--rk-rule);
	border-radius: 8px;
	padding: 1.6rem 1.5rem;
	height: 100%;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.rk-card:hover {
	border-color: var(--rk-accent);
	transform: translateY(-2px);
}

.rk-card h3,
.rk-card .elementor-heading-title {
	margin-top: 0;
}

/* Small kicker above the site intro. */
.rk-kicker .elementor-heading-title,
.rk-kicker {
	font-family: var(--rk-mono);
	font-size: 0.78rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--rk-accent);
}

/* --- Archive headers ------------------------------------------ */

.ast-archive-description {
	background: none;
	border-bottom: 1px solid var(--rk-rule);
	padding-bottom: 1.2rem;
	margin-bottom: 2rem;
}

.ast-archive-description .ast-archive-title {
	font-size: 2rem;
}

/* --- Footer --------------------------------------------------- */

.site-footer {
	border-top: 1px solid var(--rk-rule);
	font-size: 0.9rem;
	color: var(--rk-muted);
}

/* --- Motion preference ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.rk-card {
		transition: none;
	}
	.rk-card:hover {
		transform: none;
	}
}

/* --- Home page card grid --- */

.rk-cards.e-con-boxed > .e-con-inner,
.rk-cards:not(.e-con-boxed) {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	align-items: stretch;
}

@media (min-width: 560px) {
	.rk-cards.e-con-boxed > .e-con-inner,
	.rk-cards:not(.e-con-boxed) {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1000px) {
	.rk-cards.e-con-boxed > .e-con-inner,
	.rk-cards:not(.e-con-boxed) {
		grid-template-columns: repeat(3, 1fr);
	}
}

.rk-cards > .e-con-inner > .e-con,
.rk-cards > .e-con-inner > .elementor-element,
.rk-cards:not(.e-con-boxed) > .e-con,
.rk-cards:not(.e-con-boxed) > .elementor-element {
	width: auto;
	max-width: none;
	margin: 0;
	align-self: stretch;
}

.rk-card .elementor-widget-text-editor {
	color: var(--rk-body);
}

.rk-card .elementor-button {
	background: none;
	padding: 0;
	color: var(--rk-accent);
	font-weight: 600;
	font-size: 0.95rem;
}

.rk-card .elementor-button:hover {
	color: var(--rk-accent-dark);
	text-decoration: underline;
}

.ast-separate-container .ast-article-post,
.ast-separate-container .ast-article-single {
	background-color: var(--rk-surface);
}

/* --- Click-to-load video placeholder --- */

.rk-embed {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.9rem;
	aspect-ratio: 16 / 9;
	width: 100%;
	max-width: 100%;
	padding: 1.25rem;
	background: #171c19;
	border-radius: 6px;
	text-align: center;
}

.rk-embed.is-loaded {
	display: block;
	padding: 0;
}

.rk-embed iframe {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 6px;
}

.rk-embed__play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	padding: 0;
	border: 2px solid rgba(251, 250, 247, 0.85);
	border-radius: 50%;
	background: var(--rk-accent);
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.rk-embed__play:hover,
.rk-embed__play:focus-visible {
	background: var(--rk-accent-dark);
	transform: scale(1.06);
}

.rk-embed__triangle {
	display: block;
	width: 0;
	height: 0;
	margin-left: 5px;
	border-top: 13px solid transparent;
	border-bottom: 13px solid transparent;
	border-left: 21px solid #fbfaf7;
}

.rk-embed__note {
	margin: 0;
	max-width: 42ch;
	font-size: 0.82rem;
	line-height: 1.5;
	color: rgba(232, 230, 225, 0.8);
}

/* --- Cookie notice (informational only - nothing to consent to) --- */

.rk-cookie {
	position: fixed;
	inset: auto 1rem 1rem 1rem;
	z-index: 9999;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	max-width: 46rem;
	margin: 0 auto;
	padding: 0.9rem 1.1rem;
	background: #171c19;
	color: #e8e6e1;
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
	font-size: 0.88rem;
	line-height: 1.5;
}

.rk-cookie[hidden] {
	display: none;
}

.rk-cookie__text {
	margin: 0;
	flex: 1 1 22rem;
}

.rk-cookie__text a {
	color: #f0a878;
	text-decoration: underline;
}

.rk-cookie__close {
	flex: 0 0 auto;
	padding: 0.45rem 1.1rem;
	border: 1px solid rgba(232, 230, 225, 0.35);
	border-radius: 5px;
	background: none;
	color: #e8e6e1;
	font-size: 0.85rem;
	cursor: pointer;
}

.rk-cookie__close:hover {
	background: rgba(232, 230, 225, 0.12);
}

@media (prefers-reduced-motion: reduce) {
	.rk-embed__play {
		transition: none;
	}
	.rk-embed__play:hover {
		transform: none;
	}
}

/* Core's embed wrapper reserves space with a ::before sized for an absolutely
   positioned iframe. Our click-to-load placeholder is a normal flow element and
   brings its own aspect-ratio, so the spacer just leaves a gap. */
[class*="wp-embed-aspect-"] .wp-block-embed__wrapper:has(.rk-embed)::before,
.wp-block-embed__wrapper:has(.rk-embed)::before {
	content: none;
	display: none;
	padding-top: 0;
}

.wp-block-embed__wrapper .rk-embed {
	position: relative;
}

/* --- Footer navigation (mirrors the header, plus Privacy) --- */

.site-footer .footer-nav-wrap .ast-builder-menu-1 .main-header-menu,
.site-footer .ast-builder-menu .main-header-menu {
	flex-wrap: wrap;
	justify-content: center;
	row-gap: 0.15rem;
}

.site-footer .main-header-menu .menu-link {
	padding-block: 0.3rem;
	font-size: 0.88rem;
}

@media (max-width: 921px) {
	.site-footer .ast-builder-grid-row {
		text-align: center;
	}
}

.site-footer .site-footer-section {
	text-align: center;
}

.site-footer .ast-footer-copyright {
	margin-top: 0.4rem;
}

.site-footer .site-primary-footer-wrap .ast-builder-footer-grid-columns {
	grid-template-columns: 1fr;
}

/* --- Empty blog index --- */

.rk-empty {
	padding: 3.5rem 0 4.5rem;
}

.rk-empty__title {
	margin: 0 0 0.5rem;
}

.rk-empty__text {
	margin: 0;
	color: var(--rk-muted);
}
