/* austenangell.art: one stylesheet for the public site and the admin. */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5e5d58;
  --accent: #2a3f9d;
  --accent-text: #ffffff;
  --border: #dcd9d2;
  --placeholder: #e7e4dd;
  --placeholder-line: #b9b5ab;
  --ok: #2f6b3a;
  --warn: #8a5a00;
  --error: #a3261c;

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --measure: 68ch;
  --radius: 2px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1b1b1a;
    --text: #ecebe6;
    --muted: #a8a59d;
    --accent: #9fb2ff;
    --accent-text: #10131f;
    --border: #34332f;
    --placeholder: #242421;
    --placeholder-line: #55534c;
    --ok: #7fc48c;
    --warn: #e0b15a;
    --error: #ff8a80;
  }
}
:root[data-theme="dark"] {
  --bg: #121211;
  --surface: #1b1b1a;
  --text: #ecebe6;
  --muted: #a8a59d;
  --accent: #9fb2ff;
  --accent-text: #10131f;
  --border: #34332f;
  --placeholder: #242421;
  --placeholder-line: #55534c;
  --ok: #7fc48c;
  --warn: #e0b15a;
  --error: #ff8a80;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.measure { max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { font-family: var(--font-display); font-size: 1.35rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-size: 0.9375rem; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); padding: 6px 12px; font: inherit; cursor: pointer; border-radius: var(--radius); }
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 72px; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px var(--gutter) 16px; flex-direction: column; gap: 4px; z-index: 5; }
  .nav.open { display: flex; }
  .site-header { position: relative; }
}

.site-footer { border-top: 1px solid var(--border); margin-top: 96px; padding: 32px 0 48px; color: var(--muted); font-size: 0.875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer a { color: var(--muted); }
.theme-toggle { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

main { display: block; padding-top: 56px; }
section + section { margin-top: 88px; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: end; }
.hero p.lede { font-family: var(--font-display); font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.45; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); padding: 10px 18px; border-radius: var(--radius); font: 500 0.9375rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.small { padding: 6px 12px; font-size: 0.8125rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Artwork frames and placeholders */
.frame { position: relative; background: var(--placeholder); overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.placeholder {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--placeholder);
  background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), var(--placeholder-line) 50%, transparent calc(50% + 0.5px)),
                    linear-gradient(to top left, transparent calc(50% - 0.5px), var(--placeholder-line) 50%, transparent calc(50% + 0.5px));
  border: 1px dashed var(--placeholder-line);
  color: var(--muted);
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.4;
  padding: 10px 12px;
}
.placeholder .ph-top, .placeholder .ph-bottom { background: var(--placeholder); align-self: flex-start; padding: 2px 6px; }
.placeholder .ph-bottom { align-self: flex-end; }

/* Gallery grid: rows of equal height, each tile keeps its proportion. */
.gallery { display: flex; flex-wrap: wrap; gap: clamp(16px, 2.4vw, 32px); }
.gallery .tile { flex-grow: var(--ratio); flex-basis: calc(var(--ratio) * 260px); min-width: 0; text-decoration: none; color: inherit; }
.gallery .tile .frame { aspect-ratio: var(--ar); width: 100%; }
.gallery .tile .caption { margin-top: 10px; font-size: 0.875rem; }
.gallery .tile .caption .title { font-family: var(--font-display); font-size: 1.05rem; color: var(--text); }
.gallery::after { content: ""; flex-grow: 999; }
@media (max-width: 560px) { .gallery .tile { flex-basis: 100%; } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 32px; }
.chip { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.875rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.badge { display: inline-block; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; color: var(--muted); }
.badge.available { color: var(--ok); border-color: currentColor; }
.badge.sold { color: var(--muted); }
.badge.hold { color: var(--warn); border-color: currentColor; }

.notice { border-left: 3px solid var(--accent); background: var(--surface); padding: 14px 18px; margin: 24px 0; }
.notice.warn { border-left-color: var(--warn); }

/* Artwork detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.detail .stage { display: flex; justify-content: center; background: var(--surface); padding: clamp(16px, 4vw, 56px); }
.detail .stage .frame { max-height: 78vh; max-width: 100%; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 24px 0; font-size: 0.9375rem; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.thumbs button { border: 1px solid var(--border); padding: 0; background: none; width: 64px; height: 64px; cursor: pointer; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }

/* Lists: reading, news, writing */
.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.list > li { border-bottom: 1px solid var(--border); padding: 20px 0; }
.person { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr) minmax(0, 1.4fr); gap: 8px 24px; }
.person .name { font-family: var(--font-display); font-size: 1.2rem; }
.person .works { font-style: italic; }
@media (max-width: 760px) { .person { grid-template-columns: 1fr; } }

.news-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 24px; }
.news-item .meta { color: var(--muted); font-size: 0.8125rem; }
.news-item h3 { font-size: 1.15rem; margin: 0 0 4px; }
.news-item h3 a { color: var(--text); text-decoration: none; }
.news-item h3 a:hover { text-decoration: underline; }
.news-item .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 600px) { .news-item { grid-template-columns: 1fr; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0; }
input[type="search"], input[type="text"], input[type="email"], input[type="number"], input[type="url"], input[type="password"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; width: 100%;
}
textarea { min-height: 140px; resize: vertical; }
label { display: block; font-size: 0.875rem; margin-bottom: 6px; color: var(--muted); }
.field { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -5000px; }

.quote { font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.4; border: 0; margin: 0; padding: 0; }
.propositions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 800px) { .propositions { grid-template-columns: 1fr; } }
.prose { max-width: var(--measure); font-size: 1.0625rem; }
.prose p { margin-bottom: 1.1em; }
.prose h2 { margin-top: 1.6em; }

/* Admin */
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.admin-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); font: inherit; cursor: pointer; }
.admin-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--border); padding: 20px; margin-bottom: 20px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; background: var(--bg); position: sticky; top: 0; }
td input, td select { padding: 5px 8px; min-width: 90px; }
.status { font-size: 0.875rem; margin-top: 8px; min-height: 1.4em; }
.status.ok { color: var(--ok); }
.status.error { color: var(--error); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card-grid .card { border: 1px solid var(--border); background: var(--bg); padding: 12px; }
.card-grid .card img { width: 100%; border: 1px solid var(--border); }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; font-size: 0.75rem; }
.calendar .day { border: 1px solid var(--border); min-height: 72px; padding: 4px; background: var(--bg); overflow: hidden; }
.calendar .day .n { color: var(--muted); }
.calendar .day .post { background: var(--surface); border-left: 2px solid var(--accent); padding: 2px 4px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar .dow { color: var(--muted); text-align: center; padding: 4px 0; }

@media (prefers-reduced-motion: no-preference) {
  .gallery .tile .frame { transition: opacity 0.2s; }
  .gallery .tile:hover .frame { opacity: 0.92; }
}
