/* Shared website link semantics. Kept separate from the frozen Lattice release stylesheet. */
:root {
  --family-link-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6h8M7 3l3 3-3 3' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --family-link-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 10 10 2M3 2h7v7' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --family-link-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1.5v6M3.5 5 6 7.5 8.5 5M2 10h8' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/*
  One semantic marker system:
  - internal andrazdjuric.com-family navigation: horizontal right arrow
  - external destinations: up-right arrow
  - file/artifact downloads: download symbol
  The three marks share the same 12px canvas, stroke width and rounded geometry.
*/
a[href],
a.project-card[href] {
  --family-active-link-marker: var(--family-link-right);
}

/* Absolute web/mail destinations are external by default. Exact family origins override below. */
a[href^="http://"],
a[href^="https://"],
a[href^="//"],
a[href^="mailto:"] {
  --family-active-link-marker: var(--family-link-external);
}
a[href^="https://andrazdjuric.com/"],
a[href="https://andrazdjuric.com"],
a[href^="https://crop.andrazdjuric.com/"],
a[href="https://crop.andrazdjuric.com"],
a[href^="https://image.andrazdjuric.com/"],
a[href="https://image.andrazdjuric.com"],
a[href^="https://media.andrazdjuric.com/"],
a[href="https://media.andrazdjuric.com"],
a[href^="https://pdf.andrazdjuric.com/"],
a[href="https://pdf.andrazdjuric.com"],
a[href^="https://exocortex.andrazdjuric.com/"],
a[href="https://exocortex.andrazdjuric.com"] {
  --family-active-link-marker: var(--family-link-right);
}

/* Explicit artifacts and download routes outrank navigation/external semantics. */
a[download],
a[href*="/downloads/"],
a[href="/download-source"],
a[href$=".zip"],
a[href$=".exe"],
a[href$=".apk"],
a[href$=".sha256.txt"] {
  --family-active-link-marker: var(--family-link-download);
}

a[href]::after,
a.project-card[href] .project-action::after {
  content: "";
  display: inline-block;
  flex: none;
  width: 0.7em;
  height: 0.7em;
  margin-inline-start: 0.3em;
  vertical-align: 0.02em;
  background-color: currentColor;
  -webkit-mask: var(--family-active-link-marker) center / contain no-repeat;
  mask: var(--family-active-link-marker) center / contain no-repeat;
  pointer-events: none;
}

/* Action buttons that already carry an explicit SVG icon do not duplicate it. */
a[href]:has(> svg)::after,
a[href]:has(> span > svg)::after {
  content: none;
}

a[href]:not(:where(.project-card, .family-media-link, .family-primary, .family-secondary, .primary-action, .primary, .secondary)),
a.project-card[href] .project-action {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
  text-underline-offset: 4px;
  text-decoration-skip-ink: auto;
}

a[href]:where(.text-action, .content-link, .guide-link, .text-link, .family-text-action),
.document a[href],
a.project-card[href] .project-action {
  border-bottom: 0;
}

/* Whole-card links expose exactly one marker beside their destination label. */
a.project-card[href]::after { content: none; }

/* Existing flex gaps already separate these labels from their marker. */
a[href]:where(.family-primary, .primary, .secondary)::after,
.family-home-nav a[href]::after { margin-inline-start: 0; }

a.family-media-link[href] {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  text-decoration: none;
}
a.family-media-link[href]::after {
  align-self: flex-end;
  margin: 6px 0 0;
}

@media (forced-colors: active) {
  a[href]::after,
  a.project-card[href] .project-action::after {
    forced-color-adjust: none;
    background-color: LinkText;
  }
}

/* Shared chrome is deliberately markerless. This is container-scoped so future
   header/footer/Home/return links inherit it automatically. Buy me a coffee is
   the sole header exception and keeps the normal external marker. */
.site-header a[href]::after,
.family-home-nav a[href]::after,
.site-footer a[href]::after {
  content: none;
}
.site-header .family-donation a[href]::after {
  content: "";
}

/* Main site is the sole parent-row exception: mirror the existing internal mark.
   This indicates the umbrella destination, never browser-history Back. */
.family-home-nav a.family-main-return::after {
  content: "";
  display: inline-block;
  flex: none;
  width: 0.7em;
  height: 0.7em;
  background-color: currentColor;
  -webkit-mask: var(--family-link-right) center / contain no-repeat;
  mask: var(--family-link-right) center / contain no-repeat;
  transform: scaleX(-1);
}
@media (forced-colors: active) {
  .family-home-nav a.family-main-return::after {
    forced-color-adjust: none;
    background-color: LinkText;
  }
}

/* Parent links follow the current project's interaction palette. */
.family-home-nav a:is(:hover, :focus-visible) { color: var(--family-accent-strong); }
@media (forced-colors: active) {
  .family-home-nav a:is(:hover, :focus-visible) { color: LinkText; }
}

/* Contact left and Guide/Settings right. CSS handles enlarged-text wrapping;
   the shell measures only total height to reserve document clearance. */
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: var(--family-space-12);
}
.site-footer-links {
  order: 2;
  margin-left: auto;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-footer-contact {
  order: 1;
  white-space: nowrap;
}
