/*
Theme Name:   Akram K
Theme URI:    https://akram-k.art
Description:  Painting portfolio theme for akram-k.art. Black and white, the paintings are the only colour. Light and dark mode with a sun/moon toggle. Needs the "Akram K Core" plugin for Galleries, Paintings and Workshops.
Version:      0.2.0
Requires at least: 6.4
Requires PHP: 7.4
Author:       akram-k.art
License:      GPL-2.0-or-later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  akram-k
Fonts:        Cormorant Garamond and Instrument Sans, SIL Open Font License 1.1, self-hosted in assets/fonts.
*/

/* ---------- Fonts (self-hosted, no calls to Google) ---------- */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 600; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }

/* ---------- Tokens: light by default, dark from the browser or the toggle ---------- */
:root {
	--bg: #ffffff;
	--fg: #151515;
	--muted: #5e5e5e;
	--line: #e3e3e3;
	--surface: #f4f4f4;
	--scrim: rgba(255, 255, 255, .96);
	--font-display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
	--font-body: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
	--step--1: .8125rem;
	--step-0: 1rem;
	--step-1: 1.25rem;
	--step-2: 1.75rem;
	--step-3: clamp(2.1rem, 1.6rem + 2vw, 3rem);
	--gutter: clamp(16px, 4vw, 48px);
	--max: 1240px;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #111111; --fg: #ecebe8; --muted: #a6a6a6; --line: #2b2b2b; --surface: #1a1a1a; --scrim: rgba(17, 17, 17, .97);
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #111111; --fg: #ecebe8; --muted: #a6a6a6; --line: #2b2b2b; --surface: #1a1a1a; --scrim: rgba(17, 17, 17, .97);
	color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
	margin: 0; background: var(--bg); color: var(--fg);
	font-family: var(--font-body); font-size: var(--step-0); line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.label { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; inset-block-start: -60px; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 50; }
.skip:focus { inset-block-start: 8px; }

/* ---------- Header ---------- */
.site-head { position: sticky; top: 0; z-index: 20; background: var(--bg); border-block-end: 1px solid var(--line); }
.admin-bar .site-head { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-head { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-head { top: 0; } }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 14px; }
.wordmark { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 2rem; line-height: 1; text-decoration: none; letter-spacing: .01em; }
.custom-logo-link img { max-height: 48px; width: auto; }
.head-right { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); }
.nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); margin: 0; padding: 0; list-style: none; }
.nav a { text-decoration: none; font-size: .9375rem; padding-block: 6px; border-block-end: 1px solid transparent; }
.nav a:hover { border-color: var(--muted); }
.nav a[aria-current="page"] { border-color: var(--fg); }
.mode { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; }
.mode:hover { border-color: var(--fg); }
.mode svg { width: 18px; height: 18px; }
.mode .moon { display: none; }
.is-dark .mode .sun { display: none; }
.is-dark .mode .moon { display: block; }

main { min-height: 60vh; }
main:focus { outline: none; }
section { padding-block: clamp(48px, 8vw, 96px); }
section + section { border-block-start: 1px solid var(--line); }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-block-end: 28px; }
.sec-head h1, .sec-head h2 { font-size: var(--step-3); }
.crumbs { font-size: var(--step--1); color: var(--muted); margin-block-end: 14px; }
.crumbs a { color: var(--muted); }
.intro { color: var(--muted); max-width: 60ch; margin-block-start: 12px; }
.empty { color: var(--muted); }

/* ---------- Painting tile ---------- */
.tile { display: flex; flex-direction: column; gap: 10px; padding: 0; border: 0; background: none; text-align: start; cursor: zoom-in; min-width: 0; }
.tile .frame { position: relative; overflow: hidden; background: var(--surface); }
.tile img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; transition: transform .5s ease; }
.tile:hover img { transform: scale(1.025); }
.tile .cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: .9375rem; }
.tile .t { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; line-height: 1.25; }

/* Status label: shape carries meaning, not colour */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--step--1); color: var(--muted); white-space: nowrap; }
.status i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.st-available { color: var(--fg); }
.st-available i { background: currentColor; }
.st-sold i { background: linear-gradient(135deg, transparent 40%, currentColor 40% 60%, transparent 60%); }

/* ---------- Featured strip ---------- */
.featured { padding-block: clamp(24px, 4vw, 40px) clamp(40px, 6vw, 72px); }
.strip { position: relative; display: flex; gap: clamp(12px, 2vw, 24px); overflow-x: auto; scroll-snap-type: x mandatory; padding-block-end: 14px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.strip .tile { flex: none; scroll-snap-align: start; }
.strip .tile img { height: clamp(240px, 52vh, 520px); width: auto; max-width: none; }
.strip-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-start: 8px; }
.arrows { display: flex; gap: 8px; }
.arrow { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; }
.arrow:hover:not(:disabled) { border-color: var(--fg); }
.arrow:disabled { opacity: .35; cursor: default; }
.arrow svg { width: 18px; height: 18px; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.about .portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about .text { display: grid; gap: 18px; max-width: 62ch; min-width: 0; }
.about .text h2 { font-size: var(--step-3); }
.about .text blockquote, .statement { margin: 8px 0 0; padding-inline-start: 20px; border-inline-start: 1px solid var(--fg); font-family: var(--font-display); font-style: italic; font-size: 1.45rem; line-height: 1.4; }
.about .text blockquote p { margin: 0; }
.about .text blockquote cite { display: block; font-size: var(--step--1); font-style: normal; font-family: var(--font-body); color: var(--muted); margin-block-start: 8px; }
.about.no-portrait { grid-template-columns: 1fr; }
@media (max-width: 720px) { .about { grid-template-columns: 1fr; } .about .portrait { max-width: 420px; } }

/* ---------- Contact ---------- */
.contact { display: grid; gap: 14px; max-width: 60ch; }
.contact h2 { font-size: var(--step-3); }
.soon { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 12px 16px; width: fit-content; }
.soon i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--fg); }
.contact-lines { display: grid; gap: 6px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.socials a { text-underline-offset: 4px; }

/* ---------- Gallery index ---------- */
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(20px, 3vw, 36px); }
.gcard { display: grid; gap: 12px; text-decoration: none; align-content: start; }
.gcard .frame { position: relative; overflow: hidden; background: var(--surface); aspect-ratio: 4 / 3; }
.gcard img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease; }
.gcard:hover img { transform: scale(1.025); }
.gcard h2 { font-size: var(--step-2); }
.gcard .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* ---------- Single gallery: justified rows that keep each painting's proportions ---------- */
.jgrid { display: flex; flex-wrap: wrap; gap: clamp(14px, 2vw, 24px); }
.jgrid > .tile { flex: var(--ar) 1 calc(var(--ar) * 220px); }
.jgrid::after { content: ""; flex: 10 1 0; }

/* ---------- Workshops ---------- */
.wlist { display: grid; gap: 28px; }
.wcard { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(18px, 3vw, 40px); align-items: center; text-decoration: none; padding-block-end: 28px; border-block-end: 1px solid var(--line); }
.wcard:last-child { border-block-end: 0; padding-block-end: 0; }
.wcard .frame { position: relative; overflow: hidden; background: var(--surface); aspect-ratio: 3 / 2; }
.wcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.wcard:hover img { transform: scale(1.025); }
.wcard .body { display: grid; gap: 8px; min-width: 0; }
.wcard h3 { font-size: var(--step-2); }
.wcard .more { font-size: .9375rem; text-decoration: underline; text-underline-offset: 4px; }
.past .wcard { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
@media (max-width: 640px) { .wcard, .past .wcard { grid-template-columns: 1fr; } }
.sub { font-family: var(--font-display); font-size: var(--step-2); margin-block-end: 18px; }
.past { margin-block-start: clamp(48px, 7vw, 80px); }

.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .9375rem; }
.meta span { display: inline-flex; gap: 6px; }

.wsingle h1 { font-size: var(--step-3); margin-block-start: 6px; }
.wsingle .photos { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; margin-block: 28px 40px; }
.wsingle .photos .tile:first-child { grid-row: span 2; }
.wsingle .photos .tile .frame, .wsingle .photos .tile img { height: 100%; }
.wsingle .photos .tile img { aspect-ratio: auto; }
.wsingle .photos.n1 { grid-template-columns: 1fr; grid-template-rows: auto; }
.wsingle .photos.n1 .tile img { aspect-ratio: 3 / 2; }
.wsingle .photos.n2 { grid-template-rows: auto; }
.wsingle .photos.n2 .tile:first-child { grid-row: auto; }
.wsingle .photos.n2 .tile img { aspect-ratio: 3 / 2; }
@media (max-width: 640px) {
	.wsingle .photos { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
	.wsingle .photos .tile:first-child { grid-column: span 2; grid-row: auto; }
	.wsingle .photos .tile img { aspect-ratio: 3 / 2; }
}
.wdetail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 64px); }
.wdetail .desc { display: grid; gap: 16px; max-width: 62ch; align-content: start; }
.facts { display: grid; gap: 20px; align-content: start; border-block-start: 1px solid var(--fg); padding-block-start: 18px; }
.facts dl { margin: 0; display: grid; gap: 14px; }
.facts dt { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.facts dd { margin: 2px 0 0; }
.facts ul { margin: 4px 0 0; padding-inline-start: 18px; }
@media (max-width: 760px) { .wdetail { grid-template-columns: 1fr; } }
.note { font-size: var(--step--1); color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--fg); color: var(--bg); text-decoration: none; padding: 13px 22px; font-weight: 500; border: 1px solid var(--fg); width: fit-content; }
.btn:hover { background: none; color: var(--fg); }

/* ---------- Single painting page ---------- */
.psingle { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.psingle .info { display: grid; gap: 14px; }
.psingle h1 { font-size: var(--step-3); }
@media (max-width: 760px) { .psingle { grid-template-columns: 1fr; } }

/* ---------- Ordinary pages (privacy, imprint) ---------- */
.entry { max-width: 68ch; display: grid; gap: 1em; }
.entry h1 { font-size: var(--step-3); }
.entry h2 { font-size: var(--step-2); margin-block-start: .6em; }
.entry h3 { font-size: var(--step-1); }
.entry ul, .entry ol { margin: 0; padding-inline-start: 1.3em; }
.entry a { text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.site-foot { border-block-start: 1px solid var(--line); }
.site-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 28px; font-size: var(--step--1); color: var(--muted); }
.site-foot .socials a { color: var(--fg); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.totop { background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--fg); text-decoration: underline; text-underline-offset: 4px; font-size: var(--step--1); }

/* ---------- Lightbox ---------- */
dialog.lb { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--scrim); color: var(--fg); }
dialog.lb::backdrop { background: var(--scrim); }
.lb-inner { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 12px var(--gutter) 16px; gap: 12px; }
.lb-top { display: flex; justify-content: space-between; align-items: center; font-size: var(--step--1); color: var(--muted); }
.lb-stage { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 0; touch-action: pan-y; }
.lb-fig { position: relative; height: 100%; display: grid; place-items: center; min-height: 0; margin: 0; }
.lb-fig img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 10px 40px rgba(0, 0, 0, .18); }
.lb-cap { display: grid; gap: 6px; max-width: 760px; width: 100%; margin-inline: auto; text-align: center; }
.lb-cap h2 { font-size: var(--step-2); }
.lb-cap .meta { justify-content: center; }
.lb-cap .noteline { color: var(--muted); font-size: .9375rem; }
.lb .close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; }
.lb .close:hover { border-color: var(--fg); }
.lb .close svg { width: 18px; height: 18px; }
.lb-data { display: none; }
@media (max-width: 640px) { .lb-stage { grid-template-columns: minmax(0, 1fr); } .lb-stage .arrow { display: none; } }
