/*
Theme Name: Hamachbesa
Text Domain: hamachbesa
Description: תבנית גלריית המכבסה – מינימליסטית, מימין לשמאל, נגישה. עובדת עם התוסף ליבת הגלריה.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Author: Ad Twisters
License: GPL-2.0-or-later
WPVibe: yes
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #faf9f6;
	--surface: #f1efea;
	--ink: #161616;
	--ink-soft: #55534e;
	--line: #dedbd3;
	--accent: #8a3b24;
	--accent-ink: #ffffff;
	--focus: #1a5fb4;

	--font-display: "Frank Ruhl Libre", "David", serif;
	--font-body: "Assistant", "Arial Hebrew", Arial, sans-serif;

	--wrap: 1240px;
	--gutter: clamp(20px, 4vw, 48px);
	--space: clamp(56px, 8vw, 112px);
	--radius: 2px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@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(--ink);
	font-family: var(--font-body);
	font-size: 18px;
	line-height: 1.7;
	direction: rtl;
	text-align: right;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; top: -100px; right: 16px; z-index: 100;
	background: var(--ink); color: #fff; padding: 10px 16px;
}
.skip-link:focus { top: 16px; color: #fff; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; }
.muted { color: var(--ink-soft); }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }
.eyebrow { font-size: .85rem; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: .6em; }

.button {
	display: inline-block; padding: 12px 28px;
	background: var(--ink); color: #fff; text-decoration: none;
	border-radius: var(--radius); font-weight: 600;
}
.button:hover { background: var(--accent); color: var(--accent-ink); }
.link-more { font-weight: 600; text-decoration: underline; }
.link-more::after { content: " ←"; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; }
.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-logo__img { height: 56px; width: auto; }
.site-logo__text { font-family: var(--font-display); font-size: 1.35rem; }
.site-logo:has(.site-logo__img) .site-logo__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

.nav__list { list-style: none; display: flex; gap: 32px; margin: 0; padding: 0; }
.nav__list a { text-decoration: none; font-size: 1.05rem; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav__list a:hover,
.nav__list .current-menu-item > a,
.nav__list a[aria-current="page"] { border-bottom-color: currentColor; color: var(--ink); }

.nav-toggle { display: none; background: none; border: 0; padding: 12px; cursor: pointer; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
	display: block; width: 24px; height: 2px; background: var(--ink); position: relative; content: "";
}
.nav-toggle__bars::before { position: absolute; top: -7px; }
.nav-toggle__bars::after { position: absolute; top: 7px; }

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); }
	.nav.is-open { display: block; }
	.nav__list { flex-direction: column; gap: 0; padding: 8px var(--gutter) 20px; }
	.nav__list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
.site-main:focus { outline: none; }
.section { padding-block: var(--space); }
.section--tight { padding-block: 32px var(--space); }
.section--tint { background: var(--surface); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-head { padding-top: clamp(40px, 6vw, 80px); padding-bottom: 16px; }
.page-title { font-size: clamp(2.2rem, 5vw, 3.6rem); }

.grid { display: grid; gap: clamp(20px, 3vw, 40px); }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1024px) { .grid--4, .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
	.grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
	.grid--4, .grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card__media .card__img,
.hero__media .hero__img { position: absolute; inset: 0; }
.card__media, .hero__media { position: relative; }

.split > *, .hero__inner > *, .exhibition__body > *, .artist__head > * { min-width: 0; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.card__link { display: block; text-decoration: none; color: inherit; }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden; }
.card__media--portrait { aspect-ratio: 1; border-radius: 50%; }
.card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card__link:hover .card__img { transform: scale(1.03); }
.card__body { padding-top: 14px; }
.card__title { font-size: 1.35rem; margin-bottom: .2em; }
.card__link:hover .card__title { color: var(--accent); }
.card__meta { color: var(--ink-soft); margin: 0; }
.card__date { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.card--artist { text-align: center; }
.card--artist .card__title { font-size: 1.15rem; }
.card__initial { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--font-display); font-size: 3rem; color: var(--ink-soft); }
.badge {
	position: absolute; top: 12px; inset-inline-start: 12px;
	background: var(--ink); color: #fff; font-size: .8rem; padding: 4px 10px;
}
.badge--upcoming { background: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(32px, 5vw, 64px); }
.hero__inner { display: grid; grid-template-columns: 3fr 2fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero__media { aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden; }
.hero__img { width: 100%; height: 100%; object-fit: cover; }
.hero__title { font-size: clamp(2.6rem, 6vw, 4.6rem); margin-bottom: .2em; }
.hero__artists { font-size: 1.3rem; margin-bottom: .2em; }
.hero__dates { color: var(--ink-soft); }
.hero__excerpt { color: var(--ink-soft); margin-bottom: 1.6em; }
@media (max-width: 860px) { .hero__inner { grid-template-columns: 1fr; } }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.filters a { text-decoration: none; border: 1px solid var(--line); padding: 6px 16px; border-radius: 999px; font-size: .95rem; }
.filters a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Single exhibition / artist ---------- */
.exhibition__head { padding-top: clamp(40px, 6vw, 80px); }
.exhibition__artists { font-size: 1.35rem; }
.exhibition__artists a { text-decoration: underline; }
.exhibition__cover { margin-block: 24px 48px; }
.exhibition__cover-img { width: 100%; max-height: 78vh; object-fit: contain; background: var(--surface); }
.exhibition__body { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(32px, 6vw, 96px); padding-bottom: 48px; }
@media (max-width: 860px) { .exhibition__body { grid-template-columns: 1fr; } }

.details dl { margin: 0; border-top: 1px solid var(--line); }
.details dt { font-size: .85rem; color: var(--ink-soft); padding-top: 14px; }
.details dd { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }

.prose { max-width: 68ch; }
.prose blockquote { margin: 1.5em 0; padding-inline-start: 24px; border-inline-start: 2px solid var(--accent); font-family: var(--font-display); font-size: 1.1rem; }
.prose cite { display: block; font-style: normal; color: var(--ink-soft); font-size: .9rem; font-family: var(--font-body); }
.prose h2 { font-size: 1.8rem; margin-top: 1.6em; }
.prose ul { padding-inline-start: 1.2em; }
.video { margin-top: 32px; aspect-ratio: 16/9; }
.video iframe { width: 100%; height: 100%; }

.artist__head { display: grid; grid-template-columns: 300px 1fr; gap: clamp(32px, 6vw, 80px); padding-top: clamp(40px, 6vw, 80px); padding-bottom: 48px; align-items: start; }
.artist__portrait { aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--surface); }
.artist__img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .artist__head { grid-template-columns: 1fr; } .artist__portrait { max-width: 220px; } }
.inline-links { list-style: none; padding: 0; display: flex; gap: 20px; }

/* ---------- Gallery ---------- */
.gallery { padding-bottom: var(--space); }
.gallery__grid { list-style: none; margin: 0; padding: 0; columns: 3 280px; column-gap: 20px; }
.gallery__item { break-inside: avoid; margin-bottom: 20px; }
.gallery__link { display: block; cursor: zoom-in; }
.gallery__img { width: 100%; height: auto; transition: opacity .3s; }
.gallery__link:hover .gallery__img { opacity: .88; }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(12, 12, 12, .96); color: #fff; }
.lightbox::backdrop { background: rgba(12, 12, 12, .96); }
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox__figure { margin: 0; display: grid; place-items: center; height: 100vh; padding: 48px 0; }
.lightbox__img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.lightbox__caption { margin-top: 12px; color: #ccc; font-size: .95rem; }
.lightbox__close, .lightbox__nav { background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; padding: 8px; line-height: 1; }
.lightbox__close { position: absolute; top: 12px; inset-inline-end: 20px; }
.lightbox__nav:hover, .lightbox__close:hover { color: #e6b8a8; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-top: 56px; font-size: 1rem; }
.site-footer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.site-footer__title { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: .4em; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-block: 20px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .9rem; }
.site-footer__bottom p { margin: 0; }
.social { list-style: none; padding: 0; margin: 0; display: flex; gap: 16px; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; } }

.visit { background: var(--surface); padding: 32px; }
.list-item { padding-block: 24px; border-bottom: 1px solid var(--line); }
