/* SPDX-License-Identifier: LicenseRef-Proprietary */
/* Copyright (C) 2024-2026 Tonic */

/* Builds on ocul.css: its tokens (.oc) and fonts. */
/* Journal: the overview and the article. One column of about 680 px, large type */
.oc-read { max-width: 728px; margin-inline: auto; padding-inline: 24px; }
.oc-journal, .oc-article { padding-block: 64px 96px; }
.oc-journal h1, .oc-article h1 { font-size: clamp(34px, 4.2vw, 52px); line-height: 1.1; }
.oc-article-lead { font-family: var(--serif); font-size: 22px; line-height: 1.45; color: var(--body); margin-top: 18px !important; }
.oc-back { display: inline-block; font-size: 15px; color: var(--muted) !important; margin-bottom: 28px; }
.oc-back:hover { color: var(--ink) !important; }
.oc-byline, .oc-journal-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; color: var(--muted); }
.oc-byline { margin-top: 28px !important; padding-top: 18px; border-top: 1px solid var(--line); }
.oc-byline span:first-child { color: var(--ink); font-weight: 500; }
.oc-cover { max-width: 1040px; margin: 44px auto 0; padding-inline: 24px; }
.oc-cover img { display: block; width: 100%; height: auto; border-radius: 8px; }

.oc-article-body { margin-top: 44px; font-size: 19px; line-height: 1.75; color: var(--ink); }
/* Quill keeps line breaks of the stored HTML (pre-wrap); in reading they are no blank lines */
.oc-article-body .ql-editor { padding: 0; height: auto; overflow: visible; white-space: normal; font-family: inherit; color: inherit; line-height: inherit; }
.oc-article-body p { margin: 0 0 1.15em !important; }
.oc-article-body h2, .oc-article-body .ql-editor h2 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.2; margin: 1.7em 0 .55em; }
.oc-article-body h3, .oc-article-body .ql-editor h3 { font-size: 23px; margin: 1.5em 0 .5em; }
.oc-article-body a { color: var(--accent-dark) !important; text-decoration: underline; text-underline-offset: 3px; }
.oc-article-body img { max-width: 100%; height: auto; border-radius: 6px; margin-block: .6em; }
.oc-article-body blockquote { margin: 1.4em 0; padding-left: 20px; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 23px; line-height: 1.45; color: var(--ink); }
.oc-article-body ol, .oc-article-body ul { margin: 0 0 1.15em; }
.oc-article-body li { margin-bottom: .35em; }
.oc-article-body ul > li:not([data-list]) { list-style-type: disc; padding-left: .3em; }
.oc-article-body ol > li:not([data-list]) { list-style-type: decimal; padding-left: .3em; }
.oc-article-body ul, .oc-article-body ol { padding-left: 1.4em; }

.oc-article-next { margin-top: 64px; padding-top: 36px; border-top: 2px solid var(--ink); }
.oc-article-next h2 { font-size: 30px; }
.oc-article-next p { color: var(--body); margin-top: 12px !important; }
.oc-article-next .oc-cta-row { margin-top: 24px; }

.oc-journal-list { list-style: none; max-width: 920px; margin: 52px auto 0; padding: 0 24px; display: grid; gap: 0; }
.oc-journal-list a { display: grid; grid-template-columns: 1fr 240px; gap: 36px; align-items: start; padding-block: 32px; border-top: 1px solid var(--line); color: inherit !important; }
.oc-journal-list a > div:only-child { grid-column: 1 / -1; }
.oc-journal-list h2 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2; max-width: none; transition: color .15s; }
.oc-journal-list a:hover h2 { color: var(--accent-dark); }
.oc-journal-list p { color: var(--body); margin-top: 10px !important; }
.oc-journal-list .oc-journal-meta { margin-top: 14px !important; color: var(--muted); }
.oc-journal-list img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }

@media (max-width: 620px) {
  .oc-read, .oc-cover, .oc-journal-list { padding-inline: 18px; }
  .oc-journal, .oc-article { padding-block: 40px 72px; }
  .oc-article-lead { font-size: 19px; }
  .oc-article-body { font-size: 18px; }
  .oc-journal-list a { grid-template-columns: 1fr; gap: 18px; }
  .oc-journal-list img { order: -1; }
}

/* The path above an article or a topic: Journal › area › topic */
.oc-trail ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; padding: 0; margin: 0 0 28px; font-size: 15px; color: var(--muted); }
.oc-trail li + li::before { content: "›"; margin: 0 10px; color: var(--muted); }
.oc-trail a { color: var(--muted) !important; }
.oc-trail a:hover { color: var(--ink) !important; }
.oc-byline a { color: var(--ink) !important; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* The topics, on the overview and on a topic's page */
.oc-topic-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 26px 0 0; }
.oc-topic-list a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; color: var(--ink) !important; }
.oc-topic-list a:hover { border-color: var(--ink); }
.oc-muted { color: var(--muted); }

/* The table of contents, from three headings on */
.oc-contents { margin-top: 40px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 8px; }
.oc-contents h2 { font-size: 17px; margin: 0 0 8px; }
.oc-contents ol { margin: 0; padding-left: 1.3em; font-size: 17px; }
.oc-contents li { list-style-type: decimal; margin-bottom: 4px; }
.oc-contents a { color: var(--accent-dark) !important; }
.oc-article-body h2[id] { scroll-margin-top: 24px; }

/* The video card: Ocul's own preview; YouTube loads only after the reader agrees */
.oc-video { margin-top: 40px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.oc-video-preview { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.oc-video-body { padding: 18px 22px 22px; }
.oc-video-title { font-weight: 600; color: var(--ink); }
.oc-video-ask p { margin-top: 10px !important; color: var(--body); font-size: 16px; }
.oc-video .oc-cta-row { margin-top: 16px; }
.oc-video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* Pictures with caption and source, tables with a source line */
.oc-article-body figure { margin: 1.6em 0; }
.oc-article-body figure img { display: block; width: 100%; margin: 0; }
.oc-article-body figcaption { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.oc-article-body figcaption .oc-picture-source { display: block; font-size: 13px; }
.oc-article-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0 .4em; font-size: 16px; line-height: 1.45; }
.oc-article-body th, .oc-article-body td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.oc-article-body th { border-bottom: 2px solid var(--ink); font-weight: 600; }
.oc-article-body th p, .oc-article-body td p { margin: 0 !important; }
.oc-article-body .oc-table-wrap { overflow-x: auto; }

/* More on this topic */
.oc-related { margin-top: 48px; }
.oc-related h2 { font-size: 24px; }
.oc-related ul { list-style: none; padding: 0; margin: 16px 0 0; }
.oc-related li { padding: 14px 0; border-top: 1px solid var(--line); }
.oc-related a { font-weight: 600; color: var(--ink) !important; }
.oc-related span { display: block; margin-top: 4px; color: var(--body); font-size: 16px; }

/* The download under the text */
.oc-article-pdf { margin-top: 28px !important; font-size: 16px; }
.oc-article-pdf a { color: var(--accent-dark) !important; text-decoration: underline; text-underline-offset: 3px; }
.oc-print-only { display: none; }

/* Printed, an article is one A4 page to pass on: no header, footer or buttons, smaller type, and
   every link inside the text names its address. */
@media print {
  @page { size: A4; margin: 16mm 18mm; }
  /* Bootstrap's print styles give the body a minimum width of 992 px; Chrome then shrinks the
     whole page onto A4 and the type comes out half its size. */
  body { background: #fff !important; min-width: 0 !important; }
  .oc-top, .oc-foot, .oc-back, .oc-article-next, .oc-article-pdf, .oc-trail, .oc-video, .oc-related { display: none !important; }
  .oc-article { padding: 0 !important; }
  .oc-read, .oc-cover { max-width: none; padding-inline: 0; }
  .oc-article h1 { font-size: 24pt; }
  .oc-article-lead { font-size: 12.5pt; margin-top: 8pt !important; }
  .oc-byline { font-size: 9pt; margin-top: 10pt !important; padding-top: 6pt; }
  .oc-cover { margin-top: 12pt; }
  .oc-cover img { max-height: 70mm; object-fit: cover; }
  .oc-article-body { font-size: 10.5pt; line-height: 1.5; margin-top: 12pt; }
  .oc-article-body h2, .oc-article-body .ql-editor h2 { font-size: 13.5pt; margin: 12pt 0 4pt; break-after: avoid; }
  .oc-article-body p { margin-bottom: 6pt !important; }
  .oc-article-body li { margin-bottom: 2pt; }
  .oc-article-body a { color: inherit !important; }
  .oc-article-body a[href^="/"]::after { content: " (" var(--print-host, "") attr(href) ")"; }
  .oc-print-only { display: block; margin-top: 14pt !important; padding-top: 6pt; border-top: 1px solid #ccc; font-size: 9pt; color: #555; }
}
