/* OPG Rendulić — single-page layout */

:root {
  --color-bg: #f6f3ee;
  --color-surface: #ffffff;
  --color-text: #1c1b19;
  --color-muted: #5c5853;
  --color-accent: #2d4a32;
  --color-accent-light: #3d6b45;
  --color-gold: #b8925a;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 24px 48px -12px rgb(28 27 25 / 0.12);
  --header-inner-min: 72px;
  --header-offset: 7.5rem; /* JS postavlja stvarnu visinu zaglavlja */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Pristupačnost: preskoči na sadržaj */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -120px;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--color-text);
  color: #faf8f5;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.2s var(--ease);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

.skip-link:hover {
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

main:focus {
  outline: none;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgb(246 243 238 / 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(28 27 25 / 0.06);
}

.tts-feedback {
  position: fixed;
  top: var(--header-offset);
  left: 0;
  right: 0;
  z-index: 99;
  margin: 0;
  padding: 0.6rem min(1120px, 100% - 2.5rem);
  background: #fff8e6;
  color: #3d3518;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
  border-bottom: 1px solid rgb(184 146 90 / 0.4);
  box-shadow: 0 4px 12px rgb(28 27 25 / 0.06);
}

.tts-feedback[hidden] {
  display: none !important;
}

.header-inner {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
  min-height: var(--header-inner-min);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.tts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid rgb(28 27 25 / 0.18);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s, border-color 0.2s;
}

.tts-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tts-svg {
  width: 1.4rem;
  height: 1.4rem;
  display: block;
}

.tts-svg--stop {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
}

.tts-btn.is-playing .tts-svg--listen {
  display: none;
}

.tts-btn.is-playing .tts-svg--stop {
  display: block;
}

.tts-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.tts-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.tts-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tts-btn.is-playing {
  background: var(--color-accent);
  color: #faf8f5;
  border-color: var(--color-accent);
}

.tts-btn.is-playing:hover {
  color: #fff;
  border-color: var(--color-accent-light);
  background: var(--color-accent-light);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  min-width: 0;
}

.logo:hover {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.75rem;
}

.site-nav a {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--color-muted);
  text-decoration: none;
  padding: 0.35rem 0;
  position: relative;
  transition: color 0.2s var(--ease);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-accent);
}

.site-nav a.active {
  color: var(--color-accent);
}

.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-offset);
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1.5rem 1.5rem;
    background: var(--color-bg);
    border-bottom: 1px solid rgb(28 27 25 / 0.08);
    gap: 0;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s var(--ease), opacity 0.25s, visibility 0.35s;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid rgb(28 27 25 / 0.06);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .site-nav a::after {
    display: none;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-offset) + 2rem) 1.25rem 4rem;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgb(28 27 25 / 0.75) 0%,
    rgb(28 27 25 / 0.45) 45%,
    rgb(45 74 50 / 0.35) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  color: #faf8f5;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(184 146 90 / 0.95);
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgb(250 248 245 / 0.88);
  margin: 0 0 2rem;
  font-weight: 300;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s, transform 0.2s;
}

.btn-primary {
  background: var(--color-gold);
  color: #1c1b19;
  border: none;
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.2);
}

.btn-primary:hover {
  background: #c9a66a;
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  outline: 2px solid #faf8f5;
  outline-offset: 3px;
}

/* Sections */
.section {
  scroll-margin-top: calc(var(--header-offset) + 0.75rem);
}

.about {
  padding: 5.5rem 0;
}

.split {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.split-text h2,
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  margin: 0 0 1.25rem;
  color: var(--color-text);
}

.split-text .intro {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--color-accent);
  margin: 0 0 1rem;
}

.split-text p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.highlights {
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--color-muted);
}

.highlights li {
  margin-bottom: 0.5rem;
}

.split-media {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.split-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Services */
.services {
  padding: 5.5rem 0 6rem;
  background: linear-gradient(180deg, var(--color-bg) 0%, #ebe6de 100%);
}

.section-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 3.5rem;
}

.section-header p {
  margin: 0;
  color: var(--color-muted);
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.card {
  display: grid;
  gap: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

@media (min-width: 860px) {
  .card {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .card-reverse .card-image {
    order: 2;
  }

  .card-reverse .card-body {
    order: 1;
  }
}

.card-image img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.card-body {
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 860px) {
  .card-body {
    padding: 2.75rem 2.5rem;
  }
}

.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 1rem;
  color: var(--color-text);
}

.card-body > p {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-size: 1rem;
}

.card-list {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--color-muted);
}

.card-list li {
  margin-bottom: 0.4rem;
}

/* Kontakt i impressum */
.contact {
  padding: 5rem 0 5.5rem;
  background: var(--color-bg);
  border-top: 1px solid rgb(28 27 25 / 0.06);
}

.contact-grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.contact-card h2,
.impressum-card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 400;
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.contact-lead {
  margin: 0 0 1.75rem;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.contact-list {
  margin: 0;
}

.contact-list dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 1.25rem 0 0.35rem;
}

.contact-list dt:first-child {
  margin-top: 0;
}

.contact-list dd {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-text);
}

.contact-list a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgb(45 74 50 / 0.35);
  transition: color 0.2s var(--ease), border-color 0.2s;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  color: var(--color-accent-light);
  border-bottom-color: var(--color-accent-light);
}

.impressum-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 2.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgb(28 27 25 / 0.05);
}

.impressum-address {
  margin: 0.5rem 0 0;
  font-style: normal;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-muted);
}

.impressum-name {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

/* EU — program ruralnog razvoja (tekst + zastave) */
.eu-project {
  padding: 4.5rem 0 5rem;
  background: #fff;
  border-top: 1px solid rgb(28 27 25 / 0.08);
}

.eu-project-inner {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}

.eu-program-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 520px) {
  .eu-program-brand {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 1.25rem;
  }

  .eu-program-titles {
    flex: 1;
    min-width: 0;
  }
}

.program-mark {
  flex-shrink: 0;
}

.eu-program-titles {
  text-align: center;
}

@media (min-width: 520px) {
  .eu-program-titles {
    text-align: left;
  }
}

.eu-fund-name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-muted);
}

.eu-project-heading {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 400;
  margin: 0 0 0.5rem;
  color: var(--color-text);
  line-height: 1.25;
}

.program-rural-title {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.35;
}

.program-rural-prefix {
  color: #1a5a96;
  font-weight: 600;
  margin-right: 0.35rem;
}

.program-rural-em {
  font-weight: 800;
  color: #0d3358;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eu-project-tender {
  margin: 2rem 0 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--color-text);
  text-align: center;
}

.eu-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2rem;
  margin: 2.25rem 0 1.5rem;
}

.eu-flag-img {
  flex: 0 0 auto;
  width: 12rem;
  height: 6rem;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgb(28 27 25 / 0.1);
  border-radius: 4px;
  background: #fafafa;
}

.eu-project-period {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.eu-project-tagline {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--color-muted);
}

.eu-project-statement {
  margin: 1.5rem 0 0;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--color-text);
}

.footer-sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

.footer-flags-wrap {
  border-top: 1px solid rgb(250 248 245 / 0.12);
  padding: 1.5rem 0 1.25rem;
}

.footer-flags-inner {
  text-align: center;
}

.footer-flags-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.25rem;
}

.footer-eu-flag {
  flex: 0 0 auto;
  width: 7.5rem;
  height: 3.75rem;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgb(250 248 245 / 0.2);
  border-radius: 4px;
  background: rgb(250 248 245 / 0.08);
}

.footer-flags-link-wrap {
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

.footer-flags-link-wrap a {
  color: rgb(250 248 245 / 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgb(250 248 245 / 0.35);
}

.footer-flags-link-wrap a:hover,
.footer-flags-link-wrap a:focus-visible {
  color: #fff;
  border-bottom-color: var(--color-gold);
}

.site-footer a {
  color: rgb(250 248 245 / 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgb(250 248 245 / 0.35);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
  border-bottom-color: var(--color-gold);
}

/* Footer */
.site-footer {
  background: var(--color-text);
  color: rgb(250 248 245 / 0.85);
  padding: 3rem 0 0;
}

.footer-inner {
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr 1.2fr;
  }
}

.footer-note {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  opacity: 0.85;
}

.footer-contact p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
}

.copyright {
  margin: 0;
  padding: 1.25rem 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgb(250 248 245 / 0.45);
  border-top: 1px solid rgb(250 248 245 / 0.08);
}
