/* =============================================================================
   1. LAYOUT & STRUCTURE
   ============================================================================= */

/* Homepage hero banner — earth-boy-on-moon photo + site title */
.hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-image {
  width: 180px;
  height: auto;
  flex-shrink: 0;
}

/* The social/PDF icon row is the paragraph immediately following the
   hero block in index.md — no class needed, targeted by position. */
.hero + p {
  margin: -4.5em 0 4em 10.25rem;
}

/* Extra right-side buffer on the main content area, desktop only
   (removed again in the mobile media query below) */
.md-content {
  padding-right: 4rem;
}

.blog-controls {
  display: flex;
  gap: 0.75em;
  margin-bottom: 1.5em;
}

.blog-controls button {
  display: flex;
  align-items: center;
  gap: 0.4em;
  background: none;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 4px;
  padding: 0.4em 0.7em;
  cursor: pointer;
  color: currentColor;
  font-size: 0.6rem;
}

.blog-controls .btn-icon svg {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
}

/* Zensical's admonition CSS auto-applies to any bare <details>
   element, adding a default icon (shows as a paper clip here) and a
   background tint meant for actual admonition blocks. Neither is
   wanted on these month-group collapsibles, so both are reset here. */

.md-typeset .month-group {
  background: rgba(88, 166, 255, 0.05);
  border: none;
  box-shadow: none;
}

.month-group summary {
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4em 0;
}

.month-group > summary::before {
  display: none;
}

.month-group .recent-posts {
  margin-top: 0.5em;
  padding-left: 1.2em;
}

/* =============================================================================
   2. COLOR & THEME
   ============================================================================= */

/* Light mode background override */
[data-md-color-scheme="default"] {
  --md-default-bg-color: #ececec;
}

/* Nav tab text color in dark mode only — creamy yellow */
[data-md-color-scheme="slate"] .post-nav a {
  color: #f5e6b3;
}

[data-md-color-scheme="slate"] .post-nav a:hover {
  color: #f5e6b3;
  opacity: 1;
}

/* Base badge icon: renders an external SVG via CSS mask so it can be recolored per theme */
.badge-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.badge-icon + a {
  margin-left: 0.3em;
  vertical-align: middle;
}

/* Icon-specific mask images */
.badge-icon--github {
  mask-image: url("../assets/icons/github.svg");
  -webkit-mask-image: url("../assets/icons/github.svg");
}

.badge-icon--html {
  mask-image: url("../assets/icons/monitor.svg");
  -webkit-mask-image: url("../assets/icons/monitor.svg");
}

.badge-icon--new {
  mask-image: url("../assets/icons/rocket.svg");
  -webkit-mask-image: url("../assets/icons/rocket.svg");
}

.badge-icon--pdf {
  mask-image: url("../assets/icons/file-pdf.svg");
  -webkit-mask-image: url("../assets/icons/file-pdf.svg");
}

/* Recolor badge icons to a warm creamy yellow, dark mode only */
[data-md-color-scheme="slate"] .badge-icon {
  background-color: #f2d28c;
}

/* "New post" badge — inline MDI "new-box" SVG appended after a post
   title by recent_posts()/all_posts_grouped() in main.py, for posts
   dated within the last two weeks. fill="currentColor" on the SVG
   itself means `color` here recolors the icon. */
.new-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  color: darkred;
}

.new-badge svg {
  width: 1.5em;
  height: 1.5em;
  vertical-align: -0.45em;
  filter: drop-shadow(1px 1px 1.5px rgba(0, 0, 0, 0.45));
}

/* Blog page (all_posts_grouped()) renders posts inside .month-group
   <details> blocks — bump the badge up slightly there vs. the home
   page's recent_posts() list. */
.month-group .new-badge svg {
  width: 1.65em;
  height: 1.65em;
  vertical-align: -0.5em;
}

[data-md-color-scheme="slate"] .new-badge {
  color: #2ecc71;
}

[data-md-color-scheme="slate"] .new-badge svg {
  filter: drop-shadow(0 0 4px #2ecc71);
}

/* =============================================================================
   3. TYPOGRAPHY
   ============================================================================= */

.hero-text h1,
.md-typeset h1 {
  font-weight: 450;   /* Montserrat SemiBold */
}

.hero-text h2,
.md-typeset h2,
.md-typeset h3 {
  font-weight: 350;
}

.hero-text h1 {
  margin-bottom: 0.25rem;
}

.hero-text h2 {
  margin-top: 0;
  font-weight: 400;
  opacity: 0.8;
}

.md-ellipsis {
  font-weight: 350;   /* top header site name */
}


/* =============================================================================
   4. COMPONENTS
   ============================================================================= */

/* --- Footer: certification badge + social icon row ---------------------- */

.md-badge {
  max-height: 75px;
}

.md-social {
  align-items: center;
}

/* --- GLightbox modal captions — match site link color -------------------- */

.gslide-description a {
  color: var(--md-typeset-a-color, var(--md-primary-fg-color));
}

.gslide-description a:hover {
  color: var(--md-accent-fg-color);
}

/* --- Inline social/PDF icon row (home + resume pages) -------------------- */

.social-icons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  gap: 0.5em;
}

/* PDF is always last in the config array — push it to the far
   right and color it distinctly from the rest of the row. */
.social-icons a:last-child {
  margin-left: auto;
  color: darkred;
}

/* Zensical's own theme CSS sets a competing max-height on this same
   selector — !important is required to win that specific conflict,
   not a general workaround. */
.md-typeset .twemoji svg,
.md-social__link svg {
  width: 2em !important;
  height: 2em !important;
  max-height: 2em !important;
}

/* Small "opens in new tab" arrow appended by extra.js — sized
   independently so it doesn't inherit the 2em icon size above. */
.external-link-icon svg {
  width: 1em;
  height: 1em;
  margin-left: 0.3em;
  vertical-align: -0.075em;
  fill: currentColor;
}

/* Nav tab icons, inserted by extra.js's initNavIcons() */
.nav-tab-icon svg {
  width: 1em;
  height: 1em;
  margin-right: 0.3em;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
}

/* Extra breathing room around the | separators in job-meta lines
   (Company | City, State | Dates), added dynamically by extra.js */
.job-meta-sep {
  margin: 0 1em;
  opacity: 0.6;
}

/* Blog post list — icon sized to match the title text exactly via em,
   so it never drifts out of sync. !important on font-size overrides
   are deliberate: Zensical's own theme CSS wins the normal cascade on
   these selectors, same conflict pattern as the icon-size rule
   earlier tonight — not general overuse. */

.recent-posts,
.recent-posts li {
  list-style: none;
}

.recent-posts {
  padding-left: 0;
  margin-left: 0;
}

.recent-posts li {
  margin-bottom: 1.5em;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.post-header .post-title {
  font-size: 0.8rem !important;
  font-weight: 500;
}

.post-header .post-icon {
  flex-shrink: 0;
}

.post-header .post-icon svg {
  width: 1.5em;
  height: 1.5em;
  max-width: none;
  vertical-align: -0.45em;
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
}

.post-icon-inline svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  vertical-align: -0.15em;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.post-nav a {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.5rem;
}

.post-nav-icon svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
  vertical-align: -0.15em;
}

/* Date/time: italic, smaller, but the "|" separator inside it stays
   upright — the .job-meta-sep span is reset back to normal style so
   only the actual date/time text renders italic, not the pipe. */

.recent-posts-more {
  text-align: right;
  font-size: 0.7rem !important;
}

.recent-posts-more a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.recent-posts .post-date {
  font-size: 0.5rem !important;
  font-style: italic;
  opacity: 0.6;
}

.recent-posts .post-date .job-meta-sep {
  font-style: normal;
}

.recent-posts .post-excerpt {
  font-size: 0.6rem !important;
  margin-top: 0.3em;
}

/* =============================================================================
   5. RESPONSIVE — mobile (≤600px)
   ============================================================================= */

@media (max-width: 600px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero + p {
    margin-top: -2.5em;
    margin-left: 0;
  }

  .hero + p .social-icons {
    justify-content: center;
  }

  .social-icons a:last-child {
    margin-left: 0;
  }

  .md-content {
    padding-right: 0;
  }

  .glightbox-mobile .glightbox-container .gslide-title {
    font-size: 1rem;
  }

  .glightbox-mobile .glightbox-container .gslide-desc a {
    color: var(--md-typeset-a-color, var(--md-primary-fg-color));
  }

  .glightbox-mobile .glightbox-container .gslide-desc a:hover {
    color: var(--md-accent-fg-color);
  }

  .blog-controls button {
    font-size: 1rem;
    padding-bottom: 0;
  }

  .blog-controls .btn-label {
    display: none;
  }

  .post-header .post-icon svg {
    height: 3em;
    width: 3em;
    max-width: none;
    margin-right: 0.5em;
  }

  .post-nav {
    gap: 1.2em;
  }

  .post-nav a {
    font-size: 0.6rem;
    gap: 0.5em;
  }

  .post-nav-icon svg {
    width: 2em;
    height: 2em;
  }
}