/* Vīlandes Q&A — publiskā lapa. Vizuāli turpina pasākuma plakātus. */
:root {
  --blue-950: #0a2f63;
  --blue-900: #0e3b78;
  --blue-800: #134a92;
  --blue-700: #1b56a6;
  --blue-600: #2463b2;
  --blue-400: #5e9bd6;
  --sky-300: #a9d2f5;
  --sky-200: #c6e3fb;
  --sky-100: #dff0ff;
  --mint: #b7efff;
  --ink: #123f7d;
  --ink-soft: #2a5590;
  --muted: #4d6f9c;
  --line: rgba(18, 63, 125, .16);
  --danger: #b3261e;
  --radius: 16px;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--blue-600);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }

/* ---------- Fons kā plakātos: zils, mīksta gaisma, grauds ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(42% 38% at 88% 8%, rgba(176, 214, 246, .55), transparent 70%),
    radial-gradient(38% 46% at 4% 96%, rgba(150, 196, 238, .38), transparent 70%),
    radial-gradient(60% 55% at 60% 55%, rgba(14, 59, 130, .55), transparent 72%),
    linear-gradient(155deg, #3577c4 0%, #2463b2 38%, #1a55a4 70%, #144b98 100%);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--grain);
  background-size: 240px 240px;
  opacity: .32;
  mix-blend-mode: overlay;
}

/* ---------- Izkārtojums ---------- */
.layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 72px);
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
  align-items: start;
}

.poster {
  position: sticky; top: 24px;
  height: calc(100vh - 48px);
  height: calc(100svh - 48px);
  max-height: 1080px;
  min-height: 560px;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  overflow: hidden;
  background: var(--blue-700);
  box-shadow: 0 40px 80px -40px rgba(4, 24, 64, .75), 0 0 0 1px rgba(255, 255, 255, .08) inset;
  container-type: inline-size;
}
.poster picture, .poster-img { width: 100%; height: 100%; }
.poster-img { object-fit: cover; object-position: center 40%; }

.poster-meta {
  position: absolute; left: 0; right: 0; top: 74.6%;
  margin: 0; text-align: center;
  color: #e9f6ff;
  font-style: italic; font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 15px;
  font-size: 3.25cqw;
  line-height: 1.78;
  text-shadow: 0 1px 12px rgba(10, 40, 90, .25);
}
.poster-meta p { margin: 0; }

.content {
  min-height: calc(100vh - 48px);
  min-height: calc(100svh - 48px);
  display: flex; flex-direction: column; justify-content: center;
  max-width: 640px;
  width: 100%;
  padding: 8px 0 0;
}

/* ---------- Kartīte = gaišais sarunu burbulis ---------- */
.card {
  position: relative;
  background: linear-gradient(168deg, #e6f4ff 0%, #d4eafc 55%, #c3e0f8 100%);
  border-radius: 30px;
  padding: clamp(24px, 4vw, 48px);
  box-shadow: 0 34px 70px -34px rgba(4, 24, 64, .7), inset 0 1px 0 rgba(255, 255, 255, .8);
  margin-bottom: 34px;
  isolation: isolate;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background-image: var(--grain); background-size: 240px 240px;
  opacity: .16; mix-blend-mode: multiply; pointer-events: none;
}
.card::after { /* burbuļa “astīte” kā plakātā */
  content: ""; position: absolute; left: 64px; bottom: -24px;
  width: 46px; height: 26px;
  background: #c4e0f8;
  clip-path: polygon(0 0, 100% 0, 6% 100%);
}
.card:focus { outline: none; }
.card-center { text-align: center; padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(32px, 5vw, 56px); }

.eyebrow {
  margin: 0 0 10px;
  font-size: .8rem; font-style: italic; font-weight: 400;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted);
}
.card-title {
  margin: 0 0 16px;
  font-weight: 600;
  font-size: clamp(2rem, 3.3vw, 2.75rem);
  line-height: 1.06;
  letter-spacing: -.022em;
  color: var(--ink);
}
.deadline {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 20px; padding: 7px 14px 7px 12px;
  border-radius: 14px;
  background: rgba(18, 63, 125, .08);
  font-size: .9rem; font-weight: 500; color: var(--ink);
}
.deadline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); box-shadow: 0 0 0 4px rgba(36, 99, 178, .18); }

.intro p, .lead { margin: 0 0 14px; font-size: 1.0625rem; line-height: 1.62; color: var(--ink-soft); }
.intro p:last-child { margin-bottom: 0; }
.lead-strong { font-weight: 600; color: var(--ink); }

/* ---------- Forma ---------- */
.qa-form { margin-top: 30px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 1rem; color: var(--ink); }
.req { color: var(--blue-600); }
.opt { margin-left: 6px; font-weight: 400; font-size: .82rem; color: var(--muted); }
.hint { margin: -2px 0 10px; font-size: .92rem; line-height: 1.5; color: var(--muted); }

textarea, input[type="text"] {
  width: 100%;
  font: inherit; font-size: 1.0625rem; line-height: 1.55;
  color: var(--ink);
  background: rgba(255, 255, 255, .92);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 132px; }
#f-context { min-height: 112px; }
textarea::placeholder, input::placeholder { color: rgba(18, 63, 125, .45); }
textarea:hover, input[type="text"]:hover { border-color: rgba(18, 63, 125, .28); }
textarea:focus, input[type="text"]:focus {
  outline: none; background: #fff;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(36, 99, 178, .16);
}
.has-error textarea, .has-error input[type="text"] { border-color: var(--danger); }

.field-foot { display: flex; justify-content: space-between; gap: 12px; min-height: 1.2em; margin-top: 6px; font-size: .82rem; }
.field-error { color: var(--danger); font-weight: 500; }
.counter { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .2s; }
.counter.is-visible { opacity: 1; }
.counter.is-near { color: #a05a00; }

/* Vārds + anonimitāte */
.name-field { margin-bottom: 26px; }
.name-field input[type="text"]:disabled {
  background: rgba(255, 255, 255, .45); color: rgba(18, 63, 125, .45);
  border-color: rgba(18, 63, 125, .1); cursor: not-allowed;
}
.name-field.is-anon > label .req { visibility: hidden; }
.name-field .check { display: inline-flex; margin: 0; font-weight: 500; font-size: 1rem; }
.name-field .field-error { display: block; min-height: 1.2em; margin: 6px 0 4px; font-size: .82rem; }
.check { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; font-weight: 500; user-select: none; color: var(--ink); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  flex: none; width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid rgba(18, 63, 125, .35); background: #fff;
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.check-box::after {
  content: ""; width: 11px; height: 6px; margin-top: -3px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) scale(0); transition: transform .15s;
}
.check input:checked + .check-box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .check-box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .check-box { outline: 3px solid var(--blue-400); outline-offset: 2px; }

/* Pogas */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 14px 28px;
  border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-weight: 600; font-size: 1.0625rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 10px 24px -12px rgba(10, 40, 90, .8); }
.btn-primary:hover { background: var(--blue-950); }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(18, 63, 125, .28); }
.btn-ghost:hover { background: rgba(255, 255, 255, .5); border-color: rgba(18, 63, 125, .45); }
.btn-icon { width: 20px; height: 20px; transition: transform .2s; }
.btn-submit:hover .btn-icon { transform: translateX(3px); }
.btn[disabled], .btn.is-busy { cursor: progress; opacity: .75; }
.btn.is-busy .btn-icon { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.privacy-note { margin: 16px 0 0; font-size: .86rem; line-height: 1.55; color: var(--muted); }
.privacy-note a { color: var(--ink); font-weight: 500; }

.form-alert {
  margin: 0 0 20px; padding: 12px 16px;
  border-radius: 14px; background: #fde8e6; color: #8c1d18;
  font-weight: 500; font-size: .95rem;
}

.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Apstiprinājums / slēgts */
.badge { width: 76px; margin: 0 auto 22px; color: var(--ink); }
.badge .symbol { width: 64px; height: 64px; margin: 0 auto; color: var(--blue-600); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.closed-unsent { text-align: left; margin-top: 18px; }
.unsent-text {
  white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .95rem;
  background: rgba(255, 255, 255, .7); border-radius: 14px; padding: 12px 14px; margin: 0; user-select: all;
}

/* Kājene */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 4px 6px 8px;
  font-size: .85rem; color: rgba(255, 255, 255, .8);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.footer-brand .symbol { width: 22px; height: 22px; color: var(--mint); }

/* ---------- Telefons / planšete ---------- */
@media (max-width: 959.98px) {
  .layout { display: block; padding: 12px 12px 8px; }
  .poster {
    position: relative; top: 0; height: auto; min-height: 0; max-height: none;
    aspect-ratio: auto; border-radius: 22px;
    background: linear-gradient(180deg, #1d5aa9, #194f9b);
  }
  .poster picture, .poster-img { height: auto; }
  .poster-img { aspect-ratio: 1200 / 562; }
  .poster-meta {
    position: relative; top: auto;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px;
    padding: 11px 16px 13px;
    font-size: .78rem; line-height: 1.4; letter-spacing: .1em;
  }
  .poster-meta p + p::before { content: "·"; margin-right: 14px; opacity: .7; }
  .content { min-height: 0; display: block; max-width: 640px; margin: 18px auto 0; padding: 0; }
  .card { border-radius: 24px; margin-bottom: 30px; }
  .card::after { left: 40px; }
  .btn-submit { width: 100%; }
  .eyebrow { display: none; }
  .deadline { font-size: .85rem; align-items: flex-start; }
  .deadline .dot { margin-top: 6px; flex: none; }
}
@media (min-width: 960px) {
  .poster-meta--below { display: none; }
}
@media (max-width: 420px) {
  .card { padding: 22px 18px 24px; }
  .card-title { font-size: 1.85rem; }
  .actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Privātuma lapa */
.content-single { min-height: 0; display: block; max-width: 760px; margin: 0 auto; padding: 40px 16px; }
.prose h2 { margin: 28px 0 8px; font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; }
.prose p, .prose li { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.65; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 1.2em; }
.prose a { color: var(--ink); font-weight: 500; }
.actions-left { justify-content: flex-start; }
.prose .btn { color: #fff; }
