/*
 * RAROG Web — parts shared by all blocks: container, section headings,
 * buttons, cards of entries, forms, formatted text. Tokens (colors, radius)
 * are in site.css. Mobile first; breakpoints 768, 1024, 1280 px. Each block
 * has its own file next to this one.
 */

.rw-site img { max-width: 100%; height: auto; }
.rw-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.rw-narrow { max-width: 860px; }
.rw-center { text-align: center; }
.rw-sr, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Copies for the look only (endless slider, logo marquee; site.js ghost(), 1.42.3): the text is
   drawn from data-t, so the copy has no text of its own for crawlers and screen readers */
.rw-ghost-text::before { content: attr(data-t); }
.rw-i { display: inline-flex; vertical-align: -0.125em; }
.rw-i > svg { width: 1em; height: 1em; }

/* Sections */
.rw-block { padding: 56px 0; }
.rw-heading { max-width: 26em; margin: 0 auto 36px; font-size: clamp(1.65rem, 3.4vw, 2.4rem); line-height: 1.15; text-align: center; letter-spacing: -.025em; }
.rw-heading::before { content: ""; display: block; width: 36px; height: 4px; margin: 0 auto 16px; border-radius: 4px; background: var(--rw-gold); }
.rw-heading-left { margin-left: 0; text-align: left; }
.rw-heading-left::before { margin-left: 0; }
.rw-lead { margin: 0 0 20px; font-size: 1.12rem; line-height: 1.6; color: var(--rw-muted); }
.rw-lead-narrow { max-width: 42em; margin: -16px auto 36px; }

/* Buttons: gold with dark text (AA contrast), darker gold with white text on hover */
.rw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border: 2px solid transparent; border-radius: 999px; font: inherit; font-weight: 650; font-size: .98rem; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background-color .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s; }
.rw-btn-primary { background: var(--rw-gold); color: var(--rw-dark); box-shadow: 0 6px 18px rgba(164, 123, 44, .28); }
.rw-btn-primary:hover { background: var(--rw-gold-dark); color: #fff; transform: translateY(-1px); }
.rw-btn-secondary { border-color: rgba(10, 16, 22, .18); background: #fff; color: var(--rw-dark); }
.rw-btn-secondary:hover { border-color: var(--rw-dark); }
.rw-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.rw-more { display: inline-flex; align-items: center; gap: 6px; color: var(--rw-gold-dark); font-weight: 650; text-decoration: none; }
.rw-more::after { content: "→"; transition: transform .18s; }
.rw-more:hover::after { transform: translateX(3px); }

/* Formatted text */
.rw-prose { line-height: 1.75; }
.rw-prose h2 { margin: 1.8em 0 .55em; font-size: 1.6rem; line-height: 1.25; }
.rw-prose h3 { margin: 1.5em 0 .45em; font-size: 1.25rem; }
.rw-prose h4 { margin: 1.3em 0 .4em; font-size: 1.05rem; }
.rw-prose > :first-child { margin-top: 0; }
.rw-prose p { margin: 0 0 1.1em; }
.rw-prose a { color: var(--rw-gold-dark); text-underline-offset: 3px; }
.rw-prose blockquote { margin: 1.6em 0; padding: 18px 22px; border-left: 4px solid var(--rw-gold); border-radius: 0 12px 12px 0; background: var(--rw-gold-tint); color: var(--rw-ink); font-size: 1.08em; font-style: normal; font-weight: 500; }
.rw-prose blockquote > :last-child { margin-bottom: 0; }
.rw-prose ul, .rw-prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.rw-prose li { margin: .35em 0; }
.rw-prose li::marker { color: var(--rw-gold); }

/* Forms (sent by site.js in the background, or posted without JS) */
.rw-form { display: flex; flex-wrap: wrap; gap: 16px; padding: 24px; border: 1px solid var(--rw-line); border-radius: 20px; background: #fff; box-shadow: var(--rw-shadow); }
.rw-form fieldset { display: contents; border: 0; }
.rw-form-row { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; }
.rw-form label { font-size: .88rem; font-weight: 600; color: var(--rw-dark); }
.rw-form input, .rw-form select, .rw-form textarea, .rw-newsletter input {
    width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #cdd3da; border-radius: 12px; font: inherit; color: var(--rw-dark); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.rw-form textarea { min-height: 120px; resize: vertical; }
.rw-form input:focus, .rw-form select:focus, .rw-form textarea:focus, .rw-newsletter input:focus { border-color: var(--rw-gold); outline: 0; box-shadow: 0 0 0 4px rgba(164, 123, 44, .18); }
.rw-form-note { flex: 1 1 100%; margin: 0; font-size: .84rem; color: var(--rw-muted); }
.rw-form .rw-btn { align-self: flex-start; }
fieldset[disabled] .rw-btn { opacity: .8; cursor: not-allowed; }
.rw-form-title { flex: 1 1 100%; margin: 0 0 4px; padding: 0; font-size: 1.2rem; font-weight: 700; color: var(--rw-dark); }
.rw-req { color: var(--rw-gold-dark); }
.rw-form-hint { font-size: .84rem; color: var(--rw-muted); }
.rw-form-error { flex: 1 1 100%; margin: 0; font-size: .86rem; font-weight: 600; color: #B42318; }
.rw-form-error[hidden], .rw-form-status[hidden] { display: none; }
.rw-form [aria-invalid="true"] { border-color: #D92D20; }
.rw-form-status { flex: 1 1 100%; padding: 12px 16px; border-radius: 12px; font-size: .95rem; font-weight: 600; line-height: 1.5; }
.rw-form-status-ok { border: 1px solid #A6DDB7; background: #ECFAF1; color: #146C34; }
.rw-form-status-error { border: 1px solid #F5C2BE; background: #FEF3F2; color: #B42318; }
.rw-form input[type="file"] { min-height: 0; padding: 10px; background: var(--rw-soft); }
/* Consent: the whole label is pressable (at least 44 px) */
.rw-form-consent { gap: 2px; }
.rw-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; font-size: .88rem; font-weight: 500 !important; line-height: 1.45; color: var(--rw-ink) !important; cursor: pointer; }
.rw-form .rw-check input, .rw-check input { flex: 0 0 auto; width: 20px; min-height: 0; height: 20px; margin: 1px 0 0; padding: 0; accent-color: var(--rw-gold); cursor: pointer; }
.rw-form-privacy-link { font-weight: 600; } /* 1.43.0: the name of the policy in the consent text */
.rw-form-privacy { display: inline-flex; align-items: center; min-height: 44px; margin-left: 30px; font-size: .86rem; font-weight: 600; }
/* Honeypot: off the screen for people, still in the form for bots */
.rw-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.rw-form, .rw-newsletter-form { position: relative; }
.rw-form.is-sending .rw-btn, .rw-newsletter-form.is-sending .rw-btn { opacity: .7; cursor: progress; }
/* 1.32.0: "Šalje se…" with a spinner on the button while a form is sent (site.js) */
.rw-spinner { display: inline-block; width: 1em; height: 1em; margin-right: 6px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.15em; animation: rw-spin .7s linear infinite; }
@keyframes rw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rw-spinner { animation-duration: 2s; } }
.rw-form.is-sent > fieldset > :not(.rw-form-status):not(legend) { display: none; }
.rw-preview-hint { flex: 1 1 100%; margin: 8px 0 0; padding: 10px 14px; border: 1px dashed var(--rw-gold); border-radius: 10px; background: var(--rw-gold-soft); color: var(--rw-gold-dark); font-size: .9rem; }

/* Cards of entries (list blocks and list pages); the whole card is the link */
.rw-entry-cards { display: grid; gap: 24px; }
.rw-entry-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--rw-line); border-radius: var(--rw-radius); background: #fff; transition: transform .22s, box-shadow .22s, border-color .22s; }
.rw-entry-card:hover { border-color: rgba(164, 123, 44, .45); }
.rw-entry-card:focus-within { border-color: var(--rw-gold); }
.rw-entry-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--rw-soft); }
.rw-entry-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.rw-entry-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }
.rw-entry-body h3, .rw-entry-body .rw-h3 { margin: 0; font-size: 1.16rem; line-height: 1.3; }
.rw-entry-body h3 a, .rw-entry-body .rw-h3 a { color: var(--rw-dark); text-decoration: none; }
.rw-entry-body h3 a::after, .rw-entry-body .rw-h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.rw-entry-body h3 a:focus-visible, .rw-entry-body .rw-h3 a:focus-visible { outline: 0; }
.rw-entry-card:has(h3 a:focus-visible), .rw-entry-card:has(.rw-h3 a:focus-visible) { outline: 3px solid var(--rw-gold); outline-offset: 2px; }
.rw-entry-body > p { margin: 0; color: var(--rw-muted); font-size: .97rem; }
.rw-entry-body .rw-more { margin-top: auto; padding-top: 4px; }
.rw-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
.rw-card-tags span { padding: 3px 10px; border-radius: 999px; background: var(--rw-gold-soft); color: var(--rw-gold-dark); font-size: .76rem; font-weight: 700; letter-spacing: .02em; }
.rw-card-tags .rw-badge-draft { background: var(--rw-dark); color: #fff; }
.rw-card-tags .rw-badge-free { background: var(--rw-gold-dark); color: #fff; }
.rw-card-meta { margin: 0 !important; font-size: .85rem !important; color: var(--rw-muted); }
.rw-layout-list .rw-entry-card { flex-direction: row; }
.rw-layout-list .rw-entry-img { flex: 0 0 34%; aspect-ratio: auto; }

/* Preview (admin) */
.rw-preview-badge { padding: 4px 10px; border-radius: 999px; background: var(--rw-gold-soft); color: var(--rw-gold-dark); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rw-page-title { padding: 48px 0 8px; }
.rw-page-title h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; }
.rw-preview-empty { padding: 80px 20px; text-align: center; color: var(--rw-muted); }

@media (min-width: 768px) {
    .rw-container { padding: 0 32px; }
    .rw-block { padding: 72px 0; }
    .rw-form { padding: 32px; }
    .rw-form-half { flex: 1 1 calc(50% - 8px); }
    .rw-entry-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rw-layout-list.rw-entry-cards { grid-template-columns: 1fr; }
}
@media (min-width: 1024px) {
    .rw-block { padding: 96px 0; }
    .rw-entry-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
}
@media (max-width: 767px) {
    .rw-layout-list .rw-entry-card { flex-direction: column; }
}


/* Product cards: screenshot on a dark background */
.rw-card-product .rw-entry-img { background: linear-gradient(135deg, var(--rw-dark) 0%, var(--rw-dark-3) 100%); }
.rw-card-product .rw-entry-img img { object-fit: contain; padding: 14px; }

/* Product or project at first sight (1.34.0): label on every card and page,
   a product with its application icon and a download button, a project with
   its area as tags. Same RAROG style, different look: a product has a dark
   label and a gold top line, a project a light label. */
.rw-kind-label { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; margin: 0; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; }
.rw-kind-label .rw-i { width: 14px; height: 14px; }
.rw-kind-product { background: var(--rw-dark); color: #fff; }
.rw-kind-product .rw-i { color: var(--rw-gold-light); }
.rw-kind-project { border: 1px solid var(--rw-gold-soft); background: var(--rw-gold-tint); color: var(--rw-gold-dark); }
.rw-hero-text .rw-kind-label { display: flex; width: max-content; margin-bottom: 14px; }
.rw-card-product { border-top: 3px solid var(--rw-gold); }
.rw-card-app { display: flex; align-items: center; gap: 12px; }
.rw-card-app h3, .rw-card-app .rw-h3 { flex: 1; min-width: 0; }
.rw-card-app-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; overflow: hidden; border-radius: 10px; background: var(--rw-dark); color: var(--rw-gold-light); }
.rw-card-app-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rw-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: auto 0 0 !important; padding-top: 4px; }
.rw-card-actions .rw-more { margin-top: 0; padding-top: 0; }
.rw-card-download { position: relative; z-index: 2; gap: 6px; min-height: 44px; padding: 9px 16px; font-size: .9rem; }
.rw-card-download .rw-i { width: 16px; height: 16px; }
@media (max-width: 767px) {
    .rw-kind-label { padding: 3px 8px; font-size: .66rem; }
    .rw-card-app { gap: 8px; }
    .rw-card-app-icon { width: 32px; height: 32px; border-radius: 8px; }
    .rw-card-download { width: 100%; justify-content: center; padding: 9px 10px; font-size: .85rem; }
    .rw-card-actions .rw-more { display: none; }
}

/*
 * Phones and tablets: more content per screen, less scrolling (CLAUDE.md,
 * "Telefon i tablet"). Cards in 2 columns on phones and 3 on tablets,
 * smaller section spacing, text from 14 px, everything pressable at least
 * 44 px high (whole cards are links). Long lists show the first items with
 * "Prikaži još" (site.js, data-rw-more).
 */
.rw-more-wrap { display: flex; justify-content: center; margin-top: 16px; }
.rw-more-wrap[hidden] { display: none; }
.rw-is-more { display: none !important; }

@media (max-width: 767px) {
    .rw-container { padding: 0 16px; }
    .rw-block { padding: 36px 0; }
    .rw-heading { margin-bottom: 22px; font-size: clamp(1.4rem, 6.2vw, 1.7rem); }
    .rw-heading::before { width: 28px; margin-bottom: 12px; }
    .rw-lead { margin-bottom: 16px; font-size: 1rem; line-height: 1.55; }
    .rw-lead-narrow { margin: -10px auto 22px; }
    .rw-btn { min-height: 46px; padding: 11px 20px; }
    .rw-page-title { padding: 28px 0 4px; }
    .rw-form { gap: 12px; padding: 18px; border-radius: 16px; }

    .rw-entry-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .rw-entry-cards:not(:has(> :nth-child(2))), .rw-layout-list.rw-entry-cards { grid-template-columns: 1fr; }
    .rw-entry-card { border-radius: 14px; }
    .rw-entry-body { gap: 6px; padding: 12px 12px 14px; }
    .rw-entry-body h3, .rw-entry-body .rw-h3 { font-size: .98rem; line-height: 1.28; overflow-wrap: anywhere; hyphens: auto; }
    .rw-entry-body > p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: .875rem; line-height: 1.45; }
    .rw-entry-body .rw-more { font-size: .875rem; }
    .rw-card-tags span { padding: 2px 8px; font-size: .72rem; }
    .rw-card-meta { font-size: .8rem !important; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .rw-block { padding: 52px 0; }
    .rw-heading { margin-bottom: 28px; }
    .rw-entry-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .rw-entry-body { padding: 16px 16px 18px; }
    .rw-entry-body h3, .rw-entry-body .rw-h3 { font-size: 1.05rem; }
    .rw-entry-body > p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; font-size: .93rem; }
}

/* ---------- Even card grids on the whole site (1.28.0, CLAUDE.md rule 15) ----------
   rw_grid() chooses the columns from the number of cards, so the last row
   never holds a single card; when no column count fits, the last row is
   centred (rw-g-center). Phones: 2 columns, a last card alone spans the row. */
@media (max-width: 767px) {
    .rw-g:not(.rw-layout-list) > :last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .rw-g.rw-gt-1 { grid-template-columns: minmax(0, 1fr); }
    .rw-g.rw-gt-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rw-g.rw-gt-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rw-g.rw-gt-2:not(.rw-layout-list) > :last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
    .rw-g.rw-gd-1 { grid-template-columns: minmax(0, 1fr); }
    .rw-g.rw-gd-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rw-g.rw-gd-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); --rw-g-n: 3; }
    .rw-g.rw-gd-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); --rw-g-n: 4; }
    .rw-g.rw-gd-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); --rw-g-n: 5; }
    .rw-g.rw-g-center { display: flex; flex-wrap: wrap; justify-content: center; }
    .rw-g.rw-g-center > * { flex: 0 0 calc((100% - (var(--rw-g-n, 3) - 1) * 24px) / var(--rw-g-n, 3)); }
    .rw-layout-list.rw-g { grid-template-columns: minmax(0, 1fr); }
}

/* A section that stands out (1.28.0, option "Pozadina sekcije: Istaknuta" of
   Kartice sa ikonom and Grid funkcija): dark background, stronger heading */
.rw-block.rw-block-accent { background: var(--rw-dark); color: #fff; }
.rw-block-accent .rw-heading { color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.rw-block-accent .rw-heading::before { background: var(--rw-gold); }
.rw-block-accent .rw-lead { color: rgba(255, 255, 255, .78); }
.rw-block-accent .rw-card, .rw-block-accent .rw-features li { border-color: rgba(255, 255, 255, .12); background: var(--rw-dark-2); box-shadow: none; }
.rw-block-accent .rw-card h3, .rw-block-accent .rw-card .rw-h3, .rw-block-accent .rw-features strong { color: #fff; }
.rw-block-accent .rw-card p, .rw-block-accent .rw-features p { color: rgba(255, 255, 255, .72); }
.rw-block-accent .rw-card-icon { background: rgba(210, 174, 102, .14); color: var(--rw-gold-light); }
.rw-block-accent .rw-more { color: var(--rw-gold-light); }
