/* ==========================================================================
   Alternativa za Hrvatsku — style.css
   Konsolidirani CSS: tokens + layout + komponente
   ========================================================================== */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { line-height: 1.5; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }

/* ---- Design tokens ---- */
:root {
    /* boje */
    --c-bg:           #0a0e13;
    --c-surface:      #0f1720;
    --c-surface-2:    #141d28;
    --c-border:       rgba(154,166,178,0.18);
    --c-border-2:     rgba(154,166,178,0.30);
    --c-text:         #e6f0fa;
    --c-text-muted:   #b7c4ce;
    --c-text-soft:    #9aa6b2;

    --c-accent:       #0098ff;
    --c-accent-90:    #007fd9;
    --c-accent-soft:  rgba(0,152,255,0.12);
    --c-on-accent:    #ffffff;

    --c-success:      #4ade80;
    --c-warn:         #fbbf24;
    --c-danger:       #ef4444;

    /* tipografija */
    --font-body:    "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Merriweather", Georgia, serif;
    --font-mono:    ui-monospace, "SF Mono", Menlo, Monaco, "Courier New", monospace;

    /* prostor */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;
    --sp-9: 6rem;

    /* radius */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-2xl: 24px;
    --r-full: 9999px;

    /* sjene */
    --sh-sm: 0 1px 2px rgba(0,0,0,0.20);
    --sh-md: 0 4px 12px rgba(0,0,0,0.30);
    --sh-lg: 0 12px 32px rgba(0,0,0,0.40);
    --sh-glow: 0 0 0 3px var(--c-accent-soft);

    /* layout */
    --container: 1200px;
    --nav-h: 72px;

    /* tranzicije */
    --t-fast: 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
    --t-base: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
    --t-slow: 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---- Helpers ---- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(1.5rem, 6vw, 3rem);
    padding-right: clamp(1.5rem, 6vw, 3rem);
}
@media (max-width: 480px) {
    .container { padding-left: 1.25rem; padding-right: 1.25rem; }
}
/* .section koristi only top/bottom padding (NE shorthand!) da se ne brka s .container */
.section { padding-top: var(--sp-9); padding-bottom: var(--sp-9); }
.section--tight { padding-top: var(--sp-7); padding-bottom: var(--sp-7); }
.section-eyebrow {
    color: var(--c-accent);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--sp-3);
	margin-top: var(--sp-6);
}
.section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin-bottom: var(--sp-4);
    color: var(--c-text);
}
.section-subtitle {
    font-size: 1.125rem;
    color: var(--c-text-muted);
    max-width: 65ch;
    margin-bottom: var(--sp-6);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--r-md);
    transition: all var(--t-base);
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn--primary {
    border-color: var(--c-accent);
    color: var(--c-on-accent);
}
.btn--primary:hover { background: var(--c-accent-90); box-shadow: var(--sh-md); }
.btn--ghost {
    background: transparent;
    color: var(--c-text);
    border-color: var(--c-border-2);
}
.btn--ghost:hover { border-color: var(--c-accent); color: var(--c-accent); }
.btn--lg { padding: 1rem 2rem; font-size: 1rem; }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }

/* ---- Navigation ---- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 19, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
}
.nav__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--sp-5);
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: var(--sp-5);
}
.nav__logo { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.nav__logo img { height: 40px; width: 40px; }
.nav__logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--c-text);
}
.nav__menu { display: flex; gap: var(--sp-1); margin-left: auto; align-items: center; }
.nav__link {
    padding: var(--sp-2) var(--sp-4);
    font-size: 0.95rem;
    color: var(--c-text-muted);
    border-radius: var(--r-md);
    transition: all var(--t-fast);
}
.nav__link:hover { color: var(--c-text); background: var(--c-surface); }
.nav__link.is-active { color: var(--c-accent); }
.nav__cta { margin-left: var(--sp-3); }
.nav__toggle {
    display: none;
    width: 44px;
    height: 44px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    color: var(--c-text);
}
.nav__toggle:hover { background: var(--c-surface); }
.nav__toggle svg { width: 24px; height: 24px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 900px) {
    .nav__menu {
        display: none;
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background: var(--c-bg);
        border-bottom: 1px solid var(--c-border);
        padding: var(--sp-4);
        flex-direction: column;
        gap: var(--sp-1);
        align-items: stretch;
        max-height: calc(100vh - var(--nav-h));
        overflow-y: auto;
    }
    .nav__menu.is-open { display: flex; }
    .nav__link { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--c-border); }
    .nav__cta { margin-left: 0; margin-top: var(--sp-2); }
    .nav__cta .btn { width: 100%; }
    .nav__toggle { display: flex; }
}

/* ---- Hero ---- */
.hero {
    position: relative;
    padding: var(--sp-9) 0;
    overflow: hidden;
}
.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 70% 20%, rgba(0,152,255,0.15), transparent 60%),
        radial-gradient(ellipse 60% 40% at 20% 70%, rgba(0,152,255,0.08), transparent 70%);
}
.hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--sp-8);
    align-items: center;
}
.hero__title {
    font-size: clamp(2rem, 5vw, 3.75rem);
    line-height: 1.1;
    margin-bottom: var(--sp-5);
    color: var(--c-text);
}
.hero__title-accent { color: var(--c-accent); }
.hero__lead {
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    color: var(--c-text-muted);
    margin-bottom: var(--sp-6);
    max-width: 60ch;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hero__visual {
    position: relative;
    aspect-ratio: 4/5;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
}
.hero__visual img { width: 100%; height: 100%; object-fit: cover; }
.hero__visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(10,14,19,0.6) 100%);
}

@media (max-width: 900px) {
    .hero { padding: var(--sp-7) 0; }
    .hero__inner { grid-template-columns: 1fr; gap: var(--sp-6); }
    .hero__visual { aspect-ratio: 16/10; max-height: 380px; }
}

/* ---- e-Demokracija banner (na index) ---- */
.edem-banner {
    background: linear-gradient(135deg, var(--c-accent-soft) 0%, transparent 70%);
    border: 1px solid var(--c-accent-soft);
    border-radius: var(--r-xl);
    padding: var(--sp-6);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--sp-5);
    align-items: center;
    margin: var(--sp-6) 0;
}
.edem-banner__content { display: flex; flex-direction: column; gap: var(--sp-2); }
.edem-banner__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-accent);
}
.edem-banner__badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-success);
    box-shadow: 0 0 0 4px rgba(74,222,128,0.2);
    animation: pulse 2s ease-in-out infinite;
}
.edem-banner__badge--offline::before { background: var(--c-warn); box-shadow: 0 0 0 4px rgba(251,191,36,0.2); }
.edem-banner__badge--checking { color: var(--c-text-soft); }
.edem-banner__badge--checking::before { background: var(--c-text-soft); box-shadow: 0 0 0 4px rgba(154,166,178,0.2); animation: none; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.edem-banner__title {
    font-size: 1.25rem;
    font-family: var(--font-heading);
    color: var(--c-text);
}
.edem-banner__text {
    color: var(--c-text-muted);
    font-size: 0.95rem;
}
@media (max-width: 700px) {
    .edem-banner { grid-template-columns: 1fr; }
    .edem-banner__cta { width: 100%; }
    .edem-banner__cta .btn { width: 100%; }
}

/* ---- Cards / sectors ---- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-5);
    margin-top: var(--sp-6);
}
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    transition: all var(--t-base);
}
.card:hover { border-color: var(--c-accent); transform: translateY(-2px); box-shadow: var(--sh-md); }
.card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    background: var(--c-accent-soft);
    color: var(--c-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-2);
}
.card__icon svg { width: 24px; height: 24px; }
.card__title { font-size: 1.125rem; color: var(--c-text); }
.card__text { color: var(--c-text-muted); font-size: 0.95rem; line-height: 1.6; }

/* ---- Feature row (alternirajuće slike + tekst) ---- */
.feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-7);
    align-items: center;
    padding: var(--sp-7) 0;
    border-bottom: 1px solid var(--c-border);
}
.feature:last-child { border-bottom: 0; }
.feature--reverse .feature__visual { order: 2; }
.feature__visual {
    aspect-ratio: 4/3;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
}
.feature__visual img { width: 100%; height: 100%; object-fit: cover; }
.feature__title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--sp-4); }
.feature__text { color: var(--c-text-muted); font-size: 1.05rem; line-height: 1.7; margin-bottom: var(--sp-4); }
.feature__list { display: flex; flex-direction: column; gap: var(--sp-3); }
.feature__list li {
    display: flex;
    gap: var(--sp-3);
    align-items: flex-start;
    color: var(--c-text-muted);
    font-size: 1rem;
    line-height: 1.6;
}
.feature__list li::before {
    content: '';
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-accent);
    margin-top: 0.6em;
}
@media (max-width: 900px) {
    .feature { grid-template-columns: 1fr; gap: var(--sp-5); }
    .feature--reverse .feature__visual { order: 0; }
}

/* ---- Page header (za sub-stranice) ---- */
.page-header {
    padding: var(--sp-8) 0 var(--sp-6);
    border-bottom: 1px solid var(--c-border);
    text-align: center;
}
.page-header__title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: var(--sp-3); }
.page-header__subtitle { color: var(--c-text-muted); font-size: 1.125rem; max-width: 60ch; margin: 0 auto; }

/* ---- Prose (za .html stranice s tekstom) ---- */
.prose {
    max-width: 70ch;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--c-text-muted);
}
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: 1.75rem; color: var(--c-text); margin-top: 2.5em; margin-bottom: 0.5em; }
.prose h3 { font-size: 1.35rem; color: var(--c-text); margin-top: 2em; margin-bottom: 0.5em; }
.prose p { color: var(--c-text-muted); }
.prose ul, .prose ol { padding-left: 1.5rem; color: var(--c-text-muted); }
.prose ul li, .prose ol li { margin-bottom: 0.4em; }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose strong { color: var(--c-text); font-weight: 600; }
.prose a:not(.btn) { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:not(.btn):hover { color: var(--c-accent-90); }
/* Gumbovi unutar .prose se ne smiju oblikovati kao linkovi (.prose p kasakade) */
.prose .btn,
.prose a.btn,
.prose a.btn:hover { text-decoration: none; }
.prose a.btn--primary,
.prose a.btn--primary:hover { color: var(--c-on-accent); }
.prose a.btn--ghost { color: var(--c-text); }
.prose a.btn--ghost:hover { color: var(--c-accent); }
.prose blockquote {
    border-left: 3px solid var(--c-accent);
    padding-left: var(--sp-5);
    color: var(--c-text);
    font-style: italic;
}
.prose hr { border: 0; border-top: 1px solid var(--c-border); margin: 2em 0; }

/* ---- Footer ---- */
.footer {
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    padding: var(--sp-7) 0 var(--sp-5);
    margin-top: var(--sp-9);
}
.footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--sp-7);
    align-items: start;
}
.footer__brand { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer__brand-row { display: flex; align-items: center; gap: var(--sp-3); }
.footer__brand-row img { height: 36px; width: 36px; }
.footer__brand-text { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; color: var(--c-text); }
.footer__brand-desc { color: var(--c-text-soft); font-size: 0.9rem; line-height: 1.6; max-width: 36ch; }
.footer__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.footer__col h4 {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--sp-3);
}
.footer__col ul {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    align-items: center;
}
.footer__col a {
    color: var(--c-text-soft);
    font-size: 0.9rem;
    transition: color var(--t-fast);
}
.footer__col a:hover { color: var(--c-accent); }
.footer__bottom {
    margin-top: var(--sp-7);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--c-border);
    text-align: center;
    color: var(--c-text-soft);
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    align-items: center;
}
.footer__bottom a { color: var(--c-text-soft); transition: color var(--t-fast); }
.footer__bottom a:hover { color: var(--c-accent); }
.footer__bottom-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
}

@media (max-width: 900px) {
    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--sp-5);
    }
    .footer__brand {
        grid-column: 1 / -1;
        align-items: center;
        text-align: center;
    }
    .footer__brand-row { justify-content: center; }
    .footer__brand-desc { margin: 0 auto; max-width: 50ch; }
}
@media (max-width: 600px) {
    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
        text-align: center;
    }
    .footer__col {
        align-items: center;
        text-align: center;
    }
    .footer__col h4,
    .footer__col ul { text-align: center; }
	
	.footer__bottom {
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: var(--sp-3); /* adjust spacing if needed */
    }

	.footer__legal {
		text-align: center;
    }
}

/* ---- Tablice (statut, pravila) ---- */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}
.prose th, .prose td {
    text-align: left;
    padding: var(--sp-3);
    border-bottom: 1px solid var(--c-border);
}
.prose th { color: var(--c-text); font-weight: 600; background: var(--c-surface); }

/* ---- Skip link ---- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    padding: var(--sp-2) var(--sp-4);
    background: var(--c-accent);
    color: var(--c-on-accent);
    border-radius: var(--r-md);
    z-index: 9999;
}
.skip-link:focus { left: 8px; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
