/* Government orders: the public list, the detail page and the PDF viewer.
   Uses the colour and spacing tokens defined in css/site.css. */

:root { --pdf: #d92d20; --pdf-50: #fdecea; }

/* --- filter bar ------------------------------------------------------------------------------ */
.go-filter {
  display: grid; grid-template-columns: minmax(240px, 2.2fr) repeat(3, minmax(150px, 1fr)); gap: .75rem;
  margin-bottom: 1.25rem; align-items: center;
}
.go-filter__search { position: relative; }
.go-filter__search i { position: absolute; left: 1.15rem; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 2; pointer-events: none; }
.go-filter .form-control, .go-filter .form-select { border-radius: 999px; border: 1.5px solid var(--line); box-shadow: var(--shadow-sm); font-size: .95rem; }
.go-filter .form-control { padding-left: 3rem; }
.go-filter .form-control:focus, .go-filter .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .25rem rgba(36, 87, 245, .15); }
@media (max-width: 991.98px) { .go-filter { grid-template-columns: 1fr 1fr; } .go-filter__search { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .go-filter { grid-template-columns: 1fr; } }

/* --- list ------------------------------------------------------------------------------------ */
.go-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.go-row {
  display: flex; align-items: flex-start; gap: 1.1rem; padding: 1.15rem 1.3rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.go-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 35%, white); }
.go-row__icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 1.65rem; color: var(--pdf); background: var(--pdf-50); }
.go-row__main { flex: 1; min-width: 0; }
.go-row__meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; }
.go-row__meta i { margin-right: .2rem; }
.go-ref { color: var(--brand); font-weight: 800; letter-spacing: .01em; }
.go-kind { color: var(--accent-600); letter-spacing: .02em; font-weight: 800; }
.go-row__title { font-size: 1.08rem; line-height: 1.4; margin: 0; }
.go-row__title a { color: var(--ink); }
.go-row__title a:hover { color: var(--brand); }
.go-row__summary { margin: .45rem 0 0; color: var(--muted); font-size: .93rem; }
.go-row__actions { flex: none; display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.go-row__actions .btn { white-space: nowrap; }
@media (max-width: 767.98px) {
  .go-row { flex-wrap: wrap; }
  .go-row__main { flex-basis: calc(100% - 70px); }
  .go-row__actions { flex-direction: row; flex-basis: 100%; }
  .go-row__actions .btn { flex: 1; }
}
.go-list--compact .go-row { padding: .85rem 1.1rem; }
.go-list--compact .go-row__icon { width: 42px; height: 42px; font-size: 1.3rem; border-radius: 12px; }
.go-list--compact .go-row__title { font-size: .98rem; }

.go-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; font-size: .9rem; color: var(--muted); font-weight: 600; }

/* --- detail ---------------------------------------------------------------------------------- */
.go-facts {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem;
  padding: 1.25rem 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
}
.go-facts dl { display: flex; flex-wrap: wrap; gap: 1rem 2.25rem; margin: 0; }
.go-facts dt { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.go-facts dd { margin: .1rem 0 0; font-weight: 700; color: var(--ink); }
.go-facts__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.go-summary { max-width: 80ch; font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 1.25rem; }
.go-hidden-note { display: flex; gap: .6rem; align-items: center; padding: .8rem 1.1rem; margin-bottom: 1.25rem; border-radius: var(--radius-sm); background: #fff8e1; color: #6b4e00; border: 1px solid #f3dc8a; font-weight: 600; }
.go-help { margin: .9rem 0 0; font-size: .88rem; color: var(--muted); }
.go-more { margin-top: 3rem; }
.go-more h2 { font-size: 1.25rem; margin-bottom: 1rem; }

/* --- PDF viewer ------------------------------------------------------------------------------ */
.pdfv {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
}
html:not(.js) .pdfv__bar { display: none; }
.pdfv__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.25rem; padding: .55rem .8rem; border-bottom: 1px solid var(--line); background: #fff; }
.pdfv__group { display: flex; align-items: center; gap: .25rem; }
.pdfv__group--end { margin-left: auto; }
.pdfv__btn, .pdfv__zoom {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 .55rem; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-soft); font-size: 1.05rem; font-weight: 700; transition: background .15s, color .15s;
}
.pdfv__btn:hover, .pdfv__zoom:hover { background: var(--brand-50); color: var(--brand); }
.pdfv__btn[hidden] { display: none; }
.pdfv__zoom { font-size: .85rem; min-width: 56px; }
.pdfv__page-no { display: flex; align-items: center; gap: .4rem; margin: 0 .25rem; font-weight: 700; color: var(--ink-soft); font-size: .9rem; }
.pdfv__page-no input {
  width: 3.6rem; height: 38px; text-align: center; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; color: var(--ink);
  background: var(--bg); -moz-appearance: textfield;
}
.pdfv__page-no input::-webkit-outer-spin-button, .pdfv__page-no input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdfv__page-no input:focus { outline: 0; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 .2rem rgba(36, 87, 245, .15); }

.pdfv__stage {
  position: relative; height: clamp(460px, 82vh, 1000px); overflow: auto; background: #e6eaf3; padding: 16px 0 2px;
  -webkit-overflow-scrolling: touch; outline: 0;
}
.pdfv__stage:focus-visible { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--brand) 50%, white); }
.pdfv__pages { width: max-content; min-width: 100%; box-sizing: border-box; }
.pdfv__page {
  position: relative; margin: 0 auto 14px; background: #fff; box-shadow: 0 2px 12px rgba(15, 23, 42, .2);
  min-height: 120px;
}
.pdfv__page canvas { display: block; width: 100%; height: 100%; }
.pdfv__page.is-error { display: grid; place-items: center; }
.pdfv__page.is-error::after { content: "This page could not be drawn."; color: var(--muted); font-weight: 600; }

.pdfv__status { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: .8rem; background: rgba(230, 234, 243, .92); color: var(--ink-soft); font-weight: 600; }
.pdfv__status[hidden] { display: none; }
.pdfv__spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid color-mix(in srgb, var(--brand) 20%, white); border-top-color: var(--brand); animation: pdfv-spin .8s linear infinite; }
@keyframes pdfv-spin { to { transform: rotate(360deg); } }

.pdfv__frame { display: block; width: 100%; height: 100%; min-height: 460px; border: 0; background: #fff; }
.pdfv--fallback .pdfv__bar .pdfv__group:not(.pdfv__group--end) { display: none; }
.pdfv--fallback .pdfv__stage { display: flex; flex-direction: column; padding: 0; }
.pdfv--fallback .pdfv__frame { flex: 1; }
.pdfv__note { margin: 0; padding: .8rem 1.1rem; background: #fff8e1; color: #6b4e00; font-weight: 600; font-size: .9rem; }
noscript .pdfv__frame { height: 82vh; }

.pdfv:fullscreen { height: 100vh; border-radius: 0; border: 0; }
.pdfv:fullscreen .pdfv__stage { flex: 1; height: auto; }

@media (max-width: 575.98px) {
  .pdfv__bar { gap: .25rem .6rem; padding: .4rem .5rem; }
  .pdfv__stage { height: clamp(420px, 75vh, 800px); }
  .pdfv__group--end { margin-left: 0; }
  .go-facts { padding: 1rem 1.1rem; }
  .go-facts__actions { width: 100%; }
  .go-facts__actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pdfv__spinner { animation-duration: 2.4s; }
}
