/*
Theme Name: SuprSimple
Theme URI: https://suprsimple.com
Author: SuprSimple
Description: Custom theme for suprsimple.com — handwritten home page, WhatsApp contact, and an art gallery blog where every post hangs on the wall.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: suprsimple
*/

/* ---------------------------------------------------------------------------
   Fonts (self-hosted Inter, SIL OFL)
--------------------------------------------------------------------------- */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2");
}

/* ---------------------------------------------------------------------------
   Tokens
   --s = one pixel of the artboard. Desktop artboard is 1366 x 768,
   mobile artboard is 414 x 736. Every measurement below is taken from the
   artboards and multiplied by --s so the layout scales like the design.
--------------------------------------------------------------------------- */
:root {
	--ink: #000;
	--ink-soft: #1b1b1b;
	--muted: #77736c;
	--paper: #fff;
	--wall: #f6f5f2;
	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	/* Desktop: scale by width, but never let the page outgrow the viewport height. */
	--s: max(0.62px, min(100vw / 1366, 100svh / 768));
	--fs: max(13px, calc(17.2 * var(--s)));   /* body / nav text */
	--ls: -0.012em;
	--edge-l: calc(103 * var(--s));
	--edge-r: calc(83 * var(--s));
}

@media (max-width: 767px) {
	:root {
		--s: calc(100vw / 414);
		--fs: max(10px, calc(9.95 * var(--s)));
		--fs-nav: max(9.4px, calc(9.4 * var(--s)));
		--edge-l: calc(42 * var(--s));
		--edge-r: calc(51 * var(--s));
	}
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-weight: 600;
	font-size: var(--fs);
	line-height: 1.21;
	letter-spacing: var(--ls);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }

p { margin: 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Underline that draws in on hover */
.site-nav a,
.home__bottom a,
.site-footer a,
.article__back {
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0% 1.5px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size .35s cubic-bezier(.2, .7, .2, 1);
	padding-bottom: 2px;
}
.site-nav a:hover,
.site-nav a[aria-current="page"],
.home__bottom a:hover,
.site-footer a:hover,
.article__back:hover { background-size: 100% 1.5px; }

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: calc(58 * var(--s)) var(--edge-r) 0 var(--edge-l);
	box-sizing: content-box;
	height: max(16px, calc(21 * var(--s)));
	position: relative;
	z-index: 5;
}

.site-logo img {
	height: max(16px, calc(21 * var(--s)));
	width: auto;
}

.site-nav {
	display: flex;
	gap: calc(35 * var(--s));
}

@media (max-width: 767px) {
	.site-header { padding-top: calc(45.3 * var(--s)); padding-left: calc(50 * var(--s)); height: max(12px, calc(13 * var(--s))); }
	.site-logo img { height: calc(13 * var(--s)); min-height: 12px; }
	.site-nav { gap: calc(19 * var(--s)); font-size: var(--fs-nav); }
	/* Bigger tap target, same visual size. */
	.site-nav a { position: relative; }
	.site-nav a::after { content: ""; position: absolute; inset: -14px -8px; }
}

/* ---------------------------------------------------------------------------
   Home
--------------------------------------------------------------------------- */
body.home {
	min-height: 100svh;
	display: flex;
	flex-direction: column;
}

main.home {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 0 var(--edge-r) calc(73 * var(--s)) var(--edge-l);
}

.hand {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: calc(93 * var(--s)) 0 calc(138 * var(--s));
}

.hand__desktop {
	width: calc(966.77 * var(--s));
	/* artboard: SVG starts 214px from the left edge */
	margin-left: calc((214 - 103) * var(--s));
}
.hand__mobile { display: none; }

.home__bottom {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"line link"
		"contact .";
	row-gap: calc(15.7 * var(--s));
	column-gap: 2rem;
}
.home__art-line { grid-area: line; }
.home__art-link { grid-area: link; margin-right: calc((95 - 83) * var(--s)); }
.home__contact  { grid-area: contact; }

.arrow {
	display: inline-block;
	width: .5em;
	height: .5em;
	vertical-align: .08em;
	margin-left: .05em;
	transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
a:hover .arrow { transform: translate(2px, -2px); }

@media (max-width: 767px) {
	body.home { min-height: 0; }
	main.home { padding: 0 calc(16 * var(--s)) calc(120 * var(--s)) var(--edge-l); }
	.hand { flex: none; padding: calc(97.7 * var(--s)) 0 0; }
	.hand__desktop { display: none; }
	.hand__mobile {
		display: block;
		width: calc(288.73 * var(--s));
		margin-left: calc((61 - 42) * var(--s));
	}
	.home__bottom {
		grid-template-columns: 1fr;
		grid-template-areas: "line" "link" "contact";
		row-gap: 0;
		padding-top: calc(98.2 * var(--s));
		line-height: calc(19.6 * var(--s));
	}
	.home__art-link { margin-right: 0; }
	.home__contact { margin-top: calc(25.6 * var(--s)); }
}


/* ---------------------------------------------------------------------------
   Inner page footer
--------------------------------------------------------------------------- */
.site-footer {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: calc(120 * var(--s)) var(--edge-r) calc(71 * var(--s)) var(--edge-l);
}
.site-footer__copy { color: var(--muted); }
@media (max-width: 767px) {
	.site-footer { flex-direction: column; padding: 96px var(--edge-l) 48px; gap: 10px; }
}

/* ---------------------------------------------------------------------------
   Gallery (posts page)
--------------------------------------------------------------------------- */
body.blog,
body.archive,
body.search { background: var(--wall); }

.gallery {
	padding: 0 var(--edge-r) 40px var(--edge-l);
	overflow: hidden; /* keeps the hover zoom + swing from causing scrollbars */
}

.gallery__title {
	position: relative;
	z-index: 2;
	font-size: var(--fs);
	font-weight: 600;
	margin: calc(120 * var(--s)) 0 clamp(72px, calc(110 * var(--s)), 140px);
	letter-spacing: var(--ls);
}

.gallery__empty { color: var(--muted); padding: 10vh 0; }

.wall {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center; /* hung on a common centre line, like a real gallery */
	gap: clamp(90px, 9vw, 150px) clamp(56px, 7vw, 120px);
	max-width: 1500px;
}

.art { position: relative; }

.art__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

/* Soft spotlight on the wall behind each piece */
.art::before {
	content: "";
	position: absolute;
	left: 50%;
	top: -18%;
	width: 170%;
	height: 135%;
	transform: translateX(-50%);
	background: radial-gradient(closest-side, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .5) 45%, rgba(255, 255, 255, 0) 100%);
	pointer-events: none;
	z-index: 0;
	transition: opacity .5s ease;
	opacity: .85;
}
.art:hover::before { opacity: 1; }

.art__hang {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-top: 46px;
	transform-origin: 50% 0;
	animation:
		ss-hang 1.7s cubic-bezier(.25, .8, .3, 1) both,
		ss-sway 9s ease-in-out infinite;
	animation-delay:
		calc(var(--i, 0) * 140ms + 120ms),
		calc(var(--i, 0) * 140ms + 1.8s);
}

/* Nail */
.art__hang::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	width: 7px;
	height: 7px;
	margin-left: -3.5px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #d8d4cc, #6f6a62 70%);
	box-shadow: 0 2px 3px rgba(0, 0, 0, .25);
	z-index: 2;
}

/* Hanging wire: two thin diagonals from the nail to the frame's top corners */
.art__wire {
	position: absolute;
	top: 3px;
	left: 50%;
	width: 56%;
	height: 47px;
	transform: translateX(-50%);
	pointer-events: none;
}
.art__wire::before,
.art__wire::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 50%;
}
.art__wire::before {
	left: 0;
	background: linear-gradient(to top left, transparent calc(50% - .7px), #8f8a82 50%, transparent calc(50% + .7px));
}
.art__wire::after {
	right: 0;
	background: linear-gradient(to top right, transparent calc(50% - .7px), #8f8a82 50%, transparent calc(50% + .7px));
}

/* Frame + mat */
.art__frame {
	position: relative;
	display: block;
	padding: 16px;
	background: #fff;
	border: 9px solid #151515;
	border-top-color: #1f1f1f;
	border-bottom-color: #0c0c0c;
	box-shadow:
		0 1px 1px rgba(0, 0, 0, .12),
		0 14px 24px -10px rgba(0, 0, 0, .28),
		0 38px 60px -30px rgba(0, 0, 0, .35);
	transition: transform .6s cubic-bezier(.2, .7, .2, 1), box-shadow .6s cubic-bezier(.2, .7, .2, 1);
	will-change: transform;
}
.art__frame::after { /* bevel shadow on the mat */
	content: "";
	position: absolute;
	inset: 0;
	box-shadow: inset 0 2px 5px rgba(0, 0, 0, .14);
	pointer-events: none;
}

.art__img {
	display: block;
	width: auto;
	max-width: none;
	object-fit: cover;
	background: #eee;
}
.art--portrait  .art__img { height: clamp(260px, 26vw, 380px); }
.art--square    .art__img { height: clamp(220px, 21vw, 300px); }
.art--landscape .art__img { height: clamp(190px, 18vw, 260px); }
.art__img--blank { aspect-ratio: 4 / 5; height: 300px; }

.art__link:hover .art__frame,
.art__link:focus-visible .art__frame {
	transform: scale(1.05);
	box-shadow:
		0 1px 1px rgba(0, 0, 0, .12),
		0 24px 34px -12px rgba(0, 0, 0, .32),
		0 60px 80px -36px rgba(0, 0, 0, .4);
}

.art__title {
	position: relative;
	z-index: 1;
	margin-top: 26px;
	max-width: 260px;
	text-align: center;
	font-size: 13px;
	line-height: 1.35;
	letter-spacing: 0;
	color: var(--ink-soft);
	transition: opacity .3s ease;
}
.art__link:hover .art__title { opacity: .65; }

@keyframes ss-hang {
	0%   { opacity: 0; transform: translateY(-36px) rotate(4.5deg); }
	35%  { opacity: 1; transform: translateY(0) rotate(-2.6deg); }
	58%  { transform: rotate(1.4deg); }
	76%  { transform: rotate(-.7deg); }
	90%  { transform: rotate(.25deg); }
	100% { opacity: 1; transform: rotate(0); }
}
@keyframes ss-sway {
	0%, 100% { transform: rotate(0); }
	30%      { transform: rotate(.45deg); }
	70%      { transform: rotate(-.45deg); }
}

.pager {
	display: flex;
	justify-content: center;
	gap: 28px;
	margin-top: 100px;
	font-size: 14px;
}
.pager .current { color: var(--muted); }

@media (max-width: 767px) {
	.gallery__title { margin: 72px 0 56px; }
	.wall { flex-direction: column; flex-wrap: nowrap; gap: 84px; }
	.art--portrait  .art__img { height: auto; width: 62vw; }
	.art--square    .art__img { height: auto; width: 62vw; }
	.art--landscape .art__img { height: auto; width: 66vw; }
	.art__frame { padding: 12px; border-width: 7px; }
	.art__title { margin-top: 20px; }
}

/* ---------------------------------------------------------------------------
   Single article
--------------------------------------------------------------------------- */
.article__hero {
	margin: calc(72 * var(--s)) 0 0;
	padding: clamp(32px, 6vw, 96px) var(--edge-l);
	background: var(--wall);
	display: flex;
	justify-content: center;
}
.article__hero-img {
	width: auto;
	max-width: 100%;
	max-height: 78vh;
	object-fit: contain;
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .35), 0 10px 20px -12px rgba(0, 0, 0, .2);
	animation: ss-rise 1.1s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes ss-rise {
	from { opacity: 0; transform: translateY(18px) scale(.985); }
	to   { opacity: 1; transform: none; }
}

.article__body {
	max-width: 680px;
	margin: 0 auto;
	padding: clamp(48px, 7vw, 88px) 24px 0;
}

.article__back {
	display: inline-block;
	font-size: 14px;
	letter-spacing: 0;
	margin-bottom: 36px;
}

.article__title {
	font-size: clamp(32px, 4.4vw, 52px);
	line-height: 1.06;
	letter-spacing: -0.03em;
	font-weight: 600;
	margin: 0 0 18px;
}

.article__meta {
	display: flex;
	gap: 8px;
	font-size: 14px;
	letter-spacing: 0;
	color: var(--muted);
	margin-bottom: 48px;
}

.article__content,
.article__lead {
	font-weight: 400;
	font-size: 18px;
	line-height: 1.7;
	letter-spacing: -0.005em;
	color: #1a1a1a;
}
.article__content > * + * { margin-top: 1.25em; }
.article__content h2,
.article__content h3 {
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.25;
	margin-top: 2.2em;
	color: var(--ink);
}
.article__content h2 { font-size: 24px; }
.article__content h3 { font-size: 20px; }
.article__content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article__content blockquote {
	margin: 2.2em 0;
	padding: 0 0 0 22px;
	border-left: 2px solid var(--ink);
	font-weight: 600;
	font-size: 22px;
	line-height: 1.4;
	letter-spacing: -0.015em;
	color: var(--ink);
}
.article__content blockquote p { margin: 0; }
.article__content img,
.article__content figure { max-width: 100%; height: auto; margin-left: 0; margin-right: 0; }
.article__content figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.article__content ul,
.article__content ol { padding-left: 1.2em; }

.article__more {
	max-width: 680px;
	margin: 96px auto 0;
	padding: 32px 24px 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	border-top: 1px solid #e6e3dd;
}
.article__more-link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 16px;
	letter-spacing: -0.01em;
	transition: opacity .3s ease;
}
.article__more-link span { font-size: 12px; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
.article__more-link:hover { opacity: .6; }
.article__more-link--prev { grid-column: 2; text-align: right; }

@media (max-width: 767px) {
	.article__hero { margin-top: 48px; padding: 28px 20px; }
	.article__hero-img { max-height: 70vh; }
	.article__body { padding-top: 40px; padding-left: var(--edge-l); padding-right: var(--edge-l); }
	.article__content { font-size: 17px; }
	.article__more { grid-template-columns: 1fr; padding-left: var(--edge-l); padding-right: var(--edge-l); }
	.article__more-link--prev { grid-column: auto; text-align: left; }
}

/* ---------------------------------------------------------------------------
   Reduced motion
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
	}
}
