/* Castle Manor Watch — stylesheet */

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

:root {
  --color-bg: #f5f0e1;
  --color-text: #1c2331;
  --color-muted: #8c7a5e;
  --color-accent: #1d4e89;
  --color-border: #d9d0be;
  --color-card-bg: #faf6eb;
  --color-plate-bg: #e8dfc8;
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, monospace;
  --max-width: 860px;
}

/* 10. Smooth scroll */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 1rem;
}

a {
  color: var(--color-accent);
}

a:hover {
  text-decoration: none;
}

/* 5. Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--color-accent);
  color: #fff;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-tagline {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

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

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

/* 9. Footer enhancement */
.footer-about {
  margin-bottom: 0.5rem;
}

/* Incidents list (homepage) */
.incidents-list h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
}

/* 2. Card hover & interaction polish */
.incident-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.incident-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* 8. Typography — stronger card titles */
.incident-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.35rem 0 0.5rem;
}

.incident-card h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.incident-card h3 a:hover {
  color: var(--color-accent);
}

.incident-card-meta,
.incident-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.plate {
  font-family: var(--font-mono);
  background: var(--color-plate-bg);
  padding: 0 0.35em;
  border-radius: 3px;
  color: var(--color-text);
}

.thumb {
  display: block;
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0.75rem 0;
  border: 1px solid var(--color-border);
}

.excerpt {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0.5rem 0;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Individual incident page */
.incident-header {
  margin-bottom: 1.5rem;
}

/* 8. Typography — bolder post title */
.incident-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.5rem;
  line-height: 1.25;
}

/* 3. Gallery image improvements */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.media-gallery figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  display: block;
  transition: filter 0.2s ease;
}

.media-gallery figure a:hover img {
  filter: brightness(0.9);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2.5rem;
  line-height: 1;
  padding: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

/* 1. Responsive video embed */
.video-embed {
  margin-bottom: 1.5rem;
}

.video-embed iframe,
.video-embed video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  display: block;
}

.incident-body {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.incident-body p + p {
  margin-top: 1rem;
}

.incident-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  font-size: 0.9rem;
}

.empty-state {
  color: var(--color-muted);
  font-style: italic;
}

/* Legal page */
.legal-page h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.legal-page h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-page p {
  margin-bottom: 0.75rem;
  line-height: 1.75;
}

/* 4. Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #151a24;
    --color-text: #e4dfd4;
    --color-muted: #a09580;
    --color-accent: #5a9bd5;
    --color-border: #2a3040;
    --color-card-bg: #1c2231;
    --color-plate-bg: #2a3040;
  }

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

/* 7. Print stylesheet */
@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .incident-footer {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .media-gallery figure img {
    break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
