/*
Theme Name: Bandidor Modern
Description: A fast, accessible block theme for the Bandidor hobby and technology archive.
Version: 0.2.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: bandidor-modern
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:where(.wp-site-blocks) {
  min-height: 100vh;
}

:where(.wp-block-post-content) :where(pre, code) {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

:where(.wp-block-post-content) pre {
  overflow-x: auto;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 0.5rem;
  background: var(--wp--preset--color--surface);
  padding: var(--wp--preset--spacing--40);
}

:where(.wp-block-post-featured-image img) {
  border-radius: 0.75rem;
}

.bandidor-card {
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 0.85rem;
  background: var(--wp--preset--color--surface);
}

.bandidor-card-body {
  padding: var(--wp--preset--spacing--50);
}

.bandidor-card-image {
  aspect-ratio: 16 / 9;
  max-height: 18rem;
  overflow: hidden;
  margin: 0;
  background: var(--wp--preset--color--canvas);
}

.bandidor-card-image img {
  height: 100%;
  width: 100%;
  border-radius: 0;
  object-fit: cover;
}

.bandidor-card .wp-block-post-title {
  margin-top: var(--wp--preset--spacing--30);
}

.bandidor-card .wp-block-post-title a {
  color: var(--wp--preset--color--ink);
  text-decoration: none;
}

.bandidor-card .wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}

.bandidor-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wp--preset--spacing--50);
  padding: 0;
}

.bandidor-post-grid > li:first-child {
  grid-column: 1 / -1;
}

.bandidor-post-grid > li:first-child .bandidor-card:has(.bandidor-card-image) {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  align-items: stretch;
}

.bandidor-post-grid > li:first-child .bandidor-card-image,
.bandidor-post-grid > li:first-child .bandidor-card-image a,
.bandidor-post-grid > li:first-child .bandidor-card-image img {
  height: 100%;
  max-height: none;
}

.bandidor-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--border);
}

.bandidor-intro::after {
  position: absolute;
  z-index: -1;
  top: -7rem;
  right: -5rem;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--wp--preset--color--accent) 12%, transparent);
  content: "";
}

.bandidor-kicker {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bandidor-section-heading {
  margin-top: var(--wp--preset--spacing--70);
}

.bandidor-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--wp--preset--font-size--small);
}

.bandidor-categories a {
  display: inline-block;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: var(--wp--preset--color--surface);
  text-decoration: none;
}

.bandidor-meta {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--small);
}

.bandidor-primary-nav .wp-block-page-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--30);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bandidor-primary-nav a {
  color: var(--wp--preset--color--ink);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.25em;
}

@media (max-width: 48rem) {
  .bandidor-post-grid {
    grid-template-columns: 1fr;
  }

  .bandidor-post-grid > li:first-child {
    grid-column: auto;
  }

  .bandidor-post-grid > li:first-child .bandidor-card:has(.bandidor-card-image) {
    display: block;
  }

  .bandidor-post-grid > li:first-child .bandidor-card-image {
    height: auto;
    max-height: 18rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :where(a) {
    transition: color 120ms ease;
  }
}
