/* =====================================================================
   DVD Kaptol — Modern CSS 2.1 (2025)
   HERO PERFECTED EDITION
   ===================================================================== */

/* ----------------------------- Design Tokens ----------------------------- */
:root {
  /* brand */
  --color-primary: #b71c1c;
  --color-primary-600: #c62828;
  --color-primary-700: #a31616;
  --color-accent: #d32f2f;

  /* surfaces */
  --surface-bg: #f4f4f4;
  --surface-card: #ffffff;
  --surface-soft: #f7f7f7;

  /* text */
  --text-main: #222;
  --text-muted: #555;
  --text-muted-2: #777;

  /* borders & shadows */
  --border: #e6e6e6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

  /* spacing */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;

  /* layout */
  --max-width: 1200px;
}

/* ------------------------- Dark Mode Tokens --------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --surface-bg: #0f1113;
    --surface-card: #171a1d;
    --surface-soft: #1f2327;

    --text-main: #e9e9e9;
    --text-muted: #b6b6b6;
    --text-muted-2: #a6a6a6;

    --border: #2f3337;

    --shadow: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.45);
  }
}

/* -------------------------------- Reset -------------------------------- */
*, ::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--surface-bg);
  color: var(--text-main);
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* -------------------------------- Layout -------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* -------------------------------- Header -------------------------------- */
.site-header {
  background: var(--surface-card);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.logo { max-height: 70px; }

/* --------------------------- Navigation (Modern) --------------------------- */
.responsive-nav {
  background: var(--surface-card);
  border-top: 2px solid var(--color-primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: relative;
  z-index: 50;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: .5rem;
}

.menu-toggle {
  display: none;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: .65rem .9rem;
  font-size: 1.35rem;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

#main-menu {
  list-style: none;
  display: flex;
  gap: .2rem;
  padding: 0;
  margin: 0;
}

#main-menu li a {
  display: block;
  padding: .9rem 1.2rem;
  font-weight: 700;
  border-radius: 6px;
  transition: .25s background;
}
#main-menu a:hover,
#main-menu a.active {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

/* Mobile nav */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  #main-menu {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--surface-card);
    border: 1px solid var(--border);
    display: none;
  }
  #main-menu.show { display: flex; }

  #main-menu a {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
}

/* ======================================================================== */
/*                            PERFECT HERO SECTION                           */
/* ======================================================================== */

.hero-modern {
  height: clamp(380px, 45vw, 700px); /* Perfect fluid hero */
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
  overflow: hidden;
}

/* Background image */
.hero-modern::before {
  content: "";
  position: absolute; inset: 0;
  background: center 30% / cover no-repeat var(--hero-image);
  filter: brightness(.80) contrast(1.06) saturate(1.02);
  transition: background-size .4s ease;
}

/* Cinematic overlay */
.hero-modern::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.62),
      rgba(0,0,0,0.60),
      rgba(0,0,0,0.55)
  );
}

/* Content */
.hero-modern .hero-content {
  position: relative;
  z-index: 10;
  padding: var(--space-3);
}

.hero-modern h1 {
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  margin: 0 0 .7rem;
  font-weight: 800;
  letter-spacing: .5px;
}

.hero-modern p {
  font-size: clamp(1rem, 2.3vw, 1.3rem);
  margin-bottom: var(--space-2);
  opacity: .95;
}

/* Ultra-wide screen improvement (21:9, 32:9, 4K) */
@media (min-width: 1600px) {
  .hero-modern::before {
    background-size: 115%;   /* smanjuje crop – savršeno za široke monitore */
    background-position: center 28%;
  }
}

@media (min-width: 2200px) {
  .hero-modern::before {
    background-size: 125%;
    background-position: center 25%;
  }
}

/* ========================================================================
   Buttons
   ======================================================================== */

.btn {
  display: inline-block;
  padding: .9rem 1.3rem;
  background: var(--color-primary);
  color: #fff !important;
  border-radius: 8px;
  font-weight: 700;
  transition: background .25s, transform .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--color-primary-600); text-decoration:none; }
.btn:active { transform: translateY(1px); }

/* Footer CTA */
.footer-cta .btn {
  background: var(--color-primary);
  padding: .8rem 1.2rem;
  border-radius: 10px;
  font-weight: 700;
}
.footer-cta .btn:hover {
  background: var(--color-primary-600);
}

/* ========================================================================
   Slider (Galerija)
   ======================================================================== */

.slider-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin: var(--space-4) auto;
}

.slider-track {
  display: flex;
  transition: transform .6s ease;
}

.slide {
  flex: 0 0 100%;
  padding: .5rem;
}

.slide img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  transition: transform .25s;
}
.slide img:hover { transform: scale(1.02); }

/* Buttons */
.slider-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: .45rem .7rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(4px);
}
.slider-btn.prev { left: .6rem; }
.slider-btn.next { right: .6rem; }

/* Dots */
.slider-dots {
  text-align: center;
  margin-top: .5rem;
}
.slider-dots .dot {
  display: inline-block;
  width: 12px; height: 12px;
  background: #ccc;
  border-radius: 50%;
  margin: 0 4px;
  cursor: pointer;
}
.slider-dots .active {
  background: var(--color-primary);
}

/* ========================================================================
   Lightbox (Galerija)
   ======================================================================== */

.lightbox-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  justify-content: center; align-items: center;
  z-index: 3000;
}
.lightbox-overlay.show { display: flex; }
.lightbox-overlay img {
  max-width: 90vw; max-height: 90vh;
  border-radius: var(--radius-sm);
}

/* ========================================================================
   News Grid + Cards
   ======================================================================== */

.news-row {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.news-card {
  background: var(--surface-card);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.news-card .news-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: .7rem;
}

.news-card h3 {
  margin: .4rem 0;
  color: var(--color-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.news-card .news-excerpt {
  color: var(--text-muted);
  font-size: .96rem;
  margin-bottom: .8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.news-card .link {
  margin-top: auto;
  font-weight: 700;
}

/* ========================================================================
   Meteo alarm preview
   ======================================================================== */

.news-preview {
  background: var(--surface-soft);
  border-left: 4px solid var(--color-accent);
  padding: 1rem;
  border-radius: 6px;
  transition: .3s background;
}
.news-preview:hover {
  background: #fff3e0;
}

/* ========================================================================
   Kalendar događanja
   ======================================================================== */

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.event-list li {
  background: var(--surface-card);
  padding: .9rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: .6rem;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--color-primary);
}

/* ========================================================================
   Single Article (vijest.php)
   ======================================================================== */

.vijest-body {
  max-width: 800px;
  margin: var(--space-4) auto;
  padding: var(--space-3);
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  line-height: 1.85;
}

.vijest-body h1 {
  text-align:center;
  margin-bottom:.5rem;
  font-size:clamp(1.8rem,3vw,2.3rem);
  color:var(--color-primary);
}

.vijest-body img {
  margin: 1.2rem auto;
  border-radius: 10px;
  max-width: 100%;
}

.vijest-back {
  display:inline-block;
  margin-top:1.5rem;
  font-weight:700;
  color: var(--color-primary);
}

/* ========================================================================
   Forms (Admin + Kontakt)
   ======================================================================== */

.form-container {
  background:var(--surface-card);
  border-radius:var(--radius);
  padding:var(--space-3);
  box-shadow:var(--shadow);
}

.form-container label {
  display:block;
  margin-top:1rem;
  font-weight:700;
}

.form-container input,
.form-container textarea,
.form-container select {
  width:100%;
  padding:10px;
  border-radius:6px;
  border:1px solid var(--border);
  background:#fff;
  margin-top:.4rem;
  font-size:1rem;
}

.form-container input:focus,
.form-container textarea:focus,
.form-container select:focus {
  border-color:var(--color-primary);
  box-shadow:0 0 4px rgba(183,28,28,0.35);
  outline:none;
}

/* ========================================================================
   Footer
   ======================================================================== */

footer {
  text-align:center;
  padding:var(--space-4) 1rem;
  background:#222;
  color:#ccc;
}
footer a {
  color:#ddd;
}
footer a:hover {
  text-decoration: underline;
}

/* ========================================================================
   Responsivne prilagodbe
   ======================================================================== */

@media (max-width: 1024px) {
  .slider img { height: auto; }
}

@media (max-width: 768px) {
  .vijest-body { margin: 1.5rem auto; padding: 1.25rem; }
  .form-container { padding: 1.25rem; }
}

/* ========================================================================
   Reduced motion
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================
   Print mode
   ======================================================================== */

@media print {
  nav, .menu-toggle, .slider-wrapper, .lightbox-overlay, footer {
    display:none !important;
  }
  body {
    background:#fff; color:#000;
  }
  .vijest-body, main {
    box-shadow:none !important;
    padding:0 !important;
    margin:0 !important;
  }
}
