/*
Theme Name: Shownd
Theme URI: https://shownd.com
Author: Shownd
Description: A lookbook-style block theme for shownd.com: outfit ideas, hair, nails and costumes. Orchid and lime on a pale lilac ground, hang-tag category labels, and a big featured-story opener. Full Site Editing; edit everything under Appearance > Editor.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shownd
Tags: blog, full-site-editing, block-patterns, wide-blocks, custom-colors, editor-style, featured-images, threaded-comments, translation-ready
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--wp--preset--color--lime); color: var(--wp--preset--color--ink); }

:where(a):focus-visible,
:where(button):focus-visible,
:where(input):focus-visible {
	outline: 3px solid var(--wp--preset--color--orchid);
	outline-offset: 3px;
}

.screen-reader-text { position: absolute; left: -9999px; }

/* ---------- Header ---------- */
.shownd-header {
	border-bottom: 2px solid var(--wp--preset--color--ink);
	position: relative;
	z-index: 20;
	background: var(--wp--preset--color--paper);
}
.shownd-header .wp-block-site-title a {
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}
.shownd-header .wp-block-site-title a::after {
	content: "";
	display: inline-block;
	width: .28em;
	height: .28em;
	margin-left: .08em;
	border-radius: 50%;
	background: var(--wp--preset--color--orchid);
}
.shownd-header .wp-block-navigation a {
	text-decoration: none;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
}
.shownd-header .wp-block-navigation a:hover,
.shownd-header .wp-block-navigation .current-menu-item > a {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 6px;
	text-decoration-color: var(--wp--preset--color--orchid);
}

/* Header search: icon centered on the same line as the menu links. */
.shownd-header .wp-block-search {
	width: auto;
	margin: 0;
	display: flex;
	align-items: center;
}
.shownd-header .wp-block-search__inside-wrapper {
	display: flex;
	align-items: center;
}
.shownd-header .wp-block-search .wp-block-search__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: auto;
	margin: 0;
	padding: .4rem;
	line-height: 1;
}
.shownd-header .wp-block-search .wp-block-search__button svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
}

/* ---------- Hang tag (category label) ---------- */
.shownd-tag { margin: 0; line-height: 1; }
.shownd-tag a {
	position: relative;
	display: inline-block;
	padding: .5rem .8rem .5rem 1.7rem;
	background: var(--wp--preset--color--lime);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: .9rem;
	text-decoration: none;
	clip-path: polygon(.65rem 0, 100% 0, 100% 100%, .65rem 100%, 0 50%);
}
.shownd-tag a::before {
	content: "";
	position: absolute;
	left: .75rem;
	top: 50%;
	width: .42rem;
	height: .42rem;
	margin-top: -.21rem;
	border-radius: 50%;
	background: var(--wp--preset--color--paper);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--ink);
}
.shownd-tag a:hover { background: var(--wp--preset--color--orchid); color: var(--wp--preset--color--paper); }
.shownd-tag .wp-block-post-terms__separator { display: none; }

/* ---------- Opening story ---------- */
body.paged .shownd-hero,
body.paged .shownd-hero-rule { display: none; }

.shownd-hero .wp-block-post-featured-image {
	box-shadow: 14px 14px 0 var(--wp--preset--color--lime);
	border: 2px solid var(--wp--preset--color--ink);
	margin-bottom: 14px;
	margin-right: 14px;
}
.shownd-hero .wp-block-post-featured-image img { display: block; }
.shownd-hero .wp-block-post-title { text-wrap: balance; }
.shownd-hero .wp-block-post-title a { text-decoration: none; }
.shownd-hero .wp-block-post-title a:hover { color: var(--wp--preset--color--orchid); }
.shownd-hero .shownd-tag { margin-bottom: 1.25rem; }

/* ---------- Cards ---------- */
.shownd-card { position: relative; }
.shownd-card .wp-block-post-featured-image {
	border: 2px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--blush);
	overflow: hidden;
}
.shownd-card .wp-block-post-featured-image img { display: block; }
.shownd-card .shownd-tag {
	position: relative;
	z-index: 2;
	margin: -1.05rem 0 0 .75rem;
}
.shownd-card .wp-block-post-title { text-wrap: balance; margin-top: .85rem; }
.shownd-card .wp-block-post-title a { text-decoration: none; }
.shownd-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 4px;
	text-decoration-color: var(--wp--preset--color--orchid);
}
.shownd-card .wp-block-post-excerpt__excerpt { margin: 0; }

/* ---------- Pagination ---------- */
.wp-block-query-pagination { gap: .5rem; }
.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-next,
.wp-block-query-pagination-previous {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	text-decoration: none;
	padding: .45rem .9rem;
	border: 2px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
	line-height: 1.2;
}
.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}
.wp-block-query-pagination .page-numbers.dots { border-color: transparent; }
.wp-block-query-pagination a:hover { background: var(--wp--preset--color--lime); }

/* ---------- Single post ---------- */
.shownd-single-title { text-wrap: balance; }
.shownd-single .wp-block-post-featured-image {
	border: 2px solid var(--wp--preset--color--ink);
	box-shadow: 12px 12px 0 var(--wp--preset--color--lime);
	margin-bottom: 12px;
	margin-right: 12px;
}
.shownd-meta { color: var(--wp--preset--color--mist); }
/* Article text: a step up from the site base size for easier reading. */
.shownd-single .wp-block-post-content,
.shownd-single .wp-block-post-content :where(p, li, blockquote) {
	font-size: 1.3125rem;
	line-height: 1.7;
}
.shownd-single .wp-block-post-content :where(figcaption, small) { font-size: 1rem; }
/* Room between the lead photo (and its lime offset) and the first line of text. */
.shownd-single .wp-block-post-content { padding-top: var(--wp--preset--spacing--50); }
.wp-block-post-title + .wp-block-post-content { padding-top: 0; }
.wp-block-post-content > * + h2 { margin-top: 2.5rem; }
.wp-block-post-content > * + h3 { margin-top: 2rem; }
/* Every image in an article fills the same column and sits in the same frame,
   including raw <img> tags pasted inside links or <center> (affiliate banners). */
.wp-block-post-content img {
	display: block;
	max-width: 100%;
	height: auto;
}
.wp-block-post-content figure.wp-block-image,
.wp-block-post-content a:has(> img:only-child) {
	display: block;
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}
.wp-block-post-content figure.wp-block-image img,
.wp-block-post-content a > img:only-child {
	width: 100%;
	border: 2px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--blush);
}
.wp-block-post-content center,
.wp-block-post-content .aligncenter,
.wp-block-post-content figure.aligncenter {
	display: block;
	width: 100%;
	max-width: 100%;
	text-align: center;
	margin-left: 0;
	margin-right: 0;
}
.wp-block-post-content iframe,
.wp-block-post-content video,
.wp-block-post-content table { max-width: 100%; }
/* Never let one oversized element create a sideways scrollbar. */
body { overflow-x: clip; }
.wp-block-post-content figure figcaption { color: var(--wp--preset--color--mist); font-size: .9rem; }
.wp-block-post-content blockquote {
	border-left: 6px solid var(--wp--preset--color--orchid);
	padding-left: 1.25rem;
	margin-left: 0;
}
.wp-block-post-content ul li::marker,
.wp-block-post-content ol li::marker { color: var(--wp--preset--color--orchid); font-weight: 700; }

/* Previous / next story: two matching cards side by side. */
.shownd-single .wp-block-group.shownd-postnav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
	max-width: 860px;
	margin-left: auto;
	margin-right: auto;
}
.shownd-postnav .wp-block-post-navigation-link {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: .5rem;
	margin: 0;
	padding: 1.1rem 1.25rem 1.25rem;
	background: var(--wp--preset--color--paper);
	border: 2px solid var(--wp--preset--color--ink);
	transition: background-color .15s ease, box-shadow .15s ease;
}
.shownd-postnav .post-navigation-link-next { grid-column: 2; text-align: right; }
.shownd-postnav .post-navigation-link-previous { grid-column: 1; text-align: left; }
.shownd-postnav .post-navigation-link__label {
	font-family: var(--wp--preset--font-family--display);
	font-size: .9rem;
	font-weight: 600;
	color: var(--wp--preset--color--mist);
	line-height: 1.2;
}
.shownd-postnav .post-navigation-link-previous .post-navigation-link__label::before { content: "\2190\00a0"; }
.shownd-postnav .post-navigation-link-next .post-navigation-link__label::after { content: "\00a0\2192"; }
.shownd-postnav a {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	text-wrap: balance;
}
/* The whole card is clickable, not just the title. */
.shownd-postnav a::after { content: ""; position: absolute; inset: 0; }
.shownd-postnav .wp-block-post-navigation-link:hover,
.shownd-postnav .wp-block-post-navigation-link:focus-within {
	background: var(--wp--preset--color--lime);
	box-shadow: 6px 6px 0 var(--wp--preset--color--ink);
}
.shownd-postnav .wp-block-post-navigation-link:hover .post-navigation-link__label,
.shownd-postnav .wp-block-post-navigation-link:focus-within .post-navigation-link__label { color: var(--wp--preset--color--ink); }
@media (max-width: 640px) {
	.shownd-single .wp-block-group.shownd-postnav { grid-template-columns: 1fr; }
	.shownd-postnav .post-navigation-link-next,
	.shownd-postnav .post-navigation-link-previous { grid-column: 1; }
}

/* ---------- Search block ---------- */
.wp-block-search__input {
	border: 2px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
	padding: .6rem .8rem;
	font: inherit;
}
.wp-block-search__button {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	border: 2px solid var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	cursor: pointer;
}
.wp-block-search__button:hover { background: var(--wp--preset--color--orchid); border-color: var(--wp--preset--color--orchid); }
.wp-block-search.wp-block-search__button-only .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 0;
	padding: .4rem;
}

/* ---------- Footer ---------- */
.shownd-footer { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }
.shownd-footer a { color: var(--wp--preset--color--paper); text-decoration-color: var(--wp--preset--color--lime); text-underline-offset: 4px; }
.shownd-footer a:hover { color: var(--wp--preset--color--lime); }
.shownd-footer .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--paper); }
.shownd-footer .shownd-fine { color: #cdbfd6; }
.shownd-footer .shownd-fine strong { color: var(--wp--preset--color--paper); }
.shownd-footer .wp-block-navigation a { text-decoration: none; font-family: var(--wp--preset--font-family--display); font-weight: 600; }
.shownd-footer .wp-block-navigation a:hover { text-decoration: underline; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; animation: none !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.shownd-hero .wp-block-post-featured-image { box-shadow: 8px 8px 0 var(--wp--preset--color--lime); margin-right: 8px; margin-bottom: 8px; }
	.shownd-single .wp-block-post-featured-image { box-shadow: 8px 8px 0 var(--wp--preset--color--lime); margin-right: 8px; margin-bottom: 8px; }
}
