/* Tehnoetika platforma — jedna tema, akcentna boja po publikaciji (--accent). */
:root {
  --accent: #1a7f6b;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e2da;
  --bg: #fffdf9;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; height: auto; }
main { max-width: 680px; margin: 0 auto; padding: 0 1.25rem 3rem; }

/* ---------- Tenant (javna stranica) ---------- */
.site-header { text-align: center; padding: 2.5rem 1rem 1rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.site-identity { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.site-identity:hover { text-decoration: none; }
.site-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.site-name { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; }
.site-tagline { color: var(--muted); margin: .4rem auto .9rem; max-width: 560px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1.1rem; justify-content: center; font-size: .95rem; }
.site-nav a { color: var(--ink); }
.site-nav a:hover { color: var(--accent); }

.subscribe { background: #f6f3ec; border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.25rem; margin: 0 0 2rem; }
.subscribe-lead { margin: 0 0 .6rem; font-weight: 600; }
.subscribe-row { display: flex; gap: .5rem; }
.subscribe input[type="email"] { flex: 1; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 6px; font-size: 1rem; }
.subscribe button, .btn, button[type="submit"] {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: .55rem 1.1rem; font-size: 1rem; cursor: pointer;
}
.btn { display: inline-block; }
.btn:hover { text-decoration: none; opacity: .92; }

.hero { margin-bottom: 2.2rem; }
.hero-cover { border-radius: 8px; margin-bottom: .8rem; }
.hero h2 { font-family: var(--serif); font-size: 1.9rem; margin: 0 0 .3rem; line-height: 1.25; }
.hero h2 a { color: var(--ink); }
.hero-subtitle { color: var(--muted); font-size: 1.1rem; margin: 0 0 .3rem; }
.hero time, .post-card time { color: var(--muted); font-size: .85rem; }

.post-list { display: flex; flex-direction: column; }
.post-card { display: flex; gap: 1rem; justify-content: space-between; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.post-card h3 { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 .2rem; line-height: 1.3; }
.post-card h3 a { color: var(--ink); }
.post-card-subtitle { color: var(--muted); margin: 0 0 .2rem; }
.post-card-thumb { width: 130px; height: 88px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

.page-title { font-family: var(--serif); }
.pagination { display: flex; justify-content: space-between; padding: 1.5rem 0; }
.more { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 2rem 0; }

/* Post */
.post h1 { font-family: var(--serif); font-size: 2.1rem; line-height: 1.2; margin: 0 0 .4rem; }
.post-subtitle { color: var(--muted); font-size: 1.2rem; margin: 0 0 1rem; }
.byline { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; margin-bottom: 1.4rem; }
.byline img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.post-cover { border-radius: 8px; margin-bottom: 1.4rem; }

.post-body { font-family: var(--serif); font-size: 1.15rem; line-height: 1.75; }
.post-body h2, .post-body h3, .post-body h4 { font-family: var(--serif); line-height: 1.3; margin: 1.8em 0 .5em; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2rem auto; width: 60%; }
.post-body blockquote { border-left: 3px solid var(--accent); margin: 1.2em 0; padding: .1em 0 .1em 1.2em; color: #444; }
.post-body img { border-radius: 6px; margin: .5em 0; }
.post-body code { background: #f2efe8; padding: .1em .35em; border-radius: 4px; font-size: .9em; font-family: ui-monospace, monospace; }
.post-body pre { background: #f2efe8; padding: 1em; border-radius: 8px; overflow-x: auto; }
.post-body pre code { background: none; padding: 0; }

.embed { position: relative; aspect-ratio: 16 / 9; margin: 1.2em 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.embed-video video { width: 100%; border-radius: 8px; margin: 1.2em 0; }

.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 1.25rem; max-width: 680px; margin-left: auto; margin-right: auto; }
.footer-meta { text-align: center; color: var(--muted); font-size: .85rem; }

.flash { padding: .8rem 1rem; border-radius: 8px; margin: 1rem 0; }
.flash-ok { background: #e8f5ee; border: 1px solid #b7dfc9; }
.flash-err { background: #fdeaea; border: 1px solid #f2bcbc; }

/* ---------- Platforma / dashboard ---------- */
.platform main.platform-main { max-width: 960px; padding-top: 1.5rem; }
.platform-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.platform-header .brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.platform-header .brand span { color: var(--accent); font-weight: 400; }
.platform-header nav { display: flex; align-items: center; gap: 1rem; }
.platform-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem; }
.inline-form { display: inline; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 1rem; padding: 0; }

.landing-hero { text-align: center; padding: 3rem 1rem 2rem; }
.landing-hero h1 { font-family: var(--serif); font-size: 2.2rem; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; padding: 1rem 0; }
.pub-card { border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem; color: var(--ink); background: #fff; }
.pub-card:hover { border-color: var(--accent); text-decoration: none; }
.pub-card h3 { margin: 0 0 .3rem; }
.pub-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.pub-card.new { border-style: dashed; text-align: center; color: var(--accent); }

.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; margin: 1rem 0; }
.card.narrow { max-width: 420px; margin: 2rem auto; }
label { display: block; margin: .8rem 0; font-weight: 600; font-size: .95rem; }
label input, label select, label textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .5rem .7rem;
  border: 1px solid var(--line); border-radius: 6px; font-size: 1rem; font-family: inherit; font-weight: 400;
}
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.muted { color: var(--muted); font-weight: 400; font-size: .9rem; }

.dash-nav { display: flex; align-items: center; gap: 1.2rem; padding: .8rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.dash-nav a.active { font-weight: 700; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.badge { font-size: .78rem; padding: .15rem .5rem; border-radius: 99px; background: #eee; }
.badge-published, .badge-confirmed { background: #e8f5ee; color: #14683f; }
.badge-draft, .badge-pending { background: #fdf3e0; color: #8a5a00; }
.badge-unsubscribed { background: #fdeaea; color: #a02020; }

/* Editor */
.editor { display: grid; grid-template-columns: 1fr 260px; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .editor { grid-template-columns: 1fr; } .post-card-thumb { width: 90px; height: 64px; } }
.editor-title { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; border: 0; border-bottom: 1px solid var(--line); width: 100%; padding: .4rem 0; background: transparent; }
.editor-subtitle { font-size: 1.05rem; color: var(--muted); border: 0; border-bottom: 1px solid var(--line); width: 100%; padding: .4rem 0; margin-top: .3rem; background: transparent; }
.editor-toolbar { display: flex; gap: .6rem; align-items: center; margin: .8rem 0; }
.editor-toolbar button { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: .35rem .7rem; cursor: pointer; }
#body-md { width: 100%; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .95rem; line-height: 1.6; padding: .8rem; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.preview-pane { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.4rem; margin-top: .8rem; }
.editor-side { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.editor-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.editor-actions button { width: 100%; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: .5rem; cursor: pointer; }
.editor-actions button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.editor-actions button.warn { color: #8a5a00; }
.editor-actions button.danger, button.danger { color: #a02020; border-color: #f2bcbc; background: #fff; }
button.small { font-size: .8rem; padding: .2rem .5rem; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.media-item { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.media-item img, .media-item video { width: 100%; height: 140px; object-fit: cover; display: block; }
.media-item figcaption { padding: .5rem; font-size: .8rem; display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.media-item code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.logo-preview { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin-top: .5rem; }

/* Domovina SSO login */
#sso-box #sso-magic { width: 100%; }
.sso-or { display: flex; align-items: center; gap: .75rem; color: var(--muted, #888); margin: 1.1rem 0; font-size: .85rem; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
button.secondary { width: 100%; background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { opacity: .92; }
#sso-status:not([hidden]) { display: block; }

/* Google sign-in button (službeni izgled: bijela pozadina, G logo) */
.btn-google {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  background: #fff; color: #3c4043; border: 1px solid #dadce0; border-radius: 8px;
  padding: .65rem 1rem; font-size: .95rem; font-weight: 500; line-height: 1; cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn-google:hover { background: #f7f8f9; box-shadow: 0 1px 3px rgba(60,64,67,.18); border-color: #d2d5d9; }
.btn-google:active { background: #eef0f2; }
.btn-google .g-logo { flex: 0 0 auto; display: block; }
