/* juicergallery — photo-first gallery theme for juicer.
 *
 * Conventions match the rest of the bundled themes: CSS variables for
 * design tokens, [data-theme="dark"] overrides, semantic
 * .juicergallery-* class names, no utility framework. Tiny inline JS
 * for theme toggle is the only script.
 *
 * Aesthetic: a near-black ink on warm-white, with a single amber
 * accent for hover. Photos are the page; chrome stays out of the
 * way. Masonry grid uses pure CSS column-count — no JS layout.
 */

/* ============================================================
   Tokens
   ============================================================ */
:root {
  --brand:        #1f2937;   /* near-black ink */
  --brand-strong: #0b1220;
  --brand-soft:   #e5e7eb;
  --accent:       #b45309;   /* amber accent for hover */
  --accent-soft:  #fde68a;

  --bg:           #fbfaf7;   /* warm off-white */
  --bg-soft:      #f3f1ec;
  --surface:      #ffffff;
  --surface-soft: #efece5;
  --ink:          #1c1b18;
  --ink-soft:     #4a473f;
  --ink-faint:    #8a8678;
  --rule:         #e5e2d8;
  --rule-soft:    #efece5;

  --font-sans:  -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-serif: 'Iowan Old Style', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-mono:  ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --measure:    62ch;
  --gutter:     1rem;
  --max-w:      84rem;
  --max-w-page: 56rem;

  --radius:     0.25rem;
  --radius-lg:  0.375rem;
  --shadow-sm:  0 1px 2px 0 rgba(28, 27, 24, 0.05);
  --shadow-md:  0 8px 24px -6px rgba(28, 27, 24, 0.16);
  --transition: 0.18s ease;
}

[data-theme="dark"] {
  --brand:        #f3f1ec;
  --brand-strong: #ffffff;
  --brand-soft:   rgba(243, 241, 236, 0.16);
  --accent:       #f59e0b;
  --accent-soft:  rgba(245, 158, 11, 0.18);

  --bg:           #121110;
  --bg-soft:      #1a1816;
  --surface:      #1a1816;
  --surface-soft: #1f1d1a;
  --ink:          #f3f1ec;
  --ink-soft:     #c7c2b3;
  --ink-faint:    #8a8678;
  --rule:         #2a2724;
  --rule-soft:    #221f1c;

  --shadow-sm:    0 1px 2px 0 rgba(0, 0, 0, 0.30);
  --shadow-md:    0 8px 24px -6px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   Reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color var(--transition), border-color var(--transition);
}
a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

img, picture, video, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em 0;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-family: var(--font-serif);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em 0; }

/* ============================================================
   Layout shell
   ============================================================ */
.juicergallery-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.juicergallery-main { flex: 1; }

/* ============================================================
   Topbar
   ============================================================ */
.juicergallery-topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.juicergallery-topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}
.juicergallery-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.625rem;
  color: var(--ink);
  border-bottom: none;
  font-family: var(--font-serif);
}
.juicergallery-brand:hover { color: var(--accent); }
.juicergallery-brand-logo {
  width: 1.5rem;
  height: 1.5rem;
  align-self: center;
}
.juicergallery-brand-name {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.juicergallery-brand-tagline {
  font-size: 0.875rem;
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--ink-faint);
  font-style: italic;
}
.juicergallery-topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.juicergallery-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.juicergallery-nav a {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  border-bottom: none;
}
.juicergallery-nav a:hover { color: var(--accent); }
.juicergallery-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.juicergallery-theme-toggle:hover {
  background: var(--surface-soft);
  color: var(--accent);
  border-color: var(--rule);
}
.juicergallery-icon-sun { display: none; }
.juicergallery-icon-moon { display: block; }
[data-theme="dark"] .juicergallery-icon-sun { display: block; }
[data-theme="dark"] .juicergallery-icon-moon { display: none; }

/* ============================================================
   Home — intro + cover grid
   ============================================================ */
.juicergallery-home-intro {
  padding: 3.5rem var(--gutter) 2.5rem;
}
.juicergallery-home-intro-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.juicergallery-home-title {
  font-size: 3rem;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin-bottom: 0.25em;
}
.juicergallery-home-tagline {
  font-size: 1.25rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 1.5em;
  max-width: 38rem;
}
.juicergallery-home-blurb {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 42rem;
}

.juicergallery-cover-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr));
  gap: 2rem 1.5rem;
}
.juicergallery-cover-card {
  display: block;
  color: var(--ink);
  border-bottom: none;
}
.juicergallery-cover-figure {
  margin: 0 0 0.85rem 0;
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.juicergallery-cover-figure img,
.juicergallery-cover-figure picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.juicergallery-cover-card:hover .juicergallery-cover-figure {
  box-shadow: var(--shadow-md);
}
.juicergallery-cover-card:hover .juicergallery-cover-figure img {
  transform: scale(1.03);
}
.juicergallery-cover-meta {
  padding: 0;
}
.juicergallery-cover-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
  letter-spacing: -0.005em;
}
.juicergallery-cover-card:hover .juicergallery-cover-title { color: var(--accent); }
.juicergallery-cover-date {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-sans);
}
.juicergallery-cover-summary {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ============================================================
   Gallery detail — header + masonry
   ============================================================ */
.juicergallery-detail {
  padding: 0 var(--gutter) 5rem;
}
.juicergallery-detail-head {
  max-width: var(--max-w-page);
  margin: 0 auto;
  padding: 3rem 0 2rem;
}
.juicergallery-detail-title {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin-bottom: 0.4rem;
}
.juicergallery-detail-meta {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.juicergallery-detail-blurb {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 42rem;
}
.juicergallery-detail-blurb p { margin-bottom: 1em; }
.juicergallery-detail-blurb p:last-child { margin-bottom: 0; }

/* Masonry via CSS columns. Each photo is a block inside a column.
   `break-inside: avoid` keeps a figure from being torn across two
   columns. Column count steps with viewport width. */
.juicergallery-masonry {
  max-width: var(--max-w);
  margin: 0 auto;
  columns: 1;
  column-gap: var(--gutter);
}
@media (min-width: 40rem) {
  .juicergallery-masonry { columns: 2; }
}
@media (min-width: 64rem) {
  .juicergallery-masonry { columns: 3; }
}
@media (min-width: 96rem) {
  .juicergallery-masonry { columns: 4; }
}

.juicergallery-photo {
  margin: 0 0 var(--gutter);
  break-inside: avoid;
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.juicergallery-photo:hover { box-shadow: var(--shadow-md); }
.juicergallery-photo-link {
  display: block;
  border-bottom: none;
}
.juicergallery-photo-link img,
.juicergallery-photo-link picture {
  width: 100%;
  height: auto;
  display: block;
}
.juicergallery-photo-caption {
  margin: 0;
  padding: 0.625rem 0.875rem 0.875rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.5;
  font-style: italic;
  background: var(--surface);
}

/* ============================================================
   Sub-section list (rare — for hybrid gallery+sub layouts)
   ============================================================ */
.juicergallery-subsections {
  max-width: var(--max-w-page);
  margin: 3rem auto 0;
}
.juicergallery-subsection-list {
  list-style: none;
  margin: 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule);
}
.juicergallery-subsection-list li {
  padding: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--rule-soft);
}
.juicergallery-subsection-date {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Generic single-page (about, contact, 404)
   ============================================================ */
.juicergallery-page-wrap {
  max-width: var(--max-w-page);
  margin: 0 auto;
  padding: 3rem var(--gutter) 5rem;
}
.juicergallery-page-title {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin-bottom: 0.6rem;
}
.juicergallery-page-summary {
  font-size: 1.125rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 1.5em;
  max-width: 38rem;
}
.juicergallery-content {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  max-width: var(--measure);
}
.juicergallery-content > * + * { margin-top: 1.1rem; }
.juicergallery-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.4rem;
}
.juicergallery-content h3 {
  font-size: 1.1875rem;
  margin-top: 2rem;
}
.juicergallery-content a {
  color: var(--accent);
  border-bottom-color: var(--accent-soft);
}
.juicergallery-content a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.juicergallery-content blockquote {
  margin: 1.25rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
}

.juicergallery-404 {
  text-align: center;
  padding-top: 6rem;
}

/* ============================================================
   Footer
   ============================================================ */
.juicergallery-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  padding: 2rem var(--gutter) 1.25rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.juicergallery-footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.juicergallery-footer-name {
  margin: 0 0 0.25rem;
  font-weight: 500;
  color: var(--ink);
  font-family: var(--font-serif);
}
.juicergallery-footer-contact { margin: 0; color: var(--ink-faint); }
.juicergallery-footer-contact a { color: var(--ink-soft); border-bottom-color: transparent; }
.juicergallery-footer-contact a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.juicergallery-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.juicergallery-footer-links a {
  color: var(--ink-soft);
  border-bottom: none;
}
.juicergallery-footer-links a:hover { color: var(--accent); }
.juicergallery-footer-fine {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
.juicergallery-footer-credit a {
  color: var(--ink-faint);
  border-bottom-color: transparent;
}
.juicergallery-footer-credit a:hover { color: var(--accent); border-bottom-color: var(--accent); }
