/* =========================================================================
   ZENEL — Fjalë. The blog index, the reading page, and standalone pages.
   ========================================================================= */

.masthead-space { height: clamp(6rem, 16vh, 10rem); }

.page-head {
  padding: 0 var(--gut);
  max-width: 82rem;
  margin: 0 auto clamp(2.5rem, 8vh, 5rem);
}

.page-head__marker {
  display: block;
  margin-bottom: 1rem;
  color: var(--ink-faint);
}

.page-head__title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.page-head__rule {
  height: 1px;
  margin-top: clamp(2rem, 6vh, 3.5rem);
  background: var(--rule);
  transform-origin: left;
  animation: rule-in 1.4s var(--ease) both;
}

@keyframes rule-in { from { transform: scaleX(0); } }

/* -------------------------------------------------------------------------
   Index — a table of contents, read down the page
   ------------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  max-width: 82rem;
  margin: 0 auto clamp(1.5rem, 5vh, 3rem);
  padding: 0 var(--gut);
}

.filter {
  padding: 0;
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.3s var(--ease);
}

.filter:hover { color: var(--ink-dim); }
.filter.is-on { color: var(--ink); }

/* Thumb-sized tag filters. Padding rather than an overlay, so that wrapped
   rows of buttons meet edge to edge instead of overlapping each other. */
@media (pointer: coarse) {
  .filter { padding-block: 0.6rem; }
  .filters { gap: 0 1.25rem; }
}

.entries {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 var(--gut);
  list-style: none;
}

.entry { border-top: 1px solid var(--rule-soft); }
.entry:last-child { border-bottom: 1px solid var(--rule-soft); }
.entry[hidden] { display: none; }

.entry__link {
  position: relative;
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.4rem 2rem;
  padding: clamp(1.4rem, 4vh, 2.4rem) 0;
  text-decoration: none;
}

.entry__date {
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.4s var(--ease);
}

.entry__title {
  grid-column: 2;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  line-height: 1.2;
  text-wrap: balance;
  transition: transform 0.5s var(--ease);
}

.entry__dek {
  grid-column: 2;
  max-width: 44rem;
  color: var(--ink-dim);
  font-size: 0.98rem;
  line-height: 1.5;
}

.entry__meta {
  grid-column: 3;
  grid-row: 1;
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* A rule that sweeps in from the left as the row wakes up. */
.entry__rule {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease);
}

.entry__link:hover .entry__rule,
.entry__link:focus-visible .entry__rule { transform: scaleX(1); }
.entry__link:hover .entry__title,
.entry__link:focus-visible .entry__title { transform: translateX(0.4rem); }
.entry__link:hover .entry__date,
.entry__link:focus-visible .entry__date { color: var(--ink-dim); }

.entry--empty span {
  display: block;
  padding: 3rem 0;
  color: var(--ink-faint);
  font-style: italic;
}

/* One column on a phone. Two will not fit: the meta is `nowrap` and its tag
   list runs close to 350px, which starves the date column of everything and
   wraps "August 2026" a character at a time. Stack it in reading order and
   undo both of the base rules that caused it. */
@media (max-width: 44rem) {
  .entry__link {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem 0;
  }

  .entry__date,
  .entry__title,
  .entry__dek,
  .entry__meta { grid-column: 1; }

  .entry__meta {
    grid-row: auto;        /* the base rule pins it to row 1 */
    white-space: normal;   /* let the tags wrap instead of forcing a width */
  }

  .entry__title { margin-top: 0.1rem; }
}

/* -------------------------------------------------------------------------
   Reading page
   ------------------------------------------------------------------------- */

.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 150;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

.post {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* A band rather than a full frame: the drawing announces the piece without
   pushing the writing off the screen. */
.post__art {
  width: 100%;
  aspect-ratio: 16 / 5;
  margin-bottom: clamp(2rem, 7vh, 4rem);
  opacity: 0.6;
}

.post__art .boil__f { object-fit: cover; object-position: 50% 100%; }

/* Holding the space for a drawing that isn't finished yet. Rather than an
   empty box, it carries the site's own mark — the hairline horizon from the
   homepage and the favicon — so it reads as intended rather than broken. */
.post__art--placeholder {
  position: relative;
  opacity: 1;
}

.post__art--placeholder::after {
  content: "";
  position: absolute;
  inset: auto 0 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 12%, var(--rule) 88%, transparent);
}

.post__head { margin-bottom: clamp(2.5rem, 8vh, 4.5rem); }

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--ink-faint);
}

.post__title {
  max-width: 20ch;
  margin: 0;
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.post__dek {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  color: var(--ink-dim);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}

/* The prose itself. One column, honest measure, generous leading. */
.prose {
  max-width: var(--measure);
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.75;
  text-wrap: pretty;
}

.prose > * + * { margin-top: 1.5em; }
.prose > * { margin-bottom: 0; }

.prose h2,
.prose h3 {
  margin-top: 2.6em;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose h2 { font-size: 1.6em; }
.prose h3 { font-size: 1.25em; }

.prose a {
  text-decoration: none;
  background-image: linear-gradient(var(--rule), var(--rule));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 0.35s var(--ease), background-image 0.35s var(--ease);
}

.prose a:hover {
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: 100% 1px;
}

.prose strong { font-weight: 600; }

.prose blockquote {
  margin-inline: 0;
  padding-left: 1.6em;
  border-left: 1px solid var(--rule);
  color: var(--ink-dim);
  font-style: italic;
}

.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 1em; }

.prose ul,
.prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--ink-faint); }

.prose hr {
  width: 4rem;
  margin: 3.5em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.15em 0.4em;
  background: rgba(255, 255, 255, 0.07);
}

.prose pre {
  overflow-x: auto;
  padding: 1.25rem;
  border: 1px solid var(--rule-soft);
  font-size: 0.86em;
  line-height: 1.6;
}

.prose pre code { padding: 0; background: none; font-size: 1em; }

.prose img {
  width: 100%;
  height: auto;
  filter: grayscale(1);
  mix-blend-mode: screen;
}

/* A reference list, not reading matter. The markdown parser puts an id on
   every heading, so the list that follows "## Sources" can be reached without
   any extra markup in the article itself. */
.prose h2#sources + ul {
  padding-left: 0;
  list-style: none;
  font-size: 0.88em;
  line-height: 1.55;
  color: var(--ink-dim);
}

.prose h2#sources + ul li + li {
  margin-top: 0.9em;
  padding-top: 0.9em;
  border-top: 1px solid var(--rule-soft);
}

.prose figcaption,
.prose small {
  display: block;
  margin-top: 0.75rem;
  color: var(--ink-faint);
  font-size: 0.85em;
}

/* -------------------------------------------------------------------------
   Post footer
   ------------------------------------------------------------------------- */

.post__foot {
  max-width: var(--measure);
  margin-top: clamp(4rem, 12vh, 7rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule-soft);
}

.post__back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease), gap 0.3s var(--ease);
}

.post__back:hover { color: var(--ink); gap: 1rem; }

/* -------------------------------------------------------------------------
   Standalone pages (Impressum, Datenschutz) and 404
   ------------------------------------------------------------------------- */

.plain {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 var(--gut);
}

.notfound {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 0 var(--gut);
  text-align: center;
  overflow: hidden;
}

.notfound__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  opacity: 0.2;
}

.notfound__art .boil__f { object-fit: contain; }

.notfound__body { position: relative; z-index: 2; }

.notfound__code {
  display: block;
  margin-bottom: 1.25rem;
  color: var(--ink-faint);
}

.notfound__line {
  margin: 0 0 2rem;
  font-size: clamp(1.25rem, 3.4vw, 2.25rem);
  line-height: 1.3;
}
