/* Single article page */

.entry-content figure {
	margin: 0 0 40px;
}

.series-intro {
    font-style: italic;
}
.series-intro:before {
    content: "•";
    color: #fd2870;
    margin-right: 5px;
    font-weight: 600;
    font-style: normal;
}

figure[id^=attachment] {
	width: 100% !important;
}

figure[id^=attachment] img[class*="wp-image"],
figure[id^=attachment] img.alignnone,
figure[id^=attachment] picture.k-image>*,
img.k-image  {
	left: 0;
	width: 100%;
	max-width: 100%;
}

/* TODO: ensure importants are still necessary */
figure.wp-caption {
	margin-bottom: var(--margin);
	max-width: 100% !important; /* override fixed max-width on figure element */
	font-size: 0.7rem;
	color: var(--text-caption);
	padding-bottom: 10px;
	width: 100% !important; /* must override inline style fixed width? */
	background-color: #f1f4f6;
	border-radius: 8px;
}

/* TODO check if necessary */
.wp-caption-text {
	margin-top: 6px;
	font-weight: 400;
}
.wp-caption .wp-caption-text>a {
	color: var(--text-caption);
}

.entry-content>p {
	margin-bottom: 20px;
}

.entry-content>p:last-child {
	margin-bottom: inherit;
}

.entry-content>*:first-child {
    margin-top: 0;
}

.entry-content iframe {
	max-width: 100%;
}

img[class*="wp-image"], img.alignnone, picture.k-image>*, img.k-image {
	margin-left: auto;
	margin-right: auto;
	position: relative;
	margin-bottom: 10px;
	width: 100%;
}

figure>img[class*="wp-image"],
p>img[class*="wp-image"]:last-of-type,
picture.k-image:last-of-type>img,
picture.k-img-pic:last-of-type>img,
img.k-image:last-of-type {
	margin-bottom: 0;
}

figure>video.k-video,
figure>picture.k-image:last-of-type>img,
figure>img.k-image:last-of-type {
	margin-bottom: 0;
}

video.ik-gif {
    width: 100%;
    height: auto;
    max-height: 720px;
}

/* TODO: not sure if video-play-poster still used */
.video-play-poster {
    position: relative;
    width: 100%;
}

.video-play-poster img {
    z-index: 2;
    width: 100%;
}

.video-play-poster div {
    position: absolute;
    left: calc(50% - 40px);
    top: calc(50% - 40px);
    height: 80px;
    width: 80px;
    line-height: 80px;
    border-radius: 50%;
    background-color: #fff;
    color: var(--text-b);
    opacity: .8;
    z-index: 3;
    font-size: 60px;
    text-align: center;
}

.video-play-poster div:hover {
    opacity: 1;
}

figcaption {
	font-size: 0.9rem;
	color: var(--text-sub);
	padding: 0 18px 5px;
	font-weight: 300;
	line-height: 1.4;
}

img[class*="wp-image"], picture.k-image, img.k-image {
	cursor: zoom-in;
}

/* border-radius is set on figure object normally */
img.k-image:not(figure.wp-caption>img) {
	border-radius: 8px;
}

video.k-video {
	width: 100%;
	background-color: #f7f9fa;
}

.entry-header {
	border-radius: 5px;
}


/* Article meta */

/* Not used
.search-post-terms {
    grid-area: 2/1/3/2;
    display: flex;
    flex-wrap: wrap;
    overflow-y: hidden;
    list-style-type: none;
    margin: 0;
    padding: 0;
    align-items: center;
}
.search-post-terms li {
    display: inline;
    margin: 2.5px 0 10px 10px;
    height: 30px;
    line-height: 30px;
    background-color: #003ddb;
    color: white;
    border-radius: 15px;
    padding: 0 10px;
}
.search-post-terms li img {
    height: 20px;
    width: 20px;
    vertical-align: middle;
    position: relative;
    bottom: 2px;
    margin-right: 5px;
}

@media screen and (max-width: 768px) { 
	.search-post-terms {
        grid-area: 1/2/3/3;
		overflow-y: visible;
	}
	.search-post-terms li {
		margin-left: 0;
		margin-right: 10px;
		margin-bottom: 2.5px;
	}
}
*/



/* Styles */
.entry-content blockquote {
	margin: 35px 0 60px;
}

blockquote:not(.long-passage) {
	position: relative;
	text-align: left;
	color: var(--text-b);
	padding-left: 50px;
}

blockquote.long-passage {
	padding-left: 50px;
}

article .entry-content blockquote:not(.long-passage) p {
	color: var(--text-b);
	font-weight: 700;
}

blockquote>p {
	margin-bottom: 20px;
}

blockquote:not(.long-passage)>p:nth-last-child(2)::after,
blockquote:not(.long-passage)>p:only-child::after {
	display: inline-block;
	content: " ";
	font-size: 90px;
	font-weight: 800;
	font-style: normal;
	font-family: serif;
	color: rgba(0,0,0,.0);
	background-image: url('/wp-content/themes/KbooOS2/img/quote-1903.svg');
	transform: rotateX(180deg) rotateY(180deg);
	background-repeat: no-repeat;
	background-size: contain;
	height: 20px;
	width: 30px;
	margin-left: 5px;
}

article .entry-content blockquote:not(.long-passage)>p:last-child {
	font-size: 16px;
	line-height: 25px;
	letter-spacing: 0;
	margin-bottom: 20px;
	font-weight: 400;
	color: var(--text-sub);
	margin-top: -10px;
}

article .entry-content blockquote:not(.long-passage)>p:only-child {
	font-size: 1.2rem;
	font-weight: 700;
	color: #1a1a1a;
	margin-top: 0;
}

.entry-content>blockquote:not(.long-passage,.tiktok-embed)::before {
    display: block;
    content: " ";
    font-size: 90px;
    font-weight: 800;
    font-style: normal;
    font-family: serif;
    color: rgba(0,0,0,.0);
    background-image: url('/wp-content/themes/KbooOS2/img/quote-1903.svg');
    background-repeat: no-repeat;
    background-size: contain;
    height: 35px;
    width: 35px;
    margin-bottom: 30px;
    position: absolute;
    left: 0;
    top: 0;
}



/* Sources */

/* TODO -- replace with details element? */
.kb-article-sources-container {
	/* Try to keep hidden/open same height (prevent page jump) */
	min-height: 28px;
}

.kb-article-sources-container:before {
    background-color: #E5E5E5;
    color: #666;
    content: "Source";
    cursor: pointer;
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 2;
    margin-right: .25rem;
    border-radius: 1.2rem;
    outline: none;
    padding: 0 15px;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.kb-article-sources {
    display: none;
}
.kb-article-sources-container.reveal:before {
    display: none;
}
.kb-article-sources-container.reveal .kb-article-sources {
    display: block;
}

.article-source, .posted-on {
	align-self: center;
}

/* Share buttons */

.kbos-share {
	color: var(--text-b);
	border-top: 1px solid rgba(0,0,0,.07);
	margin-top: 40px;
	padding-top: 20px;
}

.share-button-container {
	margin: 20px 0;
	width: 100%;
	display: flex;
	justify-content: space-between;
}

.share-button {
	position: relative;
	width: calc(50% - 5px);
	height: 50px;
	font-size: 20px;
	font-weight: 600;
	line-height: 50px;
	color: var(--text-contrast);
	border-radius: 5px;
	text-align: center;
}

.share-label-container {
	margin: 0 auto;
	height: 100%;
}
img.fb-icon {
	height: 50px;
	padding: 12px 5px;
}
.share-button .icon-twitter {
	top: 8px;
    position: relative;
    height: 28px;
}
.share-label {
	margin-left: 10px;
}
.share-label-fb {
	margin-left: 5px;
	position: relative;
	bottom: 18px;
}

/* show only share icons on really narrow displays */
@media screen and (max-width: 320px) {
	.share-label {
		display: none;
	}
}

.share-button.twitter {
	background-color: var(--twitter-blue);
}
.share-button.facebook {
	background-color: var(--facebook-blue);
}

.share-button:hover {
	cursor: pointer;
}



/* Etc. */

.entry-content strong {
	font-weight: 600;
	color: var(--text-b);
}

.entry-content a {
	color: #fd2870;
	font-weight: 600;
	strong {
		color: inherit;
	}
}

.wp-embedded-content {
	margin: auto;
	display: block;
	max-width: 100%;
}



/* SNS Fixes */

.instagram-media, twitterwidget {
	margin: 0 auto 40px !important;
}
.entry-content iframe.instagram-media {
	left: 0;
}
.instagram-media {
	margin-bottom: 45px !important;
	position: relative !important;
	max-width: 100% !important;
	width: 100% !important; /* override inline style */
}
twitter-widget {
	margin: auto;
}
.twitter-tweet {
    margin-inline: auto;
}

/* Fix ad container inside long-passage */
blockquote.long-passage .kb-ads-dynamic {
    margin-left: -50px;
    max-width: calc(100% + 50px);
    width: calc(100% + 50px);
}



/* Lists */

.entry-content ul {
	position: relative;
	list-style-type: disc;
}
.entry-content ul,
.entry-content ol {
	padding-left: 30px;
	line-height: 26px;
	font-weight: 400;
	margin-top: 20px;
	margin-bottom: 20px;
}



/* Spoiler image */

.spoiler-image-placeholder {
	background-color: #1a1a1a90;
	background-blend-mode: multiply;
	background-size: cover;
	position: relative;
	text-align: center;
	cursor: pointer;
}

.spoiler-image-placeholder img {
    width: 100%;
    height: auto;
}
.spoiler-image-placeholder:before {
    content: "Image hidden. Tap to view.";
    font-size: 1.9rem;
    color: var(--text-contrast);
    text-align: center;
    position: absolute;
    top: calc(50% - 30px);
    width: 100%;
    padding: 0 30px;
    line-height: 1.15;
}
.spoiler-image-placeholder.spoiler-image {
    border-radius: 5px;
}
.spoiler-image-placeholder.spoiler-video:before {
    content: "GIF hidden. Tap to view."
}

img.spoiler {
	filter: blur(30px) brightness(0.5);
	cursor: pointer;
}

picture:has(>img.spoiler),
p:has(>img.spoiler) {
	position: relative;
	display: block;
	overflow: hidden;
}

picture:has(>img.spoiler)::before,
p:has(>img.spoiler)::before {
	text-align: center;
	content: "Image hidden. Tap to view.";
	color: white;
	text-shadow: 2px 2px black;
	font-size: 1.6rem;
	top: 40%;
	width: 100%;
	position: absolute;
	z-index: 10;
}

/* Content warnings */

.cw-header {
	padding: 20px 10px 20px 100px;
	color: var(--inverse-text);
	position: relative;
	min-height: 80px;
	padding-left: 20px;
	background-color: var(--vibrant-purple);
    font-size: 1rem;

	h2 {
		color: var(--inverse-text);
	}
	&.cw-sp {
		background-color: var(--vibrant-blue);
	}
}

.cw-footer {
	background-color: rgba(67, 26, 67, .1);
	border: 1px solid rgba(67, 26, 67, .6);
	border-radius: 5px;
	padding: 20px;
	margin-bottom: 20px;
    font-style: italic;
}

.cw-footer p {
    color: var(--text-medium);
}



/* Update */

.article-update {
	margin-bottom: var(--margin);
	background-color: var(--update-bg);
	border: 1px solid var(--brand);
	padding: 5px;
	border-radius: 5px;
}
.article-update>:first-child:before {
    content: "Update: ";
    font-weight: 600;
}
.article-correction {
	border-top: 1px solid rgba(0,0,0,.07);
	padding-top: var(--margin);
	font-style: italic;
}



/* Series characters */

.series-character {
    --char0: rgba(230, 40, 90, .2);
    --char1: rgba(40, 90, 230, .2);
    --char2: rgba(90, 230, 40, .2);
    --char3: rgba(210, 40, 210, .2);
    --char4: rgba(40, 210, 210, .2);
    --char5: rgba(210, 210, 40, .2);
    border-bottom: 1px dotted;
    background-color: var(--char0);
    padding: 0 1px;
    margin: 0 -1px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-b);
}

.series-character[data-index="1"] {
    background-color: var(--char1);
}

.series-character[data-index="2"] {
    background-color: var(--char2);
}

.series-character[data-index="3"] {
    background-color: var(--char3);
}

.series-character[data-index="4"] {
    background-color: var(--char4);
}

.series-character[data-index="5"] {
    background-color: var(--char5);
}
#k_tooltip {
	max-width: 300px;
	max-width: min(300px, 95vw);
	padding: 5px;
	background-color: var(--bg);
	z-index: 99;
	box-shadow: 2px 2px 5px rgba(0,0,0,.15);
	border: 1px solid #787878;
	border-radius: 5px;
	position: fixed;
}
[data-tooltip] {
	user-select: none;
	touch-action: manipulation;
}

/* Misc media queries */

@media screen and (min-width: 768px) { /* bp-tablet */
    video.k-video {
        max-height: 80vh;
    }
    .video-play-poster > img {
        width: 100%;
        max-height: 80vh;
        object-fit: contain;
    }
}

@media screen and (max-width: 480px) { /* bp-mobile */
    embed,
	.entry-content iframe,
	object {
		max-height: 500px;
	}
	iframe.twitter-tweet,
	div.twitter-tweet>iframe,
	iframe.instagram-media {
		max-height: none;
	}
}

@media screen and (max-width: 900px) { /* bp-desktop */
	embed,
	.entry-content iframe,
	object {
		max-height: 720px;
	}

	iframe.twitter-tweet,
	div.twitter-tweet>iframe,
	iframe.instagram-media {
		max-height: none;
	}

	div.twitter-tweet,
	iframe.twitter-tweet {
        /* not sure if needed */
		background-color: unset;
	}

	.entry-content iframe[src*="www.youtube.com/"] {
		height: 56.25vw !important;
		height: calc((100vw - 90px) * .5625 + 60px) !important;
		max-width: 100% !important;
		/* setting width 100% because it wasn't taking up whole page before. seems to work */
		width: 100%;
	}
}
