/* Organska farma – galerije (sajt i admin pregled) */
.ofg { --ofg-k: 4; --ofg-r: 10px; --ofg-u: 10px; --ofg-o: 1/1; }
.ofg .ofg-k { margin: 0; min-width: 0; }
.ofg .ofg-st { display: block; overflow: hidden; border-radius: var(--ofg-u); background: #efe6d8; }
.ofg .ofg-st img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.ofg a.ofg-st:hover img { transform: scale(1.05); }
.ofg a.ofg-st:focus-visible { outline: 3px solid #c8963e; outline-offset: 2px; }
.ofg .ofg-opis { font-size: 14px; line-height: 1.4; padding: 6px 2px 0; color: inherit; opacity: .85; }

/* Mreža (prepisuje staru .of-galerija) */
.of-galerija.ofg--mreza { display: grid; grid-template-columns: repeat(var(--ofg-k), minmax(0, 1fr)); gap: var(--ofg-r); }
.ofg--mreza .ofg-st, .ofg--traka .ofg-st, .ofg--velika .ofg-st { aspect-ratio: var(--ofg-o); }
.of-galerija.ofg a { aspect-ratio: auto; border-radius: var(--ofg-u); }
.ofg--mreza a.ofg-st, .ofg--traka a.ofg-st, .ofg--velika a.ofg-st { aspect-ratio: var(--ofg-o); }

/* Zid */
.of-galerija.ofg--zid { display: block; columns: var(--ofg-k); column-gap: var(--ofg-r); }
.ofg--zid .ofg-k { break-inside: avoid; margin-bottom: var(--ofg-r); }
.ofg--zid .ofg-st img { height: auto; }

/* Traka */
.ofg-traka-okvir { position: relative; }
.of-galerija.ofg--traka { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--ofg-k) - 1) * var(--ofg-r)) / var(--ofg-k)); gap: var(--ofg-r); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.ofg--traka::-webkit-scrollbar { display: none; }
.ofg--traka .ofg-k { scroll-snap-align: start; }
.ofg-str { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: #3b2418; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.ofg-str--l { left: 8px; } .ofg-str--d { right: 8px; }

/* Velika + male */
.of-galerija.ofg--velika { display: grid; grid-template-columns: repeat(var(--ofg-k), minmax(0, 1fr)); gap: var(--ofg-r); }
.ofg--velika .ofg-k:first-child { grid-column: span 2; grid-row: span 2; }
.ofg--velika .ofg-k:first-child .ofg-st { aspect-ratio: auto; height: 100%; }

@media (max-width: 980px) {
	.of-galerija.ofg--mreza, .of-galerija.ofg--velika { grid-template-columns: repeat(min(var(--ofg-k), 3), minmax(0, 1fr)); }
	.of-galerija.ofg--zid { columns: min(var(--ofg-k), 3); }
}
@media (max-width: 600px) {
	.of-galerija.ofg--mreza, .of-galerija.ofg--velika { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.of-galerija.ofg--zid { columns: 2; }
	.of-galerija.ofg--traka { grid-auto-columns: 78%; }
	.ofg-str { display: none; }
}

/* ---------- Admin ---------- */
.ofg-skica { flex-direction: row !important; flex-wrap: wrap; gap: 2px !important; padding: 0 !important; background: #e9dfcf !important; }
.ofg-skica img { flex: 1 1 calc(50% - 2px); width: auto !important; height: calc(50% - 1px) !important; margin: 0 !important; min-width: 0; }
.ofg-skica img:only-child { height: 100% !important; }
.ofg-skica > span { flex: 1; color: #8a7a68 !important; }
.of-sl-vise summary { cursor: pointer; color: #6b5a4a; font-size: 13px; }
.of-sl-vise[open] { flex-basis: 100%; }
.of-sl-vise form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.of-sl-vise label { display: flex; gap: 6px; align-items: center; flex-basis: 100%; }
.of-sl-vise input[type=text] { flex: 1; min-width: 0; width: 100%; box-sizing: border-box; }
.of-link-crveni { color: #b32d2e !important; }
.of-st-dno { flex-wrap: wrap; gap: 8px; }

.of-gal-ime { margin: 0; padding: 0 !important; }
.of-gal-ime input { font: 600 26px/1.2 Georgia, serif; border: 1px solid transparent; background: transparent; padding: 4px 8px; margin-left: -8px; border-radius: 8px; width: min(520px, 100%); }
.of-gal-ime input:hover, .of-gal-ime input:focus { border-color: #d3c2a5; background: #fff; }
.of-gal-ured h2 { font-size: 17px; margin: 22px 0 10px; }
.of-gal-ured h2 small { font-weight: 400; color: #7a6a5a; font-size: 13px; }
.of-gal-kolone { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 28px; }
@media (max-width: 1100px) { .of-gal-kolone { grid-template-columns: minmax(0, 1fr); } }
.of-gal-ured .of-galerija-admin li { height: auto; width: 140px; background: #fff; border: 1px solid #e6dccb; }
.of-gal-ured .of-galerija-admin img { height: 120px; }
.of-gal-opis { width: 100%; border: 0 !important; border-top: 1px solid #eee5d6 !important; border-radius: 0 !important; font-size: 12px; padding: 4px 6px !important; }
.of-gal-izbor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.of-gal-opcija { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 2px solid #e6dccb; border-radius: 12px; background: #fff; cursor: pointer; }
.of-gal-opcija input { position: absolute; opacity: 0; }
.of-gal-opcija:has(input:checked) { border-color: #3b2418; box-shadow: 0 0 0 3px rgba(200, 150, 62, .3); }
.of-gal-opcija:has(input:focus-visible) { outline: 2px solid #c8963e; outline-offset: 2px; }
.of-gal-opcija small { color: #7a6a5a; line-height: 1.35; }
.of-gal-ikona { display: grid; gap: 3px; height: 48px; margin-bottom: 6px; grid-template-columns: repeat(3, 1fr); }
.of-gal-ikona i { background: #c9b48f; border-radius: 3px; }
.of-gal-ikona--zid { display: block; columns: 3; column-gap: 3px; }
.of-gal-ikona--zid i { display: block; height: 15px; margin-bottom: 3px; break-inside: avoid; }
.of-gal-ikona--zid i:nth-child(3n+1) { height: 27px; }
.of-gal-ikona--traka { grid-template-columns: repeat(3, 1fr) .4fr; }
.of-gal-ikona--traka i:nth-child(n+5) { display: none; }
.of-gal-ikona--velika { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.of-gal-ikona--velika i:first-child { grid-row: span 2; }
.of-gal-ikona--velika i:nth-child(6) { display: none; }
.of-gal-polja { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 14px; }
.of-gal-polja label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.of-gal-polja label.of-gal-check { flex-direction: row; align-items: center; font-weight: 400; grid-column: 1 / -1; }
.of-gal-polja input[type=number] { width: 70px; }
.of-gal-pregled { background: #fff; border: 1px solid #e6dccb; border-radius: 14px; padding: 18px; }
