/* Dhanda i18n + blog additions. Keeps main.css untouched. */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #111;
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

/* The chrome wraps page bodies in <main>. body is flex-column/center and the
   original sections size off body width, so <main> must replicate that
   centering or every section collapses to a narrow shrink-wrapped column. */
main { width: 100%; display: flex; flex-direction: column; align-items: center; }
.container { width: 100%; }

/* Language switcher */
.lang-switch { position: relative; display: inline-block; }
.lang-switch summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(15, 61, 62, 0.2);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.55);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lang-switch summary:hover { background: #fff; border-color: var(--teal); }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-caret { font-size: 0.7rem; opacity: 0.6; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 160px;
  z-index: 50;
}
.lang-menu li { margin: 0; }
.lang-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
}
.lang-menu a:hover { background: rgba(0, 0, 0, 0.06); }
.lang-menu a[aria-current="true"] { font-weight: 700; background: rgba(0, 0, 0, 0.05); }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; opacity: 0.7; margin-bottom: 16px; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Blog index */
.blog-subtitle { opacity: 0.75; margin-bottom: 32px; max-width: 60ch; }
.blog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.blog-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.blog-card-cover { width: 100%; height: 160px; object-fit: cover; display: block; }
.blog-card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card-section {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.6;
}
.blog-card h2 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.blog-card h2 a { color: inherit; text-decoration: none; }
.blog-card h2 a:hover { text-decoration: underline; }
.blog-card p { margin: 0; opacity: 0.8; font-size: 0.95rem; }
.blog-card-meta { font-size: 0.8rem; opacity: 0.6; }
.blog-read-more { margin-top: auto; font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.blog-empty { opacity: 0.7; }

/* Blog article */
.blog-article { max-width: 72ch; }
.blog-article header h1 { margin: 8px 0 12px; }
.blog-article-meta { font-size: 0.85rem; opacity: 0.65; margin-bottom: 24px; }
.blog-cover img { width: 100%; border-radius: 12px; display: block; }
.blog-article-body { line-height: 1.75; font-size: 1.02rem; }
.blog-article-body h2 { margin-top: 1.8em; }
.blog-article-body h3 { margin-top: 1.4em; }
.blog-article-body img { max-width: 100%; height: auto; border-radius: 8px; }
.blog-article-body blockquote {
  border-left: 3px solid rgba(0, 0, 0, 0.2);
  margin: 1.2em 0;
  padding: 0.2em 1.2em;
  opacity: 0.85;
}
.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.blog-tag {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}
.blog-back { margin-top: 32px; }
.blog-back a { text-decoration: none; font-weight: 600; }

/* RTL (Arabic) */
[dir="rtl"] .lang-menu { right: auto; left: 0; }
[dir="rtl"] .blog-article-body blockquote { border-left: none; border-right: 3px solid rgba(0, 0, 0, 0.2); }
[dir="rtl"] .blog-read-more, [dir="rtl"] .blog-back a { direction: rtl; }

/* On small phones the navbar (logo + About/Contact/Blog + language + Join Beta)
   no longer fits one row. Wrap to two rows: logo + language + Join Beta on top,
   nav links centered beneath. display:contents lets .log/.navlinks join the
   navbar flex so they can be ordered independently of the .nav wrapper. */
@media (max-width: 600px) {
  .navbar { flex-wrap: wrap; row-gap: 0.35rem; padding: 0.6rem 4%; }
  .nav { display: contents; }
  .log { order: 1; }
  .navright { order: 2; margin-left: auto; gap: 0.4rem; }
  .navlinks { order: 3; flex-basis: 100%; justify-content: center; gap: 0.25rem; }
  .navlinks a { font-size: 0.85rem; padding: 0.3rem 0.6rem; }
  .lang-switch summary { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
  .lang-caret { display: none; }
  .sub { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
}