/* Katherine Holt Crochet
   Layout: sticky photo banner with page links, then one centered column per page.
   Colors come from Kat's own work: mustard, teal and berry on rosy oatmeal. */

:root {
  --bg: #fbf1ec;          /* rosy oatmeal */
  --surface: #fffaf6;
  --ink: #34203c;         /* plum */
  --muted: #7a6280;
  --marigold: #e3a21a;
  --teal: #1d8481;
  --berry: #c2275f;
  --violet: #8a6bd1;
  --orange: #e0703a;
  --line: #ead8d2;
  --plum-deep: #3a2140;
  --banner-ink: #fff7ee;
  --shadow: 0 1px 2px rgba(52,32,60,.08), 0 6px 18px rgba(52,32,60,.08);
  --display: "Corben", Georgia, "Times New Roman", serif;
  --body: "Karla", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1422; --surface: #2a1f30; --ink: #f6e9df; --muted: #c4afc4;
    --marigold: #f2b53a; --teal: #4fc2bc; --berry: #f0628f; --violet: #b39cf0; --orange: #f29a6b; --line: #3f3046;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; text-wrap: balance; margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; border-radius: 4px; }
.gutter, main, footer {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- sticky banner ---------- */
.banner {
  position: sticky; top: 0; z-index: 5;
  background-color: var(--plum-deep); background-position: center 45%; background-size: cover;
  color: var(--banner-ink);
}
.banner-inner {
  background: linear-gradient(90deg, rgba(42,22,48,.86) 0%, rgba(42,22,48,.55) 55%, rgba(42,22,48,.25) 100%);
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.banner-row { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 3vw, 1.9rem); text-decoration: none; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a {
  text-decoration: none; font-weight: 700; font-size: .95rem; padding: 8px 14px 10px; border-radius: 10px 10px 0 0;
  white-space: nowrap; color: var(--banner-ink); background: rgba(255,255,255,.12);
}
nav.tabs a:hover { background: rgba(255,255,255,.24); }
nav.tabs a[aria-current="page"] { background: var(--bg); color: var(--ink); }
/* chain-stitch edge under the banner */
.chain { height: 10px; background:
  radial-gradient(ellipse 7px 4px at 9px 5px, transparent 3px, var(--marigold) 3.5px, var(--marigold) 5px, transparent 5.5px) 0 0 / 18px 10px repeat-x, var(--bg); }

/* ---------- page shell ---------- */
main { padding-block: 28px 56px; }
.wrap { max-width: 1120px; margin: 0 auto; display: grid; gap: 40px; }
.wrap.narrow { max-width: 760px; }
.stack { display: grid; gap: 14px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--berry); }
.intro { max-width: 62ch; display: grid; gap: 8px; }
.intro h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.intro p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.meta { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.stitchfacts { font-size: .85rem; color: var(--teal); font-weight: 600; }
.btn { justify-self: start; display: inline-block; padding: 10px 18px; border-radius: 999px; background: var(--berry); color: #fff; font-weight: 700; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.more { justify-self: start; font-weight: 700; color: var(--berry); }
.empty { color: var(--muted); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 .9em; }
.prose img { border-radius: 12px; }
.prose a { color: var(--berry); }

/* ---------- home: photo buttons ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile {
  position: relative; display: block; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 18px; overflow: hidden;
  text-decoration: none; color: #fff; box-shadow: var(--shadow); isolation: isolate;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; z-index: -2; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(30,14,34,.78) 0%, rgba(30,14,34,.15) 55%, transparent 100%); }
.tile:hover img { transform: scale(1.04); }
.tile .label { position: absolute; left: 18px; right: 18px; bottom: 16px; display: grid; gap: 2px; }
.tile .label strong { font-family: var(--display); font-size: clamp(1.3rem, 2.8vw, 1.9rem); }
.tile .label span { font-size: .95rem; opacity: .92; }
.tile .stripe { position: absolute; top: 14px; left: 14px; height: 6px; width: 46px; border-radius: 3px; }

/* ---------- home: featured ---------- */
.featured { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.featured.no-photo { grid-template-columns: minmax(0, 1fr); }
.featured > img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.featured .body { padding: clamp(20px, 4vw, 40px); display: grid; align-content: center; gap: 12px; min-width: 0; }
.featured h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.featured p { margin: 0; }

/* ---------- blog ---------- */
.masonry { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; align-items: start; }
.masonry.js-cols { display: flex; align-items: flex-start; }
.masonry .col { flex: 1 1 0; min-width: 0; display: grid; gap: 20px; }
.post { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border-top: 6px solid var(--accent, var(--marigold)); min-width: 0; }
.post-photo { position: relative; display: block; }
.post-photo img { width: 100%; display: block; max-height: 420px; object-fit: cover; object-position: center 35%; }
.count { position: absolute; right: 8px; bottom: 8px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(30,14,34,.7); color: #fff; }
.post .body { padding: 18px 20px 20px; display: grid; gap: 8px; }
.post h3 { font-size: 1.25rem; }
.post h3 a { text-decoration: none; }
.post h3 a:hover { text-decoration: underline; }
.post p { margin: 0; }

/* ---------- single post ---------- */
.single { gap: 24px; }
.single h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); }
.back { font-weight: 700; color: var(--berry); text-decoration: none; }
.post-photos { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-photos.count-1 { grid-template-columns: minmax(0, 1fr); }
.post-photos.count-3 a:first-child { grid-column: 1 / -1; }
.post-photos img { width: 100%; display: block; border-radius: 14px; max-height: 80vh; object-fit: cover; }
.single .prose { font-size: 1.08rem; }

/* ---------- gallery ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-weight: 700; font-size: .92rem; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.chip span { font-weight: 400; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--berry); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .7; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.ggrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.piece { all: unset; cursor: pointer; display: grid; gap: 8px; min-width: 0; align-content: start; }
.piece .ph { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: var(--line); }
.piece img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; display: block; }
.piece:hover img { transform: scale(1.05); }
.piece:focus-visible .ph { outline: 3px solid var(--marigold); outline-offset: 3px; }
.piece .cap { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.piece .cap strong { font-family: var(--display); font-size: 1rem; font-weight: 700; line-height: 1.25; }
.piece .cap span { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.lightbox { border: 0; padding: 0; max-width: min(1000px, calc(100vw - 32px)); width: 100%; max-height: calc(100dvh - 32px);
  border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: auto; }
.lightbox::backdrop { background: rgba(30,14,34,.72); }
.lb-inner { position: relative; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.lb-photo { background: #1e1422; display: grid; align-content: center; gap: 10px; padding-bottom: 10px; }
.lb-photo > img { width: 100%; max-height: 72dvh; object-fit: contain; display: block; }
.lb-thumbs { display: flex; gap: 8px; padding-inline: 10px; overflow-x: auto; }
.lb-thumbs button { all: unset; cursor: pointer; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; opacity: .55; border: 2px solid transparent; flex: none; }
.lb-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--marigold); }
.lb-thumbs button:focus-visible { outline: 3px solid var(--marigold); }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lb-body { padding: 28px 26px 24px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.lb-body h2 { font-size: 1.6rem; padding-right: 30px; }
.specs { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: .95rem; }
.specs dt { font-weight: 700; color: var(--teal); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; padding-top: 3px; }
.specs dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.specs a { color: var(--berry); font-weight: 700; }
.specs.boxed { background: var(--surface); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.lb-nav { display: flex; gap: 8px; margin-top: 6px; }
.pill { font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.pill:hover { border-color: var(--berry); }
.lb-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 1.6rem; line-height: 1; background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- ravelry / about ---------- */
.construction { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.construction > img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.construction .body { padding: clamp(20px, 4vw, 44px); display: grid; gap: 14px; align-content: center; min-width: 0; }
.construction h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.construction p { margin: 0; }
.tape { display: inline-block; justify-self: start; padding: 6px 14px; font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #2a1630;
  background: repeating-linear-gradient(-45deg, #f2b53a 0 14px, #ffd977 14px 28px); border-radius: 4px; }

/* ---------- footer ---------- */
footer { background: var(--plum-deep); color: var(--banner-ink); padding-block: 36px 40px; padding-bottom: max(40px, env(safe-area-inset-bottom, 0px)); }
.foot { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-start; }
.foot h2 { font-size: 1.2rem; margin-bottom: 10px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.socials a { text-decoration: none; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 2px solid currentColor; }
.socials a:nth-child(1) { color: #ff8a8a; } .socials a:nth-child(2) { color: #ffc65c; } .socials a:nth-child(3) { color: #7fe0d6; }
.socials a:hover { background: rgba(255,255,255,.08); }
.email a { font-weight: 700; font-size: 1.05rem; }
.soon { opacity: .7; }
.foot .fine { flex-basis: 100%; font-size: .85rem; opacity: .7; margin: 0; }

/* ---------- smaller screens ---------- */
@media (max-width: 900px) { .ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .featured, .construction { grid-template-columns: minmax(0, 1fr); }
  .featured > img { aspect-ratio: 4 / 3; }
  .construction > img { min-height: 200px; max-height: 300px; }
  .lb-inner { grid-template-columns: minmax(0, 1fr); }
  .lb-photo > img { max-height: 55dvh; }
  .lb-body { padding: 20px 18px; }
}
@media (max-width: 600px) { .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 480px) { .tiles { gap: 10px; } .tile { aspect-ratio: 1; } .tile .label span { display: none; } }
@media (prefers-reduced-motion: reduce) { .tile img, .piece img { transition: none; } .tile:hover img, .piece:hover img { transform: none; } }
