/* === shumer.dev CSS === */

/* Color scheme */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #5a5a5a;
  --muted2: #8a8a8a;
  --border: #111111;
  --max: 800px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #f5f5f7;
    --muted: #b8b8b8;
    --muted2: #909090;
    --border: #f2f2f2;
  }
}

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

/* Core typography & layout */
body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.75;
  color: var(--fg);
  background: var(--bg);
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1 {
  font-size: 20px;
  letter-spacing: 0.4px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
  line-height: 1.3;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.25px;
  margin-bottom: 6px;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: background 0.15s ease, color 0.15s ease;
  opacity: 0.9;
}

a:hover {
  color: var(--bg);
  background: var(--fg);
  opacity: 1;
}

a:focus-visible {
  outline: 2px dashed var(--fg);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* Paragraphs */
p {
  color: var(--muted);
  margin-bottom: 10px;
}

/* Spacing utilities */
.stack > * + * { margin-top: 40px; }
.stack-sm > * + * { margin-top: 18px; }
.stack-xs > * + * { margin-top: 10px; }

/* Indentation */
.indent { padding-left: 24px; }
.double-indent { padding-left: 48px; }
.triple-indent { padding-left: 72px; }

/* Category label */
.cat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted2);
  margin-bottom: 8px;
}

/* Back link */
.back-link {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
  background-image: none;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--fg);
  background: none;
}

/* Site header */
.site-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 14px 0 10px;
  z-index: 10;
}

.site-header h1 {
  margin-bottom: 10px;
}

/* Section nav */
.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}

.section-nav a {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted2);
  background-image: none;
  padding: 0;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.section-nav a:hover {
  color: var(--fg);
  background: none;
  border-bottom-color: var(--fg);
}

.section-nav a.active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.section-nav .sep {
  color: var(--muted2);
  font-size: 11px;
  user-select: none;
}

/* Card grid for index page */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
  margin-top: 28px;
}

.card {
  display: block;
  background-image: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 80ms ease, box-shadow 0.15s ease;
}

.card:hover {
  background: none;
  border-color: var(--fg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  color: inherit;
}

.card-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.card-label {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

/* Detail page media */
.detail-media {
  width: 100%;
  max-width: 100%;
  border-radius: 4px;
  margin: 16px 0;
}

/* Description text */
#desc {
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.75;
}

/* Dark mode card adjustments */
@media (prefers-color-scheme: dark) {
  .card {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .card-media {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

/* Responsive */
@media (max-width: 520px) {
  body {
    font-size: 13px;
    padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card-label {
    padding: 12px 16px;
    font-size: 13px;
  }

  .detail-media {
    border-radius: 2px;
  }
}

/* Print */
@media print {
  body { max-width: 100%; padding: 20px; }
  a { background-image: none; }
  a::after { content: " (" attr(href) ")"; font-size: 10px; color: var(--muted2); }
}
