/* Site-wide overrides on top of simple.css */

/* Force the dark theme regardless of the OS setting */
:root,
::backdrop {
  color-scheme: dark;
  --bg: #212121;
  --accent-bg: #2b2b2b;
  --text: #dcdcdc;
  --text-light: #ababab;
  --accent: #ffb300;
  --accent-hover: #ffe099;
  --accent-text: var(--bg);
  --code: #f06292;
  --preformatted: #ccc;
  --marked: #ffdd33;
  --disabled: #111;
}

/* Soften bright media against the dark background */
img,
video {
  opacity: 0.8;
}

body > footer {
  font-size: 0.9rem;
}

body > footer p {
  margin: 0.25rem 0;
}

/* Blog card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.card {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  background-color: var(--bg);
  margin: 0;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.card > a {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.card-image {
  margin: 0;
}

.card-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 1.25rem 1.25rem;
}

.card-body h2 {
  font-size: 1.35rem;
  margin: 1rem 0 0.25rem;
  line-height: 1.3;
}

.card-date {
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.read-more {
  margin-top: auto;
  color: var(--accent);
  font-weight: bold;
}

/* Homepage */
.hero h1 {
  max-width: 480px;
  margin: 3rem auto 2rem;
}

.hero img {
  width: 100%;
  border-radius: 0;
}

.home-intro {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 2.5rem 0;
}

.home-intro img {
  width: 45%;
  flex-shrink: 0;
}

.latest-posts h2 {
  font-size: 2rem;
  margin-top: 0;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.post-date {
  color: var(--text-light);
  font-size: 0.85rem;
  white-space: nowrap;
}

@media only screen and (max-width: 720px) {
  .home-intro {
    flex-direction: column;
  }

  .home-intro img {
    width: 100%;
  }
}

/* Links page */
.link-list {
  list-style: none;
  padding: 0;
}

.link-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.9rem 1.25rem;
  background-color: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
}

.link-label {
  font-weight: bold;
}