/* Soler — blog: the index (home.php), articles (single.php) and archives (archive.php).
   Page shell, chapter marks, buttons and the motion start states: base.css. Reading style and contents
   column follow the policy pages (pages.css), with the article's own measure. */

/* ---------------------------------------------------------------------------
   Breadcrumbs
   ------------------------------------------------------------------------- */

.blog-crumbs {
	position: relative;
	z-index: 2;
	margin: 0 0 18px;
	color: var(--muted);
	font-size: 13px;
	font-style: italic;
}

.blog-crumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-crumbs li {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
}

.blog-crumbs li + li::before {
	content: "/";
	opacity: 0.45;
}

.blog-crumbs a {
	color: var(--green);
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: background-size 0.45s var(--ease-out);
}

.blog-crumbs a:hover,
.blog-crumbs a:focus-visible {
	background-size: 100% 1px;
}

.blog-crumbs__current span {
	display: block;
	max-width: 38ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Hero (index and archives)
   ------------------------------------------------------------------------- */

.blog-hero .chapter {
	margin-bottom: clamp(10px, 1.1vw, 18px);
}

.blog-hero .page-hero__title {
	max-width: 12em;
}

.blog-body {
	position: relative;
	z-index: 1;
}

/* Category links */
.blog-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 28px;
	margin: 0 0 clamp(28px, 3.4vw, 56px);
	padding-bottom: 18px;
	border-bottom: 1px solid var(--line);
}

.blog-filter__label {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	font-style: italic;
}

.blog-filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 26px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-filter a {
	display: inline-block;
	padding: 4px 0;
	color: var(--text);
	font-size: 16px;
	font-style: italic;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: color 0.3s ease, background-size 0.5s var(--ease-out);
}

.blog-filter a:hover,
.blog-filter a:focus-visible,
.blog-filter a[aria-current] {
	color: var(--green);
	background-size: 100% 1px;
}

/* ---------------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------------- */

.blog-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(40px, 4.5vw, 76px) clamp(24px, 3vw, 52px);
}

.bcard {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.bcard__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--sand);
}

.bcard__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.2s var(--ease-out);
}

.bcard:hover .bcard__img,
.bcard:focus-within .bcard__img {
	transform: scale(1.045);
}

/* No photo: a sand panel with a painted flower standing in it. */
.bcard__flower {
	position: absolute;
	bottom: 0;
	left: 50%;
	width: auto;
	height: 90%;
	max-width: none;
	transform: translateX(-50%);
	transform-origin: 50% 100%;
	transition: transform 1.2s var(--ease-out);
}

.bcard:hover .bcard__flower {
	transform: translateX(-50%) scale(1.04) rotate(1deg);
}

.bcard__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding-top: clamp(14px, 1.4vw, 22px);
}

.bcard__cat {
	position: relative;
	z-index: 2;
	margin: 0 0 8px;
	font-size: 14px;
	font-style: italic;
}

.bcard__cat a {
	display: inline-block;
	color: var(--green);
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: background-size 0.45s var(--ease-out);
}

.bcard__cat a:hover,
.bcard__cat a:focus-visible {
	background-size: 100% 1px;
}

.bcard__title {
	font-size: clamp(21px, 1.7vw, 27px);
	line-height: 1.22;
	text-wrap: balance;
}

/* The whole card is the title's link. */
.bcard__title a {
	color: var(--ink);
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: color 0.3s ease, background-size 0.6s var(--ease-out);
}

.bcard__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.bcard:hover .bcard__title a,
.bcard__title a:focus-visible {
	color: var(--green);
	background-size: 100% 1px;
}

.bcard__title a:focus-visible::after {
	outline: 2px solid var(--green);
	outline-offset: 4px;
}

.bcard__excerpt {
	display: -webkit-box;
	margin: 12px 0 0;
	overflow: hidden;
	color: var(--muted);
	font-size: 15.5px;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.bcard__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
	margin: auto 0 0;
	padding-top: 14px;
	color: var(--muted);
	font-size: 13px;
	font-style: italic;
}

/* The first article on the first page is wide, photo beside text. */
.bcard--lead {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
	gap: clamp(24px, 3.6vw, 68px);
	align-items: center;
}

.bcard--lead .bcard__media {
	aspect-ratio: 16 / 10;
}

.bcard--lead .bcard__body {
	padding-top: 0;
}

.bcard--lead .bcard__cat {
	font-size: clamp(14px, 1.04vw, 17px);
}

.bcard--lead .bcard__title {
	font-size: clamp(26px, 2.8vw, 46px);
	line-height: 1.12;
}

.bcard--lead .bcard__excerpt {
	margin-top: 18px;
	font-size: clamp(16px, 1.2vw, 19px);
	-webkit-line-clamp: 3;
}

.bcard--lead .bcard__meta {
	margin-top: 0;
	padding-top: 22px;
}

/* Pages */
.blog-pages {
	margin-top: clamp(44px, 4.4vw, 80px);
}

.blog-pages ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-pages .page-numbers a,
.blog-pages .page-numbers span {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid transparent;
	color: var(--text);
	font-size: 15px;
	transition: border-color 0.3s ease, color 0.3s ease;
}

.blog-pages .page-numbers a:hover,
.blog-pages .page-numbers a:focus-visible {
	border-color: var(--green);
	color: var(--green);
}

.blog-pages .page-numbers .current {
	background: var(--green);
	color: var(--cream);
}

/* Nothing here yet */
.blog-empty {
	display: grid;
	grid-template-columns: minmax(120px, 220px) minmax(0, 36em);
	gap: clamp(24px, 4vw, 64px);
	align-items: end;
	padding: clamp(8px, 2vw, 32px) 0 clamp(16px, 3vw, 48px);
}

.blog-empty__plant {
	position: relative;
	height: clamp(180px, 20vw, 300px);
}

.blog-empty__plant .bcard__flower {
	position: static;
	width: auto;
	height: 100%;
	margin-inline: auto;
	transform: none;
}

.blog-empty__text {
	margin-bottom: 26px;
	color: var(--text);
	font-size: clamp(18px, 1.5vw, 24px);
	line-height: 1.55;
}

.blog-empty__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 28px;
}

.blog-empty__link {
	font-style: italic;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

/* ---------------------------------------------------------------------------
   Article: head
   ------------------------------------------------------------------------- */

.blog--single .post-hero {
	margin-bottom: clamp(28px, 3.4vw, 56px);
}

.blog--single .post-hero__title {
	max-width: 17em;
	font-size: clamp(30px, 3.5vw, 58px);
	line-height: 1.1;
	text-wrap: balance;
}

.post-hero__lead {
	max-width: 36em;
	margin-top: clamp(16px, 1.6vw, 26px);
}

.post-meta {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
	margin: clamp(16px, 1.6vw, 26px) 0 0;
	color: var(--muted);
	font-size: 14px;
	font-style: italic;
}

.post-meta__author {
	color: var(--green);
}

.post-cover {
	position: relative;
	z-index: 1;
	aspect-ratio: 21 / 9;
	margin: 0 0 clamp(36px, 5vw, 84px);
	overflow: hidden;
	background: var(--sand);
}

.post-cover img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------------------------------------------------------------------------
   Article: contents column and text
   ------------------------------------------------------------------------- */

.post-layout {
	--prose-size: clamp(17px, 1.2vw, 19px);
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	font-size: var(--prose-size);
}

.post-main {
	min-width: 0;
}

.post-toc {
	position: sticky;
	top: 28px;
	align-self: start;
	padding-top: 6px;
	counter-reset: toc;
	font-size: 16px;
}

.post-toc__title {
	display: block;
	margin: 0 0 14px;
	color: var(--muted);
	font-size: 13px;
	font-style: italic;
	list-style: none;
	cursor: default;
}

.post-toc__title::-webkit-details-marker {
	display: none;
}

.post-toc ol {
	margin: 0;
	padding: 0;
	border-left: 1px solid var(--line);
	list-style: none;
}

.post-toc li {
	counter-increment: toc;
}

.post-toc a {
	position: relative;
	display: grid;
	grid-template-columns: 2.4em 1fr;
	padding: 6px 0 6px 14px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.4;
	transition: color 0.25s ease;
}

.post-toc a::before {
	content: counter(toc, upper-roman);
	color: var(--green);
	font-size: 12.5px;
	font-style: italic;
	opacity: 0.75;
}

/* The drawn marker follows the section being read, or the one pointed at. */
.post-toc a::after {
	content: "";
	position: absolute;
	top: 6px;
	bottom: 6px;
	left: -1px;
	width: 2px;
	background: var(--green);
	transform: scaleY(0);
	transition: transform 0.4s var(--ease-out);
}

.post-toc a:hover,
.post-toc a:focus-visible,
.post-toc a.is-active {
	color: var(--green);
}

.post-toc a:hover::after,
.post-toc a:focus-visible::after,
.post-toc a.is-active::after {
	transform: scaleY(1);
}

.post-content {
	max-width: 68ch;
	color: var(--text);
	line-height: 1.75;
	counter-reset: chapter;
	overflow-wrap: break-word;
}

.post-content > * + * {
	margin-top: 1.1em;
}

/* The first paragraph answers the question: a touch larger. */
.post-content > p:first-child {
	color: var(--ink);
	font-size: 1.12em;
	line-height: 1.65;
}

.post-content h2 {
	display: flex;
	align-items: baseline;
	gap: 14px;
	margin-top: 2.4em;
	padding-top: 1.3em;
	border-top: 1px solid var(--line);
	color: var(--green);
	font-size: clamp(23px, 1.95vw, 31px);
	line-height: 1.2;
	counter-increment: chapter;
	scroll-margin-top: 40px;
}

.post-content h2::before {
	content: counter(chapter, upper-roman);
	flex: none;
	min-width: 1.9em;
	color: var(--muted);
	font-size: 0.55em;
	font-style: italic;
	letter-spacing: 0.06em;
}

/* An article that opens with a heading starts without the rule. */
.post-content > h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.post-content h3 {
	margin-top: 1.7em;
	color: var(--ink);
	font-size: clamp(18px, 1.4vw, 21px);
	font-style: italic;
	line-height: 1.3;
	scroll-margin-top: 40px;
}

.post-content h2 + *,
.post-content h3 + * {
	margin-top: 0.9em;
}

.post-content ul,
.post-content ol {
	margin-bottom: 0;
	padding-left: 0;
	list-style: none;
}

.post-content li {
	position: relative;
	padding-left: 1.6em;
}

.post-content li + li {
	margin-top: 0.5em;
}

/* Bullets: a short drawn dash in brand green. */
.post-content ul > li::before {
	content: "";
	position: absolute;
	top: 0.9em;
	left: 0.1em;
	width: 0.8em;
	height: 1px;
	background: var(--green);
}

.post-content ol {
	counter-reset: item;
}

.post-content ol > li {
	counter-increment: item;
}

.post-content ol > li::before {
	content: counter(item) ".";
	position: absolute;
	left: 0;
	color: var(--green);
	font-style: italic;
}

.post-content li > ul,
.post-content li > ol {
	margin-top: 0.5em;
}

.post-content a {
	color: var(--green);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: text-decoration-thickness 0.2s ease;
}

.post-content a:hover,
.post-content a:focus-visible {
	text-decoration-thickness: 2px;
}

.post-content strong,
.post-content b {
	color: var(--ink);
	font-weight: 600;
}

.post-content blockquote {
	padding: 0 0 0 1.4em;
	border-left: 1px solid var(--green);
	color: var(--ink);
	font-size: 1.08em;
	font-style: italic;
	line-height: 1.6;
}

.post-content blockquote p + p {
	margin-top: 0.7em;
}

.post-content hr {
	height: 1px;
	margin: 2.4em 0;
	border: 0;
	background: var(--line);
}

.post-content figure,
.post-content .wp-block-image {
	margin: 2em 0;
}

.post-content img {
	width: 100%;
	height: auto;
}

.post-content figcaption {
	margin-top: 10px;
	color: var(--muted);
	font-size: 14px;
	font-style: italic;
}

/* A quiet ledger, like the policies'. */
.post-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92em;
	line-height: 1.55;
}

.post-content th {
	padding: 0 14px 10px 0;
	border-bottom: 1px solid rgba(27, 29, 26, 0.3);
	color: var(--muted);
	font-size: 0.85em;
	font-style: italic;
	font-weight: 400;
	text-align: left;
}

.post-content td {
	padding: 12px 14px 12px 0;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
}

/* "Кога да потърсите лекар": a sand box with a green rule on its left. A group block with the
   class "callout", the [soler_callout] shortcode, or any element with that class. */
.callout {
	margin: 2em 0;
	padding: clamp(18px, 2vw, 30px) clamp(18px, 2.2vw, 34px);
	border-left: 3px solid var(--green);
	background: var(--sand);
	color: var(--text);
	font-size: 0.96em;
	line-height: 1.65;
}

.post-content .callout > * + * {
	margin-top: 0.8em;
}

.callout__title,
.post-content .callout .callout__title {
	margin: 0 0 0.7em;
	color: var(--green);
	font-size: 1.12em;
	font-style: italic;
	line-height: 1.3;
}

.callout > :last-child {
	margin-bottom: 0;
}

.post-note {
	max-width: 68ch;
	margin: clamp(32px, 3.6vw, 56px) 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 14px;
	font-style: italic;
	line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   Article: closing block (shop categories) and more reading
   ------------------------------------------------------------------------- */

.post-cta,
.post-more {
	position: relative;
	z-index: 1;
	margin-top: clamp(56px, 7vw, 120px);
}

.post-cta {
	padding: clamp(28px, 4vw, 72px);
	background: var(--sand);
}

.post-cta__head {
	max-width: 40em;
	margin-bottom: clamp(24px, 3vw, 44px);
}

.post-cta__title,
.post-more__title {
	color: var(--green);
	font-size: clamp(26px, 2.6vw, 42px);
	line-height: 1.15;
}

.post-cta__ask {
	margin-top: 14px;
	color: var(--muted);
	font-size: clamp(15px, 1.1vw, 18px);
	font-style: italic;
}

.post-cta__ask a {
	color: var(--green);
	font-style: normal;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	white-space: nowrap;
}

.post-cta__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(16px, 2vw, 32px);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* A category: its picture, the name and a long thin arrow that leans forward when pointed at. */
.ctile {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"media media"
		"name go";
	align-items: center;
	gap: 14px 12px;
	height: 100%;
	padding: 0 0 4px;
	color: var(--ink);
}

.ctile__media {
	position: relative;
	display: block;
	grid-area: media;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--cream);
}

.ctile__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.2s var(--ease-out);
}

.ctile:hover .ctile__media img,
.ctile:focus-visible .ctile__media img {
	transform: scale(1.05);
}

.ctile__text {
	grid-area: name;
	display: grid;
	gap: 2px;
	justify-items: start;
	min-width: 0;
}

.ctile__group {
	color: var(--muted);
	font-size: 13px;
	font-style: italic;
}

.ctile__name {
	font-size: clamp(18px, 1.5vw, 24px);
	line-height: 1.2;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: color 0.3s ease, background-size 0.5s var(--ease-out);
}

.ctile:hover .ctile__name,
.ctile:focus-visible .ctile__name {
	color: var(--green);
	background-size: 100% 1px;
}

.ctile__go {
	grid-area: go;
	width: clamp(40px, 3.6vw, 56px);
	color: var(--green);
	transition: transform 0.45s var(--ease-out);
}

.ctile__go .icon {
	width: 100%;
	height: auto;
}

.ctile:hover .ctile__go,
.ctile:focus-visible .ctile__go {
	transform: translateX(6px);
}

.post-more__head {
	margin-bottom: clamp(24px, 3vw, 48px);
}

.post-more__all {
	margin-top: clamp(28px, 3vw, 48px);
	font-size: 15px;
	font-style: italic;
}

.post-more__all a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

/* ---------------------------------------------------------------------------
   Wider screens: contents column beside the text
   ------------------------------------------------------------------------- */

@media (min-width: 961px) {
	.post-layout {
		grid-template-columns: minmax(190px, 250px) minmax(0, 68ch);
		gap: clamp(36px, 6vw, 110px);
	}

	.post-layout:not(.post-layout--toc) {
		grid-template-columns: minmax(0, 68ch);
	}
}

/* ---------------------------------------------------------------------------
   Tablets and phones
   ------------------------------------------------------------------------- */

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

	.bcard--lead {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.bcard--lead .bcard__body {
		padding-top: clamp(14px, 1.4vw, 22px);
	}

	.bcard--lead .bcard__meta {
		padding-top: 14px;
	}

	.post-cta__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* The contents list sits above the text, in a sand box. */
@media (max-width: 960px) {
	.post-toc {
		position: static;
		padding: 16px 20px;
		background: var(--sand);
	}

	/* Folded on phones: "Съдържание" opens the list. */
	.post-toc__title {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0;
		color: var(--green);
		font-size: 15px;
		cursor: pointer;
	}

	.post-toc__title::after {
		content: "+";
		font-size: 22px;
		font-style: normal;
		line-height: 1;
	}

	.post-toc__box[open] > .post-toc__title::after {
		content: "\2212";
	}

	.post-toc__box[open] > .post-toc__title {
		margin-bottom: 10px;
	}

	.post-toc ol {
		border-left: 0;
	}

	.post-toc a {
		padding-left: 0;
	}

	.post-toc a::after {
		display: none;
	}
}

@media (max-width: 767px) {
	/* The bookmark (menu, search, cart) stands top-right: the trail wraps before it. */
	.blog-crumbs {
		padding-right: 76px;
	}

	.blog-grid {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.blog-filter {
		margin-bottom: 28px;
	}

	.blog-empty {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.blog-empty__plant {
		height: 150px;
	}

	.blog-empty__plant .bcard__flower {
		margin-inline: 0;
	}

	.blog--single .post-hero__title {
		font-size: clamp(28px, 8vw, 36px);
	}

	.post-cover {
		aspect-ratio: 4 / 3;
		margin-inline: -16px;
	}

	.post-layout {
		font-size: 17px;
	}

	.post-cta {
		margin-inline: -16px;
		padding: 32px 16px;
	}

	.post-cta__list {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	/* Phones: the picture beside the name, a compact row. */
	.ctile {
		grid-template-columns: 38% minmax(0, 1fr) auto;
		grid-template-areas: "media name go";
		gap: 14px;
		align-items: center;
	}

	.ctile__media {
		aspect-ratio: 4 / 3;
	}

	.post-content table,
	.post-content thead,
	.post-content tbody,
	.post-content tr,
	.post-content td {
		display: block;
	}

	.post-content thead {
		display: none;
	}

	.post-content tr {
		padding: 12px 0;
		border-bottom: 1px solid var(--line);
	}

	.post-content td {
		padding: 2px 0;
		border: 0;
	}

	.post-content td:first-child {
		color: var(--ink);
	}
}
