/* Inline tech icons (Zigbee, Z-Wave, etc.) in headings */
h3 a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

h3 a img {
  height: 1.4em;
  width: auto;
  max-width: 8rem;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Nav container */
.nav-container {
  position: relative;
  z-index: 100;
  background: var(--background-color);
}

/* Hero: block scrolling until done */
body[data-hero]:not([data-hero-done]) {
  overflow: hidden;
}

/* Full-screen overlay — fades out as hero scrolls */
body[data-hero]:not([data-hero-done])::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--background-color);
  z-index: 150;
  opacity: calc(1 - var(--hero-p, 0));
  pointer-events: none;
}

/* Hero logo wrap — JS sets left/top/width/height/display */
.hero-logo-wrap {
  display: none;
  position: fixed;
  z-index: 200;
  line-height: 0;
  text-decoration: none;
  overflow: visible;
}

/* Inner div clips the banner image */
.hero-logo-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-logo-wrap img {
  height: 100%;
  width: auto;
  display: block;
}

@media only screen and (max-width: 850px) {
  body[data-hero-done] .hero-logo-wrap {
    display: none;
  }
}

/* Scroll arrows */
body[data-hero]:not([data-hero-done]) .hero-scroll-arrow {
  display: block;
  position: absolute;
  bottom: -3.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.5rem;
  height: auto;
  opacity: calc(1 - var(--hero-p, 0));
  pointer-events: none;
  animation: hero-arrow-bounce 1.4s ease-in-out infinite;
}

body[data-hero][data-hero-done] .hero-scroll-arrow,
body:not([data-hero]) .hero-scroll-arrow {
  display: none;
}

body[data-hero]:not([data-hero-done]) .hero-scroll-arrow .arrow-1 {
  animation: hero-arrow-breathe 2.0s ease-in-out infinite;
}

body[data-hero]:not([data-hero-done]) .hero-scroll-arrow .arrow-2 {
  animation: hero-arrow-breathe 2.0s ease-in-out 1.0s infinite;
}

@keyframes hero-arrow-bounce {
  0%, 100% { margin-top: 0; }
  50%       { margin-top: 8px; }
}

@keyframes hero-arrow-breathe {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1.0; }
}

/* Brand carousel */
.brand-carousel {
  height: 8rem;
  margin: 1.5rem 0;
  overflow: hidden;
}

.brand-track {
  display: flex;
  width: 100%;
  height: 100%;
}

.brand-slide {
  width: 33.333%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-slide img {
  height: 8rem;
  width: auto;
  object-fit: contain;
}

.terminal-menu .main-nav .has-dropdown {
  position: relative;
}

.terminal-menu .main-nav .dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.terminal-menu .main-nav .dropdown-caret {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--font-color);
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
}

.terminal-menu .main-nav .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  min-width: 26ch;
  width: max-content;
  margin: 0;
  padding: 0.35rem 0.5rem;
  list-style: none;
  background: var(--background-color);
  border: 1px solid var(--secondary-color);
  z-index: 20;
}

.terminal-menu .main-nav .has-dropdown:hover .dropdown-menu,
.terminal-menu .main-nav .has-dropdown:focus-within .dropdown-menu,
.terminal-menu .main-nav .has-dropdown.open .dropdown-menu {
  display: block;
}

.terminal-menu .main-nav .dropdown-menu li {
  margin-right: 0;
  white-space: nowrap;
}

.terminal-menu .main-nav .dropdown-menu a {
  display: block;
  padding: 0.1rem 0;
}

/* Footer layout */
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-switcher {
  display: flex;
  gap: 1rem;
}

/* Dark-mode overrides for /img/ SVGs on storitve pages */
@media (prefers-color-scheme: dark) {
  h3 a img[src*="/img/"] {
    filter: invert(1) hue-rotate(180deg);
  }
  a[aria-label="Sonoff"] img {
    filter: invert(1) hue-rotate(180deg);
  }
}

@media only screen and (max-width: 850px) {
  /* Override theme: stack nav items vertically */
  .terminal-menu ul.main-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .terminal-menu ul.main-nav > li {
    margin-right: 0;
    margin-bottom: 0.25rem;
    padding: 0.3rem 0.5rem;
  }

  .terminal-menu .main-nav .dropdown-menu li {
    padding: 0.2rem 0.5rem;
  }

  /* Storitve dropdown: hidden by default on mobile, shown on storitve subpages */
  .terminal-menu .main-nav .has-dropdown {
    flex: content;
    flex-direction: column;
  }

  .terminal-menu .main-nav .has-dropdown .dropdown-menu {
    position: static;
    display: none;
    margin-top: 0;
    border: none;
    padding: 0;
    margin-left: 1rem;
    min-width: 0;
    width: auto;
  }

  .page-storitve .terminal-menu .main-nav .has-dropdown-services .dropdown-menu,
  .page-about .terminal-menu .main-nav .has-dropdown-about .dropdown-menu,
  .terminal-menu .main-nav .has-dropdown.open .dropdown-menu {
    display: block;
  }

  /* Carousel: vertical stack */
  .brand-carousel {
    height: auto;
  }

  .brand-track {
    flex-direction: column;
    height: auto;
  }

  .brand-slide {
    width: 100%;
    padding: 0.75rem 0;
  }

  .brand-slide img {
    max-height: 4rem;
  }
}

/* =============================================
   Testimonials Carousel (stranke page)
   ============================================= */
.testimonials-carousel {
  margin: 2rem 0;
  position: relative;
}

.testimonials-track {
  position: relative;
  min-height: 14rem;
}

.testimonial-card {
  display: none;
  padding: 1.75rem 2rem;
  border: 1px solid var(--secondary-color);
  background: var(--background-color);
  max-width: 48rem;
}

.testimonial-card.active {
  display: block;
  animation: fadeInCard 0.4s ease;
}

@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.testimonial-stars {
  font-size: 1.4rem;
  color: var(--primary-color);
  letter-spacing: 0.1rem;
  margin-bottom: 0.75rem;
}

.testimonial-quote {
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 1rem;
  font-style: italic;
  border: none;
  padding: 0;
}

.testimonial-author {
  font-size: 0.9rem;
  opacity: 0.7;
  font-style: normal;
}

.testimonials-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.testimonials-btn {
  background: none;
  border: 1px solid var(--secondary-color);
  color: var(--font-color);
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
}

.testimonials-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.testimonials-dots {
  display: flex;
  gap: 0.5rem;
}

.testimonials-dot {
  background: none;
  border: 1px solid var(--secondary-color);
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
}

.testimonials-dot.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* =============================================
   Projekti Grid (projekti list page)
   ============================================= */
.projekti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.projekti-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--secondary-color);
  text-decoration: none;
  color: var(--font-color);
  transition: border-color 0.15s;
}

.projekti-card:hover {
  border-color: var(--primary-color);
}

.projekti-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--secondary-color);
}

.projekti-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.projekti-card-placeholder {
  opacity: 0.3;
}

.projekti-card-body {
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.projekti-card-title {
  font-size: 1.05rem;
  margin: 0;
  border: none;
  padding: 0;
}

.projekti-card-summary {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0;
  flex: 1;
}

.projekti-card-cta {
  font-size: 0.85rem;
  color: var(--primary-color);
  margin-top: 0.25rem;
}

/* =============================================
   Under Construction
   ============================================= */
.under-construction {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 1rem;
  margin: 1.5rem 0 2.5rem;
  border: 1px dashed var(--secondary-color);
}

.under-construction-svg {
  width: 14rem;
  max-width: 100%;
  height: auto;
}

.under-construction-label {
  font-size: 0.9rem;
  opacity: 0.55;
  margin: 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* SVG element classes — light theme */
.uc-structure      { fill: #151515; opacity: 0.3; }
.uc-structure-faint{ fill: #151515; opacity: 0.15; }
.uc-board-fill     { fill: #1a95e0; opacity: 0.1; }
.uc-board-border   { fill: none; stroke: #1a95e0; stroke-width: 2; opacity: 0.6; }
.uc-stripes        { stroke: #1a95e0; opacity: 0.2; fill: none; }
.uc-hat            { fill: #1a95e0; opacity: 0.65; }
.uc-hat-brim       { fill: #1a95e0; opacity: 0.85; }
.uc-tool           { fill: #151515; stroke: #151515; opacity: 0.35; }

@media (prefers-color-scheme: dark) {
  .uc-structure      { fill: #e8e9ed; opacity: 0.3; }
  .uc-structure-faint{ fill: #e8e9ed; opacity: 0.15; }
  .uc-board-fill     { fill: #62c4ff; opacity: 0.1; }
  .uc-board-border   { fill: none; stroke: #62c4ff; stroke-width: 2; opacity: 0.6; }
  .uc-stripes        { stroke: #62c4ff; opacity: 0.2; fill: none; }
  .uc-hat            { fill: #62c4ff; opacity: 0.65; }
  .uc-hat-brim       { fill: #62c4ff; opacity: 0.85; }
  .uc-tool           { fill: #e8e9ed; stroke: #e8e9ed; opacity: 0.35; }
}

/* =============================================
   Single Project Page
   ============================================= */
.projekt-cover {
  margin-bottom: 2rem;
}

.projekt-cover img {
  width: 100%;
  max-height: 24rem;
  object-fit: cover;
  display: block;
}

.projekt-header {
  margin-bottom: 2rem;
}

.projekt-date {
  font-size: 0.85rem;
  opacity: 0.6;
  display: block;
  margin-top: 0.4rem;
}

.projekt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.projekt-tag {
  border: 1px solid var(--secondary-color);
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
}

.projekt-back {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.9rem;
}

@media only screen and (max-width: 850px) {
  .projekti-grid {
    grid-template-columns: 1fr;
  }
}
