/* ============================================================
   grayjfolio.com — Template B
   Light mode · serif headings (Fraunces) · terracotta accent
   Gallery-wall feel: framed mats, uniform tiles, generous whitespace
   ============================================================ */

:root {
  /* Palette — warm gallery */
  --bg: #faf6f0;            /* warm cream paper */
  --surface: #ffffff;       /* mat / card white */
  --ink: #2b2622;           /* near-black warm ink */
  --ink-soft: #6f655c;      /* muted body text */
  --ink-faint: #9c9189;     /* captions, meta */
  --line: #e7ddd1;          /* hairline borders */
  --frame: #d9cdbd;         /* frame edge */
  --accent: #c4622d;        /* muted terracotta-orange */
  --accent-soft: #e89b6c;   /* lighter terracotta for hover */
  --accent-wash: #f6e7da;   /* faint accent background */
  --shadow: 0 1px 2px rgba(43, 38, 34, 0.04), 0 8px 24px rgba(43, 38, 34, 0.06);
  --shadow-hover: 0 2px 6px rgba(43, 38, 34, 0.08), 0 16px 40px rgba(43, 38, 34, 0.12);

  /* Type */
  --serif: "Fraunces", "Lora", Georgia, "Times New Roman", serif;
  --display: "Lora", "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Rhythm */
  --maxw: 1120px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;
}

/* Dark mode — optional, kept subtle so light remains the identity */
:root[data-theme="dark"] {
  --bg: #211e1b;
  --surface: #2b2724;
  --ink: #f3ece3;
  --ink-soft: #c3b8ac;
  --ink-faint: #8d8278;
  --line: #3a342f;
  --frame: #453e37;
  --accent: #e08a52;
  --accent-soft: #eaa476;
  --accent-wash: #3a2c21;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links a {
  font-size: 0.95rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.nav-links a:hover { color: var(--accent); }

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.25rem);
  text-align: center;
}
.hero .eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}
.hero p {
  max-width: 36rem;
  margin: 0 auto;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ---------- Section headers ---------- */
.section { padding: clamp(0.5rem, 1.5vw, 1.25rem) 0 clamp(3.5rem, 8vw, 6rem); }
.section-head {
  text-align: center;
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 0.5rem;
}
.section-head p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 1.02rem;
}

/* ---------- Year groups ---------- */
.year-group { margin-bottom: clamp(2.75rem, 6vw, 4.5rem); }
.year-label {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-align: center;
  margin: 0 0 1.75rem;
  position: relative;
}
.year-label span {
  background: var(--bg);
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}
.year-label::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--line);
  z-index: 0;
}

/* ---------- Art grid: framed mats, uniform ---------- */
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
}
.art-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 0.25s ease;
}
.art-card:hover { transform: translateY(-4px); }

/* The frame + mat — gallery feel */
.frame {
  background: var(--surface);
  border: 1px solid var(--frame);
  border-radius: var(--radius);
  padding: clamp(0.9rem, 2.5vw, 1.5rem);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease;
}
.art-card:hover .frame { box-shadow: var(--shadow-hover); }

/* Uniform image window inside the mat */
.art-window {
  aspect-ratio: 4 / 3;
  background: var(--accent-wash);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder tile look */
.placeholder {
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* Wall label beneath frame */
.art-label {
  margin-top: 1rem;
}
.art-label .title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--ink);
  margin: 0;
}
.art-label .meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
  margin: 0.2rem 0 0;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.contact-inner {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 5.5rem) var(--gutter);
  text-align: center;
}
.contact h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 0.6rem;
}
.contact p.lead {
  color: var(--ink-soft);
  margin: 0 0 2.25rem;
}
.field { text-align: left; margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.field textarea { resize: vertical; min-height: 130px; }

/* Honeypot */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0.9rem 2.4rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover { background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }

.form-status {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.4em;
  color: var(--ink-soft);
}
.form-status.error { color: #b3402a; }
.form-status.ok { color: #4a7c3f; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2.5rem var(--gutter);
  color: var(--ink-faint);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

/* ============================================================
   Art detail page — museum placard
   ============================================================ */
.detail {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}
.back-link:hover { color: var(--accent); }

.placard {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
/* The hung artwork */
.placard-frame {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--frame);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2.75rem);
  box-shadow: var(--shadow-hover);
  max-width: 100%;
}
.placard-frame img {
  border: 1px solid var(--line);
  border-radius: 2px;
  max-height: 70vh;
  width: auto;
  margin: 0 auto;
}

/* Wall label beneath */
.wall-label {
  margin: clamp(2rem, 5vw, 3rem) auto 0;
  max-width: 30rem;
  padding-top: 1.75rem;
  border-top: 2px solid var(--accent);
}
.wall-label h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.6rem;
  line-height: 1.15;
}
.wall-label .placard-meta {
  font-size: 0.95rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin: 0;
}
.wall-label .placard-meta em {
  font-style: italic;
  color: var(--ink-faint);
}
.wall-label .description {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* Prev / next pager */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 760px;
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.pager a {
  flex: 1;
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 45%;
}
.pager a:hover { color: var(--accent); }
.pager .next { text-align: right; }
.pager .pager-dir {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.2rem;
}
.pager .disabled { visibility: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links { gap: 1.15rem; }
  .nav-links a.nav-collapse { display: none; }
  .art-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.5rem; }
}
