/*
 * The public pages (/, /privacy-policy, /terms-of-service, /delete-account) and the admin view's gate pages.
 * Long legal text is set for reading: a 68-character measure, 17px Roboto on 28px lines, headings in Poppins, a
 * table of contents beside it on a wide screen.
 */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-bar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.site-bar__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--s3) var(--s5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3) var(--s5);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--r-md);
}

.brand__logo {
  width: 80px;
  height: auto;
}

.brand__name {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
}

.site-nav ul,
.foot-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s2);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s3);
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--t-short) var(--ease);
}

.site-nav a:hover {
  background: var(--tint);
}

.site-nav a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

/* Documents. */
.doc-layout {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s7);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}

@media (min-width: 1040px) {
  .doc-layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: var(--s6);
  }
}

.toc {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s4) var(--s3);
  font-size: 0.9375rem;
  line-height: 1.35;
}

@media (min-width: 1040px) {
  .toc {
    position: sticky;
    top: var(--s5);
    max-height: calc(100vh - 2 * var(--s5));
    overflow: auto;
    background: transparent;
    padding: var(--s2) 0 0;
  }
}

.toc__title {
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: var(--s2);
  color: var(--ink);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.toc a {
  display: block;
  padding: 6px var(--s2);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink-2);
}

.toc a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.doc {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s5);
  min-width: 0;
}

@media (min-width: 720px) {
  .doc {
    padding: var(--s7) 64px;
  }
}

.prose {
  font-size: 1.0625rem;
  line-height: 1.65;
}

.prose > * + * {
  margin-top: 0.9em;
}

.prose h1 {
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.125rem);
  line-height: 1.2;
  max-width: 26ch;
  margin-bottom: var(--s5);
}

.prose h2 {
  font-size: 1.375rem;
  margin-top: 2.2em;
  padding-top: var(--s2);
  scroll-margin-top: var(--s5);
}

.prose h3 {
  font-size: 1.125rem;
  margin-top: 1.8em;
  scroll-margin-top: var(--s5);
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.6em;
}

.prose p,
.prose li {
  max-width: 68ch;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose li::marker {
  color: var(--coral);
}

.prose strong {
  font-weight: 700;
}

.prose a {
  overflow-wrap: anywhere;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

.prose blockquote {
  margin-left: 0;
  padding: var(--s3) var(--s4);
  border-left: 4px solid var(--coral);
  background: var(--tint);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--line);
  min-width: 12ch;
}

.prose th {
  font-family: var(--head);
  font-weight: 700;
  background: var(--shade);
}

.prose th:first-child {
  border-top-left-radius: var(--r-sm);
}

.prose th:last-child {
  border-top-right-radius: var(--r-sm);
}

/* Home. */
.home {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--s7) var(--s5);
}

.home__card {
  width: min(640px, 100%);
  background: var(--card);
  border-radius: var(--r-xl);
  padding: var(--s7) var(--s6);
  text-align: center;
}

.home__logo {
  width: min(280px, 70%);
  height: auto;
  margin: 0 auto var(--s6);
}

.home__text h1 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  margin: 0 auto;
  max-width: none;
}

.home__text p {
  margin-left: auto;
  margin-right: auto;
  color: var(--ink-2);
}

.home__text ul {
  list-style: none;
  padding: 0;
  margin-top: var(--s5);
  display: grid;
  gap: var(--s2);
  text-align: left;
}

.home__text li {
  max-width: none;
}

.home__text li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 56px;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--tint);
  font-family: var(--head);
  font-weight: 700;
  text-decoration: none;
  transition: background-color var(--t-short) var(--ease);
}

.home__text li a:hover {
  background: var(--shade);
}

/* Footer. */
.site-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.site-foot__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--s5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--s2);
  color: var(--ink-2);
}

.foot-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

.site-foot__campaign a {
  color: var(--ink);
  font-weight: 500;
}

/* The admin view's gate pages: why a request was turned away, and the way on. */
.gate {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--s7) var(--s5);
}

.gate__card {
  width: min(560px, 100%);
  background: var(--card);
  border-radius: var(--r-xl);
  padding: var(--s6) var(--s6) var(--s5);
  text-align: center;
}

.gate__logo {
  width: 120px;
  height: auto;
  margin: 0 auto var(--s5);
}

.gate__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--s4);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--page);
  color: var(--ink);
  font-size: 26px;
}

.gate h1 {
  font-size: 1.5rem;
  margin-bottom: var(--s3);
}

.gate p {
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0 auto;
}

.gate .gate__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s5);
}

.gate .gate__meta {
  margin-top: var(--s5);
  font-size: 0.875rem;
}

/* The admin view's sign-in and set-up pages: one card, the form aligned left under a centred head. */
.sign-in {
  width: min(460px, 100%);
}

.setup {
  width: min(600px, 100%);
}

.gate .sign-in__lead {
  margin-bottom: var(--s5);
}

.sign-in__notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin: 0 0 var(--s5);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  text-align: left;
  font-size: 0.9375rem;
  color: var(--ink);
}

.gate .sign-in__notice {
  max-width: none;
  color: var(--ink);
}

.sign-in__notice .icon {
  margin-top: 0.2em;
}

.sign-in__notice--info {
  background: var(--tint);
}

.sign-in__notice--warning {
  background: var(--zone-moderate);
}

.sign-in__google {
  width: 100%;
  min-height: 48px;
}

.sign-in__google .icon {
  width: 1.1em;
  height: 1.1em;
}

.gate .sign-in__or {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: var(--s5) 0;
  max-width: none;
  font-size: 0.875rem;
}

.sign-in__or::before,
.sign-in__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.sign-in__form,
.setup__form {
  display: grid;
  gap: var(--s4);
  text-align: left;
}

.gate form p {
  max-width: none;
  margin: 0;
}

.gate form .field__error {
  color: var(--danger);
}

.gate .sign-in__error {
  max-width: none;
  margin: 0;
  color: var(--danger);
  font-weight: 500;
}

.sign-in__error:empty {
  display: none;
}

.sign-in__submit {
  width: 100%;
  margin-top: var(--s2);
}

.sign-in__submit[aria-busy="true"] {
  cursor: progress;
}

.gate .setup__who {
  display: grid;
  gap: 2px;
  margin-bottom: var(--s2);
  color: var(--ink);
}

.setup__who span {
  color: var(--ink-2);
}

.gate .setup__expiry {
  margin-bottom: var(--s5);
  font-size: 0.875rem;
}

/* The password field's label with "Zapomněli jste heslo?" on its right (PRD amendment 17). */
.field__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
}

.sign-in__forgot {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}

.forgot__sent {
  text-align: left;
}

.forgot__sent .gate__meta {
  margin-top: var(--s3);
}

@media print {
  .site-bar,
  .site-foot,
  .toc,
  .env-band,
  .skip {
    display: none;
  }

  body {
    background: #fff;
  }

  .doc-layout {
    display: block;
    padding: 0;
  }

  .doc {
    padding: 0;
  }

  .prose a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
