/* =====================================================
   DARKROOM PAGE
   Goes with darkroom.html
   ===================================================== */


/* ---------- COLOURS + SIZES (change them all here) ---------- */
:root {
  --paper: #f7f1e2;        /* cream card colour (same as links page) */
  --ink: #1e1e1e;          /* main text colour */
  --faded: #6b5c45;        /* small labels + "fill me in" text */
  --safelight: #b3261e;    /* red used for titles */
  --string: #4a3728;       /* the drying line the photos hang on */
  --link: #c1502f;         /* "read more" colour (same rust as the links page) */
  --print-border: 3px;     /* white border around the hanging photos */

  --print-h: clamp(120px, 14vw, 170px);  /* how tall the hanging photos are */

  --page-width: 1100px;    /* widest the column of boxes gets. smaller = more tiles showing on both sides */
  --edge: clamp(20px, 4vw, 56px);        /* smallest gap between the boxes and the edge of the screen */
}

/* one colour per category. --tag-bg = chip colour, --tag-ink = text on it.
   To add a new category, copy one block and change the name + colours. */
[data-filter="contraptions"], [data-tag="contraptions"] {
  --tag-bg: #c9a26b;   /* cardboard box */
  --tag-ink: #1e1e1e;
}
[data-filter="developers"], [data-tag="developers"] {
  --tag-bg: #3b2a20;   /* coffee */
  --tag-ink: #f7f1e2;
}
[data-filter="emulsions"], [data-tag="emulsions"] {
  --tag-bg: #1f4e8c;   /* cyanotype blue */
  --tag-ink: #f7f1e2;
}


/* ---------- PAGE BASICS ---------- */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

* { box-sizing: border-box; }

body {
  color: var(--ink);
  font: 14px/1.6 "Courier New", Courier, monospace;
}

/* CONTENT AREA - the whole page. no navbar here, the way back is the
   back-to-room button (css/back-to-room.css) */
.content-area {
  min-height: 100vh;
  background: #8a3b22;                                        /* shows while the image loads */
  background-image: url("../images/patternsbg/terraredtiles.jpg");
  background-size: 30% auto;                                  /* bigger % = bigger tiles */
  background-repeat: repeat;
  /* top+bottom gap, then the side gap.
     side gap = whatever is left over after --page-width, split in half,
     so everything sits in the middle. never smaller than --edge */
  padding: var(--edge) max(var(--edge), (100% - var(--page-width)) / 2);
}


/* ---------- PAPER TEXTURE (on every cream box) ----------
   paper-cream-web.jpg is a small web copy of "NOAKABES TEXTURE (13)".
   To try another paper, change the file name here. */
.dark-hero,
.entry {
  background-color: var(--paper);                                     /* shows while the image loads */
  background-image: url("../images/papertextures/paper-cream-web.jpg");
  background-size: 1500px auto;                                       /* smaller number = finer grain */
  background-repeat: repeat;
}

/* start each box at a different spot on the paper so they don't all look the same */
.entry:nth-child(2n)    { background-position: 300px 200px; }
.entry:nth-child(3n)    { background-position: 700px 450px; }


/* ---------- HERO (title box at the top) ---------- */
.dark-hero {
  position: relative;
  display: inline-block;
  padding: clamp(16px, 3vw, 32px);
  padding-right: clamp(110px, 17vw, 210px);   /* leaves room for the camera */
  margin-bottom: clamp(20px, 3vw, 32px);
}

.page-title {
  font-family: 'Jacquard 12', sans-serif;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  color: var(--safelight);
  margin: 0 0 0.2em;
  letter-spacing: 1px;
}

.dark-intro {
  margin: 0;
  max-width: 44ch;   /* ch = about one letter wide, so this is line length */
}

/* the camera sticking out of the title box */
.hero-camera {
  position: absolute;
  right: -28px;
  top: 50%;
  width: clamp(110px, 17vw, 210px);           /* camera size: smallest, grows with the screen, biggest */
  transform: translateY(-50%) rotate(8deg);   /* rotate = the tilt */
  filter: drop-shadow(4px 5px 6px rgba(0, 0, 0, 0.35));
  pointer-events: none;   /* decoration only, can't be clicked */
}


/* ---------- FILTER BUTTONS ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;   /* buttons drop to a new line on small screens */
  gap: 8px;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.filter {
  font: bold 13px "Courier New", Courier, monospace;
  letter-spacing: 1px;
  color: var(--ink);
  background: var(--paper);
  border: none;            /* no outline around the button */
  padding: 7px 12px;
  cursor: pointer;
}

/* the little colour dot before each category name */
.filter::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--tag-bg, var(--ink));
}

.filter:hover { transform: translateY(-2px); }

.filter:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* the button that is switched on */
.filter.is-on {
  background: var(--tag-bg, var(--ink));
  color: var(--tag-ink, var(--paper));
}
.filter.is-on::before { background: var(--tag-ink, var(--paper)); }


/* ---------- NOTEBOOK (the list of experiments) ---------- */
.notebook {
  display: flex;
  flex-direction: column;   /* newest experiment sits first in the HTML, so it shows on top */
  gap: clamp(16px, 2vw, 26px);
}

/* one experiment card: words on the left, photos on the right */
.entry {
  position: relative;
  padding: clamp(16px, 2.5vw, 28px);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);   /* words : photos. 4 parts words, 5 parts photos */
  gap: clamp(16px, 3vw, 36px);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.25);
}

/* small line above the title: "exp. 01 · date" */
.entry-meta {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--faded);
}

.entry-title {
  font-family: 'Jacquard 12', sans-serif;
  font-weight: 400;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.05;
  color: var(--safelight);
  margin: 0 0 8px;
  letter-spacing: 1px;
}

.notes { margin: 12px 0 0; }

/* things you still need to write. looks like a pencil note */
.pending {
  color: var(--faded);
  font-style: italic;
  border-bottom: 1px dotted var(--faded);
}


/* ---------- CATEGORY CHIPS (made automatically from data-tags) ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.tag {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 2px 8px;
  background: var(--tag-bg);
  color: var(--tag-ink);
}


/* ---------- RECIPE (the "what i used" list) ---------- */
.recipe {
  margin: 0;
  border-top: 1px dotted var(--faded);
}

/* each row: label on the left, answer on the right */
.recipe div {
  display: grid;
  grid-template-columns: 9ch 1fr;   /* 9ch = width of the label column */
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--faded);
}

.recipe dt {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--faded);
  padding-top: 2px;
}

.recipe dd { margin: 0; }


/* ---------- PHOTOS (hung on a drying line) ---------- */
.prints {
  --row-gap: 56px;     /* space above each row of photos: room for the string + clips */
  position: relative;
  display: flex;
  flex-wrap: wrap;     /* photos that don't fit drop down to a new row */
  align-items: flex-start;
  align-content: flex-start;
  align-self: start;   /* the box is only as tall as its photos, so no extra strings appear */
  gap: var(--row-gap) 16px;      /* second number = space between photos side by side */
  padding-top: var(--row-gap);
}

/* the strings. one is drawn above EVERY row of photos, so a 2nd row gets its own line */
.prints::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -6px;
  right: -6px;
  /* one row = the gap + the photo + its white border */
  --row: calc(var(--row-gap) + var(--print-h) + 2 * var(--print-border));
  /* 32px = where the string sits (24px above the photos). 34px - 32px = string thickness */
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 32px,
    var(--string) 32px 34px,
    transparent 34px var(--row)
  );
}

/* one hanging photo (white border like a real print) */
.print {
  position: relative;
  display: block;
  background: #fff;
  padding: var(--print-border);   /* the white border. change it at the top of this file */
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.3);
  cursor: zoom-in;
  transform: rotate(-2deg);
  transform-origin: top center;   /* swings from the clip */
  transition: transform 0.2s ease;
}

.print:nth-child(even) { transform: rotate(1.5deg); }   /* every 2nd photo tilts the other way */
.print:hover { transform: rotate(0deg); }
.print-empty { cursor: default; }

.print img {
  display: block;
  height: var(--print-h);
  width: auto;
  max-width: 100%;
  object-fit: cover;
}

/* the wooden clip (images/elements/woodclip.png) */
.print::before {
  content: "";
  position: absolute;
  top: -56px;          /* how far the clip sticks up above the photo. bigger minus = higher */
  left: 50%;
  width: 44px;         /* clip size. keep height = width x 1.5 */
  height: 66px;
  margin-left: -22px;  /* half the width, keeps it centred */
  background: url("../images/elements/woodclip.png") center / contain no-repeat;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

/* an empty slot, for a photo you haven't added yet */
.print-empty {
  width: calc(var(--print-h) * 0.75);
  height: calc(var(--print-h) + 2 * var(--print-border));   /* same height as a real photo */
  background: rgba(255, 255, 255, 0.45);
  border: 2px dashed var(--faded);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  color: var(--faded);
}


/* ---------- RED STAMP (the words come from data-stamp in the HTML) ---------- */
.entry[data-stamp]::after {
  content: attr(data-stamp);
  position: absolute;
  bottom: 24px;   /* distance from the bottom edge of the card */
  right: 28px;    /* distance from the right edge of the card */
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--safelight);
  border: 2px solid var(--safelight);
  padding: 2px 8px;
  transform: rotate(4deg);   /* the tilt. 0deg = straight */
}

/* keeps a clear strip at the bottom so the stamp never sits on top of pictures */
.entry[data-stamp] .process[open] .process-body { padding-bottom: 44px; }
.entry[data-stamp]:not(:has(.process)) { padding-bottom: 62px; }


/* ---------- READ MORE (the longer story + process pictures) ---------- */
.process {
  grid-column: 1 / -1;   /* stretches across the whole card, under the words and photos */
}

/* the clickable "read more" words */
.process summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;       /* hides the default little triangle */
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--link);
}
.process summary::-webkit-details-marker { display: none; }
.process summary:hover { text-decoration: underline; }
.process summary:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

/* show "read more" when closed and "read less" when open */
.process .less { display: none; }
.process[open] .more { display: none; }
.process[open] .less { display: inline; }

.process-body {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dotted var(--faded);
}

.process-body p {
  margin: 0 0 12px;
  max-width: 70ch;   /* keeps lines from getting too long to read */
}

/* the row of process pictures */
.process-pics {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
}

.process-pics figure {
  margin: 0;
  max-width: 100%;
}

.process-pics img {
  display: block;
  height: clamp(130px, 16vw, 200px);   /* how tall the process pictures are */
  width: auto;
  max-width: 100%;
  object-fit: cover;
  border: 1px solid var(--string);
  cursor: zoom-in;
}

.process-pics figcaption {
  margin-top: 4px;
  font-size: 12px;
  font-style: italic;
  color: var(--faded);
  max-width: 28ch;
}

/* an empty slot, for a process picture you haven't added yet */
.process-pics .pic-empty {
  width: clamp(130px, 16vw, 200px);
  height: clamp(130px, 16vw, 200px);
  border: 2px dashed var(--faded);
  background: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 11px;
  color: var(--faded);
}


/* ---------- BIG PICTURE VIEW (opens when you click a photo) ---------- */
.lightbox {
  position: fixed;
  inset: 0;                          /* covers the whole page */
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);    /* last number = how dark. 0 = clear, 1 = black */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4vh 4vw;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 84vh;      /* never taller than the screen */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  margin: 0;
  color: #fff;
  font-size: 13px;
  text-align: center;
}
.lightbox-caption:empty { display: none; }   /* no caption = no gap */

/* the x button in the corner */
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 40px;
  height: 40px;
  font: bold 26px/1 "Courier New", Courier, monospace;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}
.lightbox-close:focus-visible { outline: 2px solid #fff; }


/* ---------- HIDING (used by the filter buttons) ---------- */
.is-hidden { display: none !important; }   /* also hides the big picture view */


/* ---------- NARROW SCREENS: words on top, photos underneath ---------- */
@media (max-width: 860px) {
  .entry {
    grid-template-columns: 1fr;
  }
}


/* ---------- SMALL SCREENS (phones) ---------- */
@media (max-width: 760px) {
  .content-area {
    padding-top: 64px;   /* keeps the title clear of the hamburger menu */
  }

  .hero-camera { right: -14px; }
}
