@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Roboto+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* CSS Custom Properties */
:root {
  /* Light theme colors */
  --color-primary: #dc143c;          /* Crimson underline */
  --color-primary-hover: #b91c3c;    /* Deep Crimson background */
  --color-border: #663399;           /* Violet dotted separator */
  --color-text: #232333;             /* Dark grey text */
  --color-text-muted: #555555;       /* Medium grey text */
  --color-text-meta: #888888;        /* Light grey date/meta */
  --color-background: #ffffff;       /* Pure white background */
  --color-background-code: #f5f5f5;  /* Inline code background */
  --color-background-pre: #fcfcfc;   /* Code block background */
  
  --content-max-width: 800px;
  --content-padding: 2ch;
  --font-size-base: 16px;
  --line-height-base: 1.6;
}

/* Dark theme colors override */
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #50fa7b;          /* Bright green underline */
    --color-primary-hover: #1b8a3b;    /* Dark green background */
    --color-border: #0066ff;           /* Electric blue separator */
    --color-text: #f8f8f2;             /* Near white text */
    --color-text-muted: #cccccc;       /* Light grey text */
    --color-text-meta: #a0a0a0;        /* Muted meta text */
    --color-background: #18191a;       /* Dark grey background */
    --color-background-code: #2d2d2d;  /* Dark inline code background */
    --color-background-pre: #202124;   /* Dark code block background */
  }
}

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

html {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-background);
  scroll-behavior: smooth;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  margin: 0;
  padding: 0;
}

/* Layout Wrapper */
.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 3em var(--content-padding);
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 3px dotted var(--color-border);
  padding-bottom: 1.5em;
  margin-bottom: 2.5em;
  flex-wrap: wrap;
  gap: 1em;
}

header .main, header .main a {
  font-weight: 700;
  font-size: 1.4rem;
  border-bottom: none !important;
  color: var(--color-text) !important;
  text-decoration: none;
}

header .main a:hover {
  background-color: transparent !important;
  color: var(--color-primary) !important;
}

header nav {
  display: flex;
  gap: 1.5em;
  font-size: 1rem;
}

header nav a {
  font-weight: 700;
  border-bottom: none;
}

header nav a:hover {
  background-color: transparent !important;
  color: var(--color-primary) !important;
}

/* Typography & Content styling */
p {
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-top: 0;
  margin-bottom: 1.2em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

h1 {
  font-size: 2rem;
  margin-top: 0.5em;
}

h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--color-background-code);
  padding-bottom: 0.3em;
}

h3 {
  font-size: 1.25rem;
}

/* Links styling (Crimson Border Underline) */
a {
  color: inherit;
  text-decoration: none;
  border-bottom: 3px solid var(--color-primary);
  transition: background-color 0.2s ease, color 0.15s ease;
}

a:hover, a:focus {
  background-color: var(--color-primary-hover);
  color: #ffffff !important;
  outline: none;
}

/* Meta Data / Date */
time, .post-meta {
  color: var(--color-text-meta);
  font-size: 0.9rem;
  margin-bottom: 1.5em;
  display: inline-block;
}

/* Dividers */
hr {
  border: 0;
  border-top: 3px dotted var(--color-border);
  margin: 2.5em 0;
}

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 1.2em;
  margin: 1.5em 0;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Lists */
ul, ol {
  font-family: 'Fira Sans', sans-serif;
  font-size: 1.05rem;
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

/* Code & Preformatted Text */
code {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9em;
  background-color: var(--color-background-code);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

pre {
  background-color: var(--color-background-pre);
  border: 1px solid var(--color-background-code);
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5em 0;
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 0.85em;
}

/* Footer */
footer {
  margin-top: 5em;
  border-top: 3px dotted var(--color-border);
  padding-top: 2em;
  font-size: 0.85rem;
  color: var(--color-text-meta);
}

footer p {
  font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  header nav {
    margin-top: 0.5em;
    width: 100%;
    justify-content: flex-start;
  }
}

/* Photo Gallery Styling */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin: 2em 0;
}

.gallery-item {
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid var(--color-background-code);
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.gallery-title {
  padding: 0.6em;
  font-family: 'Fira Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  background-color: var(--color-background-pre);
  color: var(--color-text);
  border-top: 1px solid var(--color-background-code);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
