/*
 Theme Name:   MiWiki 2023
 Theme URI:    https://generatepress.com
 Description:  MiWiki GeneratePress child theme
 Author:       Stefan Kuhn
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/



/*************************************************************************
 * Archiv-Seiten
 *************************************************************************/
/* Maximale Laufweite der Inhalte */
.archive .page-header {
	max-width: 782px;
	margin: 3em auto;
	text-align: center;
}
.archive article {
	max-width: 782px;
	margin: 0 auto;
}
/* H1-Überschrift auf Archivseiten ausblenden */
@media (min-width: 1080px) {
	.archive .content-area .page-header {
		border: 0;
		clip: rect(1px,1px,1px,1px);
		-webkit-clip-path: inset(50%);
		clip-path: inset(50%);
		height: 1px;
		margin: -1px;
			margin-bottom: -1px;
		overflow: hidden;
		padding: 0;
		position: absolute !important;
		width: 1px;
		word-wrap: normal !important;
	}
}
/* Abstand zwischen den einzelnen Posts */
.one-container.archive article:not(:last-child):not(.is-loop-template-item) {
	padding-bottom: 3em;
}
.one-container.archive article:last-of-type:not(.is-loop-template-item) {
	padding-bottom: 0;
}
.one-container.archive article:first-of-type:not(.is-loop-template-item) {
	margin-top: 1.5em;
}
/* Meta-Daten des Post verbergen */
.archive h2 + .entry-meta {
	display: none;
}
/* Post-Bilder (Breite & Abstand) */
.archive article .post-image {
	/*
	margin-top: 0.4em;
	margin-bottom: 0.4em;
	*/
	margin-top: 0;
	margin-bottom: 0;
}
.archive article .post-image .size-full {
	width: 100%;
}
.archive article .post-image a {
	line-height: 0;
	display: block;
}
/* Post-Excerpt (Abstand) */
.archive article .entry-content,
.archive article .entry-summary {
	margin-top: 0;
}
.archive article .entry-content a,
.archive article .entry-summary a {
	color: inherit;
	display: block;
}
/* Silbentrennung */
.archive article {
	hyphens: auto;
}
@media (min-width: 782px) {
	.archive article .entry-header {
		hyphens: manual;
	}
}
/* Content-Reihenfolge */
.archive article .inside-article {
	display: flex;
	flex-direction: column;
}
.archive article .inside-article .post-image{
	order: 1;
}
.archive article .inside-article .entry-header{
	order: 2;
}
.archive article .inside-article .entry-content,
.archive article .inside-article .entry-summary {
	order: 3;
}
/* Content-Abstände */
.one-container.archive .post,
.one-container.archive .teaser {
	padding: 0 !important;
	margin: 0 auto 3em;
}
@media (min-width: 782px) {
	.one-container.archive .post,
	.one-container.archive .teaser {
		margin-bottom: 4.5em;
	}
}


/* Klick-Bereich vergrößern */
/*
.archive article .inside-article {
	position: relative;
}
.archive article .entry-title a::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	z-index: 1;
}
*/
@media (hover: hover) and (pointer: fine) {
	.archive article:hover {
		cursor: pointer;
	}
	.archive article:hover .entry-title a {
		/*
		color: inherit;
		*/
		color: var(--wp-j4b-theme-color-on-background-medium);
	}
	.archive article .post-image {
		width: 100%;
		overflow: hidden;
	}
	.archive article .post-image img {
		transition: transform .1s ease-in-out, filter .1s ease-in-out;
	}
	.archive article:hover .post-image img {
		transform: scale(1.05);
		filter: brightness(1) contrast(1);
	}
}



@media (min-width: 782px) {
	/* Den ersten Post auf der ersten Seite eines Archivs am Dektop prominenter darstellen */
	.archive:not(.paged) article:first-of-type {
		margin-bottom: 3em;
		max-width: unset;
	}
	.archive:not(.paged) article:first-of-type .inside-article {
		align-items: center;
	}
	.archive:not(.paged) article:first-of-type .entry-header,
	.archive:not(.paged) article:first-of-type .entry-content,
	.archive:not(.paged) article:first-of-type .entry-summary {
		width: calc( 100% - 6em);
		max-width: calc(782px + 2em);
		background-color: var(--wp-j4b-theme-color-background);
		background-image: linear-gradient(var(--wp-j4b-theme-color-lighter-1),var(--wp-j4b-theme-color-lighter-1));
	}
	.archive:not(.paged) article:first-of-type .entry-header {
		z-index: 2;
		/*
		margin-top: -6em;
		*/
		padding: 1em 1em 0;
		border-top-left-radius: 1em;
		border-top-right-radius: 1em;
		box-shadow: inset 0 4px 4px -4px var(--wp-j4b-theme-color-darker-9), inset -4px 0 4px -4px var(--wp-j4b-theme-color-darker-9), inset 4px 0 4px -4px var(--wp-j4b-theme-color-darker-9);
	}
	.archive:not(.paged) article:first-of-type .entry-content,
	.archive:not(.paged) article:first-of-type .entry-summary {
		z-index: 3;
		padding: 0 1em 1em;
		border-bottom-left-radius: 1em;
		border-bottom-right-radius: 1em;
		box-shadow: inset 0 -4px 4px -4px var(--wp-j4b-theme-color-darker-9), inset -4px 0 4px -4px var(--wp-j4b-theme-color-darker-9), inset 4px 0 4px -4px var(--wp-j4b-theme-color-darker-9);
	}
	.archive:not(.paged) article:first-of-type .post-image {
		position: relative;
		bottom: -6em;
		margin-top: -6em;
	}

}



@media (min-width: 782px) {
	/* Die normalen Posts eines Archivs am Desktop */
	.archive:not(.paged) article:not(:first-of-type),
	.archive.paged article,
	.archive.paged.one-container .post,
	.archive.one-container .teaser:not(:first-of-type) {
		margin-bottom: 0 !important;
		margin-top: 1.5em !important;
	}
	.archive:not(.paged) article:not(:first-of-type)::after,
	.archive.paged article::after {
		content: "";
		display: block;
		height: 1px;
		background: linear-gradient(90deg,var(--wp-j4b-theme-color-on-background-disabled) 25%,transparent 0) 0 100% / 0.25em 1px repeat-x;
	}
	.archive:not(.paged) article:not(:first-of-type):last-of-type::after,
	.archive.paged article:last-of-type::after {
		height: 0;
		margin-bottom: 1.5em;
	}
	.archive:not(.paged) article:not(:first-of-type) .inside-article,
	.archive.paged article .inside-article {
		display: block;
	}
	.archive:not(.paged) article:not(:first-of-type) .inside-article::after,
	.archive.paged article .inside-article::after {
		content: "";
		display: block;
		clear: both;
	}
	.archive:not(.paged) article:not(:first-of-type) .inside-article .post-image,
	.archive.paged article .inside-article .post-image {
		float: right;
		width: calc(33% - 0.5em);
		/*
		margin-top: 0;
		*/
		margin-bottom: 1.5em;
	}
	.archive:not(.paged) article:not(:first-of-type) .entry-header,
	.archive.paged article .entry-header {
		float: left;
		width: 66%;
	}
	.archive:not(.paged) article:not(:first-of-type) .entry-content,
	.archive.paged article .entry-content,
	.archive:not(.paged) article:not(:first-of-type) .entry-summary,
	.archive.paged article .entry-summary {
		float: left;
		width: 66%;
		margin-bottom: 1.5em;
	}
}



@media (min-width: 782px) {
	/* Posts ohne Bild immer in voller Breite am Desktop */
	.archive article .inside-article:not(:has(.post-image)) .entry-header,
	.archive article .inside-article:not(:has(.post-image)) .entry-content,
	.archive article .inside-article:not(:has(.post-image)) .entry-summary {
		width: 100%;
		margin-top: 0;
	}
}



/* Posts mit Status "privat" in Archiven ausgegraut darstellen */
.archive .post.status-private {
	filter: grayscale(100%);
}



/*************************************************************************
 * Schriftgrößen und Abstände an SPIEGEL-Niveau angleichen
 *************************************************************************/

@media (max-width: 781px) {
	article .entry-title {
		font-size: calc(1em / 16 * 28);
		line-height: 1.08;
		margin: calc(1em / 28 * 12) 0;
		hyphens: auto;
		text-wrap: balance;
	}
	article .entry-title .dachzeile {
		font-size: calc(1em / 28 * 16);
		margin-bottom: 0.25em;
	}
}

@media (min-width: 782px) {
	/* Tablet (Landscape) & Desktop Typo - Major Third - 4 Headline-Ebenen */
	.archive:not(.paged) article:first-of-type .entry-title {
		font-size: calc(1em / 20 * 36);
		line-height: 1.08;
		margin-bottom: calc(1em / 20 * 12);
	}
	.archive:not(.paged) article:first-of-type .entry-title .dachzeile {
		font-size: calc(1em / 36 * 16);
		line-height: 1.26;
	}
	.archive:not(.paged) article:first-of-type .entry-content,
	.archive:not(.paged) article:first-of-type .entry-summary {
		line-height: 1.38;
	}

	.archive article .entry-title {
		font-size: calc(1em * 24 / 20);
		line-height: 1.26;
		margin-bottom: calc(1em / 24 * 12);
	}
	.archive article .entry-title .dachzeile {
		font-size: calc(1em * 16 / 24);
	}
	.archive article .entry-content,
	.archive article .entry-summary {
		line-height: 1.38;
	}
}



/*************************************************************************
 * Test Archive / Home News 50/50
 *************************************************************************/
/*
@media (min-width: 782px) {
	.archive:not(.paged) article:not(:first-of-type) .entry-header,
	.archive.paged article .entry-header,
	.archive:not(.paged) article:not(:first-of-type) .inside-article .post-image,
	.archive.paged article .inside-article .post-image,
	.archive:not(.paged) article:not(:first-of-type) .entry-content, .archive.paged article .entry-content,
	.archive:not(.paged) article:not(:first-of-type) .entry-summary, .archive.paged article .entry-summary {
		width: calc(50% - 0.5em);
	}
}
*/



/*************************************************************************
 * Kategorie-Beschreibung ausblenden
 *************************************************************************/
.taxonomy-description {
	display: none;
}



/*******************************************************************************
 *
 * Sponsored Content
 *
 *******************************************************************************/

.archive article {
	position: relative;
}

.archive article .post-image a::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
}


article.category-sponsored {
	position: relative;
}

.archive:not(.paged) article.category-sponsored:not(:first-of-type)::after,
.archive.paged article.category-sponsored::after {
content: "";
	display: block;
	position: absolute;
	inset: 0;
	z-index: 1;
	margin-top: -1.5em;
	margin-bottom: 0em;
	margin-left: -1em;
	margin-right: -1em;
	background: rgba(17, 119, 238, .05);
	overflow: hidden;
	height: calc(100% + 2.25em);
}

:root[data-theme="dark"] .archive:not(.paged) article.category-sponsored:not(:first-of-type)::after,
:root[data-theme="dark"] .archive.paged article.category-sponsored::after {
	background: rgba(17, 119, 238, .16);
}

.archive:not(.paged) article.category-sponsored:not(:first-of-type) .inside-article  > *,
.archive.paged article.category-sponsored .inside-article > * {
	position: relative;
	z-index: 10;
}

.archive:not(.paged) article:not(:first-of-type):has(+ article.category-sponsored)::after,
.archive.paged article:has(+ article.category-sponsored)::after {
	background: none;
}

article.category-sponsored .inside-article::before {
	content: "Sponsored Content";
	display: block;
	position: relative;
	top: calc(-1.5em / 0.64);
	right: 0.75em;
	width: 100%;
	height: 0;
	font-size: .64em;
	font-weight: 600;
	line-height: calc(1.5 / 0.64);
	text-align: right;
	text-transform: uppercase;
	color: var(--wp-j4b-theme-color-on-background);
	opacity: .62;
}

@media (min-width: 782px) {
	.archive:not(.paged) article.category-sponsored:not(:first-of-type)::after,
	.archive.paged article.category-sponsored::after {
		height: calc(100% + 1.5em);
		background-image: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, transparent 1.5em, transparent 100%), linear-gradient(270deg, rgba(255, 255, 255, 1) 0%, transparent 1.5em, transparent 100%);
		border-radius: 0.75em;
	}

	:root[data-theme="dark"] .archive:not(.paged) article.category-sponsored:not(:first-of-type)::after,
	:root[data-theme="dark"] .archive.paged article.category-sponsored::after {
		background-color: unset;
		background-image: linear-gradient(90deg, transparent 0, rgba(17, 119, 238, .16) 1.5em, rgba(17, 119, 238, .16) 50%, transparent 50%), linear-gradient(270deg, transparent 0, rgba(17, 119, 238, .16) 1.5em, rgba(17, 119, 238, .16) 50%, transparent 50%);
	}
}
