/*
 * Slothturtle Paper Forest: paper cards.
 * White or pale-green panels with a slight tilt and a soft shadow, like paper laid on a table.
 * Block styles: .is-style-stpf-paper-card, .is-style-stpf-paper-card-green
 * Class names:  .stpf-card, .stpf-card--green, .stpf-tilt-left / -right / -none
 * Post lists:   body.stpf-archive-cards article.loop-entry (Kadence)
 */

.is-style-stpf-paper-card,
.is-style-stpf-paper-card-green,
.stpf-card,
body.stpf-archive-cards article.loop-entry.loop-entry {
	--stpf-card-tilt: -0.6deg;
	background: var(--stpf-card-bg, #FFFFFF);
	color: #2B2A28;
	padding: 32px;
	border: 0;
	border-radius: 0;
	box-shadow: 0 2px 0 rgba(43, 42, 40, 0.08), 0 10px 18px rgba(60, 45, 25, 0.16);
	transform: rotate(var(--stpf-card-tilt));
	box-sizing: border-box;
}

.is-style-stpf-paper-card-green,
.stpf-card--green {
	--stpf-card-bg: #EEF4EA;
	box-shadow: 0 2px 0 rgba(43, 42, 40, 0.08), 0 10px 18px rgba(60, 45, 25, 0.12);
}

/* Kadence columns paint their own background on an inner wrapper. */
.wp-block-kadence-column.is-style-stpf-paper-card > .kt-inside-inner-col,
.wp-block-kadence-column.is-style-stpf-paper-card-green > .kt-inside-inner-col,
.wp-block-kadence-column.stpf-card > .kt-inside-inner-col {
	background: transparent;
}

/* Neighbouring cards lean different ways, so a row looks hand-placed. */
:is(.is-style-stpf-paper-card, .is-style-stpf-paper-card-green, .stpf-card):nth-child(2n) { --stpf-card-tilt: 0.5deg; }
:is(.is-style-stpf-paper-card, .is-style-stpf-paper-card-green, .stpf-card):nth-child(3n) { --stpf-card-tilt: -0.3deg; }
.wp-block-column:nth-child(2n) > :is(.is-style-stpf-paper-card, .is-style-stpf-paper-card-green, .stpf-card) { --stpf-card-tilt: 0.5deg; }
.wp-block-column:nth-child(3n) > :is(.is-style-stpf-paper-card, .is-style-stpf-paper-card-green, .stpf-card) { --stpf-card-tilt: -0.3deg; }
/* Kadence puts each post in its own list item, so count the list items. */
body.stpf-archive-cards .entry-list-item:nth-child(2n) > article.loop-entry { --stpf-card-tilt: 0.5deg; }
body.stpf-archive-cards .entry-list-item:nth-child(3n) > article.loop-entry { --stpf-card-tilt: -0.3deg; }

/* Pick the tilt by hand. */
.stpf-tilt-left.stpf-tilt-left.stpf-tilt-left { --stpf-card-tilt: -0.6deg; }
.stpf-tilt-right.stpf-tilt-right.stpf-tilt-right { --stpf-card-tilt: 0.5deg; }
.stpf-tilt-none.stpf-tilt-none.stpf-tilt-none { --stpf-card-tilt: 0deg; }

/* Post lists: keep the card's own padding; Kadence's inner wrapper adds none. */
body.stpf-archive-cards article.loop-entry .entry-content-wrap {
	padding: 0;
}

/* Small screens: a little less padding, a gentler tilt. */
@media (max-width: 600px) {
	.is-style-stpf-paper-card,
	.is-style-stpf-paper-card-green,
	.stpf-card,
	body.stpf-archive-cards article.loop-entry.loop-entry {
		padding: 22px;
		transform: rotate(calc(var(--stpf-card-tilt) * 0.6));
	}
}

/* Printing: flat paper, no shadow. */
@media print {
	.is-style-stpf-paper-card,
	.is-style-stpf-paper-card-green,
	.stpf-card,
	body.stpf-archive-cards article.loop-entry.loop-entry {
		box-shadow: none;
		transform: none;
		border: 1px solid #CCCCCC;
	}
}
