/* ==========================================================================
   Textile Etiketten
   .woven-label   Webetikett (Wortmarke, Fakten-Etiketten, Erzeuger)
                  __name · __descriptor · __value · __text
                  --sm (Kopf mobil) · --fact (Zahl + Text) · --xl (Fuß)
   .hang-tag      Hängeetikett mit Öse (echtes Loch) und Zackenrand unten
                  __hole (Anker für den Faden) · __kicker · __title · __meta
   .stamp         Stempel „Muster“ für klar gekennzeichnete Beispiele
   ========================================================================== */

/* ---- Webetikett ------------------------------------------------------------ */
.woven-label {
  --wl-bg: var(--c-linen);
  --wl-fg: var(--c-ink);
  --wl-fg-2: var(--c-ink-2);
  --wl-stitch: var(--c-krapp);
  --wl-notch: 6px;
  --wl-pad-x: 1.05em;
  --twill-ink: rgb(35 31 28 / .05);
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3em;
  padding: .55em calc(var(--wl-notch) + var(--wl-pad-x)) .5em;
  background-color: var(--wl-bg);
  background-image: var(--twill);
  color: var(--wl-fg);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--wl-notch)) 50%, 100% 100%, 0 100%, var(--wl-notch) 50%);
  box-shadow: inset 0 1px 0 var(--c-line), inset 0 -1px 0 var(--c-line);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition: letter-spacing var(--d-3) var(--ease-out);
}
/* Stiche 5 px innen an beiden Enden */
.woven-label::before,
.woven-label::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background-image: repeating-linear-gradient(to bottom, var(--wl-stitch) 0 3px, transparent 3px 6px);
  background-size: 1px 6px;
  opacity: .9;
}
.woven-label::before { left: calc(var(--wl-notch) + 5px); }
.woven-label::after { right: calc(var(--wl-notch) + 5px); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  a.woven-label:hover::before, a.woven-label:hover::after,
  :hover > .woven-label--sew::before, :hover > .woven-label--sew::after {
    animation: wl-sew 1.2s linear infinite;
  }
  a.woven-label:hover .woven-label__name { letter-spacing: -.02em; }
}
@keyframes wl-sew { to { background-position: 0 12px; } }

.woven-label__name {
  --wght: 480;
  --soft: 100;
  --wonk: 1;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--wght);
  font-variation-settings: "SOFT" var(--soft), "WONK" var(--wonk);
  font-size: 1.375rem;
  letter-spacing: -.01em;
  line-height: .95;
  transition: letter-spacing var(--d-3) var(--ease-out);
}
.woven-label__descriptor {
  font-family: var(--font-sans);
  font-size: .75rem;               /* Lesetext-Untergrenze 12 px (dekorative Etiketten dürfen kleiner) */
  font-weight: 600;
  font-stretch: 80%;
  font-variation-settings: "wdth" 80;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wl-fg-2);
  line-height: 1.2;
  padding-left: .2em; /* optischer Ausgleich der Sperrung */
}
.woven-label--sm { --wl-notch: 5px; --wl-pad-x: .8em; }
/* Umgeschlagene Enden: 8-px-Kerbe (clip-path) + Knick mit Schattenkante – liest sich
   als eingenähtes Tuch, nicht als Aufkleber. Schatten gehört an den Elternteil
   (clip-path schneidet eigene Schatten ab). */
.woven-label--folded {
  --wl-notch: 8px;
  --wl-fold: calc(var(--wl-notch) + 4px);
  background-image:
    linear-gradient(90deg,
      rgb(35 31 28 / .13), rgb(35 31 28 / .05) calc(var(--wl-fold) - 1px),
      rgb(35 31 28 / .16) calc(var(--wl-fold) - 1px) var(--wl-fold),
      transparent var(--wl-fold) calc(100% - var(--wl-fold)),
      rgb(35 31 28 / .16) calc(100% - var(--wl-fold)) calc(100% - var(--wl-fold) + 1px),
      rgb(35 31 28 / .05) calc(100% - var(--wl-fold) + 1px), rgb(35 31 28 / .13)),
    var(--twill);
}
.woven-label--folded::before { left: calc(var(--wl-fold) + 4px); }
.woven-label--folded::after { right: calc(var(--wl-fold) + 4px); }
.woven-label--sm .woven-label__name { font-size: 1.125rem; }
.woven-label--sm .woven-label__descriptor { font-size: .5625rem; }

/* Fakten-Etikett: große Zahl + erklärender Text (umbrechend) */
.woven-label--fact {
  --wl-pad-x: 1.25em;
  align-items: flex-start;
  gap: .45em;
  padding-block: 1em 1.05em;
  white-space: normal;
  text-align: left;
  min-width: 12rem;
}
.woven-label__value {
  --wght: 380;
  --soft: 30;
  --wonk: 0;
  font-family: var(--font-display);
  font-weight: var(--wght);
  font-variation-settings: "SOFT" var(--soft), "WONK" var(--wonk);
  font-size: var(--step-3);
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: lining-nums;
}
.woven-label__text {
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--wl-fg-2);
  max-width: 26ch;
}

/* Riesiges Webetikett (Fuß): skaliert mit Containerbreite und Namenslänge */
.woven-label--xl {
  --wl-notch: clamp(10px, 1.6vw, 34px);
  --wl-pad-x: .35em;
  gap: .45em;
  padding-block: .18em .28em;
  box-shadow: inset 0 2px 0 var(--c-line), inset 0 -2px 0 var(--c-line);
  max-width: 100%;
}
.woven-label--xl::before, .woven-label--xl::after {
  width: 2px;
  top: 8%;
  bottom: 8%;
  background-image: repeating-linear-gradient(to bottom, var(--wl-stitch) 0 8px, transparent 8px 15px);
  background-size: 2px 15px;
}
.woven-label--xl::before { left: calc(var(--wl-notch) + clamp(8px, 1vw, 18px)); }
.woven-label--xl::after { right: calc(var(--wl-notch) + clamp(8px, 1vw, 18px)); }
.woven-label--xl .woven-label__name {
  --wght: 400;
  font-size: clamp(3.5rem, calc(150cqi / var(--wordmark-len, 6)), 24rem);
  line-height: .9;
  padding-inline: .06em .12em;
  white-space: normal;
  text-wrap: balance;
  text-align: center;
}
.woven-label--xl .woven-label__descriptor { font-size: clamp(.625rem, .4rem + .6vw, 1rem); }

/* ---- Hängeetikett ------------------------------------------------------------ */
.hang-tag {
  --tag-bg: var(--c-linen);
  --tag-fg: var(--c-ink);
  --tag-fg-2: var(--c-ink-2);
  --tag-rot: 0deg;
  --hole-y: 1.05rem;
  --hole-r: .3rem;
  --twill-ink: rgb(35 31 28 / .05);
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  min-width: 9.5rem;
  padding: calc(var(--hole-y) + var(--hole-r) + .7rem) 1.1rem 1.15rem;
  background-color: var(--tag-bg);
  background-image: var(--twill);
  color: var(--tag-fg);
  clip-path: polygon(22% 0, 78% 0, 100% 1.4rem, 100% 100%, 0 100%, 0 1.4rem);
  -webkit-mask:
    radial-gradient(circle at 50% var(--hole-y), #0000 var(--hole-r), #000 calc(var(--hole-r) + .5px)),
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 10px 100%;
  -webkit-mask-composite: source-in;
          mask:
    radial-gradient(circle at 50% var(--hole-y), #0000 var(--hole-r), #000 calc(var(--hole-r) + .5px)),
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 10px 100%;
          mask-composite: intersect;
  transform-origin: 50% var(--hole-y);
  rotate: var(--tag-rot);
  filter: drop-shadow(0 6px 10px rgb(35 31 28 / .14));
}
/* Messing-Öse um das Loch */
.hang-tag__hole {
  position: absolute;
  top: calc(var(--hole-y) - var(--hole-r) - 2px);
  left: calc(50% - var(--hole-r) - 2px);
  width: calc(2 * var(--hole-r) + 4px);
  height: calc(2 * var(--hole-r) + 4px);
  border-radius: 50%;
  box-shadow: 0 0 0 2px #B59A62, inset 0 0 0 1px rgb(35 31 28 / .25);
  pointer-events: none;
}
.hang-tag__kicker {
  font-size: max(11px, .6875rem);
  font-weight: 600;
  font-stretch: 85%;
  font-variation-settings: "wdth" 85;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tag-fg-2);
}
.hang-tag__title {
  --wght: 420;
  --soft: 100;
  --wonk: 1;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--wght);
  font-variation-settings: "SOFT" var(--soft), "WONK" var(--wonk);
  font-size: var(--step-1);
  line-height: 1.05;
}
.hang-tag__meta { font-size: var(--step--2); color: var(--tag-fg-2); font-variant-numeric: tabular-nums; }
.hang-tag--dark { --tag-bg: var(--c-ink-3); --tag-fg: var(--c-paper); --tag-fg-2: var(--c-paper-72); --twill-ink: rgb(245 239 228 / .05); }

/* ---- Stempel ------------------------------------------------------------------ */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .3em .7em .28em;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  outline: 1px solid currentColor;
  outline-offset: 2px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: .6875rem;
  font-weight: 700;
  font-stretch: 85%;
  font-variation-settings: "wdth" 85;
  letter-spacing: .22em;
  text-transform: uppercase;
  line-height: 1;
  rotate: var(--stamp-rot, -6deg);
  opacity: .88;
  user-select: none;
}
