/* ==================================================================
   SELF-HOSTED FONTS
   Lato (OFL) and JuliaMono (OFL) are self-hosted so they load
   without a network round-trip and cannot be intercepted by a
   locally installed copy. EB Garamond comes from Google Fonts.

   NOTE: these URLs must stay RELATIVE (../assets/...). The site is
   deployed under the /~iojea/ subpath, so an absolute /assets/... URL
   resolves against the HOST root (mate.dm.uba.ar/assets/...) and 404s.
   A relative URL resolves against the stylesheet's own location
   (/~iojea/css/ -> /~iojea/assets/...), which is correct on both the
   subpath host and a root-served local preview.
================================================================== */

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/Lato-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "JuliaMono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/JuliaMono-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "JuliaMono";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/JuliaMono-RegularItalic.ttf") format("truetype");
}

@font-face {
  font-family: "JuliaMono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/JuliaMono-SemiBold.ttf") format("truetype");
}

/* ==================================================================
    VARIABLES
================================================================== */

:root {
  --block-background: hsl(0, 0%, 94%);
  --output-background: hsl(0, 0%, 98%);
  --small: 15px;
  --normal: 18px;
  --serif: 21px;
  --text-color: #2F2F2F;
}

/* ==================================================================
    DEFAULT FONT AND LAYOUT
================================================================== */

/* Body text: EB Garamond (Google). NOTE: do NOT put "Lato" in this
   stack — Lato is installed on some machines and would be picked
   before the generic `serif`, silently overriding the webfont. */
html {
  font-family: "EB Garamond", Georgia, serif;
  font-size: var(--serif);
  color: var(--text-color);
  background-color: #FFFDF8;
}

code, pre, kbd, samp, tt {
  font-family: "JuliaMono", ui-monospace, Menlo, monospace;
}

/* ==================================================================
    BASIC GRID FOR PROFILE PIC
================================================================== */

.franklin-content .row {
  display: block;
}

.franklin-content .right {
  float: right;
  margin-right: 15px;
}

.franklin-content .right {
  float: right;
}

.franklin-content .container img {
  width: auto;
  padding-left: 0;
  border-radius: 10px;
}

.franklin-content .footnote {
  position: relative;
  top: -0.5em;
  font-size: 70%;
}

/* ==================================================================
    FOOT / COPYRIGHT
================================================================== */

.franklin-content footer a {
  text-decoration: none;
  color: #a6a2a0;
  text-decoration: underline;
}

footer {
  font-size: 80%;
  font-family: "Lato", Arial, serif;
  color: #a6a2a0;
  text-align: center;
  margin-top: 4em;
  border-top: 1px solid lightgrey;
  padding-top: 2em;
  margin-bottom: 2em;
}

/* ==================================================================
    TEXT GEOMETRY
================================================================== */

.franklin-toc li {
  /* Avoid clickable elements being too close together. */
  margin: 0.6rem 0;
}

.franklin-content {
  position: relative;
  padding-left: 2.5%;
  padding-right: 2.5%;
  line-height: 1.3em;
}

/* On wide screens, fix content width to a max value. */
@media (min-width: 940px) {
  .franklin-content {
    width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* On narrow device, reduce margins. */
@media (max-width: 480px) {
  .franklin-content {
    padding-left: 6%;
    padding-right: 6%;
  }
}

/* ==================================================================
    TITLES
================================================================== */

.franklin-content h1,
.col_left_home h1 {
    font-size: 32px;
    text-align: center;
    color: #277DF5;
}

.franklin-content h2,
.franklin-content h3,
.franklin-content h4,
.franklin-content h5,
.franklin-content h6 {
    text-align: left;
}

/* headings use Lato (sans) while body text uses EB Garamond (serif) */
.franklin-content h1,
.franklin-content h2,
.franklin-content h3,
.franklin-content h4,
.franklin-content h5,
.franklin-content h6,
.col_left_home h1 {
    font-family: "Lato", Arial, sans-serif;
}

/* "Related papers" heading — a little smaller than a default h2 */
.franklin-content h2.related {
    font-size: 20px;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

.franklin-content h1 a,
.franklin-content h1 a:hover,
.franklin-content h2 a,
.franklin-content h3 a,
.franklin-content h4 a,
.franklin-content h5 a,
.franklin-content h6 a {
    color: #277DF5;
}

.franklin-content h1 a:hover,
.franklin-content h2 a:hover,
.franklin-content h3 a:hover,
.franklin-content h4 a:hover,
.franklin-content h5 a:hover,
.franklin-content h6 a:hover {
    text-decoration: none;
}

/* Section headings in the homepage ("Research", "Blog") — dark grey, not blue.
   Placed after the `h1..h6 a` rules above so it wins. */
.franklin-content h3,
.franklin-content h3 a,
.franklin-content h3 a:hover {
    color: #444;
}

.franklin-content h1 { padding-bottom: 0em; margin-top: 0em; margin-bottom: 0em; line-height: 1.3em; }

.franklin-content l {
    font-family: "Lato", Arial, sans-serif;
    font-weight: 300;
    margin-bottom: 0.8em;
    display: block;
}

.franklin-content p,
.franklin-content li p {
    text-align: justify;
}

.franklin-content th,
td {
  font-size: var(--small);
  padding: 10px;
  border: 1px solid black;
}

.franklin-content blockquote {
  background: var(--block-background);
  border-left: 7px solid #a8a8a8;
  margin: 1.5em 10px;
  padding: 0.5em 10px;
  font-style: italic;
}

.franklin-content blockquote p {
  display: inline;
}

/* ==================================================================
    GENERAL FORMATTING
================================================================== */

/* Spacing between bullet points. */
.franklin-content li p {
  margin: 10px 0;
}

.franklin-content p {
  margin-top: 0.2em;
  margin-bottom: 0.8em;
}

.franklin-content date {
  font-size: 10pt;
}

.franklin-content a {
  color: #277DF5;
  text-decoration: none;
}

.franklin-content a:hover {
  color: #277DF5;
}

/* ==================================================================
    CONTACT LINKS (homepage: email / scholar / github icons)
================================================================== */

.contact-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7em;
  margin-top: 1em;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  color: #277DF5;
}

.contact-links img {
  width: 22px;
  height: 22px;
  /* the SVGs use fill="currentColor", so they inherit the link colour */
}

.contact-links a:hover img {
  opacity: 0.8;
}

.contact-links .sep {
  color: #999;
  font-size: 0.9em;
}

/* ==================================================================
    HYPERREFS AND FOOTNOTES
================================================================== */

.franklin-content .eqref a { color: green; }
.franklin-content .bibref a { color: green; }

/* ==================================================================
    PAPER LIST (papers/ and homepage selected papers)
================================================================== */

.franklin-content ul.paper-list {
  list-style: none;
  padding-left: 0;
}

.franklin-content ul.paper-list > li {
  padding: 0.8em 0;
  border-bottom: 1px solid #ddd;
}

.franklin-content ul.paper-list > li:last-child {
  border-bottom: none;
}

.paper-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.paper-icon {
  flex: 0 0 40px;
  height: 40px;
  text-align: center;
  line-height: 40px;
}

.paper-icon img {
  width: 20px;
  height: 20px;
}

.paper-meta {
  flex: 1;
  min-width: 0;
}

.paper-line {
  line-height: 1.35em;
}

.paper-source {
  color: #555;
  font-size: 0.9em;
}

/* ==================================================================
    BLOG
================================================================== */

/* hero image at the top of a post */
.franklin-content p.blog-hero {
  text-align: center;
  margin-bottom: 0.5em;
}

.franklin-content p.blog-hero img {
  max-width: 100%;
  border-radius: 8px;
}

/* list on /blog/ */
.franklin-content ul.blog-list {
  list-style: none;
  padding-left: 0;
}

.franklin-content ul.blog-list > li {
  margin-bottom: 1.4em;
}

.blog-entry {
  display: flex;
  align-items: center;
  gap: 1em;
}

.blog-thumb {
  flex: 0 0 96px;
}

.blog-thumb img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.blog-meta {
  flex: 1;
  min-width: 0;
}

.blog-title {
  font-size: 1.05em;
}

.blog-meta date {
  font-size: 10pt;
  color: #555;
}

.franklin-content sup {
  font-size: 70%;
  vertical-align: super;
  line-height: 0;
}

.franklin-content table.fndef {
  margin: 0;
  margin-bottom: 10px;
}

.franklin-content .fndef tr,
td {
  padding: 0;
  border: 0;
  text-align: left;
}

.franklin-content .fndef tr {
  border-left: 2px solid lightgray;
}

.franklin-content .fndef td.fndef-backref {
  vertical-align: top;
  font-size: 70%;
  padding-left: 5px;
}

.franklin-content .fndef td.fndef-content {
  font-size: 80%;
  padding-left: 10px;
  width: 100%;
}

/* ==================================================================
    IMAGES in CONTENT
================================================================== */

.franklin-content img {
  max-width: 98%;
  max-height: 98%;
  text-align: center;
  /* padding-left: 10%; */
}

.franklin-content .img-small img {
  width: 50%;
  text-align: center;
  padding-left: 20%;
}

/* ==================================================================
    KATEX
================================================================== */

body { counter-reset: eqnum; }

.katex { font-size: 1em !important; }

.katex-display .katex {
  /* Overwrite KaTeX settings. */
  display: inline-block;

  /* Allow display equations to wrap on small screens. */
  white-space: normal;
}

.katex-display::after {
  counter-increment: eqnum;
  content: "(" counter(eqnum) ")";
  position: relative;
  float: right;
  padding-right: 5px;
}

.nonumber .katex-display::after {
  counter-increment: nothing;
  content: "";
}

/* ==================================================================
    CODE & HIGHLIGHT.JS
================================================================== */

code {
  background-color: var(--block-background);
  padding: 0.1em 0.2em;
  border-radius: 2px;
  font-size: var(--small);
}

/* .franklin-content code { */

/* background-color: rgba(27,31,35,0.05); */

/* padding: 0.1em 0.2em; */

/* border-radius: 2px; */

/* font-size: 90%; } */

.hljs {
  font-size: var(--small);
  line-height: 1.3em;
  border-radius: 10px;
}

.hljs-meta { font-weight: bold;}

.hljs-meta.shell_ {color: crimson;}
.hljs-meta.prompt_ {color: rgb(25, 179, 51);}

.code-output {
  background: var(--output-background);
  border: 1px dashed #dbdbdb;
}

/* ==================================================================
    BOXES
================================================================== */

.franklin-content .colbox-blue {
  background-color: #eef3f5;
  padding-top: 5px;
  padding-right: 10px;
  padding-left: 10px;
  padding-bottom: 5px;
  margin-left: 5px;
  margin-top: 5px;
  margin-bottom: 5px;
  border-radius: 0 10px 10px 0;
  border-left: 5px solid #4c9cf1;
}
