/*
 * Firn's default style sheet uses a modified version of:
 * MVP.css v1.6.2 - https://github.com/andybrewer/mvp
 * Change the default variables below to find a styling you like.
 */

/* Reset / Overrides */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* CSS Variables (light mode) */

:root {
  --border-radius: 4px;
  --box-shadow: 2px 2px 10px;
  --color-primary: #3498db;
  --color-primary-accent: #3498db14;
  --color-bg: #fff;
  --color-bg-secondary: #e9e9e9;
  --color-secondary: #222;
  --color-secondary-accent: #222ab;
  --color-shadow: #f4f4f4;
  --color-text: #444;
  --color-text-secondary: #999;
  --font-family: "Arial", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --hover-brightness: 1.2;
  --justify-important: center;
  --justify-normal: left;
  --line-height: 1.65;
  --width-card-wide: 800px;
  --width-content: 48rem;

  /* Currently, Firn only supports 'todo | done' keywords. */
  --keyword-active: #2ecc71; /* For "active" Todo keywords. */
  --keyword-done: #bdc3c7; /* For "done type keywords" */
  --keyword-size: xx-small;

  /* Headline priorities ([#A] [#B] etc) */
  --priority-a-bg: #c0392b;
  --priority-b-bg: #3498db;
  --priority-c-bg: #2ecc71;
  --priority-size: xx-small;

  /* Headline Tags (:my-tag: :unfinished: etc)*/
  --tag-size: x-small;
  --tag-bg: #ecf0f1;
}

/* CSS Variables (dark mode) */
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #0097fc;
    --color-primary-accent: #555;
    --color-bg: #333;
    --color-bg-secondary: #555;
    --color-shadow: #bbbbbb20;
    --color-secondary: #efefef;
    --color-secondary-accent: #efefef;
    --color-text: #f7f7f7;
    --color-text-secondary: #aaa;
    --tag-bg: #555;
  }
}

/* Layout */

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  line-height: var(--line-height);
  font-size: 15px;
  margin: 0;
  overflow-x: hidden;
}

footer,
main {
  margin: 0 auto;
}

.content {
  max-width: var(--width-content);
  margin: 0 auto;
  padding: 32px;
}

hr {
  margin: 2rem 0;
  border-top: 1px solid var(--border-col);
  border-bottom: none;
}

/* Headers */
article header,
div header,
main header {
  padding-top: 0;
}

/* Typography */
code,
samp {
  background-color: var(--color-primary-accent);
  border-radius: var(--border-radius);
  color: var(--color-text);
  display: inline-block;
  margin: 0 0.1rem;
  padding: 0 0.5rem;
  font-size: 0.85em;
}

details {
  margin: 1.3rem 0;
}

details summary {
  font-weight: bold;
  cursor: pointer;
  padding: 0px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: var(--line-height);
  margin: 1em 0;
}

mark {
  padding: 0.1rem;
}

ol,
ul {
  margin: 0.125rem 0;
  padding-left: 1.25rem;
}

ol li,
ul li {
  padding: 0.125rem 0;
}

p {
  margin: 1rem 0;
  padding: 0;
}

pre {
  margin: 1rem 0;
  padding: 1rem 0;
}

pre code,
pre samp {
  display: block;
  padding: 0.5rem 1rem;
  overflow-x: auto;
}

small {
  color: var(--color-text-secondary);
}

sup {
  background-color: var(--color-primary);
  border-radius: var(--border-radius);
  color: var(--color-bg);
  font-size: xx-small;
  margin: 0.2rem;
  padding: 0.2rem 0.3rem;
  position: relative;
  top: -2px;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
}

a:hover {
  filter: brightness(var(--hover-brightness));
  text-decoration: underline;
}

/* -- Images */

figure {
  margin: 0;
  padding: 0;
}

figure img {
  max-width: 100%;
}

figure figcaption {
  color: var(--color-text-secondary);
}

/* -- Tables */
table {
  border: 1px solid var(--color-bg-secondary);
  border-radius: var(--border-radius);
  border-spacing: 0;
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  padding: 0;
  white-space: nowrap;
}

table td,
table th,
table tr {
  padding: 0.4rem 0.8rem;
  font-size: 0.9em;
}

/* Firn currently can't discern if a table has a <th>,*/
/* so we style the first element.*/
table tr:first-child {
  background-color: var(--color-primary);
  border-collapse: collapse;
  border-radius: var(--border-radius);
  color: var(--color-bg);
  margin: 0;
  padding: 0;
}

table thead th:first-child {
  border-top-left-radius: var(--border-radius);
}

table thead th:last-child {
  border-top-right-radius: var(--border-radius);
}

table thead th:first-child,
table tr td:first-child {
  text-align: var(--justify-normal);
}

table tr:nth-child(even) {
  background-color: var(--color-primary-accent);
}

blockquote {
  display: block;
  font-size: large;
  font-style: italic;
  line-height: var(--line-height);
  padding: 1.5rem 0;
  background: var(--color-primary-accent);
}

blockquote footer {
  color: var(--color-text-secondary);
  display: block;
  font-size: small;
  line-height: var(--line-height);
  padding: 1.5rem 0;
}

/* -- Firn Org Tweaks ---- */

/* Because firn spits out nested content (for example, the parser spits out p
   tags within li tags), sometimes you may need to style the children of html
   elements to get the spacing you like.*/

li > p {
  margin: 0;
  padding: 0;
}

/* -- Firn "Components" ---- */

/* Images */
.firn-img-with-caption {
  display: flex;
  flex-direction: column;
}

.firn-img-with-caption img {
  align-self: flex-start;
}

.firn-img-caption {
  font-style: italic;
}

/* Headline Keywords and Priority */

/* This applies to ALL h1-h6 */
.firn-headline {
  display: flex;
  align-items: center; /* center align useful for aligning tags + keywords */
}

.firn-headline-section {
  margin-bottom: 32px;
}

.firn-headline-priority {
  background-color: var(--color-secondary);
  border-radius: var(--border-radius);
  color: white;
  font-size: xx-small;
  font-weight: bold;
  margin-right: 0.5rem;
  padding: 0.2rem 0.3rem;
  font-size: var(--priority-size);
}

.firn-headline-priority__A {
  background-color: var(--priority-a-bg);
}

.firn-headline-priority__B {
  background-color: var(--priority-b-bg);
  font-size: var(--priority-size);
}

.firn-headline-priority__C {
  background-color: var(--priority-c-bg);
  font-size: var(--priority-size);
}

.firn-headline-keyword__DONE {
  background-color: var(--keyword-done);
  border-radius: var(--border-radius);
  color: var(--color-bg);
  font-size: var(--keyword-size);
  font-weight: bold;
  margin-right: 0.5rem;
  padding: 0.2rem 0.3rem;
  position: relative;
}

.firn-headline-keyword__TODO {
  background-color: var(--keyword-active);
  border-radius: var(--border-radius);
  color: var(--color-bg);
  font-size: xx-small;
  font-weight: bold;
  margin-right: 0.5rem;
  padding: 0.2rem 0.3rem;
  position: relative;
}

.firn-headline-text {
  display: flex;
  flex: 1;
  align-items: center;
}

.firn-cookie {
}

/* Org Footnotes */

.firn-footnote-ref {
}

.firn-footnote-def {
}

/* Org Property Drawers */

.firn-properties {
  background-color: var(--color-bg-secondary);
}

.firn-property-key {
}

.firn-property-value {
}

/* Styling for internal and external links */

.firn-external {
    color: var(--color-primary);
}

.firn-internal {
    color: var(--color-primary);
}

/* If you choose to render :PROPERTIES: drawers, you may style them: */
.firn-properties {
  background: var(--color-bg-secondary);
  padding: 8px;
}
.firn-property-key {
}
.firn-property-value {
}

/* -- Folding ---------------------------------------------------------------- */

/* Folding leverages html <details> and <summary> tags to emulate the folding
   feature of org-mode. This is a bit hacky; we hide the regular heading (so
   that it still exists so it is anchorable, still has tags, priority etc).
*/

/* Headline text is hidden when using folding; it is instead rendered in a
   <summary> tag. */
.firn-headline-text-hidden {
  visibility: collapse;
  overflow: auto;
  flex: 1;
}

/* This moves tags, priority, other non-content text in headings up to
   approximately where the <summary> tag is. */
.firn-headline-hidden {
  margin-top: -2.6em;
  justify-content: right;
  display: flex;
}

/* If folding, we have to style the <summary> tags to make them look like headings. */

/* Set the parent element, so we can size-down on mobile. */
.firn-fold {
  font-size: 15px;
}
.firn-headline-summary-1 {
  font-size: 1.3em;
  margin: 1em 0;
}
.firn-headline-summary-2 {
  font-size: 1.15em;
  margin: 1em 0;
}
.firn-headline-summary-3 {
  font-size: 1.05em;
  margin: 1em 0;
}
.firn-headline-summary-4 {
  font-size: 1em;
  margin: 1em 0;
}
.firn-headline-summary-5 {
  font-size: 0.85em;
  margin: 1em 0;
}
.firn-headline-summary-6 {
  font-size: 0.75em;
  margin: 1em 0;
}

@media (max-width: 768px) {
  .firn-fold {
    font-size: 12px;
  }
}

/* Sitemap, breadcrumbs, siblings files, related files. ---------------------- */

.firn-sitemap {
}

.firn-sitemap-item--parent {
  list-style-type: none;
}

.firn-breadcrumbs {
}

.firn-file-navigation {
  display: flex;
  justify-content: space-between;
}

/* Tags (Firn / Org tags) ---------------------------------------------------- */

/* There are two types of tags when using Firn: "org-tags" and "firn-tags"
/* org-tags are your standard org-mode heading tags:  ":mytag:"*/
/* firn-tags are file-based tags that allows tagging entire files.*/

/* Firn tags (tags that are per file basis.) */

.firn-file-tags {
}
.firn-file-tags-container {
}
.firn-file-tag-name {
  font-size: 1.2em;
  margin: 1em 0;
  text-transform: capitalize;
}
.firn-file-tag-list {
}
.firn-file-tag-item {
}
.firn-file-tag-link {
}

/* Org tags (tags that are per heading basis.) */

/* How an org tag (ex - `:mytag:`) looks when rendered alongside an org heading. */
.firn-org-tag {
  background-color: var(--tag-bg);
  border-radius: var(--border-radius);
  color: var(--color-text);
  font-size: var(--tag-size);
  font-weight: 400;
  margin: 0 4px;
  padding: 0.2rem 0.4rem;
}

.firn-org-tag:hover {
  filter: none;
}

/* Optional: Adds a "#" before an org-tag */
.firn-org-tag::before {
  content: "#";
}

/* The following css classes style the result of rendering your org-tags list via*/
/* `(render :org-tags)` */
.firn-org-tags {
}
.firn-org-tags-container {
}
.firn-org-tag-name {
  font-size: 1.2em;
  margin: 1em 0;
  text-transform: capitalize;
}
.firn-org-tag-list {
}
.firn-org-tag-item {
}
.firn-org-tag-link {
}
