:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --navy: #0f172a;
  --navy-soft: #1e293b;
  --accent: #00579b;
  --accent-hover: #004a7a;
  --accent-soft: rgba(0, 87, 155, 0.12);
  --muted: #64748b;
  --border: #e2e8f0;
  --topbar-bg: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --font: "DM Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 17px;
  color: var(--navy-soft);
  background: var(--bg);
  line-height: 1.7;
}

a {
  color: var(--navy-soft);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--accent);
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

/* ——— Top bar ——— */
.top-bar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.55rem 0;
}

.top-bar a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.top-bar a:hover {
  color: var(--accent);
}

.top-bar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar-note {
  color: var(--muted);
}

.icon-inline {
  flex-shrink: 0;
  color: var(--accent);
}

/* ——— Main header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: nowrap;
}

.header-menu {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  min-width: 0;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  text-decoration: none;
}

.logo:hover {
  color: var(--navy);
}

.logo-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.logo-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  min-width: 0;
}

.logo-dot {
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 0.1em;
  vertical-align: middle;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin: 0;
  margin-left: auto;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: var(--accent-soft);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  width: 1.45rem;
  pointer-events: none;
}

.hamburger span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Moderne tri crte različitih dužina (srednja najduža) */
.hamburger span:nth-child(1) {
  width: 55%;
}

.hamburger span:nth-child(2) {
  width: 100%;
}

.hamburger span:nth-child(3) {
  width: 72%;
}

body.menu-open .nav-toggle .hamburger span {
  width: 100%;
}

body.menu-open .nav-toggle .hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

body.menu-open .nav-toggle .hamburger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

body.menu-open .nav-toggle .hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(15, 23, 42, 0.45);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

body.menu-open .nav-backdrop {
  display: block;
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  flex: 1;
  min-width: 0;
}

.nav-main a {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  color: var(--navy-soft);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-main a:hover {
  background: var(--accent-soft);
  color: var(--navy);
  text-decoration: none;
}

.nav-main a.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-header {
  background: var(--accent);
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 87, 155, 0.35);
}

.btn-header:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

body.menu-open .site-header {
  z-index: 110;
}

/* ——— Hero (home) ——— */
.hero-wrap {
  position: relative;
  overflow: hidden;
  padding: 4rem 0 3.5rem;
  background: var(--bg);
}

.hero-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(45%, 380px);
  height: 220px;
  background: repeating-linear-gradient(
    -35deg,
    transparent,
    transparent 8px,
    rgba(148, 163, 184, 0.12) 8px,
    rgba(148, 163, 184, 0.12) 9px
  );
  pointer-events: none;
  z-index: 0;
}

.hero-dots {
  position: absolute;
  bottom: 2rem;
  right: 4%;
  width: 72px;
  height: 72px;
  background-image: radial-gradient(
    circle,
    var(--accent) 2px,
    transparent 2.5px
  );
  background-size: 12px 12px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.hero-split {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem 4rem;
  align-items: center;
}

.hero-copy h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.5vw, 3.15rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--navy-soft);
}

.hero-text {
  margin: 0;
  max-width: 38ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
  margin-top: 2rem;
}

.btn-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 0.85rem 1.6rem;
  box-shadow: 0 12px 28px rgba(0, 87, 155, 0.35);
}

.btn-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.hero-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--navy);
}

.hero-phone svg {
  color: var(--accent);
}

.hero-visual {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 520px;
}

.hero-image-ring {
  position: relative;
  padding: 5px;
  background: linear-gradient(
    145deg,
    var(--accent),
    #2d8fc8
  );
  border-radius: 0 0 0 48%;
  box-shadow: var(--shadow-md);
}

.hero-image-ring img {
  display: block;
  width: 100%;
  height: min(52vw, 440px);
  min-height: 280px;
  object-fit: cover;
  border-radius: 0 0 0 46%;
}

/* ——— Mission band ——— */
.mission-band {
  padding: 5rem 0 4rem;
  text-align: center;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.mission-band h2 {
  margin: 0 auto;
  max-width: 18ch;
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.mission-band p {
  margin: 1.35rem auto 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ——— Page hero (inner pages) ——— */
.page-hero {
  padding: 3.25rem 0 2.5rem;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.page-hero p {
  margin: 0.75rem 0 0;
  max-width: 55ch;
  color: var(--muted);
}

/* ——— Main content ——— */
main {
  padding: 4rem 0 5.5rem;
}

main.main--tight {
  padding-top: 2.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.75rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.span-8 {
  grid-column: span 8;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  color: var(--navy);
}

ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.contact-list li {
  margin-bottom: 0.5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-title {
  margin-bottom: 0.85rem;
}

/* ——— Home news block ——— */
.home-news {
  padding: 3.5rem 0 2rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.home-news-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.home-news-head h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--navy);
}

@media (max-width: 600px) {
  .home-news-head .btn-cta {
    width: 100%;
    justify-content: center;
  }
}

/* ——— News ——— */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.news-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.news-cover img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.news-body {
  padding: 1.25rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.news-meta {
  font-size: 0.86rem;
  color: var(--muted);
}

.news-title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

.news-title a {
  color: var(--navy);
}

.news-excerpt {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  line-height: 1.45;
  word-break: break-word;
}

.news-link {
  margin-top: 0.25rem;
  font-weight: 700;
  color: var(--accent-hover);
}

.news-detail-cover img {
  width: 100%;
  height: min(42vw, 420px);
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.page-btn.disabled {
  opacity: 0.5;
}

.page-status {
  color: var(--muted);
  font-weight: 700;
}

/* ——— Admin forms ——— */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
}

.form-field textarea {
  resize: vertical;
}

.form-span-2 {
  grid-column: span 2;
}

.admin-table {
  display: grid;
  gap: 0.75rem;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.7fr 0.8fr 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

.admin-row.admin-head {
  background: var(--bg-soft);
  font-weight: 800;
}

.admin-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-visual {
    justify-self: center;
    max-width: 100%;
  }

  .hero-dots {
    display: none;
  }

  .hero-text {
    max-width: 60ch;
  }

  .mission-band p {
    max-width: 60ch;
  }
}

@media (max-width: 900px) {
  /*
   * backdrop-filter na headeru pravi novi containing block — fixed meni se
   * tada veže za visinu headera umjesto za viewport. Na mobitelu ga isključujemo.
   */
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.98);
  }

  .span-8,
  .span-4,
  .span-6 {
    grid-column: span 12;
  }

  .nav-toggle {
    display: inline-flex;
    position: relative;
    z-index: 120;
    margin-left: auto;
  }

  .header-inner {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .logo {
    flex: 1;
    min-width: 0;
  }

  .logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(300px, 88vw);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1rem;
    padding: calc(4.75rem + env(safe-area-inset-top, 0px)) 1.25rem
      calc(2rem + env(safe-area-inset-bottom, 0px));
    margin: 0;
    background: #fff;
    box-shadow: -10px 0 40px rgba(15, 23, 42, 0.15);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 115;
    overflow-y: auto;
    overflow-x: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  body.menu-open .header-menu {
    transform: translateX(0);
  }

  .nav-main {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex: none;
    justify-content: flex-start;
  }

  .nav-main a {
    padding: 0.85rem 1rem;
    border-radius: 12px;
  }

  .btn-header {
    width: 100%;
    justify-content: center;
    align-self: stretch;
  }

  body.menu-open {
    overflow: hidden;
  }

  .card {
    padding: 1.65rem;
  }

  main {
    padding: 3.25rem 0 4.75rem;
  }
}

@media (max-width: 600px) {
  .top-bar-right {
    width: 100%;
  }

  .top-bar-inner {
    gap: 0.5rem 1rem;
  }

  .top-bar-left {
    gap: 0.65rem 1rem;
  }

  .top-bar-note {
    display: none;
  }

  .hero-wrap {
    padding-top: 3rem;
  }

  .mission-band {
    padding: 3.5rem 0 3rem;
  }

  .hero-copy h1 {
    font-size: clamp(1.85rem, 8vw, 2.45rem);
  }

  .hero-lead {
    font-size: 1.02rem;
  }

  .hero-actions {
    gap: 0.85rem 1.1rem;
  }

  .btn {
    padding: 0.7rem 1.2rem;
  }

  .nav-main a {
    padding: 0.45rem 0.65rem;
  }

  .header-inner {
    padding: 0.85rem 0;
  }

  .card {
    padding: 1.35rem;
  }

  .hero-image-ring img {
    height: min(78vw, 360px);
    min-height: 240px;
    border-radius: 0 0 0 52%;
  }

  .hero-image-ring {
    border-radius: 0 0 0 54%;
  }
}

@media (max-width: 420px) {
  html,
  body {
    font-size: 16px;
  }

  .container {
    width: min(1180px, 90%);
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-cta {
    width: 100%;
    justify-content: center;
  }

  .nav-main {
    gap: 0.35rem 0.4rem;
  }
}

@media (max-width: 960px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-span-2 {
    grid-column: span 1;
  }

  .admin-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}
