/* Blog: the list (blog/index.html) and one article (blog/<post>.html).
   Builds on styles.css. Generated pages: website-blog/build_blog.py. */

[hidden] {
  display: none !important;
}

.blog-section {
  padding-top: clamp(36px, 4vw, 56px);
}

/* ---------- Topic filter ---------- */

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.blog-filter__btn {
  min-height: 42px;
  padding: 8px 18px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #b9c6d0;
  border-radius: 999px;
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}

.blog-filter__btn span {
  margin-left: 4px;
  color: var(--graphite);
  font-weight: 400;
}

.blog-filter__btn:hover {
  border-color: var(--blue);
}

.blog-filter__btn[aria-pressed="true"] {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.blog-filter__btn[aria-pressed="true"] span {
  color: rgba(255, 255, 255, .8);
}

.blog-filter__btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- Article cards ---------- */

.posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 4vw, 56px) clamp(24px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card a {
  display: grid;
  align-content: start;
  gap: 10px;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.post-card a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 6px;
}

.post-card__img {
  display: block;
  margin-bottom: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--paper);
  border-bottom: 3px solid var(--blue);
}

.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

@media (hover: hover) {
  .post-card a:hover img {
    transform: scale(1.04);
  }
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--graphite);
  font-size: .875rem;
}

.post-card__cat {
  color: var(--blue-deep);
  font-weight: 700;
}

.post-card__title {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-stretch: 106%;
  font-weight: 600;
  line-height: 1.3;
}

.post-card a:hover .post-card__title {
  color: var(--blue);
}

.post-card__excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: .9375rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.post-card__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 4px;
  color: var(--blue-deep);
  font-size: .9375rem;
  font-weight: 700;
}

.post-card__more span {
  color: var(--graphite);
  font-weight: 400;
}

.post-card__more .post-card__lang {
  padding: 2px 9px;
  color: var(--blue-deep);
  background: var(--cyan-wash);
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 700;
}

.posts-all {
  margin: 40px 0 0;
}

@media (max-width: 960px) {
  .posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .posts {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- One article ---------- */

.post-head h1 {
  max-width: 28ch;
}

.post-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 0;
  padding: 0;
  color: var(--graphite);
  list-style: none;
}

.post-head__meta li + li::before {
  margin: 0 12px;
  content: "·";
  color: var(--line);
}

.post-section {
  padding-top: clamp(32px, 4vw, 56px);
}

.post {
  max-width: 46rem;
}

.post__cover {
  margin: 0 0 clamp(32px, 4vw, 48px);
  border-bottom: 3px solid var(--blue);
}

.post__cover img {
  width: 100%;
}

.post__body {
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.post__body > :first-child {
  margin-top: 0;
}

.post__body p {
  margin: 0 0 1.15em;
}

.post__body h2 {
  margin: 1.8em 0 .6em;
  font-size: clamp(1.5rem, 1.3rem + .8vw, 2rem);
  font-stretch: 110%;
}

.post__body h3 {
  margin: 1.6em 0 .5em;
  font-size: 1.3125rem;
}

.post__body h4 {
  margin: 1.4em 0 .4em;
  color: var(--ink);
  font-size: 1.0625rem;
}

.post__body strong {
  color: var(--ink);
}

.post__body ul,
.post__body ol {
  margin: 0 0 1.3em;
  padding-inline-start: 1.4em;
}

.post__body li {
  margin-bottom: .45em;
}

.post__body li::marker {
  color: var(--blue);
}

.post__body a {
  color: var(--blue-deep);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.post__body blockquote {
  margin: 1.6em 0;
  padding: 4px 0;
  padding-inline-start: 20px;
  color: var(--ink);
  border-inline-start: 4px solid var(--blue);
}

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

.post-figure {
  margin: 1.8em 0;
}

.post-figure img {
  width: auto;
  max-width: 100%;
  border: 1px solid var(--line);
}

.post-figure figcaption {
  margin-top: 8px;
  color: var(--graphite);
  font-size: .875rem;
}

.post-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 32px;
  align-items: center;
  margin: 1.6em 0;
}

.post-cols .post-figure {
  margin: 0;
}

.post-cols > div > :last-child {
  margin-bottom: 0;
}

.post-table {
  margin: 1.8em 0;
  overflow-x: auto;
}

.post-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}

.post-table th,
.post-table td {
  padding: 10px 12px;
  text-align: start;
  vertical-align: top;
  border: 1px solid var(--line);
}

.post-table tr:first-child td,
.post-table th {
  color: var(--ink);
  background: var(--paper);
  font-weight: 600;
}

.post__body[lang="ar"] {
  font-size: 1.0625rem;
}

/* ---------- Share ---------- */

.post-share {
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.post-share p {
  margin: 0 0 10px;
  color: var(--graphite);
  font-size: .875rem;
}

.post-share ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-share a,
.post-share button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--blue-deep);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}

.post-share a:hover,
.post-share button:hover {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.post-share svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.post-share svg.post-share__line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.post-share .post-share__done {
  margin: 10px 0 0;
  color: var(--blue-deep);
  font-weight: 600;
}
