/* ==========================================================================
   Blog: posts page hero and index, post cards, search, archives, single post,
   related posts and pagination. Shared texture/grid pieces come from work.css (enqueued first).
   ========================================================================== */

/* ---------- Hero (Figma "consultations") ---------- */
.ramah-blog-hero {
	position: relative;
	display: flex;
	isolation: isolate;
	overflow: hidden;
	align-items: center;
	min-block-size: 700px;
	padding-block: calc(var(--ramah-header-h) + 64px) 96px;
	background: #1a1714;
	color: #d8d3cf;
}
.ramah-blog-hero__bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.ramah-blog-hero__img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; max-inline-size: none; }
.ramah-blog-hero__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(-90deg, rgb(0 0 0 / 0.8) 27.6%, rgb(0 0 0 / 0) 45.7%); }
.ramah-blog-hero__inner { position: relative; display: flex; justify-content: flex-start; } /* start = right in RTL, over the dark side of the shade */
.ramah-blog-hero__copy { display: grid; gap: 29px; inline-size: min(572px, 100%); text-align: start; }
.ramah-blog-hero__eyebrow { display: flex; align-items: center; justify-content: flex-start; gap: 8px; color: #941c1e; font-size: 17px; font-weight: 500; line-height: 24px; }
.ramah-blog-hero__eyebrow img { inline-size: 24px; block-size: 24px; }
.ramah-blog-hero__title { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.5rem); line-height: 1.33; color: #d8d3cf; }
.ramah-blog-hero__text { color: #d8d3cf; font-size: 17px; font-weight: 500; line-height: 24px; }
.ramah-blog-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 21px; }
.ramah-blog-hero__btn { padding: 10px 20px; font-size: 20px; }
.ramah-blog-hero__btn--primary { background: #9f0114; border-color: #941c1e; color: #d8d3cf; }
.ramah-blog-hero__btn--primary:hover { background: #d8d3cf; color: #8a1520; border-color: #d8d3cf; }

@media (max-width: 1023px) {
	.ramah-blog-hero { min-block-size: 0; }
	.ramah-blog-hero__inner { justify-content: stretch; }
	.ramah-blog-hero__copy { inline-size: 100%; }
}

/* ---------- Index: title, intro, search, grid ---------- */
.ramah-blog-index { position: relative; isolation: isolate; overflow: hidden; padding-block: 64px var(--ramah-section-y); background: #fff5eb; }
.ramah-blog-index__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ramah-blog-index__inner { position: relative; display: grid; gap: 0; justify-items: center; } /* Figma 320:4959: the grid follows the search bar directly */
.ramah-blog-index__head { display: grid; justify-items: center; gap: 8px; text-align: center; }
.ramah-blog-index__title { display: flex; align-items: center; gap: 8px; color: #111827; font-size: clamp(2rem, 1.6rem + 1.2vw, 2.25rem); font-weight: 700; line-height: 40px; letter-spacing: 0.025em; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.05)); }
.ramah-blog-index__title img { inline-size: 20px; block-size: 20px; }
.ramah-blog-index__intro { color: #44403c; font-size: 16px; font-weight: 600; line-height: 24px; }

.ramah-search { position: relative; inline-size: min(448px, 100%); margin-block-start: 16px; }
.ramah-search__input {
	inline-size: 100%;
	padding-block: 8px;
	padding-inline: 17px 41px;
	border: 1px solid rgb(168 162 158 / 0.6);
	border-radius: 8px;
	background: rgb(232 223 201 / 0.8);
	box-shadow: inset 0 2px 4px 1px rgb(0 0 0 / 0.05);
	color: #1c1917;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	line-height: 20px;
	min-block-size: 44px;
}
.ramah-search__input::placeholder { color: #78716c; }
.ramah-search__input::-webkit-search-cancel-button { display: none; }
.ramah-search__submit {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: 0;
	inline-size: 44px;
	block-size: 44px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: none;
	color: #78716c;
	translate: 0 -50%;
	cursor: pointer;
}
.ramah-search__icon { inline-size: 16px; block-size: 16px; }

.ramah-blog-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	inline-size: 100%;
	max-inline-size: 1240px;
	margin-inline: auto;
}
.ramah-blog-grid__empty { text-align: center; color: var(--ramah-text-soft); }
.ramah-post-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #d9cebc;
	border-radius: 12px;
	background: #f6f1e6;
	box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.ramah-post-card__media { position: relative; flex: none; block-size: 192px; background: #1c1917; }
.ramah-post-card__img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.ramah-post-card__badge {
	position: absolute;
	inset-block-end: 10px;
	inset-inline-start: 10px;
	padding: 5px 13px;
	border: 1px solid rgb(197 154 82 / 0.3);
	border-radius: 6px;
	background: rgb(0 0 0 / 0.75);
	color: #e8c782;
	font-size: 12px;
	font-weight: 600;
	line-height: 16.5px;
	backdrop-filter: blur(4px);
}
.ramah-post-card__body { display: flex; flex: 1; flex-direction: column; gap: 0; padding: 20px; } /* Figma 320:4980: title→excerpt 10px, excerpt→meta 40px */
.ramah-post-card__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #1c1917; font-size: 16px; font-weight: 700; line-height: 24px; }
.ramah-post-card__title a { flex: 1 1 auto; min-inline-size: 0; color: inherit; }
.ramah-post-card__bullet { flex: none; inline-size: 8px; block-size: 3px; }
.ramah-post-card__title a:hover { color: #7a141b; }
.ramah-post-card__title { margin-block-end: 10px; }
.ramah-post-card__excerpt { color: #57534e; font-size: 14px; line-height: 22.75px; }
.ramah-post-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: auto; padding-block-start: 13px; border-block-start: 1px solid #e5dac8; margin-block-start: 40px; color: #78716c; font-size: 12px; line-height: 16.5px; }
.ramah-post-card__read { display: inline-flex; align-items: center; gap: 4px; }
.ramah-post-card__read img { inline-size: 14px; block-size: 14px; }

/* Pagination (WordPress markup, styled from the system) */
.ramah-pagination { margin-block-start: 56px; }
.ramah-pagination .nav-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.ramah-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-inline-size: 44px;
	block-size: 44px;
	padding-inline: 12px;
	border: 1px solid rgb(34 35 37 / 0.2);
	border-radius: 9999px;
	color: var(--ramah-color-charcoal);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.ramah-pagination a.page-numbers:hover { border-color: var(--ramah-red-500); color: var(--ramah-red-500); }
.ramah-pagination .page-numbers.current { border-color: #731217; background: #731217; color: #fff; }
.ramah-pagination .page-numbers.dots { border-color: transparent; }
.ramah-pagination .prev,
.ramah-pagination .next { padding-inline: 18px; }

/* ---------- Archives and search ---------- */
.ramah-archive { padding-block: var(--ramah-section-y); background: var(--ramah-paper); }
.ramah-archive__inner { display: grid; gap: 40px; }
.ramah-archive--search .ramah-search { margin-block-start: 0; }
.ramah-search-results__term { color: #e05a6a; }

@media (max-width: 1023px) {
	.ramah-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
	.ramah-blog-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* ---------- Single post ---------- */
.ramah-post-hero .ramah-pagehead__title { max-inline-size: 22ch; }
.ramah-post-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-block-end: 16px; color: var(--ramah-muted-on-dark); font-size: var(--ramah-fs-sm); }
.ramah-post-hero__cat { color: #e05a6a; font-weight: 700; }
.ramah-post__inner { display: grid; gap: 48px; padding-block: var(--ramah-section-y); }
.ramah-post__media { justify-self: center; inline-size: 100%; max-inline-size: 1100px; margin: 0; }
.ramah-post__img { inline-size: 100%; block-size: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--ramah-radius); }
.ramah-post__content { justify-self: center; inline-size: 100%; }
.ramah-post__share { justify-self: center; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; inline-size: 100%; max-inline-size: 760px; padding-block-start: 24px; border-block-start: 1px solid rgb(34 35 37 / 0.15); }
.ramah-post__share-label { color: var(--ramah-text-soft); font-size: var(--ramah-fs-sm); font-weight: 700; }
.ramah-post__share-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ramah-post__share-list a { display: inline-flex; align-items: center; min-block-size: 44px; padding: 6px 14px; border: 1px solid rgb(34 35 37 / 0.2); border-radius: var(--ramah-radius-sm); font-size: var(--ramah-fs-sm); font-weight: 600; transition: border-color 0.2s ease, color 0.2s ease; }
.ramah-post__share-list a:hover { border-color: var(--ramah-red-500); color: var(--ramah-red-500); }

.ramah-post-related { padding-block: var(--ramah-section-y); background: var(--ramah-paper-2); }
.ramah-post-related__inner { display: grid; gap: 40px; }
.ramah-post-related__title { font-size: var(--ramah-fs-h2); }

/* ---------- Motion: search focus, card media zoom container, badge slide-in ---------- */
.ramah-search__input { transition: box-shadow 0.35s ease, border-color 0.35s ease, inline-size 0.45s var(--ramah-ease); }
.ramah-search__input:focus { box-shadow: 0 0 0 3px rgb(148 28 30 / 0.18), inset 0 2px 4px 1px rgb(0 0 0 / 0.05); border-color: #941c1e; outline: none; }
.ramah-post-card__media { position: relative; overflow: hidden; }
@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.ramah-post-card__badge { animation: ramah-badge-in 0.8s var(--ramah-ease) both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
	}
}

@keyframes ramah-badge-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

/* Figma 318:4221 / 318:4400 / 320:4959 (page-scoped overrides) */
@media (min-width: 1024px) { .ramah-page--blog .ramah-blog-hero { padding-block: 114px 140px; } } /* copy block sits at Figma y181 */
.ramah-page--blog .ramah-blog-index { padding-block-end: 64px; }
.ramah-page--blog .ramah-faq--blog { padding-block: 36px 94px; } /* Figma 318:4400: 518px */

/* Breathing room between the search box and the post grid (client request). */
.ramah-blog-index__head { margin-block-end: 48px; }
@media (max-width: 767px) { .ramah-blog-index__head { margin-block-end: 32px; } }

/* Phones: page heroes keep their copy clear of the sadu strip on the left edge (core.css). */
@media (max-width: 1023px) {
	.ramah-page-hero__inner { padding-inline-end: calc(clamp(36px, 7vw, 101px) + 16px); }
}
/* Phones: the article starts closer to the hero's crenel band. */
@media (max-width: 639px) {
	.ramah-post__inner { padding-block-start: 56px; }
}
