/* ==========================================
   Landing Page
   labreports.app
========================================== */

:root {
  color-scheme: light;

  --background: #ffffff;
  --surface: #f5f5f3;
  --surface-raised: #ffffff;

  --text: #171817;
  --muted-text: #666a66;

  --border: #d8dad6;
  --border-strong: #b9bdb7;

  --link: #173f8a;
  --link-hover: #0d2f70;

  --button-background: #ffffff;
  --button-hover: #f1f3ef;

  --shadow:
    0 8px 24px rgba(20, 24, 20, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --background: #111311;
  --surface: #1b1e1b;
  --surface-raised: #171a17;

  --text: #f1f3ef;
  --muted-text: #aeb4ac;

  --border: #3a3f39;
  --border-strong: #555c53;

  --link: #a9c8ff;
  --link-hover: #d3e2ff;

  --button-background: #202420;
  --button-hover: #292e29;

  --shadow:
    0 8px 24px rgba(0, 0, 0, 0.28);
}

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

html {
  background: var(--background);
  color: var(--text);
}

body {
  margin: 0;

  min-height: 100vh;

  background: var(--background);
  color: var(--text);

  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  line-height: 1.5;
}

img {
  max-width: 100%;
}

a {
  color: var(--link);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--link-hover);
}

button,
input,
select,
textarea {
  font: inherit;
}

.landing-main {
  width: 100%;
  max-width: 1200px;

  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* ==========================================
   Accessibility
========================================== */

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;

  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;

  border: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

/* ==========================================
   Header
========================================== */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.header-inner {
  width: 100%;
  max-width: 1200px;

  margin: 0 auto;
  padding: 1rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-title {
  color: var(--text);

  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.1;

  text-decoration: none;
}

.site-title:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.site-navigation a {
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
}

.site-navigation a:hover {
  text-decoration: underline;
}

/* ==========================================
   Theme Toggle

   JavaScript owns the visible icon:
   ◐ in light mode
   ☀ in dark mode

   Do not add a ::before content rule.
========================================== */

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;

  flex: 0 0 auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--button-background);
  color: var(--text);

  font-size: 1rem;
  font-weight: 500;
  line-height: 1;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.theme-toggle:hover {
  background: var(--button-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0);
}

/* ==========================================
   Loading and Error Messages
========================================== */

.loading-message,
.empty-message,
.error-message {
  margin: 0;
  padding: 2rem;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface);
  color: var(--muted-text);

  text-align: center;
}

.error-message {
  color: var(--text);
}

/* ==========================================
   Featured Report
========================================== */

.featured-report {
  margin-bottom: 3rem;
}

.featured-card {
  padding: 1.25rem;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.featured-source-header {
  margin-bottom: 1rem;
}

.featured-source-meta {
  margin: 0 0 0.35rem;

  color: var(--muted-text);

  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.featured-source-title {
  margin: 0;

  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1.2;
}

.featured-source-title a {
  color: var(--text);
  text-decoration: none;
}

.featured-source-title a:hover {
  color: var(--text);
  text-decoration: underline;
}

.featured-image-link {
  display: block;

  border-radius: 8px;
  overflow: hidden;

  background: var(--surface);
  text-decoration: none;
}

.featured-image {
  width: 100%;
  height: auto;

  display: block;

  border-radius: 8px;

  transition: transform 0.25s ease;
}

.featured-image-link:hover .featured-image {
  transform: scale(1.005);
}

.featured-details {
  padding-top: 1rem;
}

.featured-label {
  margin: 0 0 0.3rem;

  color: var(--muted-text);

  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-title {
  margin: 0;

  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.25;
}

.featured-title a {
  color: var(--text);
  text-decoration: none;
}

.featured-title a:hover {
  color: var(--text);
  text-decoration: underline;
}

.featured-meta {
  margin: 0.5rem 0 0;

  color: var(--muted-text);

  font-size: 0.9rem;
}

/* ==========================================
   Image Placeholder
========================================== */

.report-image-placeholder {
  min-height: 12rem;
  padding: 2rem;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px dashed var(--border-strong);
  border-radius: 8px;

  background: var(--surface);
  color: var(--muted-text);

  font-weight: 650;
  text-align: center;
}

/* ==========================================
   Gallery
========================================== */

.report-gallery {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;

  margin-bottom: 3rem;
}

.report-card {
  min-width: 0;
  padding: 1rem;

  display: flex;
  flex-direction: column;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--surface-raised);

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.report-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.report-card-source-header {
  margin-bottom: 0.85rem;
}

.report-card-source-meta {
  margin: 0 0 0.3rem;

  color: var(--muted-text);

  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  line-height: 1.3;
  text-transform: uppercase;
}

.report-card-source-title {
  margin: 0;

  font-size: 1rem;
  line-height: 1.3;
}

.report-card-source-title a {
  color: var(--text);
  text-decoration: none;
}

.report-card-source-title a:hover {
  color: var(--text);
  text-decoration: underline;
}

.report-card-image-link {
  display: block;

  border-radius: 7px;
  overflow: hidden;

  background: var(--surface);
  text-decoration: none;
}

.report-card-image {
  width: 100%;
  height: auto;

  display: block;

  border-radius: 7px;

  transition: transform 0.25s ease;
}

.report-card-image-link:hover .report-card-image {
  transform: scale(1.01);
}

.report-card-details {
  padding-top: 0.85rem;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.report-card-title {
  color: var(--text);

  font-weight: 700;
  line-height: 1.3;

  text-decoration: none;
}

.report-card-title:hover {
  color: var(--text);
  text-decoration: underline;
}

.report-card-source {
  color: var(--link);

  font-size: 0.9rem;
  font-weight: 650;

  text-decoration: none;
}

.report-card-source:hover {
  text-decoration: underline;
}

.report-card-date {
  color: var(--muted-text);
  font-size: 0.85rem;
}

/* ==========================================
   Pagination
========================================== */

.pagination {
  margin: 3rem 0 1rem;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.pagination-button {
  min-width: 7rem;
  padding: 0.65rem 1rem;

  border: 1px solid var(--border);
  border-radius: 7px;

  background: var(--button-background);
  color: var(--text);

  font-weight: 650;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
  background: var(--button-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.pagination-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination-status {
  min-width: 4rem;

  color: var(--muted-text);

  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ==========================================
   Footer
========================================== */

.site-footer {
  padding: 2rem 1rem;

  border-top: 1px solid var(--border);

  background: var(--background);
}

.footer-inner {
  width: 100%;
  max-width: 1200px;

  margin: 0 auto;
}

.footer-statement {
  margin: 0 0 1rem;

  text-align: center;
}

.footer-links {
  margin-bottom: 1rem;

  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.footer-links a {
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copyright {
  margin: 0;

  color: var(--muted-text);

  font-size: 0.9rem;
  text-align: center;
}

/* ==========================================
   Responsive Layout
========================================== */

@media (max-width: 720px) {
  .header-inner {
    align-items: flex-start;
    gap: 1rem;
  }

  .site-navigation {
    gap: 0.75rem;
  }

  .landing-main {
    padding-top: 1.25rem;
  }

  .featured-card {
    padding: 0.9rem;
  }

  .report-gallery {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 520px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .site-navigation {
    width: 100%;
    justify-content: flex-start;
  }

  .pagination {
    justify-content: space-between;
    gap: 0.5rem;
  }

  .pagination-button {
    min-width: 0;
    flex: 1;
  }

  .pagination-status {
    flex: 0 0 auto;
  }
}

/* ==========================================
   Reduced Motion
========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
