/* ==========================================================================
   Hugo "blog awesome" theme — Quarto port
   --------------------------------------------------------------------------
   Built on Quarto's native navbar, light/dark theme toggle and back-to-top,
   so this file only restyles the generated markup.

   Contents
     1. Design tokens
     2. Base
     3. Typography & content
     4. Layout
     5. Navbar
     6. Title block
     7. Table of contents
     8. Author & post listings
     9. Footer
    10. Back to top
    11. Responsive (max-width: 768px)
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */
:root {
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #fbf8f1;
  --text-base: #3b3a36;
  --heading: #1f1e1b;
  --border: #e6dfd1;
  --smoke: #cbc2b0;
  --gray: #6f6b60;

  --link: #1d4ed8;
  --link-active: #163fb0;
  --focus-ring: rgba(29, 78, 216, 0.5);

  --blockquote-border: #d8cfba;
  --blockquote-text: #57534a;

  --inline-code-text: #2b2b2b;
  --inline-code-bg: #ece4d4;

  --toc-bg: #f2ecdf;
  --go-top-bg: #e6dfd1aa;
  --go-top-bg-hover: #ddd4c1;

  --footer-copyright-opacity: 0.85;
}

body.quarto-dark {
  --bg: #1c1e22;
  --text-base: #d6d8dc;
  --heading: #f0f0f0;
  --border: #2c2f36;
  --smoke: #454a53;
  --gray: #9aa0a6;

  --link: #82aaff;
  --link-active: #a9c2ff;
  --focus-ring: rgba(130, 170, 255, 0.5);

  --blockquote-border: #3a3f47;
  --blockquote-text: #a6acb4;

  --inline-code-text: #d6d8dc;
  --inline-code-bg: #26282d;

  --toc-bg: #23262c;
  --go-top-bg: #2f333aaa;
  --go-top-bg-hover: #3a3f47;

  --footer-copyright-opacity: 1;
}

/* 2. Base ---------------------------------------------------------------- */
* {
  transition: background-color 75ms ease-in, border-color 75ms ease-in;
}

html {
  overflow-x: hidden;
  width: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--text-base);
  background-color: var(--bg);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
}

/* The header scrolls with the page instead of being pinned. Quarto writes
   inline padding/min-height values for its fixed navbar + sticky footer, so
   these need !important to keep our flex-based footer sticky. */
body.nav-fixed { padding-top: 0 !important; }
#quarto-header.fixed-top {
  position: static;
  transform: none;
}

/* 3. Typography & content ------------------------------------------------ */
:is(h1, h2, h3, h4, h5, h6) {
  color: var(--link);
}

strong, b {
  font-weight: 700;
  color: var(--heading);
}

:is(pre, code, kbd, samp, .sourceCode) {
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration-color: var(--smoke);
}

a:hover { color: var(--link); }

a:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

hr {
  border-bottom: 0;
  border-style: solid;
  border-color: var(--border);
  opacity: 1;
}

img {
  max-width: 100%;
  vertical-align: middle;
}

figure > img { display: block; }
figcaption { font-size: 13px; text-align: center; }

ul, ol { margin-left: 30px; }
li > :is(ul, ol) { margin-top: 0; margin-bottom: 2px; }

blockquote {
  color: var(--blockquote-text);
  opacity: 0.9;
  border-left: 5px solid var(--blockquote-border);
  padding: 0 0 0 1rem;
  margin-left: .3rem;
  margin-right: .3rem;
  font-size: 1em;
}

/* Outrank the Bootstrap/Quarto secondary colour on quoted text. */
#quarto-document-content blockquote { color: var(--blockquote-text); }

u { text-decoration-color: var(--smoke); }
small { font-size: 14px; }

sup, sub {
  font-size: 79%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }

kbd {
  font-size: 85%;
  border-radius: 3px;
  color: var(--inline-code-text);
  background: var(--inline-code-bg);
  display: inline-block;
  font-family: Consolas, monaco, monospace;
  line-height: 1;
  padding: 2px 4px;
  white-space: nowrap;
}

mark, ::selection { background: #fff0a8; color: var(--heading); }
mark { border-radius: 3px; }

body.quarto-dark mark,
body.quarto-dark ::selection { background: #2f4a7a; color: #f0f0f0; }

table {
  width: 100%;
  margin-top: 15px;
  border-collapse: collapse;
  font-size: 14px;
}

table thead {
  font-weight: 700;
  color: var(--heading);
  border-bottom: 1px solid var(--border);
}

table :is(th, td) {
  border: 1px solid var(--border);
  padding: 2px 7px;
}

:is(p, li) > code {
  white-space: pre-wrap;
  font-size: 0.9em;
  padding: 1px 3px;
  color: var(--inline-code-text);
  background-color: var(--inline-code-bg);
  border-radius: 2px;
  border: 1px solid rgba(128, 128, 128, 0.1);
}

/* Outrank Quarto's default `--bs-code-bg` on inline code. */
#quarto-document-content :is(p, li) > code {
  color: var(--inline-code-text);
  background-color: var(--inline-code-bg);
}

#quarto-document-content a {
  color: var(--link);
  text-decoration: none;
}

#quarto-document-content a:hover {
  color: var(--link-active);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

#quarto-document-content div.sourceCode {
  background-color: var(--inline-code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

#quarto-document-content > p {
  margin: 0;
  padding: 15px 0;
}

#quarto-document-content :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 30px;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
  letter-spacing: .03rem;
}

#quarto-document-content h1 { font-size: 24px; }
#quarto-document-content h2 { font-size: 22px; }
#quarto-document-content h3,
#quarto-document-content h4 { font-size: 20px; }
#quarto-document-content h5 { font-size: 16px; }
#quarto-document-content h6 { font-size: 14px; }

#quarto-document-content figcaption {
  margin-top: 5px;
  font-style: italic;
}

/* 4. Layout -------------------------------------------------------------- */
#quarto-content {
  flex: 1 0 auto;
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 30px;
  min-height: 0 !important;
}

#quarto-margin-sidebar { display: none; }

main.content,
#quarto-document-content {
  max-width: none;
  padding: 0;
}

/* 5. Navbar -------------------------------------------------------------- */
.navbar {
  max-width: calc(890px - 60px);
  margin: 0 auto;
  padding: .5rem .3rem;
  background-color: transparent;
  border-bottom: 1px solid var(--border);
}

.navbar-container { padding: 0; }

.navbar-brand { padding: 0; }
.navbar-logo { height: 25px; width: 25px; }
.navbar-title { display: none; }

body.quarto-dark .navbar-logo { filter: invert(1); }

.navbar-nav { align-items: center; }

.navbar-nav .nav-link {
  color: var(--heading);
  padding: .3rem .5rem;
  opacity: 0.7;
  letter-spacing: 0.015rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--heading);
  opacity: 1;
}

.navbar-nav .nav-link.active { font-weight: 600; }

.quarto-color-scheme-toggle {
  color: var(--heading);
  opacity: 0.7;
}

.quarto-color-scheme-toggle:hover { opacity: 1; }

.navbar-toggler { border: 0; padding: .25rem .5rem; }

/* 6. Title block --------------------------------------------------------- */
#title-block-header { margin-top: 7.8em; }

#title-block-header .title {
  font-size: 2em;
  line-height: 1.2;
  margin: 10px 0 20px;
  color: var(--link);
  font-weight: 700;
}

.list-page #title-block-header .title { text-align: center; }

/* These need to outrank Quarto's `#title-block-header.quarto-title-block.default` rules. */
#quarto-document-content #title-block-header .quarto-title-meta {
  display: flex;
  gap: 1.5em;
  padding-top: 3px;
  line-height: 1.3;
  color: var(--gray);
}

#quarto-document-content #title-block-header .quarto-title-meta-heading { display: none; }

#quarto-document-content #title-block-header .quarto-title-meta-contents p { margin: 0; }

/* The theme's post header is just title + date/author. */
#quarto-document-content #title-block-header .quarto-categories,
#quarto-document-content #title-block-header .description { display: none; }

/* Pages that provide their own header (e.g. the home bio). */
.home #title-block-header { display: none; }

/* 7. Table of contents --------------------------------------------------- */
#TOC {
  margin: 1.1rem 0 1rem;
  padding: .5rem 1rem;
  border-radius: .3rem;
  background-color: var(--toc-bg);
  width: auto;
}

#TOC #toc-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
}

#TOC ul {
  padding-top: 1rem;
  padding-left: 1rem;
  margin-left: 1rem;
}

#TOC li {
  margin-bottom: 0.5em;
  line-height: 1.4;
}

#TOC a {
  color: var(--text-base);
  text-decoration: none;
}

#TOC a:hover { color: var(--link); }

/* 8. Author & post listings ---------------------------------------------- */
.author {
  margin: 3.5rem 0;
  text-align: center;
}

.author .author-name {
  font-size: 1.7em;
  margin-bottom: 2px;
}

.author .author-bio {
  margin: 0 auto;
  opacity: 0.9;
  max-width: 393px;
  line-height: 1.688;
}

.posts-item-note {
  padding-bottom: .3rem;
  font-size: 1.17em;
  font-weight: 500;
  color: var(--link);
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0 6px;
}

.post-item + .post-item { border-top: 1px solid var(--border); }

.post-item .post-item-date {
  min-width: 96px;
  color: var(--heading);
  text-align: right;
  white-space: nowrap;
}

.post-item .post-item-title {
  margin: 0;
  border: 0;
  padding: 0;
  font-size: 16px;
  font-weight: normal;
  letter-spacing: 0.1px;
}

#quarto-document-content .post-item .post-item-title a {
  color: var(--text-base);
  transition: color 150ms ease-in;
}

#quarto-document-content .post-item .post-item-title a:hover { color: var(--heading); }

.post-year { padding-bottom: .5rem; }

/* 9. Footer -------------------------------------------------------------- */
.footer {
  flex: none;
  width: 100%;
  max-width: 720px;
  margin: 5em auto 0;
  padding: 0 30px;
  text-align: center;
  background-color: transparent;
  border-top: 0;
}

.footer .nav-footer {
  padding: 0;
  background-color: transparent;
}

.footer-social-icons .footer-icon {
  color: var(--gray);
  font-size: 24px;
  margin-right: .31rem;
  text-decoration: none;
  transition: color 150ms ease-in;
}

.footer-social-icons .footer-icon:hover { color: var(--heading); }

.footer-copyright {
  display: block;
  font-size: 13px;
  color: var(--gray);
  opacity: var(--footer-copyright-opacity);
  margin-top: .7rem;
  padding: .3rem .95rem;
}

/* 10. Back to top -------------------------------------------------------- */
#quarto-back-to-top {
  left: auto;
  right: 30px;
  bottom: 60px;
  transform: none;
  padding: .2rem .35rem;
  font-size: 0;
  border-radius: 10%;
  background-color: var(--go-top-bg);
  color: var(--text-base);
  box-shadow: none;
}

#quarto-back-to-top i { font-size: 24px; }

#quarto-back-to-top:hover { background-color: var(--go-top-bg-hover); }

/* 11. Responsive --------------------------------------------------------- */
@media screen and (max-width: 768px) {
  #quarto-content {
    padding-right: 20px;
    padding-left: 20px;
  }

  body.post #quarto-content {
    padding-right: 15px;
    padding-left: 15px;
  }

  .navbar { padding: .5rem .3rem; }

  .navbar-collapse { background-color: var(--bg); }

  .navbar-nav .nav-link {
    display: block;
    padding: 2px 0;
    font-size: 1.1em;
  }

  #title-block-header .title { font-size: 1.9em; }

  .author { margin-bottom: 3em; }

  .post-item .post-item-title { max-width: 12rem; }
  .post-item .post-item-date {
    font-size: 14px;
    white-space: nowrap;
  }

  .footer {
    margin-top: 3em;
    padding-right: 20px;
    padding-left: 20px;
  }
}

/* 12. Top announcement banner -------------------------------------------- */
/* Lets the banner's own markup define the look (Quarto wraps it in an
   alert, which adds padding, colour and a shrink-wrapped container). */
#quarto-announcement {
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
}

#quarto-announcement .quarto-announcement-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

#quarto-announcement .quarto-announcement-content p {
  width: 100%;
  margin: 0;
}

/* 13. Projects listing --------------------------------------------------- */
/* Show Quarto's native category filter above the grid (the margin sidebar is
   hidden site-wide, so surface it here as an inline tag list). */
body.projects #quarto-margin-sidebar {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 1.5rem;
  padding: 0 30px;
}

body.projects .quarto-listing-category-title {
  margin: 0 0 .6rem;
  font-size: 1rem;
}

body.projects .quarto-listing-category {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

body.projects .quarto-listing-category .category {
  cursor: pointer;
  font-size: 13px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--gray);
}

body.projects .quarto-listing-category .category:hover,
body.projects .quarto-listing-category .category.active {
  color: var(--link);
  border-color: var(--link);
}

body.projects .quarto-listing-category-title { color: var(--heading); }
body.projects #title-block-header { margin-top: 1.5em; }

/* Cards */
body.projects .listing-actions-group {
  justify-content: flex-end;
  gap: .5rem;
  margin-bottom: 1rem;
}

body.projects .quarto-grid-item.card {
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
}

body.projects .quarto-grid-link { text-decoration: none; }

body.projects .quarto-grid-item .listing-title {
  margin-bottom: .35rem;
  color: var(--heading);
}

body.projects .quarto-grid-link:hover .listing-title { color: var(--link); }

body.projects .quarto-grid-item .listing-description { opacity: 0.9; }

body.projects .quarto-grid-item .listing-date {
  color: var(--gray);
  font-size: 13px;
}

body.projects .quarto-grid-item .listing-categories {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .6rem;
}

body.projects .quarto-grid-item .listing-category {
  cursor: pointer;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  background-color: var(--inline-code-bg);
  color: var(--gray);
}

body.projects .quarto-grid-item .listing-category:hover { color: var(--link); }
