/* =============================================================================
   B2I Resources - layout & components
   Builds on the design tokens declared in style.css (:root --rt-*).
   ========================================================================== */

/* ---- Layout primitives ---- */
.rt-container {
	width: 100%;
	max-width: var(--rt-wide-max);
	margin-inline: auto;
	padding-inline: var(--rt-space-md);
}

@media (min-width: 600px) {
	.rt-container {
		padding-inline: var(--rt-space-xl);
	}
}

.site-content {
	padding-block: var(--rt-space-xxl);
	min-height: 50vh;
}

/* =============================================================================
   SITE HEADER
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(10, 23, 38, 0.85);
	backdrop-filter: saturate(160%) blur(12px);
	-webkit-backdrop-filter: saturate(160%) blur(12px);
	border-bottom: 1px solid var(--rt-border);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--rt-space-md);
	min-height: 60px; /* Layout.headerHeight */
	padding-block: var(--rt-space-sm);
}

.site-branding {
	display: flex;
	align-items: center;
	gap: var(--rt-space-sm);
	min-width: 0;
}

.custom-logo-link img {
	display: block;
	height: 36px;
	width: auto;
}

.site-title {
	margin: 0;
	font-size: var(--rt-fs-h4);
	font-weight: var(--rt-fw-extrabold);
	line-height: 1.2;
	letter-spacing: -0.3px;
}

.site-title a {
	color: var(--rt-white);
}

.site-title a:hover,
.site-title a:focus {
	color: var(--rt-primary);
	text-decoration: none;
}

.site-description {
	margin: 0;
	color: var(--rt-text-secondary);
	font-size: var(--rt-fs-caption);
}



/* =============================================================================
   PAGE HEADER (archive / search / 404 titles)
   ========================================================================== */
.page-header {
	max-width: var(--rt-wide-max);
	margin: 0 auto var(--rt-space-xxl);
}

.page-header .rt-overline {
	display: block;
	margin-bottom: var(--rt-space-xs);
}

.page-title {
	margin: 0 0 var(--rt-space-sm);
}

.archive-description,
.rt-archive-intro {
	max-width: var(--rt-measure);
	color: var(--rt-text-secondary);
	font-size: var(--rt-fs-body-lg);
}

/* =============================================================================
   ARCHIVE GRID + CARDS
   ========================================================================== */
.rt-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--rt-space-xl);
	max-width: var(--rt-wide-max);
	margin-inline: auto;
}

@media (min-width: 600px) {
	.rt-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.rt-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.rt-card {
	display: flex;
	flex-direction: column;
	background: var(--rt-card);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-card);
	overflow: hidden;
	box-shadow: var(--rt-shadow-card);
	transition: transform var(--rt-dur-normal) var(--rt-ease), border-color var(--rt-dur-normal) var(--rt-ease), box-shadow var(--rt-dur-normal) var(--rt-ease);
}

.rt-card:hover,
.rt-card:focus-within {
	transform: translateY(-2px);
	border-color: var(--rt-accent-border);
	box-shadow: var(--rt-shadow-elevated);
}

.rt-card .post-thumbnail {
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--rt-card-elevated);
	overflow: hidden;
}

.rt-card .post-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rt-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--rt-space-sm);
	padding: var(--rt-space-lg);
	flex: 1;
}

.rt-card__title {
	margin: 0;
	font-size: var(--rt-fs-h4);
	font-weight: var(--rt-fw-bold);
	line-height: 1.35;
}

.rt-card__title a {
	color: var(--rt-white);
}

.rt-card__title a:hover,
.rt-card__title a:focus {
	color: var(--rt-primary);
	text-decoration: none;
}

.rt-card__excerpt {
	margin: 0;
	color: var(--rt-text-secondary);
	font-size: var(--rt-fs-body);
	line-height: 1.6;
}

.rt-card__meta {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--rt-space-xs);
	color: var(--rt-text-tertiary);
}

/* ---- Category / tag chips ---- */
.rt-chip {
	display: inline-block;
	padding: 3px var(--rt-space-sm);
	border-radius: var(--rt-radius-full);
	background: var(--rt-accent-bg);
	border: 1px solid var(--rt-accent-border);
	color: var(--rt-accent-text);
	font-size: var(--rt-fs-caption);
	font-weight: var(--rt-fw-semibold);
	line-height: 1.6;
}

.rt-chip:hover,
.rt-chip:focus {
	background: rgba(91, 126, 245, 0.25);
	color: var(--rt-white);
	text-decoration: none;
}

/* =============================================================================
   SINGLE / READING VIEW
   ========================================================================== */
.rt-article {
	max-width: var(--rt-content-max);
	margin-inline: auto;
}

.rt-article .entry-header {
	margin-bottom: var(--rt-space-xl);
}

.rt-article .entry-title {
	font-size: var(--rt-fs-hero);
	font-weight: var(--rt-fw-extrabold);
	line-height: 1.2;
	letter-spacing: -0.5px;
	margin-bottom: var(--rt-space-md);
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--rt-space-xs);
	color: var(--rt-text-tertiary);
}

.entry-meta a {
	color: var(--rt-text-secondary);
}

.entry-meta a:hover,
.entry-meta a:focus {
	color: var(--rt-white);
}

.meta-sep {
	color: var(--rt-text-disabled);
}

.rt-article .post-thumbnail {
	margin: 0 0 var(--rt-space-xl);
	border-radius: var(--rt-radius-lg);
	overflow: hidden;
	border: 1px solid var(--rt-border);
}

.rt-article .post-thumbnail img {
	width: 100%;
	display: block;
}

/* ---- Long-form content typography ---- */
.entry-content {
	font-size: var(--rt-fs-body-lg);
	line-height: 1.8;
	color: var(--rt-text-primary);
}

.entry-content > * {
	max-width: var(--rt-measure);
}

.entry-content .alignwide,
.entry-content .alignfull,
.entry-content figure.wp-block-image {
	max-width: none;
}

.entry-content h2 { margin-top: var(--rt-space-xxl); }
.entry-content h3 { margin-top: var(--rt-space-xl); }
.entry-content h4 { margin-top: var(--rt-space-lg); }

.entry-content a {
	color: var(--rt-accent-text);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-color: var(--rt-accent-border);
}

.entry-content a:hover,
.entry-content a:focus {
	color: var(--rt-white);
	text-decoration-color: var(--rt-white);
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.4em;
	margin-bottom: var(--rt-space-lg);
}

.entry-content li {
	margin-bottom: var(--rt-space-xs);
}

.entry-content blockquote {
	margin: var(--rt-space-xl) 0;
	padding: var(--rt-space-md) var(--rt-space-lg);
	border-left: 3px solid var(--rt-primary);
	background: var(--rt-slag-bg);
	border-radius: 0 var(--rt-radius-md) var(--rt-radius-md) 0;
	color: var(--rt-text-secondary);
	font-style: italic;
}

.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.entry-content img,
.entry-content figure {
	border-radius: var(--rt-radius-md);
}

.entry-content figure {
	margin: var(--rt-space-xl) 0;
}

.entry-content figcaption,
.wp-caption-text {
	color: var(--rt-text-tertiary);
	font-size: var(--rt-fs-caption);
	text-align: center;
	margin-top: var(--rt-space-xs);
}

.entry-content code,
.entry-content kbd {
	font-family: var(--rt-font-mono);
	font-size: 0.9em;
	background: var(--rt-card-elevated);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-xs);
	padding: 0.1em 0.4em;
}

.entry-content pre {
	max-width: 100%;
	overflow-x: auto;
	background: var(--rt-bg-deep);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-md);
	padding: var(--rt-space-md);
	margin: var(--rt-space-xl) 0;
}

.entry-content pre code {
	background: transparent;
	border: 0;
	padding: 0;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: var(--rt-space-xl) 0;
	font-size: var(--rt-fs-body);
}

.entry-content th,
.entry-content td {
	border: 1px solid var(--rt-border);
	padding: var(--rt-space-sm) var(--rt-space-md);
	text-align: left;
}

.entry-content th {
	background: var(--rt-card-elevated);
	color: var(--rt-white);
	font-weight: var(--rt-fw-semibold);
}

.entry-content hr {
	border: 0;
	border-top: 1px solid var(--rt-border);
	margin: var(--rt-space-xxl) 0;
}

/* ---- Page-link pagination inside content ---- */
.page-links {
	margin-top: var(--rt-space-xl);
	display: flex;
	flex-wrap: wrap;
	gap: var(--rt-space-xs);
	align-items: center;
}

.page-links .post-page-numbers {
	display: inline-flex;
	min-width: 36px;
	height: 36px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-sm);
	color: var(--rt-text-secondary);
}

.page-links .post-page-numbers.current {
	background: var(--rt-accent-bg);
	border-color: var(--rt-accent-border);
	color: var(--rt-white);
}

/* ---- Entry footer (cats/tags) ---- */
.entry-footer {
	max-width: var(--rt-content-max);
	margin: var(--rt-space-xxl) auto 0;
	padding-top: var(--rt-space-lg);
	border-top: 1px solid var(--rt-border);
	display: flex;
	flex-direction: column;
	gap: var(--rt-space-sm);
}

.entry-footer .rt-label {
	margin-right: var(--rt-space-xs);
}

.entry-footer a {
	color: var(--rt-accent-text);
}

/* ---- Author box ---- */
.rt-author-box {
	max-width: var(--rt-content-max);
	margin: var(--rt-space-xxl) auto 0;
	display: flex;
	gap: var(--rt-space-md);
	padding: var(--rt-space-lg);
	background: var(--rt-card);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-card);
}

.rt-author-box img {
	border-radius: var(--rt-radius-full);
	width: 64px;
	height: 64px;
	flex-shrink: 0;
}

.rt-author-box__name {
	margin: 0 0 var(--rt-space-xxs);
	font-size: var(--rt-fs-h4);
}

.rt-author-box__bio {
	margin: 0;
	color: var(--rt-text-secondary);
	font-size: var(--rt-fs-body);
}

/* ---- Post navigation (prev/next) ---- */
.post-navigation {
	max-width: var(--rt-content-max);
	margin: var(--rt-space-xxl) auto 0;
}

.post-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: var(--rt-space-md);
}

.post-navigation a {
	display: block;
	flex: 1;
	padding: var(--rt-space-md);
	background: var(--rt-card);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-md);
	color: var(--rt-text-secondary);
}

.post-navigation a:hover,
.post-navigation a:focus {
	border-color: var(--rt-accent-border);
	color: var(--rt-white);
	text-decoration: none;
}

.post-navigation .nav-next {
	text-align: right;
}

/* =============================================================================
   PAGINATION (archives)
   ========================================================================== */
.rt-pagination {
	max-width: var(--rt-wide-max);
	margin: var(--rt-space-xxl) auto 0;
}

.rt-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rt-space-xs);
	justify-content: center;
}

.rt-pagination .page-numbers {
	display: inline-flex;
	min-width: 40px;
	height: 40px;
	align-items: center;
	justify-content: center;
	padding: 0 var(--rt-space-sm);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-sm);
	color: var(--rt-text-secondary);
	font-weight: var(--rt-fw-semibold);
}

.rt-pagination .page-numbers:hover,
.rt-pagination .page-numbers:focus {
	border-color: var(--rt-accent-border);
	color: var(--rt-white);
	text-decoration: none;
}

.rt-pagination .page-numbers.current {
	background: var(--rt-primary);
	border-color: var(--rt-primary);
	color: var(--rt-text-on-primary);
}

/* =============================================================================
   SEARCH FORM
   ========================================================================== */
.search-form {
	display: flex;
	gap: var(--rt-space-xs);
	max-width: 480px;
}

.search-form .search-field {
	flex: 1;
	background: var(--rt-card);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-input);
	color: var(--rt-text-primary);
	font: inherit;
	font-size: var(--rt-fs-body-lg);
	padding: var(--rt-space-sm) var(--rt-space-md);
}

.search-form .search-field::placeholder {
	color: var(--rt-text-tertiary);
}

.search-form .search-submit {
	background: var(--rt-primary);
	color: var(--rt-text-on-primary);
	border: 0;
	border-radius: var(--rt-radius-button);
	font: inherit;
	font-weight: var(--rt-fw-bold);
	padding: var(--rt-space-sm) var(--rt-space-lg);
	cursor: pointer;
}

/* =============================================================================
   COMMENTS
   ========================================================================== */
.comments-area {
	max-width: var(--rt-content-max);
	margin: var(--rt-space-massive) auto 0;
}

.comments-title,
.comment-reply-title {
	font-size: var(--rt-fs-h3);
}

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

.comment-list .comment {
	margin-bottom: var(--rt-space-lg);
}

.comment-body {
	background: var(--rt-card);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-md);
	padding: var(--rt-space-md);
}

.comment-author {
	display: flex;
	align-items: center;
	gap: var(--rt-space-xs);
	font-weight: var(--rt-fw-semibold);
}

.comment-author .avatar {
	border-radius: var(--rt-radius-full);
}

.comment-metadata {
	color: var(--rt-text-tertiary);
	font-size: var(--rt-fs-caption);
}

.comment-list .children {
	list-style: none;
	margin-top: var(--rt-space-md);
	padding-left: var(--rt-space-lg);
	border-left: 1px solid var(--rt-border);
}

.comment-respond {
	margin-top: var(--rt-space-xl);
}

.comment-form label {
	display: block;
	margin-bottom: var(--rt-space-xxs);
	color: var(--rt-text-secondary);
	font-size: var(--rt-fs-label);
	font-weight: var(--rt-fw-semibold);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	background: var(--rt-card);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-md);
	color: var(--rt-text-primary);
	font: inherit;
	padding: var(--rt-space-sm) var(--rt-space-md);
	margin-bottom: var(--rt-space-md);
}

.comment-form .submit {
	background: var(--rt-primary);
	color: var(--rt-text-on-primary);
	border: 0;
	border-radius: var(--rt-radius-button);
	font: inherit;
	font-weight: var(--rt-fw-bold);
	padding: var(--rt-space-sm) var(--rt-space-xl);
	cursor: pointer;
}

/* =============================================================================
   SITE FOOTER
   ========================================================================== */
.site-footer {
	margin-top: var(--rt-space-massive);
	border-top: 1px solid var(--rt-border);
	background: var(--rt-bg-deep);
}

.site-footer__inner {
	padding-block: var(--rt-space-xxl);
	display: flex;
	flex-direction: column;
	gap: var(--rt-space-lg);
}

.footer-widgets {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--rt-space-xl);
}

@media (min-width: 600px) {
	.footer-widgets {
		grid-template-columns: repeat(3, 1fr);
	}
}

.footer-widgets .widget-title {
	margin-bottom: var(--rt-space-sm);
}

.site-info {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--rt-space-sm);
	color: var(--rt-text-tertiary);
	font-size: var(--rt-fs-caption);
	padding-top: var(--rt-space-lg);
	border-top: 1px solid var(--rt-border-subtle);
}



/* =============================================================================
   NO RESULTS / 404
   ========================================================================== */
.no-results,
.error-404 {
	max-width: var(--rt-content-max);
	margin-inline: auto;
	text-align: center;
	padding-block: var(--rt-space-massive);
}

.error-404 .page-title {
	font-size: var(--rt-fs-hero);
}

/* =============================================================================
   READING PROGRESS BAR (theme.js)
   ========================================================================== */
.rt-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0;
	background: var(--rt-primary);
	box-shadow: var(--rt-glow-gold);
	z-index: 100;
	transition: width 80ms linear;
}

/* ---- Back to top ---- */
.rt-to-top {
	position: fixed;
	right: var(--rt-space-lg);
	bottom: var(--rt-space-lg);
	width: 44px;
	height: 44px;
	display: none;
	align-items: center;
	justify-content: center;
	border-radius: var(--rt-radius-full);
	background: var(--rt-accent);
	color: var(--rt-white);
	border: 0;
	cursor: pointer;
	box-shadow: var(--rt-shadow-card);
	z-index: 60;
	font-size: 20px;
	line-height: 1;
}

.rt-to-top.is-visible {
	display: inline-flex;
}

/* =============================================================================
   MOTION PREFERENCES
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
