/* ============================================================
   Custom Styles — Minimalist CV Website
   Overrides & enhancements for the Minima theme
   ============================================================ */

/* ----- CSS Variables ----- */
:root {
  --color-bg:        #fafaf9;
  --color-surface:   #ffffff;
  --color-text:      #2d2d2d;
  --color-text-muted:#6b6b6b;
  --color-border:    #e6e4e1;
  --color-accent:    #3b5998;
  --color-accent-hover: #1e3a6b;
  --font-body:       'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading:    'Playfair Display', Georgia, 'Times New Roman', serif;
  --max-width:       880px;
  --radius:          6px;
  --transition:      0.2s ease;
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font: 400 17px/1.7 var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  letter-spacing: -0.003em;
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 0.6em;
}

h1 { font-size: 2.4rem; letter-spacing: -0.02em; }
h2 { font-size: 1.7rem; letter-spacing: -0.01em; margin-top: 2.2rem; }
h3 { font-size: 1.25rem; font-weight: 500; margin-top: 1.8rem; }
h4 { font-size: 1.05rem; }

p {
  margin-bottom: 1.3rem;
}

/* ----- Links ----- */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

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

/* Subtle underline animation for content links */
.post-content a:not(.page-link):not(.site-title):not(.post-link),
.home a:not(.page-link):not(.site-title):not(.post-link) {
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-size: 0% 1px;
  background-position: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease;
}

.post-content a:not(.page-link):not(.site-title):not(.post-link):hover,
.home a:not(.page-link):not(.site-title):not(.post-link):hover {
  background-size: 100% 1px;
}

a:visited {
  color: var(--color-accent);
}

/* ----- Wrapper ----- */
.wrapper {
  max-width: var(--max-width);
  margin-right: auto;
  margin-left: auto;
  padding-right: 24px;
  padding-left: 24px;
}

/* ----- Site Header ----- */
.site-header {
  border-top: 3px solid var(--color-accent);
  border-bottom: 1px solid var(--color-border);
  min-height: 60px;
  position: sticky;
  top: 0;
  background-color: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.site-header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 20px;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 60px;
  color: #1a1a1a !important;
  transition: opacity var(--transition);
  float: none;
  flex-shrink: 0;
}

.site-title:hover {
  opacity: 0.7;
  text-decoration: none;
}

.site-nav {
  line-height: 60px;
  float: none;
  flex-shrink: 0;
}

.site-nav .page-link {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.site-nav .page-link:not(:last-child) {
  margin-right: 14px;
}

.site-nav .page-link:hover {
  color: var(--color-text);
  text-decoration: none;
}

/* ----- Page Content ----- */
.page-content {
  padding: 50px 0 60px;
  flex: 1;
}

.page-heading,
.post-title {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.post-header {
  margin-bottom: 40px;
}

/* ----- Images ----- */
.home img,
.post-content img {
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s ease;
  max-width: 100%;
  height: auto;
}

.home img:hover,
.post-content img:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

/* ----- Side-by-side videos ----- */
.video-row {
  display: flex;
  gap: 16px;
  margin: 1.8rem 0;
  align-items: flex-start;
}

.video-row video,
.video-row img {
  flex: 1;
  min-width: 0;
  max-width: calc(50% - 8px);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s ease;
}

.video-row video:hover,
.video-row img:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

@media screen and (max-width: 600px) {
  .video-row {
    flex-direction: column;
    gap: 12px;
  }
  .video-row video,
  .video-row img {
    max-width: 100%;
  }
}

/* ----- Horizontal Rule (section divider) ----- */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

.post-content hr {
  margin: 2rem 0;
}

/* ----- Lists ----- */
ul, ol {
  margin-left: 1.5rem;
  padding-left: 0;
}

li {
  margin-bottom: 0.4rem;
}

li > ul,
li > ol {
  margin-top: 0.4rem;
}

/* Nested list bullets */
ul ul { list-style-type: circle; }
ul ul ul { list-style-type: square; }

/* ----- Intro / Lead Paragraph ----- */
.home > p:first-of-type + p,
.post-content > p:first-of-type {
  font-size: 1.05rem;
  color: #444;
}

/* ----- Blockquotes ----- */
blockquote {
  color: var(--color-text-muted);
  border-left: 3px solid var(--color-accent);
  padding: 0.6rem 0 0.6rem 1.2rem;
  font-size: 1rem;
  font-style: italic;
  background: var(--color-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}

/* ----- Code ----- */
pre, code {
  font-size: 0.88rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: #f5f4f2;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
}

code {
  padding: 2px 6px;
}

pre {
  padding: 16px 20px;
  overflow-x: auto;
  line-height: 1.5;
}

pre > code {
  border: 0;
  padding: 0;
}

/* ----- Tables ----- */
table {
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.92rem;
}

table th {
  background-color: #f5f4f2;
  font-weight: 500;
  border: 1px solid var(--color-border);
  padding: 10px 14px;
}

table td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
}

table tr:nth-child(even) {
  background-color: #fafaf9;
}

/* ----- Post List (Blog) ----- */
.post-list {
  list-style: none;
  margin-left: 0;
}

.post-list > li {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.post-list > li:last-child {
  border-bottom: none;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.post-link {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 500;
  color: #1a1a1a !important;
  display: block;
  transition: color var(--transition);
}

.post-link:hover {
  color: var(--color-accent) !important;
  text-decoration: none;
}

/* ----- Site Footer ----- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.footer-col-wrapper {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.contact-list,
.social-media-list {
  list-style: none;
  margin-left: 0;
}

.social-media-list li + li {
  padding-top: 4px;
}

.svg-icon {
  fill: var(--color-text-muted);
  transition: fill var(--transition);
}

a:hover .svg-icon {
  fill: var(--color-accent);
}

/* ----- Post Content Specific ----- */
.post-content h2 {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.post-content h3 {
  color: #333;
}

/* ----- Selection ----- */
::selection {
  background-color: rgba(59, 89, 152, 0.15);
  color: var(--color-text);
}

::-moz-selection {
  background-color: rgba(59, 89, 152, 0.15);
  color: var(--color-text);
}

/* ----- Focus ----- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ----- 404 Page ----- */
.container {
  margin: 60px auto;
  max-width: 500px;
  text-align: center;
}

.container h1 {
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 500;
  color: var(--color-accent);
  margin: 0 0 0.2rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.container p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* ----- Responsive ----- */
@media screen and (max-width: 800px) {
  body {
    font-size: 16px;
  }

  .page-content {
    padding: 36px 0 48px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.45rem; }
  h3 { font-size: 1.15rem; }

  .post-title,
  .page-heading {
    font-size: 2rem;
  }

  .home img,
  .post-content img {
    max-width: 100%;
  }
}

@media screen and (max-width: 600px) {
  .site-header .wrapper {
    display: block;
  }

  .site-title {
    float: left;
  }

  .site-nav {
    float: none;
    position: absolute;
    top: 12px;
    right: 15px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  }

  .wrapper {
    padding-right: 18px;
    padding-left: 18px;
  }

  .site-title {
    font-size: 19px;
  }
}
