/* Blog layout and article typography. Tokens and components come from oou.css. */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.6rem 0;
  background: rgba(253, 248, 236, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(234, 223, 200, 0.7);
}
.site-header .oou-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header .oou-lockup img {
  height: 3.25rem;
}
.site-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-link {
  display: none;
  color: var(--oou-ink);
  font-weight: 700;
  text-decoration: none;
  padding: 0.5rem 0;
}
.site-link:hover {
  color: var(--oou-teal-700);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
@media (min-width: 40rem) {
  .site-link {
    display: inline-block;
  }
}
@media (max-width: 23.5rem) {
  .site-header .oou-lockup img {
    height: 2.5rem;
  }
  .oou-lockup__sub {
    font-size: 0.9rem;
    padding-inline: 0.6rem;
  }
}

.lang {
  position: relative;
}
.lang summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--oou-radius-pill);
  border: 2px solid var(--oou-line);
  background: var(--oou-white);
  color: var(--oou-teal-900);
  font-weight: 800;
  font-size: 0.95rem;
}
.lang summary::-webkit-details-marker {
  display: none;
}
.lang summary svg {
  width: 1.15rem;
  height: 1.15rem;
}
.lang[open] summary,
.lang summary:hover {
  border-color: var(--oou-teal-700);
}
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 5;
  min-width: 11rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--oou-white);
  border: 2px solid var(--oou-line);
  border-radius: var(--oou-radius-sm);
  box-shadow: var(--oou-shadow);
  animation: lang-in var(--oou-dur) var(--oou-ease-bounce);
}
@keyframes lang-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}
.lang a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  color: var(--oou-ink);
  font-weight: 700;
  text-decoration: none;
}
.lang a:hover,
.lang a[aria-current] {
  background: var(--oou-teal-100);
  color: var(--oou-teal-900);
}

/* ---------- Blog home ---------- */
.blog-hero {
  padding: 3rem 0 2rem;
}
.blog-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  max-width: 18ch;
  margin: 1rem 0;
}
.blog-hero .oou-lead {
  max-width: 40rem;
}
.blog-hero .oou-star {
  position: absolute;
  width: 2.2rem;
  right: 8%;
  top: 2.5rem;
}
.blog-hero .oou-wrap {
  position: relative;
}

.posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .posts {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 64rem) {
  .posts {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--oou-white);
  border: 2px solid var(--oou-line);
  border-radius: var(--oou-radius);
  overflow: hidden;
  transition: transform var(--oou-dur) var(--oou-ease), box-shadow var(--oou-dur) var(--oou-ease), border-color var(--oou-dur);
}
.post-card:hover,
.post-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--oou-shadow);
  border-color: var(--oou-teal-700);
}
.post-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--oou-teal-100);
  overflow: hidden;
}
.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--oou-ease);
}
.post-card:hover .post-card__media img {
  transform: scale(1.05);
}
.post-card__media--blank {
  display: grid;
  place-items: center;
  color: var(--oou-teal-700);
}
.post-card__media--blank svg {
  width: 3rem;
  opacity: 0.7;
}
.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.4rem 1.5rem;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.6rem;
  color: var(--oou-text-muted);
  font-size: var(--oou-text-sm);
}
.post-card h2,
.post-card h3 {
  font-size: 1.35rem;
  line-height: 1.25;
}
.post-card h2 a,
.post-card h3 a {
  color: var(--oou-teal-900);
  text-decoration: none;
}
/* The whole card is clickable, through the title link. */
.post-card h2 a::after,
.post-card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.post-card:hover h2 a,
.post-card:hover h3 a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.post-card p {
  color: var(--oou-text-muted);
  margin-top: 0.6rem;
  font-size: 1.05rem;
}
.post-card__more {
  margin-top: auto;
  padding-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--oou-primary);
  font-family: var(--oou-font-display);
  font-weight: 600;
}
.post-card__more svg {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform var(--oou-dur) var(--oou-ease-bounce);
}
.post-card:hover .post-card__more svg {
  transform: translateX(4px);
}

/* The newest article spans the full width on wide screens. */
@media (min-width: 64rem) {
  .post-card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
  }
  .post-card--featured .post-card__media {
    flex: 1.15;
    aspect-ratio: auto;
    min-height: 20rem;
  }
  .post-card--featured .post-card__body {
    flex: 1;
    justify-content: center;
    padding: 2.25rem;
  }
  .post-card--featured h2 {
    font-size: 2rem;
  }
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--oou-radius);
  background: var(--oou-sun-100);
}
.empty-state .oou-star {
  width: 3rem;
  margin: 0 auto 1rem;
}
.empty-state h2 {
  font-size: 1.6rem;
}
.empty-state p {
  color: var(--oou-text-muted);
  max-width: 30rem;
  margin: 0.75rem auto 1.5rem;
}

/* ---------- Article ---------- */
.article {
  padding: 1.5rem 0 3rem;
}
.article-wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.4rem;
  font-weight: 800;
  text-decoration: none;
}
.back-link svg {
  width: 1.1rem;
  height: 1.1rem;
  transform: scaleX(-1);
}
.back-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.article-head {
  margin: 0.75rem 0 1.5rem;
}
.article-head h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  margin: 0.9rem 0 1rem;
}
.article-head .oou-lead {
  margin-bottom: 1.25rem;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  color: var(--oou-text-muted);
  font-size: var(--oou-text-sm);
}
.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.article-meta svg {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--oou-teal-700);
}
.article-cover {
  margin: 0 auto 2.25rem;
  max-width: 56rem;
  padding: 0 1.25rem;
}
.article-cover img {
  width: 100%;
  border-radius: var(--oou-radius);
  box-shadow: var(--oou-shadow);
}

.prose {
  font-size: 1.1875rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}
.prose > * + * {
  margin-top: 1.25rem;
}
.prose h2 {
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  margin-top: 2.75rem;
}
.prose h3 {
  font-size: 1.35rem;
  margin-top: 2rem;
}
.prose h2 + *,
.prose h3 + * {
  margin-top: 0.75rem;
}
.prose ul,
.prose ol {
  padding-left: 1.4rem;
}
.prose li + li {
  margin-top: 0.5rem;
}
.prose li::marker {
  color: var(--oou-coral-500);
  font-weight: 800;
}
.prose a {
  font-weight: 700;
}
.prose strong {
  color: var(--oou-teal-900);
}
.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 1rem 1.4rem;
  background: var(--oou-sun-100);
  border-left: 6px solid var(--oou-sun-400);
  border-radius: 0 var(--oou-radius-sm) var(--oou-radius-sm) 0;
  color: var(--oou-teal-900);
}
.prose blockquote > * + * {
  margin-top: 0.75rem;
}
.prose img {
  border-radius: var(--oou-radius-sm);
}
.prose hr {
  border: 0;
  height: 4px;
  width: 4rem;
  margin: 2.5rem 0;
  border-radius: 4px;
  background: var(--oou-coral-100);
}
.prose code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.95em;
  background: var(--oou-teal-50);
  color: var(--oou-teal-900);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.prose pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  background: var(--oou-teal-900);
  color: #e8f3f2;
  border-radius: var(--oou-radius-sm);
}
.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 1rem;
}
.prose th,
.prose td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--oou-line);
  text-align: left;
}
.prose th {
  font-family: var(--oou-font-display);
  color: var(--oou-teal-900);
}

.sources {
  margin-top: 3rem;
  padding: 1.5rem 1.6rem;
  background: var(--oou-white);
  border: 2px solid var(--oou-line);
  border-radius: var(--oou-radius);
  font-size: 1rem;
}
.sources h2 {
  font-size: 1.3rem;
}
.sources ul {
  margin: 0.9rem 0 0;
  padding-left: 1.25rem;
}
.sources li + li {
  margin-top: 0.4rem;
}
.sources li::marker {
  color: var(--oou-coral-500);
}
.sources a {
  font-weight: 700;
}
.article .oou-note {
  margin-top: 1.5rem;
}

.next-up {
  margin-top: 3rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--oou-teal-700);
  border-radius: var(--oou-radius);
}
.next-up h2 {
  color: var(--oou-white);
  font-size: 1.7rem;
}
.next-up p {
  color: var(--oou-teal-100);
  margin: 0.6rem auto 1.5rem;
  max-width: 28rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--oou-space-8);
  padding: 3rem 0 2rem;
  background: var(--oou-white);
  border-top: 2px solid var(--oou-line);
  color: var(--oou-muted);
}
.site-footer .oou-wrap {
  display: grid;
  gap: 2rem;
}
@media (min-width: 48rem) {
  .site-footer .oou-wrap {
    grid-template-columns: 2fr 1fr 1fr;
  }
}
.site-footer__brand img {
  height: 3rem;
  width: auto;
  margin-bottom: 0.9rem;
}
.site-footer__brand p {
  max-width: 22rem;
}
.site-footer h2 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer nav a {
  display: inline-block;
  padding: 0.55rem 0;
  font-weight: 700;
  text-decoration: none;
}
.site-footer nav a:hover,
.site-footer nav a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.site-footer__legal {
  grid-column: 1 / -1;
  padding-top: 1.25rem;
  border-top: 1px solid var(--oou-line);
  font-size: var(--oou-text-sm);
}

@media print {
  .site-header,
  .site-footer,
  .next-up,
  .back-link {
    display: none;
  }
}
