/* Public document library — responsive layout */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap");

:root {
  --docs-primary: #6366f1;
  --docs-secondary: #64748b;
  --docs-bg: #f4f6fb;
  --docs-surface: #ffffff;
  --docs-text: #0f172a;
  --docs-muted: #64748b;
  --docs-radius: 14px;
  --docs-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --docs-shadow-hover: 0 12px 40px rgba(15, 23, 42, 0.1);
  --docs-max: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.docs-body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  background: var(--docs-bg);
  color: var(--docs-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.docs-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ——— Floating home (top-right): uvijek puna primarna boja, vidljivo i na heroju i nakon scrolla ——— */
.docs-home-float {
  position: fixed;
  top: max(0.85rem, env(safe-area-inset-top, 0px));
  right: max(0.85rem, env(safe-area-inset-right, 0px));
  z-index: 200;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--docs-primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.22);
  text-decoration: none;
  font-size: 1.35rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.docs-home-float:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.28);
  filter: brightness(1.06);
  color: #ffffff;
}

.docs-home-float:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.docs-shell--no-home-float .docs-hero {
  padding-right: 1.25rem;
}

/* ——— Hero ——— */
.docs-hero {
  background: var(--docs-hero-bg, var(--docs-primary));
  color: var(--docs-hero-fg, #fff);
  padding: clamp(2rem, 5vw, 3.5rem) 1.25rem;
  padding-right: max(1.25rem, calc(44px + 2rem));
  min-height: 5.5rem;
}

.docs-hero__inner {
  max-width: var(--docs-max);
  margin: 0 auto;
}

.docs-hero-back-wrap {
  margin: 0 0 0.85rem;
}

.docs-hero-back-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.docs-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.12s ease;
}

.docs-hero-back:hover {
  transform: translateX(-2px);
}

.docs-hero-back--light {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.docs-hero-back--light:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.32);
}

.docs-hero-back--dark {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.docs-hero-back--dark:hover {
  color: #0f172a;
  background: #ffffff;
}

.docs-hero-back:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.docs-hero-live-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.05rem;
  transition: background 0.15s ease, transform 0.12s ease;
}

.docs-hero-live-home:hover {
  transform: scale(1.06);
}

.docs-hero-live-home--light {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.docs-hero-live-home--light:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.32);
}

.docs-hero-live-home--dark {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.docs-hero-live-home--dark:hover {
  color: #0f172a;
  background: #ffffff;
}

.docs-hero-live-home:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.docs-hero__title {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.docs-hero__subtitle {
  margin: 0.75rem 0 0;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  opacity: 0.92;
  max-width: 52ch;
}

.docs-hero--tone-dark .docs-hero__subtitle {
  opacity: 0.88;
}

/* ——— Main ——— */
.docs-main {
  flex: 1;
  width: 100%;
  max-width: var(--docs-max);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.75rem) 1.25rem 2.5rem;
}

/* ——— Breadcrumb ——— */
.docs-breadcrumb {
  margin-bottom: 1.25rem;
}

.docs-breadcrumb__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.875rem;
}

.docs-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-breadcrumb__item:not(:last-child)::after {
  content: "/";
  color: var(--docs-muted);
  font-weight: 400;
  margin-left: 0.15rem;
}

.docs-breadcrumb__link {
  color: var(--docs-primary);
  text-decoration: none;
  font-weight: 500;
  text-transform: uppercase;
}

.docs-breadcrumb__link:hover {
  text-decoration: underline;
}

.docs-breadcrumb__current {
  color: var(--docs-muted);
  font-weight: 500;
  text-transform: uppercase;
}

.docs-breadcrumb + .docs-section-title {
  margin-top: 0;
}

/* ——— Section titles (documents etc.) ——— */
.docs-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-muted);
  margin: 0 0 1rem;
}

/* ——— Category picker: two columns, compact ——— */
.docs-cat-block {
  margin: 0;
}

.docs-cat-block--spaced {
  margin-bottom: 2rem;
}

.docs-cat-heading {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--docs-text);
  letter-spacing: -0.02em;
}

.docs-cat-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(1rem, 4vw, 2.5rem);
  row-gap: 0.2rem;
  padding: 0.35rem 1rem 0.65rem;
  background: var(--docs-surface);
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.docs-cat-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.35rem;
  margin: 0;
  text-decoration: none;
  color: var(--docs-text);
  border-radius: 8px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

@media (max-width: 560px) {
  .docs-cat-list {
    grid-template-columns: 1fr;
  }
}

.docs-cat-row:hover {
  background: color-mix(in srgb, var(--docs-primary) 7%, transparent);
  color: var(--docs-text);
}

.docs-cat-row__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--docs-primary);
}

.docs-cat-row__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.docs-cat-row__name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  word-break: break-word;
}

.docs-cat-row__sub {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--docs-muted);
  line-height: 1.35;
  word-break: break-word;
}

/* ——— Document row cards ——— */
.docs-doc-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.docs-doc {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: var(--docs-surface);
  border-radius: var(--docs-radius);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--docs-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.docs-doc:hover {
  transform: translateY(-2px);
  box-shadow: var(--docs-shadow-hover);
}

.docs-doc__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--docs-secondary) 14%, transparent);
  color: var(--docs-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.docs-doc__body {
  min-width: 0;
  flex: 1;
}

.docs-doc__title {
  margin: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
}

.docs-doc__sub {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--docs-muted);
}

/* Kad postoji podnaslov, ikona poravnata s prvim retkom teksta */
.docs-doc:has(.docs-doc__sub) {
  align-items: flex-start;
}

.docs-doc:has(.docs-doc__sub) .docs-doc__icon {
  margin-top: 0.05rem;
}

/* ——— Document detail ——— */
.docs-prose {
  background: var(--docs-surface);
  border-radius: var(--docs-radius);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--docs-shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: 800px;
}

.docs-prose h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
}

.docs-prose .lead {
  margin: 0 0 1rem;
  color: var(--docs-muted);
  font-size: 1.05rem;
}

.docs-prose .content {
  margin-top: 1rem;
  line-height: 1.65;
}

.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.docs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.docs-btn--primary {
  background: var(--docs-primary);
  color: #fff;
}

.docs-btn--primary:hover {
  filter: brightness(0.95);
}

.docs-btn--ghost {
  background: transparent;
  color: var(--docs-primary);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.docs-btn--ghost:hover {
  background: rgba(99, 102, 241, 0.06);
}

.docs-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--docs-muted);
  background: var(--docs-surface);
  border-radius: var(--docs-radius);
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

.docs-footer {
  padding: 1.25rem;
  text-align: center;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.6);
}

.docs-footer__brand {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--docs-text);
}

.docs-footer__brand-icon {
  font-size: 1.1rem;
  color: var(--docs-primary);
  line-height: 1;
}

.docs-footer__inst {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--docs-muted);
}

@media (max-width: 480px) {
  .docs-breadcrumb__list {
    font-size: 0.8125rem;
  }
}
