/* /blog layers on top of learn.css, which owns the palette, type and shell.
   Everything here is article furniture: measure, byline, sources, cards. */

.article,
.blog-index,
.author-page {
  padding-block: clamp(28px, 6vw, 56px);
}

/* Long-form gets a narrower measure than a lesson table wants. */
.article-head,
.article-body,
.article-sources,
.article-related {
  max-width: 68ch;
  margin-inline: auto;
}

.article-head h1 {
  margin: 10px 0 12px;
}

.article-standfirst {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 22px;
}

/* Byline: the provenance line. Deliberately prominent. */
.byline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 4px;
  border-top: 2px solid var(--hairline);
}

.byline-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  object-fit: cover;
  flex: none;
}

.byline-text p {
  margin: 0;
}

.byline-name {
  font-weight: 700;
}

.byline-name a {
  color: inherit;
}

.byline-meta {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.article-hero {
  margin: 26px auto 30px;
  max-width: var(--max);
}

.article-hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--canvas-dim);
}

.article-body > * + * {
  margin-top: 1.1em;
}

.article-body p {
  line-height: 1.7;
  font-size: 1.05rem;
}

.article-body h2 {
  margin-top: 1.8em;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
}

.article-list {
  padding-left: 1.2em;
  line-height: 1.7;
}

.article-list li + li {
  margin-top: 0.4em;
}

.article-note {
  background: var(--sun-100);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.article-note p {
  margin: 0;
}

/* Example block: German term, English gloss, optional aside. */
.example-block {
  border: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.example-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 16px;
  padding: 12px 16px;
}

.example-row + .example-row {
  border-top: 2px solid var(--hairline);
}

.example-term {
  font-weight: 700;
}

.example-gloss {
  color: var(--ink-soft);
}

.example-note {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* Citation markers and the reference list they point at. */
.cite {
  font-size: 0.7em;
  line-height: 0;
}

.cite a {
  color: var(--mint-text);
  font-weight: 700;
  padding: 0 1px;
  text-decoration: none;
}

.cite a:hover {
  text-decoration: underline;
}

.article-sources {
  margin-top: 2.4em;
  border-top: 3px solid var(--ink);
  padding-top: 18px;
}

.sources-note {
  margin: 0 0 14px;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.article-sources ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.article-sources li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.source-n {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 8px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--mint-100);
  color: var(--mint-text);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Each reference is a card that is entirely clickable, so it reads as a link
   rather than as a line of text that happens to contain one. */
.source-link {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  padding: 10px 14px;
  border: 2px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.12s ease,
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.source-link:hover,
.source-link:focus-visible {
  border-color: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
}

.source-title {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

.source-icon {
  /* learn.css sets `svg { display: block }` globally, which would drop this
     glyph onto its own line. It belongs beside the title. */
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.4em;
  vertical-align: -0.05em;
  color: var(--ink-faint);
  flex: none;
}

.source-link:hover .source-icon,
.source-link:focus-visible .source-icon {
  color: var(--coral-deep);
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 5px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.source-ref {
  color: var(--ink-faint);
}

/* The bare host, so the destination is visible before the click. */
.source-host {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--canvas-dim);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.article-sources li:target .source-link {
  border-color: var(--ink);
  background: var(--sun-100);
}

.article-related {
  max-width: 68ch;
  margin-inline: auto;
}

.article-head h1 {
  margin: 10px 0 12px;
}

.article-standfirst {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 22px;
}

/* Byline: the provenance line. Deliberately prominent. */
.byline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 4px;
  border-top: 2px solid var(--hairline);
}

.byline-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  object-fit: cover;
  flex: none;
}

.byline-text p {
  margin: 0;
}

.byline-name {
  font-weight: 700;
}

.byline-name a {
  color: inherit;
}

.byline-meta {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.article-hero {
  margin: 26px auto 30px;
  max-width: var(--max);
}

.article-hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--canvas-dim);
}

.article-body > * + * {
  margin-top: 1.1em;
}

.article-body p {
  line-height: 1.7;
  font-size: 1.05rem;
}

.article-body h2 {
  margin-top: 1.8em;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
}

.article-list {
  padding-left: 1.2em;
  line-height: 1.7;
}

.article-list li + li {
  margin-top: 0.4em;
}

.article-note {
  background: var(--sun-100);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.article-note p {
  margin: 0;
}

/* Example block: German term, English gloss, optional aside. */
.example-block {
  border: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.example-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 16px;
  padding: 12px 16px;
}

.example-row + .example-row {
  border-top: 2px solid var(--hairline);
}

.example-term {
  font-weight: 700;
}

.example-gloss {
  color: var(--ink-soft);
}

.example-note {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* Citation markers and the reference list they point at. */
.cite {
  font-size: 0.7em;
  line-height: 0;
}

.cite a {
  color: var(--mint-text);
  font-weight: 700;
  padding: 0 1px;
  text-decoration: none;
}

.cite a:hover {
  text-decoration: underline;
}

.article-sources {
  margin-top: 2.4em;
  border-top: 3px solid var(--ink);
  padding-top: 18px;
}

.article-sources ol {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
}

.article-sources li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  line-height: 1.5;
}

.article-sources li + li {
  border-top: 1px solid var(--hairline);
}

.article-sources li:target {
  background: var(--sun-100);
}

.source-n {
  font-weight: 700;
  color: var(--mint-text);
  flex: none;
}

.source-ref {
  color: var(--ink-faint);
}

.article-related {
  margin-top: 2em;
}

.article-related ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article-related a {
  display: inline-block;
  border: var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  background: var(--paper);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Index cards. */
.blog-standfirst {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.6;
}

.article-cards {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

.article-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.article-card-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.article-card-link img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: var(--border);
  background: var(--canvas-dim);
}

.article-card-text {
  padding: 16px 18px 18px;
}

.article-card-text h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.article-card-text p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.article-card-meta {
  margin-top: 10px !important;
  font-size: 0.85rem;
  color: var(--ink-faint) !important;
}

/* Author page. */
.author-page {
  max-width: 68ch;
  margin-inline: auto;
}

.author-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 12px 0 18px;
}

.author-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: var(--border);
  object-fit: cover;
  flex: none;
}

.author-head h1 {
  margin: 0 0 4px;
}

.author-role {
  margin: 0;
  color: var(--ink-faint);
}

.author-bio {
  line-height: 1.7;
  font-size: 1.05rem;
}

.author-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
}

.author-links a {
  display: inline-block;
  border: 2px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 12px;
  text-decoration: none;
}

.author-articles ul {
  list-style: none;
  padding: 0;
}

.author-articles li {
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.author-articles time {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.article-empty {
  color: var(--ink-faint);
}

@media (max-width: 560px) {
  .example-row {
    grid-template-columns: 1fr;
  }

  .author-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
