/* ========================================
   COMPUTATIONAL SCIENTIST THEME
   Modern, technical, sophisticated
   With dark mode support
   ======================================== */

/* CSS Variables for theming */
:root {
  /* Light mode colors */
  --bg-primary: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f3f5;
  --text-primary: #1a1a2e;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --accent: #2d6a9f;
  --accent-hover: #1d4e73;
  --accent-subtle: #e7f1f8;
  --border: #dee2e6;
  --border-light: #e9ecef;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-strong: rgba(0, 0, 0, 0.12);
  --code-bg: #f1f3f5;
  --highlight: #3a86ff;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0d1117;
    --bg-card: #161b22;
    --bg-card-alt: #1c2128;
    --text-primary: #e6edf3;
    --text-secondary: #b1bac4;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-subtle: #1c3a5e;
    --border: #30363d;
    --border-light: #21262d;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-strong: rgba(0, 0, 0, 0.5);
    --code-bg: #1c2128;
    --highlight: #58a6ff;
  }
}

/* Google Fonts - add to _quarto.yml header */
/* @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap'); */

/* Basic typography and layout */
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Main content container */
main.content,
.content {
  max-width: 960px;
  margin: 2.5rem auto 3rem;
  padding: 2.5rem 3rem;
  background-color: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 20px var(--shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Typography */
h1 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-size: 2.25rem;
}

h2 {
  font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1.2rem;
}

h3 {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

p {
  margin-bottom: 0.9rem;
  color: var(--text-secondary);
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ========================================
   HOME HERO SECTION
   ======================================== */

.home-hero {
  margin-bottom: 2.5rem;
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
}

.home-hero > .column {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.home-hero .column:first-child h1 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.home-portrait {
  max-width: 190px;
  border-radius: 8px;
  display: block;
  margin: 0;
  box-shadow: 0 8px 24px var(--shadow-strong);
  border: 3px solid var(--border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.home-portrait:hover {
  border-color: var(--accent);
}

/* Remove margin from the paragraph wrapping the portrait */
.home-hero .column p:has(.home-portrait),
.home-hero .column > p:first-child,
.home-hero .column > p,
.home-hero .column > figure {
  margin: 0;
  text-align: left;
}

/* Align the portrait column content to the left */
.home-hero .column:last-child {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.home-hero .column:last-child > * {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Intro text styling */
.home-intro {
  font-size: 1.05rem;
  margin-bottom: 1.8rem;
}

.home-intro p {
  margin-bottom: 0.4rem;
}

/* ========================================
   NEWS + SIDEBAR SECTION
   ======================================== */

.news-sidebar-row {
  display: flex !important;
  align-items: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 2rem !important;
}

.news-sidebar-row > div,
.news-sidebar-row > .column {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.news-sidebar-row h2 {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.news-sidebar-row > div > h2:first-child,
.news-sidebar-row > .column > h2:first-child {
  margin-top: 0 !important;
}

/* Sidebar card - align with news items */
.news-sidebar-row .sidebar-card {
  margin-top: 2.8rem;
  padding-top: 1rem;
}

/* ========================================
   NEWS ITEMS
   ======================================== */

.news-item {
  padding: 1.25rem 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  margin-bottom: 1rem;
  border-left: 3px solid var(--accent);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.news-item:hover {
  border-left-color: var(--highlight);
  background-color: var(--bg-card-alt);
  transform: translateX(4px);
}

.news-item h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.news-item p {
  margin-bottom: 0;
  font-size: 0.92rem;
}



/* News images */
.news-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0 0.75rem 0;
  border-radius: 4px;
}

/* ========================================
   SIDEBAR CARD
   ======================================== */

.sidebar-card {
  padding: 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-card-alt);
  margin-bottom: 1rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-card h2 {
  font-size: 0.9rem;
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.sidebar-card h2:first-child {
  margin-top: 0;
}

.sidebar-card p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.sidebar-card a {
  color: var(--accent);
  transition: color 0.2s;
}

.sidebar-card a:hover {
  color: var(--accent-hover);
}

/* Icon links */
.sidebar-card a.icon-link {
  color: var(--text-muted);
  margin-right: 0.9rem;
  font-size: 1.2rem;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.sidebar-card a.icon-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ========================================
   TWO-COLUMN LAYOUT
   ======================================== */

.columns {
  gap: 1.8rem;
  display: flex;
  align-items: flex-start;
}

.columns > .column {
  flex-shrink: 0;
}

/* ========================================
   LISTS
   ======================================== */

ul {
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

li::marker {
  color: var(--accent);
}

/* ========================================
   CODE / TECHNICAL ELEMENTS
   ======================================== */

code {
  font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.9em;
  background-color: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}

/* ========================================
   NAVBAR CUSTOMIZATION
   ======================================== */

.navbar {
  background-color: var(--bg-card) !important;
  border-bottom: 1px solid var(--border) !important;
  transition: background-color 0.3s ease;
}

.navbar-brand,
.nav-link {
  color: var(--text-primary) !important;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--accent) !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  main.content,
  .content {
    margin: 1rem 0.75rem 2rem;
    padding: 1.5rem 1.25rem;
  }

  .home-portrait {
    max-width: 140px;
    margin-top: 1rem;
  }

  .news-sidebar-row {
    flex-direction: column !important;
  }

  .news-sidebar-row .sidebar-card {
    margin-top: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 0.95rem;
  }
}

/* ========================================
   SUBTLE TECHNICAL DETAILS
   ======================================== */

/* Add a subtle grid pattern to the background (optional) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.02;
  background-image: 
    linear-gradient(var(--text-muted) 1px, transparent 1px),
    linear-gradient(90deg, var(--text-muted) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
}

/* Selection color */
::selection {
  background-color: var(--accent);
  color: white;
}

/* Scrollbar styling (webkit browsers) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
