/* citizen.org.in blog: one readable column in the landing page's type, always in the
 * app's Monochrome scheme (palette.css; Noto Serif headings, Noto Sans text). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--md-surface);
  color: var(--md-on-surface);
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.65;
}

a {
  color: var(--md-primary);
  text-underline-offset: 0.18em;
}

header.site,
main,
footer.site {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--md-outline-variant);
}

/* The mark and the name, as on the landing page (assets/site.css .brand__*): the
 * designer's navy, the scheme's primary on dark where the navy would disappear. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  fill: #07038d;
}

/* The mark keeps the navy in every scheme, as in the app (DESIGN.md §7): on dark, the
 * navy scheme's primary, where the navy itself would disappear. */
@media (prefers-color-scheme: dark) {
  .brand__mark {
    fill: #bfc2ff;
  }
}

.brand__name {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--md-on-surface);
  white-space: nowrap;
}

.brand__name span {
  color: var(--md-on-surface-variant);
}

@media (max-width: 26rem) {
  .brand__name {
    font-size: 1.1875rem;
  }

  .brand__mark {
    width: 1.5rem;
    height: 1.5rem;
  }

  header.site,
  nav {
    gap: 0.625rem;
  }

  nav .ask {
    padding: 0.4rem 0.75rem;
  }
}

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
}

nav a {
  text-decoration: none;
  white-space: nowrap;
}

nav .ask {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--md-primary);
  color: var(--md-on-primary);
}

main {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

h1,
h2,
h3,
h4 {
  font-family: "Noto Serif", Georgia, serif;
  font-weight: 500;
  line-height: 1.25;
  margin: 2.2rem 0 0.8rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  margin-top: 0.25rem;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.3rem;
}

p,
ul,
ol {
  margin: 0 0 1.1rem;
}

li {
  margin-bottom: 0.45rem;
}

.date {
  margin: 0;
  color: var(--md-on-surface-variant);
  font-size: 0.95rem;
}

.lead {
  color: var(--md-on-surface-variant);
  font-size: 1.15rem;
}

/* The site ships one Medium cut per face (fonts.css), so bold would not show; a bold
 * lead-in is set in the headings' serif instead. */
strong {
  font-family: "Noto Serif", Georgia, serif;
  font-weight: 500;
}

code {
  font-size: 0.92em;
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--md-surface-container);
}

.table {
  overflow-x: auto;
  margin: 0 0 1.4rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--md-outline-variant);
}

thead th {
  background: var(--md-surface-container-low);
  border-bottom: 2px solid var(--md-outline);
}

.signature {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--md-outline-variant);
}

.signature span {
  display: block;
}

.signature .name {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.15rem;
}

.signature .role {
  color: var(--md-on-surface-variant);
}

ol.posts {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

ol.posts li {
  padding: 1.25rem 0;
  border-top: 1px solid var(--md-outline-variant);
}

ol.posts h2 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.45rem;
}

ol.posts h2 a {
  color: var(--md-on-surface);
  text-decoration: none;
}

ol.posts p {
  margin: 0;
}

footer.site {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--md-outline-variant);
  color: var(--md-on-surface-variant);
  font-size: 0.9rem;
}

/* Screenshots: `![description](images/name.webp "caption")` on a line of its own. */
figure {
  margin: 1.75rem 0;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--md-outline-variant);
  border-radius: 0.5rem;
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--md-on-surface-variant);
}

/* Screenshots on consecutive lines: two across, each half the width. */
.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  align-items: start;
  margin: 1.75rem 0;
}

.figure-grid figure {
  margin: 0;
}

.figure-grid figcaption {
  font-size: 0.875rem;
}

/* On a phone, half a column is too small to read: one per row again. */
@media (max-width: 34rem) {
  .figure-grid {
    grid-template-columns: 1fr;
  }
}
