@import url('https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,200..900;1,7..72,200..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Mono:ital,wght@0,300..700;1,300..700&display=swap');

body {
  background-color: var(--bg-color) !important;
}

body, main {
  height: 100%;
  font-family: 'Literata', serif !important;
  font-optical-sizing: auto;
  font-style: normal;
  font-size: 1rem;
  font-weight: normal;
  color: var(--font-color) !important;
}

::selection {
  background: var(--secondary);
  color: var(--selection-color);
}

.splash-screen {
  height: 100%;
}

nav a, a {
  text-decoration: none !important;
}

nav a:hover, a:hover, .list-post-title a:hover {
  text-decoration: underline !important;
}

.list-post-title a {
  text-decoration: none !important;
}

a {
  color: var(--primary-variant) !important;
  text-decoration: underline !important;
  text-underline-offset: 0.375em !important;
}

a:hover {
  color: var(--primary) !important;
}

@media (min-width: 1200px) {
  .container {
    max-width: 720px !important;
  }
}

table:not(.gist-data *) {
  border-collapse: collapse;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 1200px) {
  table:not(.gist-data *) {
    width: 100%;
  }
}

th:not(.gist-data *),
td:not(.gist-data *) {
  padding: .5rem;
  text-align: left;
}

th:not(.gist-data *) {
  font-weight: bold;
  background-color: var(--bg-variant);
}

td:not(.gist-data *) {
  border-bottom: 2px solid var(--bg-variant) !important;
}

ul > li:has(input[type=checkbox]) {
  list-style-type: none;
}

code {
  font-family: 'Red Hat Mono', serif !important;
}

code:not(.highlight *) {
  color: var(--secondary);
  font-weight: 600;
  user-select: all;
  padding-left: .3em;
  padding-right: .3em;
}

.highlight > div {
  padding: 0 1em;
}

.highlight > pre  {
  padding: 1em;
}

mark {
  background-color: var(--primary-variant) !important;
}

kbd {
  background-color: var(--bg-variant) !important;
  font-family: 'Red Hat Mono', monospace !important;
  font-weight: bold;
}

.post article h1,
.post article h2,
.post article h3,
.post article h4,
.post article h5,
.post article h6 {
  font-size: 1.2rem;
  margin: 24px 0 10px 0;
  font-weight: bold;
}

.post article h1::before {
  content: "# ";
  color: var(--secondary);
}

.post article h2::before {
  content: "## ";
  color: var(--secondary);
}

.post article h3::before {
  content: "### ";
  color: var(--secondary);
}

.post article h4::before {
  content: "#### ";
  color: var(--secondary);
}

.post article h5::before {
  content: "###### ";
  color: var(--secondary);
}

.post article h6::before {
  content: "###### ";
  color: var(--secondary);
}

.post article a:not(.footnote-backref)::after, footer a::after {
  content: " ↗"
}

.post article a:has(img)::after {
  content: none !important;
}

.post .draft-label {
  font-weight: bold;
  color: var(--primary);
}

.breadcrumb-item+.breadcrumb-item::before {
  color: #6c757d !important;
}

.tags a {
  text-decoration: none !important;
}

.tags a:hover {
  background-color: var(--primary) !important;
  color: var(--selection-color) !important;
  text-decoration: none !important;
}

.underline {
	background-image: linear-gradient(to right, var(--secondary), var(--secondary));
	background-position: bottom left;
	background-repeat: no-repeat;
	background-size: 100% 2px;
	text-decoration: none !important;
}

img {
  max-width: 100%;
}

figure {
  box-sizing: border-box;
  display: inline-block;
  max-width: 100%;
  width: 100%;
  text-align: center;
}

figure img {
  max-height: 500px;
  max-width: 100%;
  margin: 0 auto 0 auto;
}

figure h4 {
  margin-bottom: 1em;
  font-size: 0.85rem !important;
  font-weight: lighter !important;
  position: relative;
  overflow: hidden;
  opacity: 0.9;
}

figure h4::before {
  content: '' !important;
}

/* Cool blockquote style from catalinred */
blockquote {
  padding-left: 3rem !important;
  position: relative;
  overflow: hidden;

  &::before,
  &::after{
    position: absolute;
    color: #777;
  }

  &::before {
    content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%23777777'><path d='M9.983 3v7.391C9.983 16.095 6.252 19.961 1 21l-.995-2.151C2.437 17.932 4 15.211 4 13H0V3h9.983zM24 3v7.391c0 5.704-3.748 9.571-9 10.609l-.996-2.151C16.437 17.932 18 15.211 18 13h-3.983V3H24z'/></svg>");
    left: 15px;
  }

  &::after {
    content: "";
    left: 20px;
    top: 25px;
    width: 1px;
    height: 100%;
    background-color: currentColor;
  }

  p {
    margin: 0;
  }
  
  p + p {
    margin-top: 1rem;
  }
}

.twitter-tweet, .instagram-media {
  margin-right: auto !important;
  margin-left: auto !important;
}

.post-summary {
  margin: 0;
}

ul:has(input[type=checkbox]) {
  margin-left: 0 !important;
  padding-left: 0.5rem !important;
}

li > input[type=checkbox] {
  margin-right: 0.2rem;
}

.toc-title {
  font-size: smaller;
}

.toc {
  font-family: 'Red Hat Mono', serif !important;
}

/* Viewport ≥ 768px: container = 720px */
@media (min-width: 768px) {
  .toc {
    display: block !important;
    position: fixed !important;
    right: calc(50% - 360px - 20px); /* 720px / 2 */
    margin-right: 1.5rem;
    opacity: 2;
    /* Opacity Transition */
    -webkit-transition: opacity 1s ease-in-out;
    -moz-transition: opacity 1s ease-in-out;
    -ms-transition: opacity 1s ease-in-out;
    -o-transition: opacity 1s ease-in-out;
    transition: opacity 1s ease-in-out;
    /* Margin Transition */
    -webkit-transition: margin 1s ease-in-out;
    -moz-transition: margin 1s ease-in-out;
    -ms-transition: margin 1s ease-in-out;
    -o-transition: margin 1s ease-in-out;
    transition: margin 1s ease-in-out;

    &:hover {
      margin-right: 2.3rem;
      opacity: 2;
    }
  }
}

@media (max-width: 767px) {
  .breadcrumb {
    flex-direction: column !important;
    --bs-breadcrumb-item-padding-x: 0rem !important;
  }

  .breadcrumb-item::before {
    display: none !important;
    
  }
}

/* Viewport ≥ 992px: container = 960px */
@media (min-width: 992px) {
  .toc {
    right: calc(50% - 480px - 20px); /* 960px / 2 */
  }
}

/* Viewport ≥ 1200px: container = 1140px */
@media (min-width: 1200px) {
  .toc {
    right: calc(50% - 570px - 20px); /* 1140px / 2 */
  }
}

/* Viewport ≥ 1400px: container = 1320px */
@media (min-width: 1400px) {
  .toc {
    right: calc(50% - 660px - 20px); /* 1320px / 2 */
  }
}

#TableOfContents > ul {
  list-style-type: '//  ';
}

.badge {
  font-family: 'Red Hat Mono', serif !important;
  font-weight: 600 !important;
}

hr {
  border: 0 !important;
  height: 10px;
  color: var(--secondary) !important;
  background-image: linear-gradient(-45deg,
    transparent,
    transparent 25%,
    currentColor 25%,
    currentColor 50%,
    transparent 50%,
    transparent 75%,
    currentColor 75%);
  background-size: 4px 4px;
}

.terms-char {
  &::before {
    content: '― ';
  }
}

.giscus {
  padding-top: 1.5rem;
}

table td {
    vertical-align: top !important;
}

.portfolio-thumb img {
    width: 100rem; /* Desired width */
    object-fit: cover; /* This is the "Crop" magic */
   
}


/* Remove the light grey background from table headers */
table th {
    background-color: transparent !important;
    background: none !important;
    border: none !important; /* Optional: clears out any header lines if they appear */
}

a.project-card-link {
    text-decoration: none !important;
}
a.project-card-link .list-post-title {
    text-decoration: none !important;
}

a.project-card-link:hover .list-post-title {
    text-decoration: underline !important;
}

a.project-card-link .portfolio-thumb img {
    transition: opacity 0.25s ease-in-out !important;
    opacity: 1;
}

a.project-card-link:hover .portfolio-thumb img {
    opacity: 0.5 !important;
}

h1, h2, h3, h4, h5, h6 {
    scroll-margin-top: 5rem !important;
}

.content h3, article h3, h3 {
    font-size: 1.5rem !important; 

}

::selection {
    background-color: #e5e5e5 !important; /* Elegant light grey block for light mode */
    color: #141414 !important;            /* Keeps the text sharp and dark grey/black */
}

/* Firefox specific support override */
::-moz-selection {
    background-color: #e5e5e5 !important;
    color: #141414 !important;
}

/* Target ALL tables directly on the site, bypassing class wrappers */
table td,
table th {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    line-height: 0.8rem !important;
}

table tr {
    margin: 0 !important;
    padding: 0 !important;
}



/* Mobile Spacing Override for Bootstrap Utilities */
@media (max-width: 768px) {
  /* 1. Reduce the main container's top padding */
  main .container.pt-5,
  main .container {
    padding-top: 4rem !important;
	
  }

  /* 2. Flatten the compounded row margin and padding */
  main .row.mt-5,
  main .row.pt-5,
  main .row {
    margin-top: 2rem !important;
    padding-top: 0.5rem !important;
	
  }
}

/* Corrected Media & Embed Responsive Overrides */

/* 1. Standard Images and Native Elements */
img, 
figure, 
video, 
embed, 
object, 
.portfolio-thumb,
.portfolio-thumb img {
  max-width: 100% !important;
  height: auto !important;
  box-sizing: border-box !important;
}

/* 2. Vimeo & YouTube IFrames (Forces 100% width with cinematic 16:9 ratio) */
iframe {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  border: 0 !important;
}

/* 3. Hugo Vimeo Shortcode Wrappers */
div:has(> iframe),
.vimeo-player {
  width: 100% !important;
  max-width: 100% !important;
}

/* 4. Scroll Protection & Table Handling */
html, body {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  div[style*="display: flex"] {
    flex-wrap: wrap !important;
    gap: 1.5rem !important;
  }
}