/* LAYOUT */

:root {
  --highlight-color: #D2DBE3;
  --main-background-color: #f8f8f8;
  --main-content-text: #848e97;
  --nav-selected: #3D464F;
  --nav-unselected: #9CABB8;
  --post-background-color: #f4f4f4;
  --post-content-text: #848e97;
  --post-title-text: #3D464F;
  --badge-background: #dfe2e5;
  --badge-text: #2d363d;
}

html {
  overflow-y: scroll;
}

body {
  background: var(--main-background-color);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 680px;
  padding: 1rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.content {
  color: var(--main-content-text);
  font-size: 0.90rem;
}

/* Theme transition */
body, .content, a, h1, h2, h3, h4, h5, h6,
.post-title, .post-snippet, .work-entry,
.intro h2, .about-bio, .about-section {
  transition: color 0.3s ease, background-color 0.3s ease;
}

/* INTRO */

.intro {
  margin-bottom: 3rem;
}

.intro h2 {
  color: var(--post-title-text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.intro-links {
  display: flex;
  gap: 1rem;
}

.intro-links a {
  color: var(--nav-unselected);
  font-size: 0.85rem;
}

.intro-links a:hover {
  color: var(--nav-selected);
}

/* NAVIGATION */

.site-nav {
  display: flex;
  justify-content: space-between;
  padding-bottom: 3rem;
}

.site-nav a {
  display: block;
  font-size: 0.85rem;
  letter-spacing: .02rem;
  padding: 0.8rem;
}

.site-nav .logo {
  padding-left: 0;
}

.site-nav a:visited,
.site-nav a:link,
.site-nav a:hover,
.site-nav a:active {
  color: var(--nav-unselected);
  text-decoration: none;
}

.site-nav a:active {
  color: var(--nav-selected);
}

.site-nav a:hover {
  color: var(--nav-selected);
}

.activeLink {
  color: var(--nav-selected) !important;
}

.main-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media screen and (max-width: 680px) {
  .site-nav,
  .main-menu {
    flex-direction: row;
  }

  .site-nav a {
    padding: 0.8rem;
  }
}

/* LISTS WORK */

.work-snippet {
  border-radius: 0.4em;
  color: var(--post-content-text);
  font-size: 0.9rem;
  line-height: 1.3;
  margin-left: -1em;
  padding: 1em;
  padding-bottom: 3em;
}

.work-title {
  color: var(--post-title-text);
  display: inline;
  font-size: 0.9rem;
  font-weight: 500;
  padding-right: 0.5rem;
}

.work-snippet span:not(.badge) {
  color: var(--nav-unselected);
  font-size: 0.80rem;
}

.work-summary {
  line-height: 1.6;
}

.work-summary p { 
  margin-top: 0.3rem
}

.work-image img { 
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
}

/* LISTS OSS */

.oss-snippet {
  border-radius: 0.4em;
  color: var(--post-content-text);
  font-size: 0.9rem;
  line-height: 1.3;
  margin-left: -1em;
  padding: 1em;
  padding-bottom: 3em;
}

.oss-title {
  color: var(--post-title-text);
  display: inline;
  font-size: 0.9rem;
  font-weight: 500;
  padding-right: 0.5rem;
}

.oss-snippet span {
  color: var(--nav-unselected);
  font-size: 0.80rem;
}

.oss-summary {
  line-height: 1.6;
}

.oss-summary p { 
  margin-top: 0.3rem
}

.oss-image img { 
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
}

html:not([data-theme="dark"]) .work-image-dark {
  display: none;
}
[data-theme="dark"] .work-image-light {
  display: none;
}


/* LISTS POSTS */

.post-snippet {
  border-radius: 0.4em;
  color: var(--post-content-text);
  font-size: 0.9rem;
  line-height: 1.3;
  margin-left: -1em;
  padding: 1em;
}

.post-title {
  color: var(--post-title-text);
  display: inline;
  font-size: 0.9rem;
  font-weight: 500;
}

.post-title a {
  color: var(--nav-selected);
}

.post-snippet span {
  color: var(--nav-unselected);
  font-size: 0.80rem;
  margin-left: 0.5rem;
}

.post-snippet:hover {
  background-color: var(--post-background-color);
}

.post-summary {
  line-height: 1.6;
}

.post-summary p {
  margin-top: 8px;
  margin-bottom: 12px;
}

::selection {
  background: var(--highlight-color); /* WebKit/Blink Browsers */
}

::-moz-selection {
  background: var(--highlight-color); /* Gecko Browsers */
}

/* POST CARDS WITH THUMBNAILS */

.post-card-link {
  display: block;
  text-decoration: none;
  position: relative;
}

.post-card {
  border-radius: 0.5em;
  color: var(--post-content-text);
  margin-bottom: 0.5rem;
  padding: 1em;
  margin-left: -1em;
  transition: background-color 0.15s ease;
}

.post-card:hover {
  background-color: var(--post-background-color);
}

.post-card-thumbnail {
  position: absolute;
  right: -220px;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  height: 150px;
  overflow: hidden;
  border-radius: 0.4em;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.post-card-link:hover .post-card-thumbnail {
  opacity: 1;
}

.post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0.4em;
}

.post-card-content {
  flex: 1;
  min-width: 0;
}

.post-card .post-title {
  display: block;
  margin-bottom: 0.25rem;
}

.post-card .post-date {
  display: block;
  margin-left: 0;
  margin-bottom: 0.5rem;
}

.post-card .post-summary {
  font-size: 0.85rem;
  line-height: 1.5;
}

.post-card .post-summary p {
  margin: 0;
}

@media screen and (max-width: 1000px) {
  .post-card-thumbnail {
    display: none;
  }
}

/* FOOTER */

footer {
  font-size: 0.9rem;
  margin-top: 2rem;
  text-decoration: none;
}

footer p {
  color: var(--nav-unselected);
}

footer .inline-svg {
  display: inline-block;
  height: 0.8rem;
  position: relative;
  top: 0.1rem;
  width: 0.8rem;
}

.icon-adjust {
  color: var(--nav-unselected);
  display: inline-block;
  height: 0.8rem;
  position: relative;
  top: 0.1rem;
  width: 0.8rem;
}

/* SINGLE */

img {
  margin-bottom: 20px;
  margin-top: 14px;
  max-width: 100%;
  border-radius: 4px;
  display: block;
}

figure {
  margin: 0;
  position: relative;
  display: block;
}

figure img {
  display: block;
  margin: 0 auto;
}

.no-photoswipe {
  cursor: default;
}

.no-photoswipe img {
  max-width: 100%;
  width: auto;
  margin: 0 auto;
  display: block;
}

.gallery {
  margin: 0 !important;
  padding-bottom: 1rem;
  position: relative;
  display: block;
  clear: both;
}

.gallery .box {
  float: left;
  position: relative;
  width: 100%;
  padding-bottom: 100%;
}

.gallery figure {
  position: absolute;
  left: 0px !important;
  right: 0px !important;
  top: 0px !important;
  bottom: 0px !important;
}

.gallery .img {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
}

/* Hide the actual img element in galleries since we use background-image */
.gallery .img img {
  display: none;
}

@media only screen and (min-width: 365px) {
  .gallery .box {
    width: 50%;
    padding-bottom: 50%;
  }
}

@media only screen and (min-width: 480px) {
  .gallery .box {
    width: 33.3%;
    padding-bottom: 33.3%;
  }
}

.highlight {
  padding-bottom: 1rem;
}

.pswp__caption__center {
  text-align: center !important;
}

h1, h2 {
  color: var(--post-title-text);
  margin-top: 2.5rem;
}

h1 {
  font-size: 1.3rem;
}

h3, h4, h5, h6 {
  color: var(--post-title-text);
  margin-top: 2.5rem;
}

h4 {
  display: inline;
  font-weight: 500;
}

/* Add spacing between content elements */
p + h2,
p + h3,
p + h4,
p + h5,
p + h6 {
  margin-top: 3rem;
}

.footer a:visited,
.footer a:link,
.footer a:hover,
.footer a:active {
  color: var(--nav-selected);
  text-decoration: none;
}

.footer a:active {
  color: var(--nav-selected);
}

.footer a:hover {
  color: var(--nav-unselected);
}

a:visited,
a:link,
a:hover,
a:active {
  color: var(--nav-selected);
  text-decoration: none;
}

a:hover {
  color: var(--nav-unselected);
  cursor: pointer;
}

.ytvid {
  height: 0;
  margin-bottom: 40px;
  overflow: hidden;
  padding-bottom: 56.25%;
  position: relative;
}

.ytvid iframe {
  border: 0;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

div.highlight {
  max-width: 680px;
  margin-bottom: 1rem;
  border-radius: 8px;
}

div.highlight pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 16px;
  border-radius: 8px;
}

/* Theme Variables */
html[data-theme="light"] {
  --highlight-color: #D2DBE3;
  --main-background-color: #f8f8f8;
  --main-content-text: #848e97;
  --nav-selected: #3D464F;
  --nav-unselected: #9CABB8;
  --post-background-color: #f4f4f4;
  --post-content-text: #848e97;
  --post-title-text: #3D464F;
  --badge-background: #dadfe5;
  --badge-text: #707b89;
}

html[data-theme="dark"] {
  --highlight-color: #323940;
  --main-background-color: #3D464F;
  --main-content-text: #9CABB8;
  --nav-selected: #D2DBE3;
  --nav-unselected: #7B8FA1;
  --post-background-color: #38424B;
  --post-content-text: #9CABB8;
  --post-title-text: #D2DBE3;
  --badge-background: #343941;
  --badge-text: #b0b9bf;
}


/* BADGES */
.badge {
  background-color: var(--badge-background);
  border-radius: 4px;
  color: var(--badge-text) !important;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  margin-left: 0.5rem;
  padding: 0.2rem 0.3rem;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Code highlighting for light theme */
html[data-theme="light"] .highlight,
html:not([data-theme="dark"]) .highlight {
  background-color: #f6f6f6;
}

html[data-theme="light"] .highlight,
html:not([data-theme="dark"]) .highlight {
  color: var(--post-title-text);
}

html[data-theme="light"] .highlight .k,
html:not([data-theme="dark"]) .highlight .k,
html[data-theme="light"] .highlight .kc,
html:not([data-theme="dark"]) .highlight .kc,
html[data-theme="light"] .highlight .kd,
html:not([data-theme="dark"]) .highlight .kd,
html[data-theme="light"] .highlight .kn,
html:not([data-theme="dark"]) .highlight .kn,
html[data-theme="light"] .highlight .kp,
html:not([data-theme="dark"]) .highlight .kp,
html[data-theme="light"] .highlight .kr,
html:not([data-theme="dark"]) .highlight .kr,
html[data-theme="light"] .highlight .kt,
html:not([data-theme="dark"]) .highlight .kt {
  color: #4a5a6a; /* Keywords - darker shade of nav-selected */
}

html[data-theme="light"] .highlight .na,
html:not([data-theme="dark"]) .highlight .na {
  color: #6b7d8e; /* Names/attributes - mix of nav-unselected and nav-selected */
}

html[data-theme="light"] .highlight .s,
html:not([data-theme="dark"]) .highlight .s,
html[data-theme="light"] .highlight .s1,
html:not([data-theme="dark"]) .highlight .s1,
html[data-theme="light"] .highlight .s2,
html:not([data-theme="dark"]) .highlight .s2 {
  color: #5a7285; /* Strings - muted blue */
}

html[data-theme="light"] .highlight .c,
html:not([data-theme="dark"]) .highlight .c,
html[data-theme="light"] .highlight .c1,
html:not([data-theme="dark"]) .highlight .c1,
html[data-theme="light"] .highlight .cm,
html:not([data-theme="dark"]) .highlight .cm {
  color: #9CABB8; /* Comments - using nav-unselected */
  font-style: italic;
}

html[data-theme="light"] .highlight .mi,
html:not([data-theme="dark"]) .highlight .mi,
html[data-theme="light"] .highlight .mf,
html:not([data-theme="dark"]) .highlight .mf {
  color: #526475; /* Numbers - darker blue */
}

/* Code highlighting for dark theme */
html[data-theme="dark"] .highlight {
  background-color: #3a434c; /* Just slightly darker than main background */
}

html[data-theme="dark"] .highlight {
  color: #D2DBE3; /* Using nav-selected from dark theme */
}

html[data-theme="dark"] .highlight .k,
html[data-theme="dark"] .highlight .kc,
html[data-theme="dark"] .highlight .kd,
html[data-theme="dark"] .highlight .kn,
html[data-theme="dark"] .highlight .kp,
html[data-theme="dark"] .highlight .kr,
html[data-theme="dark"] .highlight .kt {
  color: #b3c6d9; /* Keywords - lighter shade for dark theme */
}

html[data-theme="dark"] .highlight .na {
  color: #9CABB8; /* Names/attributes - using main-content-text from dark theme */
}

html[data-theme="dark"] .highlight .s,
html[data-theme="dark"] .highlight .s1,
html[data-theme="dark"] .highlight .s2 {
  color: #a8bfd1; /* Strings - lighter blue for dark theme */
}

html[data-theme="dark"] .highlight .c,
html[data-theme="dark"] .highlight .c1,
html[data-theme="dark"] .highlight .cm {
  color: #7B8FA1; /* Comments - using nav-unselected from dark theme */
  font-style: italic;
}

html[data-theme="dark"] .highlight .mi,
html[data-theme="dark"] .highlight .mf {
  color: #b8c7d6; /* Numbers - light blue for dark theme */
}

/* Common styles for both themes */
.highlight {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.highlight pre {
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
}

.video-shortcode {
  border-radius: 6px;
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

/* PLAY GRID */

.play-grid {
  display: flex;
  gap: 1.2rem;
  width: 960px;
  margin-left: calc((680px - 960px) / 2);
}

.play-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.video-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}

.video-card .video-shortcode {
  display: block;
  margin: 0;
  border-radius: 0;
}

.video-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2rem 0.75rem 0.6rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}

.video-card-title {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
}

.video-card-date {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
}

@media screen and (max-width: 1000px) {
  .play-grid {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
  }
}

/* ABOUT PAGE */

.about-bio {
  margin-top: -2rem;
  margin-bottom: 2.5rem;
}

.about-section {
  margin-bottom: 2.5rem;
}

.about-section h2 {
  color: var(--post-title-text);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.about-section p {
  margin-bottom: 1rem;
}

.work-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
}

.work-info {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.work-company {
  color: var(--post-title-text);
  font-size: 0.9rem;
  font-weight: 500;
}

a.work-company {
  text-decoration: none;
}

a.work-company:hover {
  color: var(--nav-unselected);
}

.work-role {
  color: var(--nav-unselected);
  font-size: 0.85rem;
}

.work-role::before {
  content: "·";
  margin-right: 0.5rem;
}

.work-date {
  color: var(--nav-unselected);
  font-size: 0.8rem;
  white-space: nowrap;
}

.about-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.about-links a {
  color: var(--nav-unselected);
  font-size: 0.9rem;
}

.about-links a:hover {
  color: var(--post-title-text);
}

@media screen and (max-width: 480px) {
  .work-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .work-role::before {
    content: none;
  }

  .work-date {
    font-size: 0.75rem;
  }
}