/*
  Plakat ("poster"): a dark skin in the Swiss manner. Black ground, the
  site's name set very large and tight like a poster headline, photographs
  edge to edge with no space between, one yellow accent.

  It is the Swiss skin's rules with different values and a few changes at
  the end. docs/SKINS.md explains how to make one like it.
*/
/* Colours are not set here. They come from "modes" in skin.json, once for
   light and once for dark, and arrive as --fb-ground, --fb-text, --fb-muted,
   --fb-line, and --fb-accent. */
:root.fb-public {
  --fb-gutter: 0px;
  --fb-columns: 4;
  --fb-font: "Helvetica Neue", Helvetica, "Nimbus Sans", Arial, sans-serif;
  --fb-margin: clamp(1rem, 3vw, 2.5rem);
  background: var(--fb-ground);
  color: var(--fb-text);
  font-family: var(--fb-font);
  line-height: 1.5;
}
/* Colour is set on the body as well as the root: the admin's stylesheet,
   which is also loaded, gives the body a colour of its own. */
.fb-public body { margin: 0; min-height: 100vh; background: var(--fb-ground); color: var(--fb-text); font-feature-settings: "tnum" 1; }
.fb-public a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
/* The accent marks a hovered link by its underline. As a text colour, red on
   near-black is 4.0:1, short of the 4.5:1 that text needs. */
.fb-public a:hover { text-decoration-line: underline; text-decoration-color: var(--fb-accent); text-decoration-thickness: 2px; }
.fb-public :focus-visible { outline: 2px solid var(--fb-text); outline-offset: 3px; }
.fb-skip { position: absolute; left: -999rem; }
.fb-skip:focus { left: var(--fb-margin); top: 0.75rem; z-index: 3; padding: 0.5rem 0.75rem; background: var(--fb-ground); }

/* A line of the owner's own in the footer, if they wrote one. */
.fb-site-footer__note { margin: 0 0 0.5rem; }

/* The light and dark switch, in the header. */
.fb-mode { min-height: 2.25rem; padding: 0 0.75rem; border: 1px solid var(--fb-muted); background: none; color: inherit; font: inherit; cursor: pointer; }
.fb-mode:hover { border-color: var(--fb-text); }

/* Header: the site's name top-left, small. */
.fb-site-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.5rem; padding: 1.5rem var(--fb-margin) 1rem; }
.fb-site-title { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.fb-site-title a { text-decoration: none; }
.fb-site-tagline { margin: 0; color: var(--fb-muted); font-size: 0.875rem; }
.fb-main { padding: 0 var(--fb-margin) 4rem; }
.fb-site-footer { padding: 1.25rem var(--fb-margin) 2rem; border-top: 1px solid var(--fb-line); color: var(--fb-muted); font-size: 0.8125rem; }
.fb-empty { max-width: 34rem; margin: 3rem 0; padding: 1.25rem 0; border-top: 1px solid var(--fb-line); border-bottom: 1px solid var(--fb-line); color: var(--fb-muted); }

/* Links between the parts of the site, and the heading of an album or tag page. */
.fb-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.4rem 1.25rem; margin-left: auto; font-size: 0.875rem; }
.fb-page-title { margin: 0.5rem 0 0.5rem; font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.fb-page-description { max-width: 38rem; margin: 0 0 2rem; color: var(--fb-muted); white-space: pre-line; }
.fb-page-actions { margin: 0 0 1.5rem; font-size: 0.875rem; }
/* The albums offered on the front page: a row of names over the grid, the chosen one marked. */
.fb-chooser { display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; margin: 0.25rem 0 1.5rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--fb-line); font-size: 0.9375rem; }
.fb-chooser__link { padding: 0.15rem 0; border-bottom: 2px solid transparent; color: var(--fb-muted); text-decoration: none; }
.fb-chooser__link:hover { color: var(--fb-text); }
.fb-chooser__link[aria-current="page"] { border-bottom-color: var(--fb-accent); color: var(--fb-text); font-weight: 700; }
/* The search page: a box and a button on one line, wrapping on a narrow screen. */
.fb-search__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; max-width: 34rem; margin: 1rem 0 1.25rem; }
.fb-search__label { flex: 1 0 100%; font-size: 0.875rem; color: var(--fb-muted); }
.fb-search__input { appearance: none; -webkit-appearance: none; flex: 1; min-width: 10rem; min-height: 2.75rem; padding: 0 0.75rem; border: 1px solid var(--fb-muted); background: var(--fb-ground); color: var(--fb-text); font: inherit; }
.fb-search__button { appearance: none; -webkit-appearance: none; min-height: 2.75rem; padding: 0 1.25rem; border: 1px solid var(--fb-text); background: var(--fb-text); color: var(--fb-ground); font: inherit; font-weight: 700; cursor: pointer; }
/* A page the owner wrote: text at a readable width. */
.fb-page-body { max-width: 40rem; margin-top: 1.5rem; }
.fb-page-body p, .fb-page-body ul { margin: 0 0 1.1rem; }
.fb-page-body ul { padding-left: 1.25rem; }
.fb-page-body li + li { margin-top: 0.3rem; }
.fb-page-body h2 { margin: 2.25rem 0 0.75rem; font-size: 1.375rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.fb-page-body h3 { margin: 1.75rem 0 0.5rem; font-size: 1.0625rem; font-weight: 700; }
.fb-page-body a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.fb-page-title + .fb-grid-wrap, .fb-page-title + div > .fb-grid-wrap { margin-top: 2rem; }

/* The list of albums: square covers in a strict grid. */
.fb-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 2rem 1.25rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.fb-album__link { display: grid; gap: 0.15rem; text-decoration: none; }
.fb-album__cover { display: block; aspect-ratio: 1; margin-bottom: 0.5rem; background: var(--fb-line); overflow: hidden; }
.fb-album__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fb-album__title { font-weight: 700; }
.fb-album__count { color: var(--fb-muted); font-size: 0.875rem; }

/*
  The grid. Columns step down on narrower screens. Both layouts are CSS
  grid, so the order photos are read in is the order they appear in.
*/
.fb-grid-wrap { container-type: inline-size; --fb-cols: var(--fb-columns); }
.fb-grid {
  --fb-cols: var(--fb-columns);
  display: grid;
  grid-template-columns: repeat(var(--fb-cols), minmax(0, 1fr));
  column-gap: var(--fb-gutter);
  margin: 0; padding: 0; list-style: none;
}
/* After the rule above, so that they win over it: a container query adds no weight of its own. */
@container (max-width: 64rem) { .fb-grid { --fb-cols: min(var(--fb-columns), 3); } }
@container (max-width: 40rem) { .fb-grid { --fb-cols: 2; } }
.fb-tile { position: relative; background-size: cover; background-position: center; background-color: var(--fb-line); }
.fb-tile__link { display: block; width: 100%; height: 100%; }
.fb-tile__image { display: block; width: 100%; height: 100%; object-fit: cover; }
.fb-tile__link:focus-visible { outline-offset: -4px; }

/* Square: equal cells. */
.fb-grid--square { row-gap: var(--fb-gutter); }
.fb-grid--square .fb-tile { aspect-ratio: 1; }

/*
  Masonry without JavaScript. One row is a twentieth of a column's width,
  and each tile carries --fb-span: how many rows its shape needs (worked
  out on the server from the photo's dimensions). Tall photos span more
  rows; short ones fewer. The space between rows is the tile's own border,
  so it does not disturb the arithmetic.
*/
.fb-grid--masonry {
  grid-auto-rows: calc((100cqw - (var(--fb-cols) - 1) * var(--fb-gutter)) / var(--fb-cols) / 20);
  grid-auto-flow: row dense;
}
.fb-grid--masonry .fb-tile { grid-row: span var(--fb-span, 14); border-bottom: var(--fb-gutter) solid var(--fb-ground); }

.fb-pager { display: flex; gap: 1.5rem; margin-top: 2.5rem; font-size: 0.9375rem; }
.fb-pager__more {
  min-height: 2.75rem; padding: 0 1.5rem; border: 1px solid var(--fb-muted); background: none; color: var(--fb-text);
  font: inherit; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none;
}
.fb-pager__more:hover { border-color: var(--fb-text); color: var(--fb-text); }

/* A photo on its own page: the picture, with its words in a column beside or under it, never over it. */
.fb-photo { display: grid; grid-template-columns: minmax(0, max-content) minmax(14rem, 20rem); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
/* The first column is as wide as the picture and no wider, so the words sit beside an upright photo, not across the page from it. */
.fb-photo__figure { position: relative; margin: 0; min-width: 0; }
.fb-photo__image { display: block; max-width: 100%; max-height: 86vh; width: auto; height: auto; background-size: cover; }
.fb-photo__image--expandable { cursor: zoom-in; }
/* The button that shows the photo full screen: over a corner of the photo, appearing
   on hover. It is always there for the keyboard, and always shown where there is no
   hover (a touch screen). Dark with light text whatever the mode, so it reads on any photo. */
.fb-photo__expand {
  position: absolute; top: 0.75rem; right: 0.75rem; min-height: 2.5rem; padding: 0 0.9rem;
  border: 1px solid #f5f5f2; background: rgb(0 0 0 / 0.78); color: #f5f5f2; font: inherit; font-size: 0.875rem; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.fb-photo__figure:hover .fb-photo__expand, .fb-photo__expand:focus-visible, .fb-photo__figure--expanded .fb-photo__expand { opacity: 1; }
.fb-photo__expand:focus-visible { outline: 2px solid #f5f5f2; outline-offset: 3px; }
@media (hover: none) { .fb-photo__expand { opacity: 1; } }
/* Full screen: the photograph alone on black, as large as the screen allows. */
.fb-photo__figure--expanded { display: flex; align-items: center; justify-content: center; width: 100vw; height: 100vh; background: #000; }
.fb-photo__figure--expanded .fb-photo__image { max-width: 100vw; max-height: 100vh; cursor: zoom-out; }
.fb-photo__title { margin: 0 0 0.75rem; font-size: 1.5rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.fb-photo__description { margin: 0 0 1.25rem; color: var(--fb-muted); white-space: pre-line; }
.fb-photo__facts { margin: 0; border-top: 1px solid var(--fb-line); font-size: 0.875rem; }
.fb-photo__fact { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--fb-line); }
.fb-photo__fact dt { color: var(--fb-muted); }
.fb-photo__fact dd { margin: 0; }
.fb-photo__albums { margin: 1.25rem 0 0; font-size: 0.875rem; color: var(--fb-muted); }
.fb-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.fb-tag { display: inline-block; padding: 0.1rem 0.5rem; border: 1px solid var(--fb-line); font-size: 0.8125rem; text-decoration: none; }
.fb-tag:hover { border-color: var(--fb-accent); }
.fb-photo__licence, .fb-photo__download { margin: 1rem 0 0; font-size: 0.875rem; color: var(--fb-muted); }
.fb-photo__nav { display: flex; gap: 1.5rem; margin-top: 1.5rem; font-size: 0.9375rem; }
.fb-photo__back { margin: 0 0 1.5rem; font-size: 0.875rem; }
@media (max-width: 52rem) { .fb-photo { grid-template-columns: 1fr; } }

/* The same photo opened over the grid. */
.fb-modal { width: min(96vw, 84rem); max-height: 94vh; padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--fb-line); background: var(--fb-ground); color: var(--fb-text); overflow: auto; }
/* The dialog takes focus itself when a photo has no link left to hold it; that needs no ring. */
.fb-modal:focus { outline: none; }
.fb-modal::backdrop { background: rgb(0 0 0 / 0.86); }
.fb-modal__close { float: right; min-height: 2.75rem; margin: 0 0 1rem 1rem; padding: 0 1rem; border: 1px solid var(--fb-muted); background: none; color: var(--fb-text); font: inherit; cursor: pointer; }
.fb-modal__close:hover { border-color: var(--fb-text); }
.fb-modal .fb-photo { clear: both; }
/*
  On a wide screen the card is the same for every photo: one size, the words in one column down its
  right side, and the picture in the middle of the room that is left, whatever its shape and however
  little there is to say about it. (8rem: the card's padding and its Close button.)
*/
@media (min-width: 52.01rem) {
  .fb-modal { height: 94vh; }
  .fb-modal .fb-photo { grid-template-columns: minmax(0, 1fr) 20rem; min-height: calc(94vh - 8rem); }
  .fb-modal .fb-photo__figure { justify-self: center; align-self: center; }
  /* Not while it is shown full screen, which has the whole screen to itself. */
  .fb-modal .fb-photo__figure:not(.fb-photo__figure--expanded) .fb-photo__image { max-height: calc(94vh - 8rem); }
}
.fb-modal .fb-photo__image { max-height: 76vh; }
.fb-modal .fb-photo__figure--expanded .fb-photo__image { max-height: 100vh; }

/*
  The slideshow fills the screen. Two images are stacked and cross-faded;
  the one with --front is showing. Controls sit along the bottom on a band
  that keeps them readable over any photo.
*/
.fb-slideshow { position: fixed; inset: 0; display: grid; background: var(--fb-ground); color: var(--fb-text); font-family: var(--fb-font); overflow: hidden; }
.fb-slideshow__photo { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.fb-slideshow__photo:focus-visible { outline-offset: -4px; }
.fb-slideshow__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1s ease; }
.fb-slideshow__image--front { opacity: 1; }
.fb-slideshow__foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; max-height: 100%; }
.fb-slideshow__controls {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  padding: 0.75rem var(--fb-margin); background: rgb(0 0 0 / 0.72); font-size: 0.875rem;
}
.fb-slideshow__control {
  min-height: 2.75rem; padding: 0 1rem; border: 1px solid var(--fb-muted); background: none; color: #f5f5f2;
  font: inherit; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer;
}
.fb-slideshow__control:hover { border-color: #f5f5f2; color: #f5f5f2; }
.fb-slideshow__control[aria-pressed="true"] { background: #f5f5f2; color: #0a0a0b; }
.fb-slideshow__count { margin: 0 auto 0 0.5rem; color: #d0d0cb; font-variant-numeric: tabular-nums; }
.fb-slideshow__details {
  min-height: 0; max-height: 50vh; overflow: auto;
  padding: 1.25rem var(--fb-margin); background: rgb(0 0 0 / 0.82); color: #f5f5f2;
}
.fb-slideshow__details a { color: #f5f5f2; }
.fb-slideshow__title { margin: 0 0 0.4rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.015em; }
.fb-slideshow__description { max-width: 46rem; margin: 0 0 0.5rem; white-space: pre-line; }
.fb-slideshow__facts { margin: 0 0 0.5rem; color: #d0d0cb; font-size: 0.875rem; }
.fb-slideshow__details .fb-tags { margin: 0 0 0.5rem; }
.fb-slideshow__details .fb-tag, .fb-slideshow__details .fb-tag:hover { border-color: currentColor; }
.fb-slideshow__empty { align-self: center; justify-self: center; padding: var(--fb-margin); }

@media (prefers-reduced-motion: reduce) {
  .fb-public *, .fb-public *::before, .fb-public *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .fb-slideshow__image { transition: none; }
}

/* ── What makes this Plakat rather than Swiss ─────────────────────────── */

/* The site's name as a poster headline, with a bar of the accent under it. */
.fb-site-header { display: grid; gap: 0.5rem; padding: clamp(1.5rem, 5vw, 4rem) var(--fb-margin) 1.25rem; }
.fb-site-title { font-size: clamp(2.75rem, 11vw, 8.5rem); line-height: 0.88; letter-spacing: -0.055em; margin-left: -0.04em; overflow-wrap: anywhere; }
.fb-site-title::after { content: ""; display: block; width: clamp(3rem, 10vw, 7rem); height: clamp(0.4rem, 1vw, 0.7rem); margin-top: clamp(0.9rem, 2vw, 1.6rem); background: var(--fb-accent); }
.fb-site-tagline { font-size: 1rem; }
.fb-nav { justify-content: flex-start; margin-left: 0; margin-top: 0.5rem; font-size: 1rem; font-weight: 700; }

/* Photographs run to the edges of the screen. */
.fb-main > div > .fb-grid-wrap, .fb-main > div > div > .fb-grid-wrap { margin-left: calc(var(--fb-margin) * -1); margin-right: calc(var(--fb-margin) * -1); }

/* Headings are large and tight throughout. */
.fb-page-title { font-size: clamp(2.5rem, 7vw, 5.5rem); line-height: 0.92; letter-spacing: -0.05em; }
.fb-photo__title { font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1; letter-spacing: -0.04em; }
.fb-album__title { font-size: 1.25rem; letter-spacing: -0.02em; }
.fb-tag:hover { border-color: var(--fb-accent); }


/* Colours for light and dark, from skin.json and the admin. */
:root.fb-public { --fb-ground: #ffd400; --fb-text: #000000; --fb-muted: #4a4000; --fb-line: #d9b400; --fb-accent: #000000; color-scheme: light; }
:root.fb-public[data-fb-mode="dark"] { --fb-ground: #000000; --fb-text: #ffffff; --fb-muted: #b4b4b4; --fb-line: #333333; --fb-accent: #ffd400; color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root.fb-public[data-fb-mode="auto"] { --fb-ground: #000000; --fb-text: #ffffff; --fb-muted: #b4b4b4; --fb-line: #333333; --fb-accent: #ffd400; color-scheme: dark; } }
/* The owner's logo: the one for the mode in use is shown, at the size the page gives it. */
.fb-site-logo { display: block; max-width: 100%; height: auto; }
.fb-site-logo--dark { display: none; }
[data-fb-mode="dark"] .fb-site-logo--dark { display: block; } [data-fb-mode="dark"] .fb-site-logo--light { display: none; }
@media (prefers-color-scheme: dark) { [data-fb-mode="auto"] .fb-site-logo--dark { display: block; } [data-fb-mode="auto"] .fb-site-logo--light { display: none; } }
/* The switch names the mode it changes to. */
.fb-mode__to-light { display: none; }
[data-fb-mode="dark"] .fb-mode__to-dark { display: none; } [data-fb-mode="dark"] .fb-mode__to-light { display: inline; }
@media (prefers-color-scheme: dark) { [data-fb-mode="auto"] .fb-mode__to-dark { display: none; } [data-fb-mode="auto"] .fb-mode__to-light { display: inline; } }

/* Options chosen in the admin. */
:root.fb-public {
  --fb-gutter: 0px;
  --fb-columns: 4;
}
