/* phosphor - CRT-inspired Hugo theme */

:root {
  --bg: #141416;
  --surface: #1E1F22;
  --text: #E8E8E3;
  --text-muted: #A2A3A0;
  --accent: #00FF9C;
  --highlight: #FFB86B;
  --max-width: 680px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
.site-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--surface);
  margin-bottom: 2rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.site-title:hover {
  color: var(--highlight);
}

/* Navigation */
.site-nav {
  margin-top: 1rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-right: 1.5rem;
  font-size: 0.875rem;
  transition: color 0.15s;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  margin: 1.5em 0 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

p {
  margin: 1em 0;
}

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

a:hover {
  color: var(--highlight);
  text-decoration: underline;
}

/* Posts list */
.posts-list {
  list-style: none;
}

.post-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--surface);
}

.post-item:last-child {
  border-bottom: none;
}

.post-title {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
}

.post-title a {
  color: var(--text);
}

.post-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Article */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.post-content {
  line-height: 1.7;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
}

/* Code */
code {
  font-family: inherit;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--highlight);
}

pre {
  background: var(--surface);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-left: 3px solid var(--accent);
}

pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

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

li {
  margin: 0.25em 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.5rem;
  border: 1px solid var(--surface);
  text-align: left;
}

th {
  background: var(--surface);
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--surface);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
}

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

/* Tags */
.tags {
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--surface);
  padding: 0.2em 0.5em;
  border-radius: 3px;
  margin-right: 0.5rem;
  text-decoration: none;
}

.tag:hover {
  color: var(--bg);
  background: var(--accent);
  text-decoration: none;
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--surface);
  font-size: 0.875rem;
}

.post-nav a {
  max-width: 45%;
}

/* Gallery - album grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface);
}

.gallery-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  transition: opacity 0.2s;
}

.gallery-item:hover img {
  opacity: 0.8;
}

.gallery-title {
  display: block;
  padding: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: none;
}

/* Photo viewer - expand beyond container */
.photo-viewer {
  width: 100vw;
  max-width: 1200px;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: 0 1rem;
}

@media (min-width: 1200px) {
  .photo-viewer {
    margin-left: calc(-600px + 340px);
    margin-right: calc(-600px + 340px);
  }
}

/* Flickr embed responsive */
.post-content a[data-flickr-embed] {
  display: block;
  max-width: 100%;
}

.post-content a[data-flickr-embed] img {
  width: 100%;
  max-width: 1000px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Gallery - photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.photo-item {
  margin: 0;
}

.photo-item img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.photo-item img:hover {
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .site-nav a {
    margin-right: 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }
}
