/* ===========================================================
   dekic.dev — čist CSS, bez framework-a
   Tamna tema je podrazumevana; .light na <html> uključuje svetlu.
   =========================================================== */

:root {
  --bg: #0b1120;
  --bg-soft: #111a2e;
  --bg-card: #131d33;
  --border: #1f2b45;
  --text: #e6ecf7;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-warm: #fbbf24;
  --ring: rgba(56, 189, 248, .35);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --radius: 16px;
  --maxw: 1080px;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
}

html.light {
  --bg: #f7f9fc;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --border: #e3e9f2;
  --text: #0f1b2d;
  --muted: #5a6b85;
  --accent: #0284c7;
  --accent-2: #4f46e5;
  --ring: rgba(2, 132, 199, .25);
  --shadow: 0 12px 30px -16px rgba(20, 40, 80, .35);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;            /* da sidra ne završe ispod lepljivog headera */
  -webkit-text-size-adjust: 100%;      /* iOS ne uvećava tekst u landscape-u */
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;                    /* osigurač protiv horizontalnog skrola (ne kvari sticky) */
  overflow-wrap: break-word;           /* duge reči/URL-ovi se prelamaju, ne štrče */
  transition: background .3s ease, color .3s ease;
}

/* Ništa od medija ne sme da pređe svoj kontejner */
img, svg, video, canvas, pre, table { max-width: 100%; }

/* Deca grid/flex kontejnera smeju da se skupe (inače ih dugačak kod razvuče) */
.grid > *, .post-list > *, .footer-grid > * { min-width: 0; }

/* halo iza headera */
body::before {
  content: "";
  position: fixed;
  inset: -40% 0 auto 0;
  height: 600px;
  background: radial-gradient(60% 60% at 50% 0%, rgba(56,189,248,.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; border-radius: 10px; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; overflow-wrap: break-word; }

.muted { color: var(--muted); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #001; padding: 10px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #04101f; font-weight: 800; font-size: .85rem;
  box-shadow: var(--shadow);
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: .95rem;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--bg-soft); }
.nav a.is-active { color: var(--text); background: var(--bg-card); }

.theme-toggle, .nav-toggle {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; cursor: pointer; padding: 8px 10px; line-height: 1;
}
.theme-toggle { margin-left: 6px; }
.theme-toggle:hover { border-color: var(--accent); }

.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }

/* ---------- Sekcije / kartice ---------- */
section { position: relative; z-index: 1; }
.section { padding: clamp(40px, 7vw, 64px) 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 8px; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(18px, 3vw, 24px); box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
  min-width: 0;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Dugmad ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #04101f; box-shadow: 0 8px 24px -8px var(--ring); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }

.pill {
  display: inline-block; font-size: .78rem; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted);
}

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 84px) 0 clamp(36px, 6vw, 56px); }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); margin: 0 0 18px; }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 640px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }

/* ---------- Misija (banner) ---------- */
.mission {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg-card)), var(--bg-card));
  border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(22px, 5vw, 36px);
}
.mission h2 { margin-top: 0; }

/* ---------- Usluge ikone ---------- */
.svc-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  color: var(--accent); background: var(--bg-soft); border: 1px solid var(--border); margin-bottom: 14px;
}
.svc-icon .ic { width: 24px; height: 24px; }
.theme-toggle { display: inline-grid; place-items: center; }
.theme-toggle .ic { width: 18px; height: 18px; display: block; }
.btn .ic { width: 18px; height: 18px; }
.ic-inline { width: 1.05em; height: 1.05em; vertical-align: -.15em; }
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); }

/* ---------- Blog liste ---------- */
.post-list { display: grid; gap: 18px; }
.post-item { display: block; }
.post-item h3 { margin: 0 0 6px; }
.post-meta { font-size: .85rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* ---------- Članak ---------- */
/* samo vertikalni padding — bočni dolazi iz .container, da tekst ne dotakne ivicu na telefonu */
.article { max-width: 760px; margin: 0 auto; padding-top: clamp(36px, 6vw, 56px); padding-bottom: clamp(36px, 6vw, 56px); }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 10px; }
.prose { font-size: 1.05rem; }
.prose h2 { margin: 2em 0 .6em; font-size: 1.5rem; }
.prose h3 { margin: 1.6em 0 .5em; font-size: 1.2rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose img { margin: 1.4em 0; box-shadow: var(--shadow); }
.prose code { background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; font-size: .92em; border: 1px solid var(--border); }
.prose pre {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; overflow-x: auto; font-size: .9rem;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose blockquote {
  margin: 1.2em 0; padding: 4px 18px; border-left: 3px solid var(--accent);
  color: var(--muted); background: var(--bg-soft); border-radius: 0 10px 10px 0;
}
.prose a { text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose code { overflow-wrap: anywhere; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- Forma ---------- */
.form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; font: inherit;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring);
}
.field textarea { min-height: 150px; resize: vertical; }

.alert { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 20px; }
.alert-ok { border-color: #1d6b4f; background: color-mix(in srgb, #10b981 14%, var(--bg-card)); }
.alert-err { border-color: #7f1d1d; background: color-mix(in srgb, #ef4444 14%, var(--bg-card)); }

/* ---------- Donacije ---------- */
.donate-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
.bank-row { display: flex; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.bank-row:last-child { border-bottom: none; }
.bank-row b { color: var(--text); overflow-wrap: anywhere; }

/* ---------- Ad slot ---------- */
.ad-slot { margin: 28px auto; min-height: 90px; display: grid; place-items: center;
  border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: .85rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; background: var(--bg-soft); position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; padding-top: 44px; padding-bottom: 24px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--muted); }
.footer-contact { display: flex; flex-direction: column; gap: 6px; }
.footer-bottom { padding-top: 16px; padding-bottom: 28px; border-top: 1px solid var(--border); }
.footer-bottom p { margin: 0; font-size: .85rem; }

/* ---------- Responsive ---------- */

/* Tablet (pejzaž): tri kolone -> dve, footer -> dve */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Uži tablet / veliki telefon: mobilni meni + dve kolone -> jedna */
@media (max-width: 820px) {
  .grid-2, .donate-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 64px; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    padding: 12px clamp(16px, 4vw, 28px); transform: translateY(-135%);
    transition: transform .3s ease; z-index: -1; box-shadow: var(--shadow);
  }
  .nav.open { transform: translateY(0); }
  .nav a { padding: 12px; }
  .theme-toggle { margin: 6px 0 0; align-self: flex-start; }
}

/* Telefon: sve u jednu kolonu */
@media (max-width: 620px) {
  .grid-3, .footer-grid { grid-template-columns: 1fr; }
}

/* Mali telefon: CTA dugmad puna širina, sitnije korekcije */
@media (max-width: 430px) {
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .section-head { margin-bottom: 24px; }
  .brand-name { font-size: .98rem; }
}

/* Veliki ekrani: malo šira kolona i krupniji tekst za bolje korišćenje prostora */
@media (min-width: 1440px) {
  :root { --maxw: 1160px; }
  body { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Razgovor / portal ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); }
.bubble-body { line-height: 1.5; }
.bubble-meta { font-size: .72rem; color: var(--muted); margin-top: 6px; }
.bubble.them { align-self: flex-start; background: var(--bg-soft); border-bottom-left-radius: 4px; }
.bubble.me   { align-self: flex-end; background: color-mix(in srgb, var(--accent) 14%, var(--bg-card)); border-bottom-right-radius: 4px; }
.qr-box { background: #fff; border-radius: 12px; padding: 12px; width: 250px; max-width: 100%; }
.qr-box svg { display: block; width: 100%; height: auto; }

/* pomoćne (deljeno sa portalom) */
.btn-sm { padding: 8px 14px; font-size: .85rem; border-radius: 10px; }
.inline { display: inline; margin: 0; }

/* Hero podnaslov ispod glavnog naslova */
.hero-sub { font-size: clamp(1.15rem, 2.6vw, 1.6rem); font-weight: 600; color: var(--text); margin: 8px 0 0; letter-spacing: -.01em; }
.hero-sub + .lead { margin-top: 16px; }

/* Logo/natpis u sredini QR koda (uz error correction H) */
.qr-box { position: relative; }
.qr-logo {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; padding: 4px; border-radius: 8px; box-shadow: 0 0 0 3px #fff;
  display: grid; place-items: center;
}
.qr-logo img { display: block; width: 30px; height: 30px; }
