/*
 * src/style.css
 * Custom build per doc/SPEC.md's Visual Design section, started from
 * Skeleton V2.0.4 (getskeleton.com) as a launch point and stripped down
 * to what this site actually needs — no grid system, no unused components.
 */

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #5f5f5f;
  --color-border: #e0e0e0;
  --color-error: #c62828;

  --badge-reported: #e6a700;
  --badge-fixed: #2e7d32;
  --badge-no_response: #c62828;
  --badge-wont_fix: #7b1fa2;

  --font-sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --content-width: 960px;
  --gutter: 40px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

h1, h2, h3, p, dl, dd, figure {
  margin: 0 0 24px;
}

h1 { font-size: 2.75rem; line-height: 1.2; }
h2 { font-size: 1.75rem; line-height: 1.25; }
h3 { font-size: 1.25rem; line-height: 1.3; }

a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-text-secondary);
}

img { max-width: 100%; }

/* Layout */

header, main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

header {
  padding-top: 32px;
  padding-bottom: 32px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--color-border);
}

header h1, header a {
  display: inline-block;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}

main {
  padding-bottom: 80px;
}

section + section,
main > h2 {
  margin-top: 64px;
}

/* Status badges */

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-reported { background: var(--badge-reported); }
.badge-fixed { background: var(--badge-fixed); }
.badge-no_response { background: var(--badge-no_response); }
.badge-wont_fix { background: var(--badge-wont_fix); }

/* Buttons */

.button, button, input[type="submit"] {
  display: inline-block;
  background: var(--color-text);
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}

.button:hover, button:hover, input[type="submit"]:hover {
  background: #333;
  color: #fff;
}

/* Feed / admin listing */

ul.case-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.case-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.case-date {
  flex-shrink: 0;
  width: 110px;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.case-company {
  flex-shrink: 0;
  width: 200px;
  font-weight: 600;
}

.case-title {
  flex: 1;
  min-width: 200px;
}

.case-edit {
  margin-left: auto;
}

.empty-state {
  padding: 48px 0;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  text-align: center;
}

/* Case page */

main.case dl.case-meta {
  display: grid;
  grid-template-columns: 160px 1fr;
  row-gap: 8px;
  column-gap: 16px;
  margin: 32px 0;
}

.case-meta dt {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.case-meta dd {
  margin: 0;
}

.issue-description {
  font-size: 1.1rem;
  margin: 32px 0;
}

figure.screenshot {
  margin: 40px 0;
}

figure.screenshot img {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

figure.screenshot figcaption {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

pre code {
  display: block;
  padding: 24px;
  overflow-x: auto;
  background: #f5f5f5;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre;
}

.timeline {
  display: flex;
  gap: 48px;
  margin: 48px 0;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.timeline-step {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-date {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Not found */

main.not-found {
  padding-top: 96px;
  text-align: center;
}

main.not-found p {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
}

/* Forms (admin/new.php, admin/edit.php) */

main.admin-form form {
  max-width: 640px;
}

main.admin-form dl.case-meta {
  display: grid;
  grid-template-columns: 160px 1fr;
  row-gap: 8px;
  column-gap: 16px;
  margin: 32px 0 48px;
  max-width: 640px;
}

form label {
  display: block;
  margin-top: 24px;
  margin-bottom: 8px;
  font-weight: 600;
}

form input[type="text"],
form input[type="url"],
form input[type="date"],
form select,
form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
}

form textarea.code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

form input[type="file"] {
  display: block;
  margin-top: 4px;
}

.current-file {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--color-error);
  font-size: 0.875rem;
}

form button[type="submit"] {
  margin-top: 32px;
}

/* Responsive */

@media (max-width: 600px) {
  :root {
    --gutter: 20px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }

  .case-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .case-date, .case-company {
    width: auto;
  }

  .case-edit {
    margin-left: 0;
  }

  main.case dl.case-meta,
  main.admin-form dl.case-meta {
    grid-template-columns: 1fr;
  }

  .case-meta dt {
    margin-top: 12px;
  }

  .timeline {
    flex-direction: column;
    gap: 16px;
  }
}
