/**
 * Article/Content styles for long-form content
 * Used by apps with documentation/article sections
 */

/* ========== Long Content ========== */
.long {
  width: 100%;
  padding: 0 0 2em;
  line-height: 1.4;
  font-size: 1.07em;
}

/* ========== Blog Post (single article) ========== */
.blog-post {
  width: 100%;
  margin: 0 0 3em;
  padding: 0 0 2em;
  line-height: 1.55;
  font-size: 1.07em;
  color: #222;
}

.blog-post img {
  width: 90% !important;
  max-width: 90% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
}

.blog-post figure {
  width: 100% !important;
  max-width: 100% !important;
}

.blog-post ul,
.blog-post ol {
  margin: 0.8em 0 0.8em 1.4em;
}

.blog-post li {
  margin: 0.35em 0;
}

.blog-post figure {
  margin: 1.6em 0;
}

.blog-post figcaption {
  font-size: 0.9em;
  color: #555;
  text-align: center;
  margin-top: 0.4em;
}

.blog-post table {
  margin: 1.4em auto;
  border-collapse: collapse;
}
.blog-post th,
.blog-post td {
  border: 1px solid #ccc;
  padding: 0.4em 0.7em;
  text-align: left;
  vertical-align: middle;
}
.blog-post th {
  background: #f5f5f5;
  font-weight: 600;
}

.blog-post__back {
  display: inline-block;
  margin: 0 0 1em;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.blog-post__back:hover {
  text-decoration: underline;
}

.long h1,
.blog-post h1 {
  font-size: 1.9em;
  font-weight: 700;
  text-align: left;
  color: var(--color-dark);
  line-height: 1.25;
  margin: 1.5em 0 0.6em;
}

/* When h1 immediately follows the back link, collapse its top margin */
.blog-post__back + h1 {
  margin-top: 0.3em;
}

.long h2,
.blog-post h2 {
  font-size: 1.4em;
  font-weight: 700;
  text-align: left;
  color: var(--color-dark);
  line-height: 1.3;
  margin: 1.4em 0 0.5em;
}

.long h3,
.blog-post h3 {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--color-dark);
  line-height: 1.35;
  margin: 1.2em 0 0.4em;
}

.long h4,
.blog-post h4 {
  font-size: 1.02em;
  font-weight: 600;
  color: var(--color-dark);
  margin: 1em 0 0.3em;
}

.long p,
.blog-post p {
  margin: 0.8em 0;
}

.long ul {
  display: block;
  list-style-type: disc;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
  font-size: 1.07em;
}

.long li {
  margin: 0.5em 0;
}

.long ol {
  display: block;
  list-style-type: decimal;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
}

.long code,
.blog-post code {
  background: #f4f4f4;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: monospace;
}

/* Inside <pre>, <code> is multi-line: the inline padding/background
   only attaches to the first line and shifts it to the right. Reset. */
.long pre code,
.blog-post pre code {
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.long section {
  margin: 2em 0;
}

.long section:first-of-type {
  margin-top: 0;
}

/* ========== Table of Contents ========== */
.article__toc {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.25em 1.5em;
  margin: 1.5em 0;
}

.article__toc h3 {
  margin: 0 0 0.75em 0;
  font-size: 1em;
  color: var(--color-dark);
}

.article__toc ol {
  margin: 0;
  padding-left: 1.25em;
  columns: 2;
  column-gap: 2em;
}

.article__toc li {
  margin: 0.35em 0;
  font-size: 0.95em;
}

.article__toc a {
  color: var(--color-blue);
  text-decoration: none;
}

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

/* ========== Highlight Boxes ========== */
.article__highlight {
  background: linear-gradient(135deg, #e8f4fd 0%, #d1e8fa 100%);
  border-left: 4px solid #2a73d9;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
}

.article__highlight strong {
  color: #1a5bb5;
}

.article__tip {
  background: linear-gradient(135deg, #e8f8e8 0%, #d4f0d4 100%);
  border-left: 4px solid #28a745;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
}

.article__tip strong {
  color: #1e7e34;
}

.article__warning {
  background: linear-gradient(135deg, #fff8e6 0%, #ffecb3 100%);
  border-left: 4px solid #ffc107;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
}

.article__warning strong {
  color: #d39e00;
}

.article__example {
  background: linear-gradient(135deg, #f5f0ff 0%, #ebe0ff 100%);
  border-left: 4px solid #7c4dff;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
}

.article__example h4 {
  margin: 0 0 0.5em 0;
  color: #5e35b1;
  font-size: 1em;
}

/* ========== Tables ========== */
.article__table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95em;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.article__table thead {
  background: #f8f9fa;
}

.article__table th {
  padding: 0.85em 1em;
  text-align: left;
  font-weight: 600;
  color: var(--color-dark);
  border-bottom: 2px solid #dee2e6;
}

.article__table td {
  padding: 0.75em 1em;
  border-bottom: 1px solid #e9ecef;
  vertical-align: top;
}

.article__table tbody tr:last-child td {
  border-bottom: none;
}

.article__table tbody tr:hover {
  background: #f8f9fa;
}

.article__table_colored thead {
  background: linear-gradient(135deg, #2a73d9 0%, #1a5bb5 100%);
}

.article__table_colored th {
  color: #fff;
  border-bottom: none;
}

.article__table_colored tbody tr:nth-child(odd) {
  background: #f8fbff;
}

.article__table_colored tbody tr:nth-child(even) {
  background: #fff;
}

.article__table_colored tbody tr:hover {
  background: #e8f4fd;
}

/* ========== Article Images ========== */
.article__image {
  margin: 1.5em 0;
  text-align: center;
}

.article__image img {
  max-width: 75%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article__image figcaption {
  font-size: 0.85em;
  color: #666;
  margin-top: 0.5em;
}

/* ========== Call to Action ========== */
.article__cta {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 1.5em;
  margin-top: 2em;
  text-align: center;
}

.article__cta h2 {
  margin-top: 0;
}

.article__cta p {
  margin-bottom: 0;
}

/* ========== Terms Page ========== */
.terms-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 2em 1em;
}

.terms-page h1 {
  font-size: 1.5em;
  margin-bottom: 1em;
  color: var(--color-dark);
}

.terms-page p {
  margin: 1em 0;
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--color-text);
}

.terms-page h2 {
  font-size: 1.1em;
  margin: 1.5em 0 0.5em;
  color: var(--color-dark);
}

.terms-page a {
  color: var(--color-primary);
}

/* ========== Responsive ========== */
@media screen and (max-width: 768px) {
  .article__toc ol {
    columns: 1;
  }

  .article__table {
    font-size: 0.85em;
  }

  .article__table th,
  .article__table td {
    padding: 0.5em 0.6em;
  }

  .long section {
    overflow-x: auto;
  }
}

/* ========== Articles Index (list of articles) ========== */
.blog-index {
  width: 100%;
  margin: 0 0 3em;
  padding: 0 0 2em;
}

.blog-index__title {
  font-size: 2em;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 1em;
  text-align: left;
}

.blog-index__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1em;
}

.blog-index__item {
  display: block;
}

.blog-index__link {
  display: block;
  padding: 1.1em 1.2em;
  background: #fff;
  border: 1px solid #e6e9ed;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}

.blog-index__link:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(42, 115, 217, 0.12);
  transform: translateY(-1px);
}

.blog-index__item-title {
  font-size: 1.08em;
  font-weight: 600;
  color: var(--color-dark);
  margin: 0 0 0.5em;
  line-height: 1.35;
}

.blog-index__item-preview {
  font-size: 0.92em;
  color: #555;
  line-height: 1.5;
  margin: 0;
}

@media screen and (max-width: 555px) {
  .blog-index__title { font-size: 1.6em; }
  .blog-index__list { grid-template-columns: 1fr; }
}

.how-to__placeholder {
  background: #f5f5f5;
  border: 2px dashed #d0d0d0;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 0.9em;
  font-style: italic;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* How-to: collapse the first h1's top margin so it sits closer to the topbar */
.how-to > h1:first-child {
  margin-top: 0;
}

/* How-to: images respect the text column width, never overflow */
.how-to img,
.how-to figure {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Borderless table: for illustrating "tabular text without lines" */
.blog-post table.borderless,
.blog-post table.borderless th,
.blog-post table.borderless td {
  border: none;
  background: transparent;
}
