/* soric.cc — minimal light.
   Typography carried over from the WordPress theme: Helvetica 15px/1.6,
   ink #1c1c1c, links unadorned until hover, captions small and grey. */

:root {
  --ink: #1c1c1c;
  --muted: #888888;
  --caption: #aaaaaa;
  --rule: #e8e8e8;
  --bg: #ffffff;
  --gap: 1.5rem;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3 { font-weight: 400; margin: 0; }

a { color: var(--ink); text-decoration: none; }
a:visited { color: var(--ink); }
a:hover, a:focus, a:active { color: var(--muted); }

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

.meta { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); }

/* ---------- chrome ---------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--gap);
  padding: 1.25rem 1.5rem;
  flex-wrap: wrap;
}
.brand { font-size: 16px; font-weight: 500; }
.site-header nav { display: flex; gap: .9rem; font-size: 14px; }
.nav-sep { color: var(--rule); }

main { padding: 0 1.5rem 4rem; }

.flash { font-size: 14px; padding: .6rem 0; color: var(--muted); }
.flash.error { color: #b3261e; }

/* ---------- homepage: everything centred, no chrome ---------- */

body.home main { display: grid; place-items: center; min-height: 100vh; padding: 2rem 1.5rem; }
.home-stack { display: grid; justify-items: center; gap: 1.75rem; text-align: center; }
.home-title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.home-hero { max-height: 62vh; width: auto; max-width: min(680px, 88vw); }
.home-nav { display: flex; gap: 1.25rem; font-size: 14px; }

/* ---------- photo index ---------- */

.series-list {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1100px;
  display: grid; gap: 2.5rem var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.series-card .series-title { display: block; margin-top: .6rem; font-size: 15px; }
.series-card .meta { display: block; }

/* ---------- a series ---------- */

/* Scoped to the gallery page: .series-title is also the index card title,
   which stays left-aligned under its thumbnail. */
.series .series-title { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 2rem;
  text-align: center; }

/* Narrow screens: a plain vertical column. */
.series-track { display: flex; flex-direction: column; gap: 3rem; max-width: 46rem; margin: 0 auto; }
.slide { margin: 0; }
.slide-intro .intro-body { max-width: 34rem; }
.slide-intro p { margin: 0 0 1.5em; }
.slide-intro .shot-on, .slide-intro .meta { color: var(--ink); }
.photo figcaption {
  margin-top: .7rem;
  font-size: 12px;
  color: var(--caption);
  letter-spacing: 0.03em;
  text-align: center;
}
.series-controls { display: none; }

/* Wide screens: one horizontal track, the intro riding as its first slide.
   The generous gap plus a viewport-width-relative slide keeps one photo
   filling the screen with only a sliver of the next showing. */
@media (min-width: 900px) {
  main { padding-bottom: 1.5rem; }

  /* The gallery is exactly one screen: the page never scrolls vertically, so
     the controls and the back link are always in view. A flex column from
     body down means the track takes whatever height is left over rather than
     being guessed at with viewport-unit arithmetic. */
  body.gallery { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
  /* dvh where supported, so a mobile browser's collapsing toolbar does
     not leave the controls under the fold. */
  @supports (height: 100dvh) { body.gallery { height: 100dvh; } }
  body.gallery .site-header { flex: 0 0 auto; }
  body.gallery main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.gallery .series { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.gallery .series .series-title { flex: 0 0 auto; }
  body.gallery .series-foot { flex: 0 0 auto; }

  .series-track {
    flex: 1;
    min-height: 0;
    flex-direction: row;
    align-items: stretch;
    gap: 12vw;
    max-width: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 6vw;
    padding: 0 6vw 1rem;
    margin: 0 -1.5rem;
    scrollbar-width: none;
  }
  .series-track::-webkit-scrollbar { display: none; }

  .series-track .slide {
    flex: 0 0 auto;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .series-track .slide-intro { width: min(34rem, 70vw); overflow-y: auto; }
  .series-track .photo { height: 100%; }
  /* The slide has a definite height, so the image can be sized from it and
     take its width from the aspect ratio -- reserving room for the caption
     underneath, whether or not this photo has one. */
  .series-track .photo img { height: calc(100% - 2.2rem); width: auto; max-width: none; }
  .series-track .photo figcaption { text-align: center; margin-top: .5rem; }

  .series-controls {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 1.75rem;
    padding-top: 1.25rem;
    font-size: 14px;
  }
  /* Plain text, no box. */
  .series-controls button {
    border: 0; background: none; padding: 0; color: var(--ink); cursor: pointer;
  }
  .series-controls button:hover:not(:disabled) { color: var(--muted); }
  .series-controls button:disabled { color: var(--rule); cursor: default; }
  .series-controls .counter { color: var(--muted); font-size: 13px; }
}

/* Give fullscreen desktop galleries more breathing room without making the
   horizontal track feel sparse on laptops. */
@media (min-width: 1400px) {
  .series-track { gap: 18vw; }
}

/* A contextual exit after the final photo on mobile. Desktop already has the
   persistent Photos link in the header, so repeating it in the footer adds noise. */
.series-back { text-align: center; margin: 3rem 0 0; font-size: 12px; }
.series-back a { color: var(--caption); }
.series-back a:hover { color: var(--muted); }

@media (min-width: 900px) {
  /* Equal outer columns keep the stepper centred in the viewport. */
  .series-foot {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    padding-top: 1.25rem;
  }
  .series-foot .series-controls { grid-column: 2; padding-top: 0; }
  .series-foot .series-back { display: none; }
}

/* ---------- about ---------- */

body.about-page main { display: grid; place-items: center; min-height: 80vh; }
.about { max-width: 34rem; display: grid; justify-items: center; gap: 1.5rem; text-align: center; }
.about-photo { max-width: 220px; }
.about-lines { display: grid; gap: .3rem; }

/* ---------- prose ---------- */

.prose { max-width: 40rem; margin: 0 auto; }
.prose h1 { font-size: 20px; letter-spacing: -0.01em; margin-bottom: .25rem; }
.prose p { margin: 0 0 1.5em; }
.prose img { margin: 2rem 0; }

.post-list { list-style: none; margin: 0 auto; padding: 0; max-width: 40rem; }
.post-list li { padding: .6rem 0; border-bottom: 1px solid var(--rule); display: flex;
  justify-content: space-between; gap: var(--gap); align-items: baseline; }

/* ---------- admin ---------- */

.admin-page {
  min-height: 100%;
  background: #f4f3f1;
  color: #24211f;
}
.admin-bar {
  position: sticky; top: 0; z-index: 100;
  min-height: 58px; padding: .7rem 1.5rem;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem;
  color: #fff; background: #b42318; box-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}
.admin-bar a, .admin-bar a:visited { color: #fff; }
.admin-bar a:hover, .admin-bar a:focus { color: #fff; opacity: .76; }
.admin-brand { font-size: 16px; white-space: nowrap; }
.admin-brand strong { font-weight: 700; }
.admin-nav { display: flex; gap: .35rem; align-items: center; }
.admin-nav a { padding: .35rem .55rem; border-radius: 3px; }
.admin-nav a:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.admin-account { display: flex; align-items: center; gap: 1rem; font-size: 12px; white-space: nowrap; }
.admin-account span { opacity: .68; }
.admin-account a { font-size: 13px; font-weight: 600; }

body.admin-page main {
  width: min(1180px, 100%); margin: 0 auto; padding: 2.25rem 1.5rem 5rem;
}
.admin-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-heading h1, .admin-page main > h1 { font-size: 30px; font-weight: 600; line-height: 1.2; }
.admin-kicker {
  margin: 0 0 .25rem; color: #b42318; font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.admin-page h2 { margin: 2.2rem 0 1rem; font-size: 19px; font-weight: 600; }
.admin-panel {
  padding: 1.35rem; border: 1px solid #ddd9d5; border-radius: 5px;
  background: #fff; box-shadow: 0 1px 2px rgba(32, 25, 20, .04);
}
.table-panel { padding: 0; overflow-x: auto; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
  text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: middle;
}
.admin-table th { color: var(--muted); font-weight: 400; }
.admin-table input[type=text] { width: 100%; }
.thumb { width: 96px; height: 96px; object-fit: cover; }
.pager { display: flex; gap: 1.25rem; justify-content: center; align-items: baseline;
  margin-top: 2rem; font-size: 14px; }
.position { width: 4.5rem; }
.stack { display: grid; gap: .9rem; max-width: 46rem; }
.stack label { display: grid; gap: .3rem; }
.toolbar { display: flex; justify-content: space-between; align-items: baseline; gap: var(--gap); }
.table { margin-top: 1rem; border: 1px solid #ddd9d5; border-radius: 5px; background: #fff; }
.table .row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--rule);
}
.table .row:last-child { border-bottom: 0; }
.table .empty-state { margin: 0; padding: 1rem; color: var(--muted); }

input, select, textarea, button {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--rule); border-radius: 2px; padding: .45rem .6rem;
}
button { cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.danger { color: #b3261e; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 35px; padding: .4rem .7rem; border: 1px solid #d8d4d0; border-radius: 3px;
  background: #fff; line-height: 1;
}
.button.primary { color: #fff; border-color: #24211f; background: #24211f; }

.post-editor-form { display: grid; gap: 1.25rem; }
.post-settings {
  display: grid; grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) 150px;
  gap: 1rem; align-items: end;
}
.field { display: grid; gap: .4rem; color: #5d5752; font-size: 13px; font-weight: 600; }
.field input, .field select { width: 100%; min-height: 42px; color: #24211f; font-weight: 400; }
.field-title input { font-size: 17px; }
.editor-panel { padding: 0; overflow: hidden; }
.field-heading { padding: 1.15rem 1.25rem; border-bottom: 1px solid #e2dfdc; }
.field-heading h2 { margin: 0; font-size: 17px; }
.field-heading p { margin: .2rem 0 0; color: var(--muted); font-size: 13px; }
.wysiwyg { background: #fff; }
.wysiwyg-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  padding: .55rem .65rem; border-bottom: 1px solid #e2dfdc; background: #faf9f8;
}
.wysiwyg-toolbar button, .wysiwyg-toolbar select {
  min-height: 34px; border-color: transparent; background: transparent;
}
.wysiwyg-toolbar button:hover, .wysiwyg-toolbar select:hover { border-color: #d8d4d0; background: #fff; }
.toolbar-divider { width: 1px; height: 24px; margin: 0 .15rem; background: #ddd9d5; }
.toolbar-spacer { flex: 1; }
.wysiwyg-body {
  min-height: 460px; padding: 2.5rem max(1.25rem, calc((100% - 720px) / 2));
  outline: 0; background: #fff; font-size: 17px; line-height: 1.75;
}
.wysiwyg-body:empty::before { color: #aaa39d; content: "Start writing, or drop an image here…"; }
.wysiwyg-body h2 { margin: 1.8em 0 .55em; font-size: 28px; line-height: 1.25; }
.wysiwyg-body h3 { margin: 1.5em 0 .5em; font-size: 21px; line-height: 1.3; }
.wysiwyg-body p { margin: 0 0 1.25em; }
.wysiwyg-body blockquote { margin: 1.5em 0; padding-left: 1.2rem; border-left: 3px solid #b42318; color: #625b55; }
.wysiwyg-body figure { margin: 2rem 0; }
.wysiwyg-body img { width: auto; max-width: 100%; margin: 0 auto; }
.wysiwyg-body figcaption { margin-top: .5rem; color: var(--muted); font-size: 12px; text-align: center; }
.wysiwyg-body figcaption:empty::before { color: #bbb4ae; content: "Add a caption"; }
.wysiwyg.is-dragover .wysiwyg-body { outline: 3px solid rgba(180, 35, 24, .22); outline-offset: -3px; background: #fffafa; }
.upload-status { min-height: 30px; padding: .35rem .75rem; color: var(--muted); font-size: 12px; background: #faf9f8; }
.upload-status:empty { display: none; }
.upload-status.error { color: #b42318; }
.editor-actions {
  position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; padding: .75rem 1rem;
  border: 1px solid #ddd9d5; border-radius: 5px; background: rgba(255, 255, 255, .96);
  box-shadow: 0 -5px 20px rgba(32, 25, 20, .06); backdrop-filter: blur(8px);
}

.drag-handle {
  min-width: 38px; color: #716a64; border-color: transparent; background: transparent;
  font-size: 22px; line-height: 1; cursor: grab; touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.admin-page:not(.no-js) .sortable-table .position {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.sortable-table tr.is-dragging { opacity: .34; }
.sortable-table tr.drop-before td { box-shadow: inset 0 3px 0 #b42318; }
.sortable-table tr.drop-after td { box-shadow: inset 0 -3px 0 #b42318; }

.media-grid { display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.media-upload { display: grid; gap: .9rem; margin: 1rem 0 1.5rem; padding: 1.2rem;
  border: 1px solid #ddd9d5; border-radius: 5px; background: #fff; }
.media-upload label { display: grid; gap: .35rem; }
.bulk-progress { display: grid; gap: .35rem; }
.bulk-progress[hidden] { display: none; }
.bulk-progress progress { width: 100%; height: 12px; accent-color: #b42318; }
.bulk-progress .meta { margin: 0; overflow-wrap: anywhere; }
.bulk-progress .error { color: #b42318; }
.media-card { border: 1px solid #ddd9d5; border-radius: 5px; padding: .75rem; display: grid; gap: .5rem; background: #fff; }
.media-card input[readonly] { font-size: 12px; }
.media-meta { display: flex; flex-wrap: wrap; gap: .5rem; font-size: 12px; color: var(--muted); }
.media-meta .warn { color: #b06000; }
.media-picker { list-style: none; padding: 0; display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.media-picker label { display: block; cursor: pointer; }
/* No JavaScript: show the whole picker rather than hiding items behind
   a reveal that will never run. */
.no-js .media-picker li[hidden] { display: list-item; }
.replace { font-size: 13px; }
.replace summary { cursor: pointer; color: var(--muted); }
.replace form { display: grid; gap: .5rem; margin-top: .5rem; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.hero-picker { list-style: none; padding: 0; display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.hero-picker label { display: block; cursor: pointer; }
.hero-picker input { margin-bottom: .3rem; }

@media (max-width: 800px) {
  .admin-bar { grid-template-columns: 1fr auto; gap: .5rem 1rem; padding: .65rem 1rem; }
  .admin-nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
  .admin-account span { display: none; }
  body.admin-page main { padding: 1.5rem 1rem 4rem; }
  .post-settings { grid-template-columns: 1fr; }
  .wysiwyg-body { min-height: 380px; padding: 1.5rem 1rem; }
  .admin-table { min-width: 680px; }
  .admin-panel:has(> .admin-table) { overflow-x: auto; }
  .editor-actions .meta { display: none; }
  .editor-actions { justify-content: flex-end; }
}
