/*
  Manastir Papraća – calm, modern theme
  -------------------------------------------------
  - Works with existing markup + JS (menu .active, header.sticky).
  - Typography supports Serbian Cyrillic + English.
  - Buttons (.more) styled consistently for "See more" and "Donations" links.
*/

:root {
  /* Color system */
  --bg: #f6f1e2; /* parchment */
  --surface: #fffaf0; /* warm white */
  --text: #1f2523; /* near-black green */
  --muted: #4b5551;
  --border: #d9d1bf;

  --brand: #193733; /* monastery green */
  --brand-2: #2c5b52; /* lighter green */
  --accent: #c6a35a; /* muted gold */

  /* Sizing */
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.1);

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 56px);

  /* Typography */
  --font-sans:
    system-ui, -apple-system, Segoe UI, Roboto, Inter, "Noto Sans",
    "Noto Sans Cyrillic", "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  --font-serif:
    ui-serif, Georgia, "Noto Serif", "Noto Serif Cyrillic", "Times New Roman",
    Times, serif;

  --line: 1.65;
}

/* -------------------------
   Base / Resets
-------------------------- */

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

html {
  scroll-behavior: smooth;
}

/* Prevent fixed header from covering anchored sections */
[id] {
  scroll-margin-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: var(--line);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

/* Ensure [hidden] always hides elements (used for SR/EN toggle) */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #d1b067;
  outline: 3px solid color-mix(in oklab, var(--accent) 70%, white);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Accessibility helpers */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transform: translateY(-150%);
  transition: transform 180ms ease;
  z-index: 2000;
}
.skip-link:focus {
  transform: translateY(0);
}

/* -------------------------
   Layout primitives
-------------------------- */

main {
  display: block;
}

.arh,
#donacije {
  width: min(var(--container), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(20px, 4vw, 44px);

  /* Calm “card” surface over parchment background */
  background: var(--surface);
  background: color-mix(in oklab, var(--surface) 96%, white);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-sm);
}

/* Ensure anything inside reads nicely */
.arh p {
  max-width: none;
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in oklab, var(--border) 80%, var(--accent)),
    transparent
  );
  margin: 26px 0;
}

/* -------------------------
   Typography
-------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  letter-spacing: 0.2px;
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 2.05rem);
}

p {
  margin: 0 0 1rem;
  color: var(--text);
  color: color-mix(in oklab, var(--text) 92%, black);
}

em {
  color: var(--brand-2);
  color: color-mix(in oklab, var(--text) 85%, var(--brand));
}

/* -------------------------
   Hero
-------------------------- */

.hero,
aside[aria-label="Naslovna slika"] {
  position: relative;
  overflow: clip;
  background: #000;
}

.naslovna-slika {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 72vh;
  filter: saturate(1.05) contrast(1.02);
}

@media (min-width: 1025px) {
  .hero,
  aside[aria-label="Naslovna slika"] {
    height: 100vh;
  }
  .naslovna-slika {
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 1024px) {
  .hero,
  aside[aria-label="Naslovna slika"] {
    height: 62vh;
    min-height: 420px;
  }
  .naslovna-slika {
    height: 100%;
    max-height: none;
  }
}

.naslov {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3vw, 40px);
  transform: translateX(-50%);

  width: min(860px, calc(100% - (var(--gutter) * 2)));
  padding: clamp(16px, 2.5vw, 28px);

  border-radius: calc(var(--radius) + 8px);

  background: rgba(10, 10, 10, 0.2);
  backdrop-filter: blur(8px);

  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow);

  text-align: center;
}

.h1-main {
  margin: 0;
  color: #fff;
  text-align: center;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.6rem);
}

/* -------------------------
   Header / Navigation
-------------------------- */

header,
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(14px, 3vw, 44px);
  z-index: 1500;
  transition:
    background 220ms ease,
    padding 220ms ease,
    box-shadow 220ms ease;

  /* subtle overlay over hero */
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
}

header.sticky,
.site-header.sticky {
  background: rgba(25, 55, 51, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 10px clamp(14px, 3vw, 44px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 50px;
  width: auto;
}

.menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu a {
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  border-radius: 999px;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.menu a:hover {
  background: rgba(255, 250, 240, 0.12);
  color: #fff;
}

.menu a[aria-current="page"] {
  background: rgba(198, 163, 90, 0.22);
  border: 1px solid rgba(198, 163, 90, 0.45);
}

/* menu icon button (.btn is used both as wrapper and button in existing HTML) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  cursor: pointer;
}

.btn:hover {
  background: rgba(0, 0, 0, 0.28);
}

.btn i {
  font-size: 20px;
}

/* Language toggle buttons */
.btn-lang {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.16);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
  letter-spacing: 0.7px;
  padding: 10px 12px;
  cursor: pointer;
}

.btn-lang:hover {
  background: rgba(0, 0, 0, 0.26);
}

/* Desktop: hide mobile-only open/close icons */
@media (min-width: 1025px) {
  header button[aria-label="Otvori meni"],
  .site-header button[aria-label="Otvori meni"] {
    display: none;
  }

  .menu button[aria-label="Zatvori meni"] {
    display: none;
  }
}

/* Menu overlay (dim page behind mobile drawer) */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
  z-index: 998;
}
.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Scroll lock helper (JS toggles) */
.no-scroll {
  overflow: hidden;
}

/* Mobile nav: slide-in drawer (JS toggles .menu.active) */
@media (max-width: 1024px) {
  .menu {
    position: fixed;
    top: 0;
    right: -110%;
    width: min(360px, 92vw);
    height: 100vh;
    padding: 90px 22px 22px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    background: rgba(25, 55, 51, 0.96);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: right 260ms ease;
  }

  .menu.active {
    right: 0;
  }

  .menu a {
    font-size: 0.95rem;
    padding: 12px 14px;
    border-radius: 12px;
    text-transform: none;
    letter-spacing: 0.2px;
  }

  .menu .btn[aria-label="Zatvori meni"] {
    position: absolute;
    top: 14px;
    left: 14px;
  }
}

/* -------------------------
   Content blocks
-------------------------- */

.opis {
  display: grid;
  gap: 18px;
  font-size: 1.05rem;
}

@media (min-width: 900px) {
  .opis {
    grid-template-columns: 1fr;
  }
}

.citat {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  background: color-mix(in oklab, var(--surface) 88%, var(--bg));
  box-shadow: var(--shadow-sm);
}

.line {
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--accent), var(--brand-2));
}

/* responsive image helper used in pages */
.responsive {
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* External badge area */
.reklame {
  margin-top: 26px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in oklab, var(--surface) 92%, var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-ep {
  display: block;
  width: 240px;
  height: 72px;
  background-image: url("img/grb-zvt.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: saturate(1.02);
}

/* -------------------------
   Buttons (See more / Donations)
-------------------------- */

.more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.3px;

  padding: 12px 18px;
  margin-bottom: 15px;
  border-radius: 999px;
  border: 1px solid rgba(198, 163, 90, 0.7);
  border: 1px solid color-mix(in oklab, var(--accent) 70%, var(--brand));
  background: linear-gradient(to bottom, var(--brand-2), var(--brand));
  background: linear-gradient(
    to bottom,
    color-mix(in oklab, var(--brand-2) 70%, var(--brand)),
    var(--brand)
  );
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.more:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

/* Center button in its block */
.arh > .more,
section > .more,
article > .more {
  display: flex;
  width: fit-content;
  margin-top: 14px;
  margin-inline: auto;
}

/* keep both language spans tidy */
.more span {
  display: inline;
}

/* -------------------------
   Media / embeds
-------------------------- */

iframe {
  max-width: 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* -------------------------
   Gallery / slideshow (existing JS)
-------------------------- */

.container,
.cont1 {
  position: relative;
}

.mySlides {
  display: none;
}

.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  user-select: none;
}

.next {
  right: 10px;
}
.prev {
  left: 10px;
}

.prev:hover,
.next:hover {
  background: rgba(0, 0, 0, 0.55);
}

.numbertext {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
}

.caption-container {
  text-align: center;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(25, 55, 51, 0.92);
  color: rgba(255, 255, 255, 0.95);
}

.row:after {
  content: "";
  display: table;
  clear: both;
}

.column {
  float: left;
  width: 16.66%;
  padding: 4px;
}

.demo {
  opacity: 0.7;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.active,
.demo:hover {
  opacity: 1;
}

/* -------------------------
   Tables (Services)
-------------------------- */

#bogosluzenja {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

#bogosluzenja caption {
  padding: 10px;
}

#bogosluzenja th,
#bogosluzenja td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

#bogosluzenja thead th {
  background: var(--brand);
  background: color-mix(in oklab, var(--brand) 90%, black);
  color: rgba(255, 255, 255, 0.96);
  border-bottom: 0;
}

#bogosluzenja tbody tr:nth-child(even) {
  background: var(--surface);
  background: color-mix(in oklab, var(--surface) 85%, var(--bg));
}

#bogosluzenja tbody tr:hover {
  background: rgba(198, 163, 90, 0.12);
  background: color-mix(in oklab, var(--accent) 12%, var(--surface));
}

#bogosluzenja tbody tr:last-child td {
  border-bottom: 0;
}

/* -------------------------
   Contact section (index)
-------------------------- */

#kontakt {
  display: grid;
  gap: 18px;
  align-items: start;
  justify-content: center;
}

/* Keep contact section clean: the inner .adresa / .mapa are the cards */
#kontakt.arh {
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Contact section headings should span both columns (prevents empty top-left area on desktop) */
#kontakt > h2 {
  grid-column: 1 / -1;
  text-align: center;
  justify-self: center;
  margin-bottom: 0;
}

@media (min-width: 820px) {
  #kontakt {
    grid-template-columns: 1fr 1fr;
  }
}

.adresa {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
  background: var(--surface);
  background: color-mix(in oklab, var(--surface) 96%, white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 2.2vw, 24px);
  text-align: center;
}

.contact-item {
  margin: 0 0 16px;
}
.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item .label {
  margin: 0 0 4px;
}
.contact-item .value {
  margin: 0;
}

.adresa a {
  display: inline-block;
  margin: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -------------------------
   Footer
-------------------------- */

footer {
  margin-top: 22px;
  background: var(--brand);
  color: rgba(255, 255, 255, 0.92);
}

.grbovi {
  width: min(var(--container), 100%);
  margin-inline: auto;
  padding: 22px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

/* Footer logos: consistent height, never distorted */
.grbovi a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
}

.grbovi img {
  height: clamp(44px, 6vw, 76px); /* consistent visual height across logos */
  width: auto; /* preserve aspect ratio */
  max-width: 220px; /* prevents very wide logos dominating */
  object-fit: contain; /* safe if width/height attrs differ */
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
}

footer p {
  margin: 0;
  padding: 10px var(--gutter) 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
}

/* -------------------------
   Small screens tune-up
-------------------------- */

@media (max-width: 580px) {
  .citat {
    grid-template-columns: 6px 1fr;
  }
  .opis {
    font-size: 1rem;
  }
  .grbovi img {
    max-height: 62px;
  }
}

/* Spacing between media and text */
.arh img,
.arh iframe {
  margin-block: 14px;
}

/* Gallery centering */
.cont1 {
  padding: 5px var(--gutter) 34px;
}
.cont1 .container {
  max-width: var(--container);
  margin-inline: auto;
}
.mySlides img {
  width: 100%;
  display: block;
  margin-inline: auto;
}

/* Services table alignment */
#bogosluzenja th {
  text-align: left;
}
#bogosluzenja th:nth-child(2),
#bogosluzenja td:nth-child(2) {
  text-align: center;
  width: 180px;
}
#bogosluzenja + p {
  margin-top: 18px;
}

/* Map embed */
.mapa {
  background: var(--surface);
  background: color-mix(in oklab, var(--surface) 96%, white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mapa iframe {
  display: block;
  width: 100%;
  height: 360px;
}

@media (max-width: 580px) {
  .mapa iframe {
    height: 300px;
  }
}
