/*
Theme Name: Abid Khan — Atelier
Theme URI: https://abidkhanart.com
Author: Abid Khan Studio
Description: A quiet gallery for the paintings of Abid Khan. Every word and image on the site is edited from the "Site Content" screen; paintings are added under "Arts".
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: All rights reserved
Text Domain: atelier
*/

/* ── Design tokens ───────────────────────────────────────────────
   Colours are warm and paper-like, never pure white or pure black:
   gallery walls are bone, and ink on paper is #17 not #00.        */
:root {
  --color-paper: #f6f5f2;
  --color-paper-raised: #fbfaf8;
  --color-ink: #171614;
  --color-muted: #86827a;
  --color-rule: #e3e0d9;
  --color-accent: #8a5a3c;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;

  --header-h: 4.25rem;
  /* How much of the page width a row of paintings takes. */
  --row-w: 84%;
  /* The tallest a single painting is shown on its own page. */
  --plate-h: 68vh;
  --gutter: clamp(1.25rem, 5vw, 6rem);
  --section: clamp(5rem, 14vh, 11rem);
  --ease-gallery: cubic-bezier(0.22, 0.61, 0.36, 1);

  --logo-h: 2rem;
}

@media (min-width: 40rem) {
  :root { --logo-h: 2.25rem; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-paper: #121211;
    --color-paper-raised: #1a1a18;
    --color-ink: #ecebe6;
    --color-muted: #8b877f;
    --color-rule: #2a2926;
    --color-accent: #c08f6a;
  }
}

:root[data-theme="dark"] {
  --color-paper: #121211;
  --color-paper-raised: #1a1a18;
  --color-ink: #ecebe6;
  --color-muted: #8b877f;
  --color-rule: #2a2926;
  --color-accent: #c08f6a;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
h1, h2, h3, h4, p, figure, dl, dd, ul, ol { margin: 0; }
h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; cursor: pointer; text-align: inherit; }
[hidden] { display: none !important; }

html {
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.7;
  scrollbar-gutter: stable;
}

::selection { background-color: var(--color-ink); color: var(--color-paper); }
:focus-visible { outline: 1px solid var(--color-ink); outline-offset: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}
.skip-link:focus {
  position: fixed; top: 1rem; left: 1rem; z-index: 60; width: auto; height: auto;
  margin: 0; clip: auto; overflow: visible; white-space: normal;
  background: var(--color-paper); padding: 0.5rem 1rem;
}

/* ── Type ──────────────────────────────────────────────────────────
   Large serif text is set tight (0.96) everywhere, paragraphs included —
   that is how the launch site renders it.                          */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 0.96;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.label {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.4;
}
.serif-italic { font-family: var(--font-display); font-style: italic; }
.muted { color: var(--color-muted); }
.dot { margin-inline: 0.5rem; opacity: 0.5; }
.rule-top { border-top: 1px solid var(--color-rule); padding-top: 1.25rem; }

.link-quiet { position: relative; display: inline-block; }
.link-quiet::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15em;
  height: 1px;
  width: 100%;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease-gallery);
}
.link-quiet:hover::after,
.link-quiet:focus-visible::after { transform: scaleX(1); }
.link-quiet[aria-current="page"]::after { transform: scaleX(1); background-color: var(--color-muted); }

/* ── Layout helpers ────────────────────────────────────────────── */
.wrap { padding-inline: var(--gutter); }
.page-top { padding-top: 28vh; }
.grid12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
}
.grid12 > * { grid-column: span 12 / span 12; }
.section-gap { margin-top: var(--section); }

.page-title { font-size: clamp(2.75rem, 9vw, 7rem); }
.lead { font-size: clamp(1.35rem, 2.6vw, 2.05rem); }

/* ── Scroll reveal ─────────────────────────────────────────────────
   Only hidden once JavaScript has confirmed it can reveal them, so the
   content is never trapped behind a failed script.                 */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s var(--ease-gallery), transform 1s var(--ease-gallery);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ── Plates (photographs of paintings) ───────────────────────────── */
.plate { position: relative; overflow: hidden; }
.plate--cover { height: 100%; width: 100%; }
.plate img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: opacity 1.1s var(--ease-gallery), transform 1.4s var(--ease-gallery);
}
.js .plate[data-loaded="false"] img { opacity: 0; }
a:hover .plate img { transform: scale(1.018); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .plate img, .link-quiet::after { transition: none; }
  a:hover .plate img { transform: none; }
  .hero-layer { transition: none !important; }
}

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  background-color: var(--color-paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.5s, background-color 0.5s;
}
.site-header.is-scrolled:not(.is-open) { border-bottom-color: var(--color-rule); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.site-header__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 1.25rem;
  padding-inline: var(--gutter);
}
.site-header__home { flex-shrink: 0; }
.site-logo { display: block; object-fit: contain; height: var(--logo-h); width: auto; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-logo { filter: invert(1); }
}
:root[data-theme="dark"] .site-logo { filter: invert(1); }

.site-nav { display: none; align-items: baseline; gap: 2rem; }
.menu-toggle { display: inline; }
.mobile-nav { height: 100dvh; background-color: var(--color-paper); }
.mobile-nav nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 12vh;
  padding-inline: var(--gutter);
}
.mobile-nav a { font-size: clamp(2.5rem, 13vw, 4rem); }
.mobile-nav a[aria-current="page"] { color: var(--color-muted); }

/* ── Home ───────────────────────────────────────────────────────── */
.hero {
  height: clamp(52vh, 70vh, 46rem);
  width: 100%;
  padding-top: var(--header-h);
}
.hero-plates { position: relative; height: 100%; width: 100%; overflow: hidden; }
.hero-layer {
  position: absolute;
  inset: 0;
  transition: opacity 2200ms var(--ease-gallery);
}

.intro { padding-block: calc(var(--section) * 0.72); }
.intro__name { font-size: clamp(3rem, 11vw, 9.5rem); }
.intro__meta { margin-top: 1.5rem; }
.intro__hook {
  margin-top: 4rem;
  max-width: 18ch;
  font-size: clamp(1.75rem, 4.2vw, 3.25rem);
}
.intro__line { margin-top: 1.5rem; max-width: 44ch; }

.rows {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  row-gap: 4rem;
}
.rows--index { margin-top: 5rem; }
.more-link { margin-top: 4rem; }

.interstitial {
  height: clamp(38vh, 52vh, 34rem);
  width: 100%;
  margin-block: var(--section);
}

.statement { margin-top: 2.5rem; }
.statement p { margin-bottom: 1.75rem; }
.statement .link-quiet { margin-top: 1.5rem; }

/* ── A row of paintings hung at a common height ─────────────────────
   Each painting grows in proportion to its own aspect ratio, so the tops
   and bottoms line up exactly without cropping anything.           */
.work-row { display: flex; flex-direction: column; row-gap: 3.5rem; }
.work-row__item { min-width: 0; }
.work-link { display: block; }

.wall-label { margin-top: 1rem; font-size: 0.8125rem; line-height: 1.625; }
.wall-label__title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-style: italic;
  letter-spacing: -0.025em;
}
.wall-label__details { margin-top: 0.25rem; display: block; }
.wall-label__sep { margin-inline: 0.375rem; opacity: 0.5; }

/* ── A single work ─────────────────────────────────────────────── */
.work-page { padding-top: 20vh; }
.work-frame { margin-inline: auto; width: 100%; }
.viewer-button { display: block; width: 100%; cursor: zoom-in; }
.work-label { margin-top: 2.5rem; row-gap: 2rem; }
.work-label h1 { font-size: clamp(1.85rem, 4.5vw, 3rem); font-style: italic; }
.work-label__details { margin-top: 1rem; }
.work-label__hint { margin-top: 0.75rem; opacity: 0.6; }
.work-text p { margin-bottom: 1.25rem; max-width: 54ch; }
.work-enquire { margin-top: 3rem; border-top: 1px solid var(--color-rule); padding-top: 1.5rem; }
.work-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--color-rule);
  padding-top: 1.5rem;
  margin-top: calc(var(--section) * 0.6);
}
.work-nav a { max-width: 45%; }
.work-nav__next { text-align: right; }

/* The loupe — a circular window onto the full-resolution photograph. */
.loupe-host { position: relative; }
.loupe {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  border-radius: 9999px;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-gallery);
  will-change: transform;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--color-paper) 85%, transparent),
    0 0 0 3px color-mix(in srgb, var(--color-ink) 22%, transparent),
    0 26px 60px -18px rgb(0 0 0 / 0.55);
}
.loupe-host[data-active="true"] .loupe { opacity: 1; }
.loupe-host[data-active="true"] { cursor: none; }
@media (hover: none), (pointer: coarse) {
  .loupe-hint { display: none; }
}

/* Full-screen view */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background-color: rgb(11 11 10 / 0.97);
  backdrop-filter: blur(4px);
}
.lightbox__top, .lightbox__bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-inline: var(--gutter);
}
.lightbox__top { padding-block: 1.25rem; }
.lightbox__bottom { padding-block: 1.5rem; }
.lightbox__stage { position: relative; min-height: 0; flex: 1 1 0%; margin-inline: var(--gutter); }
.lightbox__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lightbox__count { color: rgb(255 255 255 / 0.55); }
.lightbox__btn { color: rgb(255 255 255 / 0.55); transition: color 0.2s; }
.lightbox__btn--close { color: rgb(255 255 255 / 0.75); }
.lightbox__btn:hover { color: #fff; }
.lightbox__caption { text-align: center; }
.lightbox__title { font-family: var(--font-display); font-size: 1.2rem; font-style: italic; color: rgb(255 255 255 / 0.9); }
.lightbox__medium { margin-top: 0.25rem; display: block; color: rgb(255 255 255 / 0.45); }

/* ── About ─────────────────────────────────────────────────────── */
.about-grid, .contact-grid { margin-top: 5rem; row-gap: 4rem; }
.bio p { margin-bottom: 1.25rem; max-width: 46ch; }
.bio p:first-child {
  margin-bottom: 1.75rem;
  max-width: none;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}
.facts { margin-top: 2rem; }
.facts li { border-top: 1px solid var(--color-rule); padding-top: 0.75rem; }
.facts li + li { margin-top: 0.75rem; }

.section-body { margin-top: 3rem; }
.artist-statement p { margin-bottom: 1.25rem; max-width: 52ch; }
.artist-statement p:first-child { margin-bottom: 1.75rem; max-width: none; }

.milestone { border-bottom: 1px solid var(--color-rule); padding-block: 1.5rem; }
.milestone dt, .education dt { grid-column: span 3 / span 3; }
.milestone dd, .education dd { grid-column: span 9 / span 9; }
.milestone__title { font-family: var(--font-display); font-size: 1.25rem; font-style: italic; }
.milestone__detail { margin-top: 0.25rem; display: block; max-width: 52ch; font-size: 0.875rem; }
.education-block { margin-top: 4rem; }
.education { margin-top: 1.5rem; }
.education > div { border-top: 1px solid var(--color-rule); padding-block: 1.25rem; }
.education dd { font-size: 0.9375rem; }

/* ── Contact ───────────────────────────────────────────────────── */
.contact-note { max-width: 24ch; }
.contact-details { margin-top: 3.5rem; }
.contact-details > div + div { margin-top: 2rem; }
.contact-details dd { margin-top: 0.5rem; font-size: 1.0625rem; }
.contact-emails { display: flex; flex-direction: column; gap: 0.25rem; }
.contact-emails a { width: fit-content; }
.commission { margin-top: 4rem; border-top: 1px solid var(--color-rule); padding-top: 2rem; }
.commission p { margin-top: 1rem; max-width: 46ch; }

/* ── 404 ───────────────────────────────────────────────────────── */
.not-found {
  display: flex;
  min-height: 70vh;
  flex-direction: column;
  justify-content: center;
  padding-top: 24vh;
}
.not-found h1 { font-size: clamp(2.5rem, 8vw, 6rem); }
.not-found p { margin-top: 1.5rem; max-width: 38ch; }
.not-found__links { margin-top: 2.5rem; display: flex; gap: 2rem; }

/* ── Plain pages (anything added under Pages) ─────────────────── */
.plain-content { margin-top: 3rem; max-width: 60ch; }
.plain-content > * + * { margin-top: 1.25rem; }
.plain-content a { text-decoration: underline; text-underline-offset: 0.2em; }
.plain-content img { margin-block: 2rem; }

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-rule);
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  padding-inline: var(--gutter);
  margin-top: var(--section);
}
.newsletter {
  margin-bottom: 3rem;
  row-gap: 1.5rem;
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: 3rem;
}
.newsletter__text {
  margin-top: 1rem;
  max-width: 26ch;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
}
.footer-cols { display: flex; flex-direction: column; gap: 2rem; }
.footer-cols nav, .footer-social { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-copy { margin-top: 3.5rem; }

.reach-form iframe {
  width: 100% !important;
  min-height: 420px;
  border: 0;
  display: block;
  color-scheme: light;
}
@media (max-width: 640px) {
  .reach-form iframe { min-height: 460px; }
}

/* ── From the small breakpoint up ───────────────────────────────── */
@media (min-width: 40rem) {
  .page-top { padding-top: 32vh; }
  .site-nav { display: flex; }
  .menu-toggle, .mobile-nav { display: none !important; }

  .intro__hook { margin-top: 6rem; }
  .rows { margin-top: 5rem; row-gap: 7rem; }
  .rows--index { margin-top: 8rem; }
  .more-link { margin-top: 6rem; }
  .statement { margin-top: 4rem; }
  .statement__body { grid-column: 4 / span 7; }

  .work-row {
    flex-direction: row;
    align-items: flex-start;
    column-gap: 2rem;
    margin-inline: auto;
    width: var(--row-w);
  }
  .work-row__item { flex-basis: 0; flex-grow: var(--grow); }

  .work-page { padding-top: 24vh; }
  .work-label { margin-top: 3rem; }
  .work-label__main { grid-column: span 7 / span 7; }

  .about-grid, .contact-grid { margin-top: 7rem; }
  .bio { grid-column: 1 / span 6; }
  .about-aside { grid-column: 9 / span 4; }
  .section-body { margin-top: 4rem; }
  .artist-statement { grid-column: 4 / span 7; }
  .milestone dt, .education dt { grid-column: span 2 / span 2; }
  .milestone dd, .education dd { grid-column: 3 / span 9; }

  .contact-main { grid-column: span 6 / span 6; }
  .contact-aside { grid-column: 8 / span 5; }

  .newsletter__intro { grid-column: span 5 / span 5; }
  .newsletter__form { grid-column: 7 / span 6; }
  .footer-cols { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .footer-cols nav, .footer-social { align-items: flex-end; }
}
