/* Teia-inspired minimal gallery styles */
:root {
  --bg: #ffffff;
  --text: #000000;
  --border: #e0e0e0;
  --link-hover: #666666;
  --mono-font: 'IBM Plex Mono', 'Courier New', monospace;
  --sans-font: system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #ffffff;
    --border: #333333;
    --link-hover: #999999;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono-font);
  font-size: 14px;
  line-height: 1.6;
  /* Prevent horizontal overflow on mobile */
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  overflow-x: hidden;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  overflow-x: hidden;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 40px;
}

.site-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 10px;
}

nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

nav .avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 50%;
  border: 1px solid var(--border);
  margin-left: auto;
  object-fit: cover;
  flex-shrink: 0;
}

nav a {
  padding: 5px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

nav a:hover {
  border-bottom: 1px solid var(--text);
}

/* Content */
h1 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 20px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 15px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h3 {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

p {
  margin-bottom: 15px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

ul, ol {
  margin-left: 20px;
  margin-bottom: 15px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

li {
  margin-bottom: 8px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a {
  color: var(--text);
  cursor: pointer;
}

a:hover {
  color: var(--link-hover);
}

/* Add pointing finger emoji before links (excluding nav and buttons) */
main a:not(.btn):not(.card):before,
.footer-links a:before,
.artwork-description a:before {
  content: "👉 ";
}

/* Remove emoji from button-style links */
.artwork-links a:before {
  content: none;
}

/* Grid layouts */
.grid {
  display: grid;
  gap: 30px;
  margin-bottom: 40px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Cards */
.card {
  border: 1px solid var(--border);
  padding: 20px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--text);
}

.card h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 10px;
}

.card p {
  font-size: 13px;
  color: var(--link-hover);
}

/* Artwork display */
.artwork-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .artwork-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .artwork-container > * {
    min-width: 0;
    max-width: 100%;
  }
}

.artwork-view {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  box-sizing: border-box;
}

.artwork-view iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.artwork-view img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.artwork-view .btn {
  margin-top: 10px;
}

.artwork-controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.artwork-info {
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.artwork-info h1 {
  margin-bottom: 15px;
}

.artwork-meta {
  font-size: 13px;
  color: var(--link-hover);
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.artwork-description {
  margin-bottom: 20px;
}

.artwork-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.artwork-links a {
  padding: 10px 15px;
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.2s;
}

.artwork-links a:hover {
  background: var(--text);
  color: var(--bg);
}

/* Featured work on homepage */
.featured {
  margin-bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.featured-iframe {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 1;
  height: auto;
  margin: 0 auto 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.featured-iframe img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  flex-shrink: 0;
}

.featured-info {
  text-align: center;
  margin-bottom: 10px;
}

/* Button */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--text);
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s;
  cursor: pointer;
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 80px;
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Theme tags */
.theme-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.85em;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.theme-tag:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* JavaScript disabled warning */
.js-warning {
  background: #ff004d;
  color: #ffffff;
  padding: 20px;
  margin-bottom: 20px;
  border: 2px solid #000000;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .js-warning {
    border-color: #ffffff;
  }
}

.js-warning h3 {
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: 500;
}

.js-warning p {
  margin-bottom: 15px;
  line-height: 1.5;
}

.js-warning .prompt-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  margin: 15px 0;
  font-family: var(--mono-font);
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  word-wrap: break-word;
}

.js-warning a {
  color: #ffffff;
  text-decoration: underline;
}

.js-warning ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.js-warning li {
  margin-bottom: 8px;
}

/* Archivist Notes */
.archivist-note {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.archivist-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.archivist-note-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.archivist-note-header .archivist-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.archivist-byline {
  font-size: 13px;
  color: var(--link-hover);
  font-style: italic;
  margin-bottom: 20px;
}

.archivist-note p {
  font-style: italic;
  color: var(--link-hover);
}

/* Code blocks */
pre, code {
  font-family: var(--mono-font);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

pre {
  background: rgba(128, 128, 128, 0.1);
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow-x: auto;
  max-width: 100%;
}

code {
  background: rgba(128, 128, 128, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
}

pre code {
  background: none;
  padding: 0;
}

/* Utility */
.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-40 {
  margin-bottom: 40px;
}
