/* ------------------------------------------------------------------
   Folly — site styles
   Edit these variables to tune the whole site at once.
   ------------------------------------------------------------------ */

:root {
  --bg: #000000;
  --fg: #ffffff;
  --muted: #b8b8b8;

  /* Cover & column dimensions (desktop) */
  --cover-w: 360px;            /* cover image width */
  --cover-aspect: 575 / 815;   /* cover image aspect ratio */
  --panel-w: var(--cover-w);   /* info panel matches cover width */
  --column-w: var(--cover-w);  /* text column on About / Open Call also matches cover */

  --gap: 28px;
  --pad: 36px;

  --t-fast: 200ms ease;
  --t-slide: 480ms cubic-bezier(.6,.05,.2,1);
}

/* ABC Diatype — the only typeface used for text on the site */
@font-face {
  font-family: "ABC Diatype";
  src: url("assets/fonts/ABCDiatype-Medium.otf") format("opentype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "ABC Diatype", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

ol, ul { padding-left: 1.2em; margin: 0.6em 0; }
li { margin: 0.15em 0; }

button {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

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

/* ------------------------------------------------------------------
   Header / logo
   ------------------------------------------------------------------ */
.site-header {
  position: relative;
  padding: var(--pad) var(--pad) 0 var(--pad);
  display: flex;
  justify-content: flex-end;       /* logo top-right */
  align-items: flex-start;
}
.logo { display: inline-block; line-height: 0; }
.logo-img {
  width: clamp(120px, 14vw, 210px);
  height: auto;
  display: block;
}

/* Tagline is a sibling of the covers band, absolutely positioned so its
   top edge sits in line with the top of the covers. It is plain text,
   not a link. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  /* No flex-grow — the hero is sized by its content (cover band).
     This keeps the footer close to the covers when no panel is open,
     and lets the page grow downward when a tall panel is opened. */
}
.tagline {
  position: absolute;
  top: var(--pad);              /* aligns with band's content top */
  right: var(--pad);
  margin: 0;
  padding: 0;
  z-index: 2;
  pointer-events: none;
  font-family: "ABC Diatype", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1;
  color: var(--fg);
  text-align: right;
}

/* ------------------------------------------------------------------
   Homepage — horizontal band of covers
   ------------------------------------------------------------------ */
.covers-band {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--gap);
  padding: var(--pad) var(--pad) var(--pad) var(--pad);
  overflow-x: auto;
  overflow-y: visible;          /* let panel content grow the page; footer drops down */
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.covers-band::-webkit-scrollbar { height: 8px; }
.covers-band::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.covers-band::-webkit-scrollbar-track { background: transparent; }

.cover {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.cover-trigger {
  width: var(--cover-w);
  aspect-ratio: var(--cover-aspect);
  display: block;
  flex: 0 0 auto;
  outline: none;
  transition: transform var(--t-fast);
}
.cover-trigger:focus-visible { outline: 2px solid var(--fg); outline-offset: 6px; }
.cover-trigger img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Panel — when closed, collapses both horizontally (width 0) and
   vertically (max-height 0) so it takes no space and the page is
   short. On open, it grows to its content height which pushes the
   footer down. */
.cover-panel {
  width: 0;
  max-height: 0;
  flex: 0 0 auto;
  overflow: hidden;
  margin-left: 0;
  align-self: flex-start;
  /* On close: width slides shut over t-slide, max-height delayed until after */
  transition:
    width var(--t-slide),
    margin-left var(--t-slide),
    max-height 0s var(--t-slide);
}
.cover.is-open .cover-panel {
  width: var(--panel-w);
  max-height: 5000px;
  margin-left: var(--gap);
  /* On open: max-height switches immediately so content is visible while width slides */
  transition:
    width var(--t-slide),
    margin-left var(--t-slide),
    max-height 0s 0s;
}

.cover-panel-inner {
  width: var(--panel-w);     /* fixed inner width so content doesn't reflow during transition */
  padding: 0 4px 0 4px;      /* a sliver of left padding so list markers aren't clipped */
  font-size: 15px;
  line-height: 1.55;
}

.issue-title {
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 0.6em 0;
  letter-spacing: 0.2px;
}
.issue-title .num {
  display: inline-block;
  margin-right: 0.4em;
  opacity: 0.7;
}

.issue-body p { margin: 0 0 1em 0; }

.issue-contents-heading {
  font-size: 15px;
  font-weight: 500;
  margin: 1.4em 0 0.4em 0;
  letter-spacing: 0.2px;
}

/* Numbered contents — uses CSS counters so markers are part of the LI
   itself (cannot be clipped by an ancestor's overflow). */
.issue-contents {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: c;
}
.issue-contents li {
  counter-increment: c;
  position: relative;
  padding-left: 2em;
  margin: 0.18em 0;
}
.issue-contents li::before {
  content: counter(c) ".";
  position: absolute;
  left: 0;
  top: 0;
  width: 1.6em;
  text-align: left;
}
.issue-contents .author { color: var(--muted); }

.purchase-link {
  display: inline-block;
  margin-top: 1.6em;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
}
.purchase-link:hover { text-decoration: none; opacity: 0.7; }

/* ------------------------------------------------------------------
   About / Open Call — text column matched to cover width
   ------------------------------------------------------------------ */
.text-page {
  flex: 1;
  padding: var(--pad);
  display: flex;
  justify-content: flex-start;
}
.text-column {
  width: var(--column-w);
  max-width: 100%;
  font-size: 15px;
  line-height: 1.6;
}
.text-column p { margin: 0 0 1.2em 0; }
.text-column p.lead { margin-top: 1em; }

/* ------------------------------------------------------------------
   Footer

   Three groups: masthead, pages, contacts.
   On desktop they sit on one row with dot separators.
   On mobile they stack vertically, separators hidden,
   with the order:  Pages  →  Masthead  →  Contacts.
   ------------------------------------------------------------------ */
.site-footer {
  /* Footer follows content directly. On the homepage the body's
     min-height: 100vh keeps the page filled with black; on the About /
     Open Call pages, .text-page still uses flex: 1 to push the footer
     to the viewport bottom. */
  padding: 22px var(--pad) 26px var(--pad);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }

.fg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
}
.sep { opacity: 0.5; }

/* ------------------------------------------------------------------
   Small screens / mobile
   ------------------------------------------------------------------ */
@media (max-width: 720px) {
  :root {
    --cover-w: 86vw;       /* covers fill the phone screen */
    --panel-w: 86vw;
    --column-w: 86vw;
    --pad: 22px;
    --gap: 16px;
  }

  .logo-img { width: clamp(105px, 28vw, 165px); }
  .tagline { font-size: 10px; }

  .covers-band {
    /* iOS momentum scrolling */
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .issue-title { font-size: 24px; }
  .cover-panel-inner { font-size: 14px; padding: 0 4px 0 4px; }

  /* Footer: stacked, no separators, three groups in the order
     Pages  →  Masthead  →  Contacts */
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    font-size: 13px;
  }
  .fg {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .sep { display: none; }
  .fg-pages    { order: 1; }
  .fg-masthead { order: 2; }
  .fg-contacts { order: 3; }
}
