/* css styles */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);

  /* Light Mode Defaults (matching Lux/User Reference) */
  --quarto-bg: #ffffff;
  --quarto-text: #373a3c;
  --quarto-border: #dee2e6;
  --primary-color: #2780e3;
  /* Cosmo Blue */
  --code-bg: #f8f9fa;
}

body {
  font-family: var(--bs-body-font-family);
  background-color: var(--quarto-bg);
  color: var(--quarto-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Dark Mode Overrides --- */
/* Quarto adds .quarto-dark to body when dark theme is active */
body.quarto-dark {
  --quarto-bg: #222222;
  --quarto-text: #f0f0f0;
  --quarto-border: #444444;
  --code-bg: #2d2d2d;

  /* Bootstrap overrides for dark mode */
  --bs-body-bg: #222222;
  --bs-body-color: #f0f0f0;
  --bs-heading-color: #ffffff;

  /* Force Primary Color to match Cosmo Blue, overriding Darkly's Green */
  --bs-primary: #2780e3;
  --primary-color: #2780e3;

  /* Depth: a faint primary glow from the top instead of a flat fill */
  background-image: radial-gradient(1100px 520px at 50% -8%, rgba(39, 128, 227, 0.10), transparent 62%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Lift cards off the darker backdrop for a sense of elevation */
body.quarto-dark .card,
body.quarto-dark .quarto-grid-item {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Ensure links and other elements respect the dark theme */
body.quarto-dark a {
  color: #5aaafa;
  /* Light blue for links in dark mode */
}

/* Override Bootstrap Darkly Buttons if they use the green primary */
body.quarto-dark .btn-primary {
  background-color: #2780e3;
  border-color: #2780e3;
}

body.quarto-dark .card {
  background-color: #2c2c2c;
  border-color: var(--quarto-border);
}

body.quarto-dark .list-group-item {
  background-color: #2c2c2c;
  border-color: var(--quarto-border);
}

/* --- Navbar --- */
.navbar {
  background-color: var(--quarto-bg) !important;
  border-bottom: 1px solid var(--quarto-border);
  padding: 0.8rem 1rem;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--quarto-text) !important;
}

.nav-link {
  color: var(--quarto-text) !important;
  opacity: 0.8;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
  opacity: 1;
  color: var(--primary-color) !important;
}

/* --- Trestles Layout (Home/About) --- */
/* Custom Grid Setup for 30/70 Split on Desktop */
@media (min-width: 992px) {
  .quarto-about-trestles {
    display: grid;
    grid-template-columns: 30fr 70fr;
    gap: 3rem;
    align-items: center;
    /* Vertical alignment */
  }

  .quarto-about-trestles .about-entity {
    width: auto;
    /* Let grid control width */
  }

  .quarto-about-trestles .about-contents {
    width: auto;
    /* Let grid control width */
  }
}

.quarto-about-trestles .about-entity {
  /* Removed border-right for cleaner look */
  border-right: none;
  /* Center the content */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* Increase width slightly if needed, but flex handles usually */
}

.quarto-about-trestles .about-image {
  border: none;
  width: 250px;
  max-width: 100%;
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

.quarto-about-trestles .about-image:hover {
  transform: translateY(-3px);
}

.my-focus {
  background: var(--code-bg);
  border-left: 4px solid var(--primary-color);
  border-radius: 10px;
  padding: 1rem 1.5rem 1.25rem;
  margin: 1.25rem 0 1.5rem;
  /* override the justified text inherited from .about-contents, which
     stretches the spaces on these short lines into huge gaps */
  text-align: left;
}

.my-focus h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.my-focus ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

/* `.my-focus ul li` (not `.my-focus li`) so these beat the more global
   `.about-contents li { display: flex }` rule that otherwise breaks the layout */
.my-focus ul li {
  display: block;
  margin-bottom: 0.4rem;
}

.my-focus ul li:last-child {
  margin-bottom: 0;
}

.my-focus ul li i {
  color: var(--primary-color);
  margin-right: 0.4rem;
}

.quarto-about-trestles .about-contents {
  text-align: justify;
  /* Ensure no lines look longer than others */
}

.about-link {
  border: 1px solid var(--quarto-border);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  transition: all 0.2s;
}

.about-link:hover {
  background-color: rgba(39, 128, 227, 0.1);
  color: var(--primary-color);
  text-decoration: none;
}

/* Custom List Styling */
.about-contents ul {
  list-style-type: none;
  /* Remove default bullets */
  padding-left: 0;
}

.about-contents li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.about-contents li i {
  margin-right: 10px;
  color: var(--primary-color);
  font-size: 1.1em;
}

/* --- Portfolio Grid Styles --- */
/* Quarto's grid items */
.quarto-grid-item {
  border: 1px solid var(--quarto-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--quarto-bg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quarto-grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-top {
  height: 180px;
  object-fit: contain;
  padding: 0.75rem;
  background: var(--code-bg);
  border-bottom: 1px solid var(--quarto-border);
}

body.quarto-dark .card-img-top {
  background: #2d2d2d;
}

.card-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Clamp listing-card descriptions to 3 lines for consistent card heights */
.card .card-text.description,
.card .listing-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}

/* --- Blog Post List --- */
.quarto-post {
  border-bottom: 1px solid var(--quarto-border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.quarto-post .thumbnail {
  border-radius: 6px;
}

/* --- Code Blocks --- */
/* Light theme default (GitHub-light-ish on the cosmo neutral) */
div.sourceCode {
  background-color: var(--code-bg);
  color: #24292f;
  border-radius: 12px;
  padding: 1.5rem 1rem 1rem 1rem;
  position: relative;
  margin-bottom: 2rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--quarto-border);
}

/* Dark theme override (VS Code style) */
body.quarto-dark div.sourceCode {
  background-color: #1e1e1e;
  color: #d4d4d4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.05);
}

/* Traffic Lights — read fine on both backgrounds */
div.sourceCode::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27c93f;
}

/* Scrollbar — theme-aware */
div.sourceCode pre::-webkit-scrollbar {
  height: 8px;
}

div.sourceCode pre::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

body.quarto-dark div.sourceCode pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

code {
  font-family: 'Fira Code', monospace;
}

/* --- Certifications --- */
/* Custom listing template lives at _templates/certification-card.ejs */
.certification-badge {
  height: 200px;
  object-fit: contain;
  padding: 0.75rem;
  background: transparent;
  border-bottom: 1px solid var(--quarto-border);
}

.certification-issuer {
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.certification-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.75rem;
}

.skill-chip {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--code-bg);
  color: var(--quarto-text);
  border: 1px solid var(--quarto-border);
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.skill-chip:hover {
  background: rgba(39, 128, 227, 0.08);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

body.quarto-dark .skill-chip {
  background: #2d2d2d;
  border-color: rgba(255, 255, 255, 0.12);
}

body.quarto-dark .skill-chip:hover {
  background: rgba(90, 170, 250, 0.12);
  border-color: #5aaafa;
  color: #5aaafa;
}

/* --- CTA buttons (home + project pages) --- */
.btn-primary,
.btn-outline-primary {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.btn-primary:hover,
.btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(39, 128, 227, 0.25);
}
