/* ═══════════════════════════════════════════════════════════════════════════
   TaskCatalyst SDK v1 — tc.css
   Component styles. All colors via CSS custom properties from :root / [data-theme].
   CSS vars are injected inline from the DB by TC_SiteDB::cssVars() in layout.php.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ─── Buttons ────────────────────────────────────────────────────────────── */

.tc-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: var(--tc-radius);
  font-family: var(--tc-font-body);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: opacity .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}

.tc-btn:hover  { opacity: .85; transform: translateY(-1px); }
.tc-btn:active { transform: translateY(0); opacity: .9; }

.tc-btn:focus-visible {
  outline: 2px solid var(--tc-primary);
  outline-offset: 3px;
}

.tc-btn--primary {
  background: var(--tc-primary);
  color: #fff;
}

.tc-btn--outline {
  background: transparent;
  border-color: var(--tc-primary);
  color: var(--tc-primary);
}

.tc-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--tc-primary);
}

@media (prefers-reduced-motion: reduce) {
  .tc-btn { transition: none; }
  .tc-btn:hover { transform: none; }
}


/* ─── Navbar ─────────────────────────────────────────────────────────────── */

.tc-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--tc-bg);
  border-bottom: 1px solid var(--tc-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.tc-navbar__inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 1.5rem;
}

.tc-navbar__brand {
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.tc-navbar__logo {
  height: 38px;
  width: auto;
  display: block;
}

.tc-navbar__name {
  font-family: var(--tc-font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tc-text);
  letter-spacing: -.015em;
}

.tc-navbar__nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.tc-navbar__nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: .125rem;
}

.tc-navbar__nav a {
  display: block;
  padding: .45rem .875rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--tc-muted);
  text-decoration: none;
  border-radius: calc(var(--tc-radius) * 0.75);
  transition: color .15s ease, background .15s ease;
}

.tc-navbar__nav a:hover {
  color: var(--tc-text);
  background: var(--tc-surface);
}

.tc-navbar__nav a[aria-current="page"] {
  color: var(--tc-text);
  background: var(--tc-surface);
  font-weight: 600;
}

.tc-navbar__nav a:focus-visible {
  outline: 2px solid var(--tc-primary);
  outline-offset: 2px;
}

/* Hamburger */
.tc-navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  margin-left: auto;
  border-radius: var(--tc-radius);
  -webkit-tap-highlight-color: transparent;
}

.tc-navbar__hamburger:focus-visible {
  outline: 2px solid var(--tc-primary);
  outline-offset: 2px;
}

.tc-navbar__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--tc-text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .15s ease;
  transform-origin: center;
}

.tc-navbar__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.tc-navbar__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.tc-navbar__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav panel — hidden unless .tc-navbar__hamburger toggles .open onto it (tc.js) */
.tc-mobile-nav {
  display: none;
  background: var(--tc-surface);
  border-bottom: 1px solid var(--tc-border);
}

.tc-mobile-nav.open {
  display: block;
}

.tc-mobile-nav ul {
  list-style: none;
  padding: .5rem 0;
}

.tc-mobile-nav a {
  display: block;
  padding: .8rem 1.5rem;
  color: var(--tc-text);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}

.tc-mobile-nav a:hover {
  background: var(--tc-bg);
  color: var(--tc-primary);
}

.tc-mobile-nav a:focus-visible {
  outline: 2px solid var(--tc-primary);
  outline-offset: -2px;
}

@media (max-width: 768px) {
  .tc-navbar__nav       { display: none; }
  .tc-navbar__hamburger { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-navbar__hamburger span { transition: none; }
}


/* ─── Hero ───────────────────────────────────────────────────────────────── */

.tc-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--tc-surface);
  background-image: var(--hero-bg, none);
  background-size: cover;
  background-position: center;
}

/* Dark overlay when bg image is set */
.tc-hero[style*="--hero-bg"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--hero-overlay, .5));
  z-index: 0;
}

/* Heights */
.tc-hero--full   { min-height: 100svh; }
.tc-hero--large  { min-height: 70vh; }
.tc-hero--medium { min-height: 45vh; }

/* Content area */
.tc-hero__content {
  position: relative;
  z-index: 1;
  padding-block: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tc-hero--center .tc-hero__content { align-items: center; text-align: center; }
.tc-hero--right  .tc-hero__content { align-items: flex-end; text-align: right; }
.tc-hero--left   .tc-hero__content { align-items: flex-start; text-align: left; }

/* Text: white on image hero */
.tc-hero[style*="--hero-bg"] .tc-hero__headline {
  color: #fff;
}
.tc-hero[style*="--hero-bg"] .tc-hero__subheadline {
  color: rgba(255, 255, 255, .82);
}

/* Typography */
.tc-hero__headline {
  font-family: var(--tc-font-heading);
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--tc-text);
  text-wrap: balance;
  max-width: 18ch;
  letter-spacing: -.02em;
}

.tc-hero__subheadline {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--tc-muted);
  max-width: 52ch;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .tc-hero--full { min-height: 85svh; }
  .tc-hero__content { padding-block: 3.5rem; }
}


/* ─── Heading ────────────────────────────────────────────────────────────── */

.tc-heading {
  padding: 3rem 0 1rem;
}

.tc-heading .tc-container {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.tc-heading--center .tc-container { align-items: center; text-align: center; }
.tc-heading--right  .tc-container { align-items: flex-end;  text-align: right; }
.tc-heading--left   .tc-container { align-items: flex-start; text-align: left; }

.tc-heading__text {
  font-family: var(--tc-font-heading);
  color: var(--tc-text);
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: -.01em;
}

.tc-heading--xl .tc-heading__text { font-size: clamp(1.75rem, 4vw, 3rem);    font-weight: 700; }
.tc-heading--lg .tc-heading__text { font-size: clamp(1.4rem, 3vw, 2.25rem);  font-weight: 700; }
.tc-heading--md .tc-heading__text { font-size: clamp(1.15rem, 2.2vw, 1.7rem); font-weight: 600; }
.tc-heading--sm .tc-heading__text { font-size: 1.1rem;                         font-weight: 600; }

.tc-heading__subtext {
  color: var(--tc-muted);
  font-size: 1.05rem;
  max-width: 55ch;
  line-height: 1.65;
}


/* ─── Paragraph ──────────────────────────────────────────────────────────── */

.tc-paragraph {
  padding: .875rem 0;
}

.tc-paragraph--center .tc-container { text-align: center; }
.tc-paragraph--right  .tc-container { text-align: right; }

.tc-paragraph p {
  color: var(--tc-text);
  line-height: 1.8;
}

.tc-paragraph--sm p { font-size: .9rem; }
.tc-paragraph--md p { font-size: 1rem; }
.tc-paragraph--lg p { font-size: 1.1rem; }

.tc-paragraph--narrow  p { max-width: 45ch; }
.tc-paragraph--normal  p { max-width: 65ch; }
.tc-paragraph--wide    p { max-width: 85ch; }

.tc-paragraph--center p { margin-inline: auto; }
.tc-paragraph--right  p { margin-inline-start: auto; }


/* ─── Divider ────────────────────────────────────────────────────────────── */

.tc-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.tc-divider--sm { padding-block: .875rem; }
.tc-divider--md { padding-block: 1.75rem; }
.tc-divider--lg { padding-block: 3.5rem; }

/* Line */
.tc-divider--line {
  padding-inline: 1.25rem;
}
.tc-divider--line::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: var(--tc-border);
}

/* Dots */
.tc-divider--dots { gap: .6rem; }

.tc-divider--dots span {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tc-border);
}

/* Wave */
.tc-divider--wave {
  padding-block: 0;
  overflow: hidden;
}
.tc-divider--wave svg {
  width: 100%;
  display: block;
  flex-shrink: 0;
}
.tc-divider--wave.tc-divider--sm svg { height: 28px; }
.tc-divider--wave.tc-divider--md svg { height: 48px; }
.tc-divider--wave.tc-divider--lg svg { height: 72px; }

/* Space — pure whitespace, no decoration */
.tc-divider--space { padding-inline: 0; }
.tc-divider--space::after { display: none; }


/* ─── Section wrapper (optional utility) ─────────────────────────────────── */

.tc-section {
  padding-block: 3rem;
}

@media (min-width: 768px) {
  .tc-section { padding-block: 5rem; }
}


/* ─── Footer ─────────────────────────────────────────────────────────────── */

.tc-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--tc-border);
  background: var(--tc-surface);
}

.tc-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2.5rem;
  padding-block: 2.75rem;
  align-items: start;
}

.tc-footer__brand {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.tc-footer__name {
  font-family: var(--tc-font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tc-text);
  letter-spacing: -.01em;
}

.tc-footer__brand address {
  font-style: normal;
  font-size: .875rem;
  color: var(--tc-muted);
  line-height: 1.55;
}

.tc-footer__contact {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
}

.tc-footer__contact a {
  font-size: .875rem;
  color: var(--tc-muted);
  text-decoration: none;
  transition: color .15s ease;
}

.tc-footer__contact a:hover { color: var(--tc-primary); }

.tc-footer__social {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .625rem;
}

.tc-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--tc-radius);
  border: 1px solid var(--tc-border);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--tc-muted);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.tc-footer__social a:hover {
  border-color: var(--tc-primary);
  color: var(--tc-primary);
  background: transparent;
}

.tc-footer__social a:focus-visible {
  outline: 2px solid var(--tc-primary);
  outline-offset: 2px;
}

.tc-footer__copy {
  grid-column: 1;
  grid-row: 2;
  font-size: .8rem;
  color: var(--tc-muted);
  align-self: end;
  padding-top: .5rem;
}

@media (max-width: 640px) {
  .tc-footer__inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .tc-footer__contact {
    grid-column: 1;
    grid-row: 2;
    align-items: flex-start;
  }
  .tc-footer__social {
    grid-column: 1;
    grid-row: 3;
    justify-content: flex-start;
  }
  .tc-footer__copy {
    grid-row: 4;
    padding-top: .75rem;
  }
}


/* ─── Scroll-reveal utility ──────────────────────────────────────────────── */

.tc-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}

.tc-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .tc-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ─── Text component ─────────────────────────────────────────────────────── */

.tc-text {
  padding: 3rem 0;
}

.tc-text__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Alignment */
.tc-text--left   { text-align: left; }
.tc-text--left   .tc-text__inner { align-items: flex-start; }

.tc-text--center { text-align: center; }
.tc-text--center .tc-text__inner { align-items: center; }

.tc-text--right  { text-align: right; }
.tc-text--right  .tc-text__inner { align-items: flex-end; }

/* Heading */
.tc-text__heading {
  font-family: var(--tc-font-heading);
  font-weight: 700;
  color: var(--tc-text);
  text-wrap: balance;
  line-height: 1.25;
}

.tc-text--sm .tc-text__heading { font-size: clamp(1.1rem, 3vw, 1.4rem); }
.tc-text--md .tc-text__heading { font-size: clamp(1.4rem, 4vw, 2rem);   }
.tc-text--lg .tc-text__heading { font-size: clamp(1.8rem, 5vw, 2.8rem); }

/* Body */
.tc-text__body {
  color: var(--tc-text);
  max-width: 68ch;
}

.tc-text--sm .tc-text__body { font-size: .9rem;  }
.tc-text--md .tc-text__body { font-size: 1rem;   }
.tc-text--lg .tc-text__body { font-size: 1.15rem; }

.tc-text__body p + p   { margin-top: .85em; }
.tc-text__body a       { color: var(--tc-primary); }
.tc-text__body a:hover { opacity: .8; }
.tc-text__body strong  { font-weight: 600; color: var(--tc-text); }
.tc-text__body em      { font-style: italic; }


/* ─── Section grid ───────────────────────────────────────────────────────── */

.tc-section__grid {
  display: grid;
  grid-template-columns: repeat(var(--tc-cols, 1), 1fr);
  gap: var(--tc-gap, 2rem);
}

.tc-section__item {
  grid-column: span var(--tc-span, 1);
  min-width: 0;
}

@media (max-width: 768px) {
  .tc-section__grid {
    grid-template-columns: 1fr !important;
  }
  .tc-section__item {
    grid-column: span 1 !important;
  }
}


/* ─── Feature card ───────────────────────────────────────────────────────── */

.tc-feature-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--tc-radius);
  background: var(--tc-surface);
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease;
}

.tc-feature-card--border {
  border: 1px solid var(--tc-border);
}

.tc-feature-card--shadow:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
}

/* Alignment */
.tc-feature-card--center {
  align-items: center;
  text-align: center;
}
.tc-feature-card--left {
  align-items: flex-start;
  text-align: left;
}

/* Icon */
.tc-feature-card__icon {
  color: var(--tc-primary);
  flex-shrink: 0;
}

/* Image */
.tc-feature-card__image {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--tc-radius);
}

/* Heading */
.tc-feature-card__heading {
  font-family: var(--tc-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tc-text);
  line-height: 1.3;
}

/* Body */
.tc-feature-card__body {
  font-size: .9rem;
  color: var(--tc-muted);
  line-height: 1.65;
  flex: 1;
}

/* Link */
.tc-feature-card__link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--tc-primary);
  text-decoration: none;
  margin-top: .25rem;
}
.tc-feature-card__link:hover { opacity: .75; }

/* SVG icon baseline */
.tc-icon { vertical-align: middle; flex-shrink: 0; }


/* ─── Slider ─────────────────────────────────────────────────────────────── *
 * Track slides side by side with transform: translateX() and clips the rest
 * via overflow:hidden — every slide is ALWAYS in normal flow inside the
 * track, so there's no opacity/visibility toggling and no structural
 * pseudo-class (:first-child) fighting a JS-managed .active class. Only the
 * transform moves; nothing can silently overlap or stack vertically.
 *
 * Markup (tc.js auto-inits every .tc-slider found on the page):
 *   <div class="tc-slider" data-interval="6000" data-per-view="1" data-loop="1">
 *     <div class="tc-slider__viewport">
 *       <div class="tc-slider__track">
 *         <div class="tc-slider__item">...</div>
 *         <div class="tc-slider__item">...</div>
 *       </div>
 *     </div>
 *     <button class="tc-slider__arrow tc-slider__arrow--prev" data-dir="-1" aria-label="Prethodni"><i class="fa-solid fa-chevron-left"></i></button>
 *     <button class="tc-slider__arrow tc-slider__arrow--next" data-dir="1" aria-label="Sljedeći"><i class="fa-solid fa-chevron-right"></i></button>
 *     <div class="tc-slider__dots"></div>
 *   </div>
 * ── */

.tc-slider {
  position: relative;
}

.tc-slider__viewport {
  overflow: hidden;
}

.tc-slider__track {
  display: flex;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.tc-slider__item {
  flex: 0 0 calc(100% / var(--tc-slider-per-view, 1));
  min-width: 0;
}

.tc-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--tc-border);
  background: color-mix(in srgb, var(--tc-bg) 85%, transparent);
  color: var(--tc-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: opacity .15s ease;
}
.tc-slider__arrow:hover      { opacity: .8; }
.tc-slider__arrow--prev      { left: 1rem; }
.tc-slider__arrow--next      { right: 1rem; }
.tc-slider[data-loop='0'] .tc-slider__arrow[disabled] { opacity: .3; cursor: default; pointer-events: none; }

.tc-slider__dots {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  z-index: 5;
}

.tc-slider__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--tc-text);
  padding: 0;
  cursor: pointer;
}
.tc-slider__dot.active {
  background: var(--tc-text);
  width: 24px;
  border-radius: 5px;
}

@media (max-width: 768px) {
  .tc-slider__arrow { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-slider__track { transition: none; }
}
