/* vrobot.ch – site styles. Plain CSS, no framework, no build step.
 *
 * Colours come from the logo:
 *   black #1A1A1A  – text, header, footer
 *   red   #E2000A  – accents (buttons, active navigation, highlights)
 *   grey  #939CA4  – lines and decoration only (too light for text)
 */

:root {
  --black: #1a1a1a;
  --red: #e2000a;
  --red-dark: #b8000a;
  --grey: #939ca4;
  --grey-light: #e6e9ec;
  --grey-lighter: #f4f5f7;
  --text: var(--black);
  --text-muted: #555c63; /* 7:1 on white */
  --bg: #ffffff;
  --radius: 0.4rem;
  --max-width: 68rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

/* Links: dark text with a red underline; red on hover. */
a {
  color: var(--text);
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--red-dark);
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem);
  font-weight: 800;
}

h2 {
  font-size: 1.5rem;
  font-weight: 750;
}

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

/* ID selector so `.container`'s padding shorthand does not reset it. */
#main {
  flex: 1;
  padding-block: 2rem 4rem;
}

/* --- Accessibility helpers ------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  z-index: 10;
}

/* --- Circuit line (from the logo): grey track ending in a red tab ------ */

.circuit-line {
  position: relative;
  height: 12px;
  margin: 0;
  border: 0;
  background: linear-gradient(var(--grey), var(--grey)) left center / calc(100% - 4.5rem) 3px
    no-repeat;
}

.circuit-line::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 0;
  width: 3.5rem;
  height: 100%;
  background: var(--red);
  transform: skewX(-35deg);
}

/* --- Header ----------------------------------------------------------- */

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

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand img {
  height: 56px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-name .v {
  color: var(--red);
}

.brand-tagline {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-toggle {
  display: none;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: block;
  padding-block: 0.4rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.main-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--grey);
}

.main-nav a[aria-current="page"] {
  border-bottom-color: var(--red);
}

.main-nav .external::after {
  content: " ↗";
  color: var(--red);
}

/* Mobile: navigation collapses behind a menu button (only with JS; without
 * JS the full navigation stays visible). */
@media (max-width: 52rem) {
  .header-inner {
    gap: 0.75rem 1rem;
  }

  .brand {
    gap: 0.5rem;
  }

  .brand img {
    height: 44px;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .brand-tagline {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
  }

  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    font: inherit;
    font-weight: 700;
    color: var(--text);
    background: var(--bg);
    border: 2px solid var(--black);
    border-radius: var(--radius);
    cursor: pointer;
  }

  .js .nav-toggle[aria-expanded="true"] {
    background: var(--black);
    color: #fff;
  }

  .main-nav {
    width: 100%;
  }

  .js .main-nav:not(.is-open) {
    display: none;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--grey-light);
  }

  .main-nav a[aria-current="page"] {
    border-bottom: 1px solid var(--grey-light);
    border-left: 4px solid var(--red);
    padding-left: 0.6rem;
  }
}

/* --- Buttons ---------------------------------------------------------- */

.button {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  color: #fff;
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.button-secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--black);
}

.button-secondary:hover {
  color: #fff;
  background: var(--black);
  border-color: var(--black);
}

.teaser .button-secondary {
  color: #fff;
  border-color: #fff;
}

.teaser .button-secondary:hover {
  color: var(--black);
  background: #fff;
}

/* --- Sections --------------------------------------------------------- */

.section {
  margin-block: 3rem;
}

/* Section title with a red tab, echoing the logo. */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.section-title::before {
  content: "";
  flex: none;
  width: 1.4rem;
  height: 0.7rem;
  background: var(--red);
  transform: skewX(-35deg);
}

.section-more {
  margin-top: 1rem;
  font-weight: 600;
}

/* --- Home hero -------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 32rem) 1fr;
  align-items: center;
  gap: 2rem 3.5rem;
  padding-block: 1rem 2rem;
}

.hero-photo {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  /* Red tab in the corner, echoing the logo. */
  box-shadow: -0.6rem 0.6rem 0 var(--red);
}

.hero h1 {
  margin-top: 0;
}

.lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 38rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 44rem) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo {
    box-shadow: -0.4rem 0.4rem 0 var(--red);
  }

  .lead {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }
}

/* GearsBot teaser */
.teaser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.75rem 2rem;
  color: #fff;
  background: var(--black);
  border-radius: var(--radius);
  border-left: 6px solid var(--red);
}

.teaser h2 {
  margin: 0 0 0.25rem;
}

.teaser p {
  margin: 0;
  color: #d6d9dc;
}

/* --- Events ----------------------------------------------------------- */

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

.event {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0 1.25rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--grey-light);
}

.event-badge {
  grid-row: span 5;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0;
  color: #fff;
  background: var(--black);
  border-radius: var(--radius);
  border-bottom: 4px solid var(--red);
  line-height: 1.1;
}

.event-badge-day {
  font-size: 1.6rem;
  font-weight: 800;
}

.event-badge-month {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.event p {
  margin: 0.15rem 0;
}

.event-date {
  font-weight: 600;
  color: var(--text-muted);
}

.event-title {
  margin: 0.1rem 0;
  font-size: 1.2rem;
}

.event-location {
  color: var(--text-muted);
}

/* --- Posts ------------------------------------------------------------ */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.5rem;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}

.post-card:hover {
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.08);
  transform: translateY(-2px);
}

.post-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Cards without an image get a placeholder in brand colours. */
.post-card-noimage {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(115deg, transparent 0 62%, var(--red) 62% 70%, transparent 70%),
    var(--black);
}

.post-card-body {
  padding: 1rem 1.1rem 1.25rem;
}

.post-card h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.15rem;
}

/* The whole card is clickable via the title link. */
.post-card h3 a {
  text-decoration: none;
}

.post-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card p {
  margin: 0;
  color: var(--text-muted);
}

.post-meta {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.post {
  max-width: 44rem;
}

.post-image {
  display: block;
  margin-block: 1.5rem;
  border-radius: var(--radius);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 2.5rem;
  font-weight: 600;
}

/* Rich text (.prose) lives in prose.css, shared with the admin editor preview. */

/* --- Pages ------------------------------------------------------------ */

.page {
  max-width: 44rem;
}

/* Decorative title image of the fixed pages and the agenda (core/_banner.html). */
.page-banner img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Keep the Bee-Bot's face in the crop. */
.page-banner-ueber-uns img {
  object-position: 50% 80%;
}

.page-banner + .page h1,
.page-banner + h1 {
  margin-top: 1.5rem;
}

@media (max-width: 44rem) {
  .page-banner img {
    aspect-ratio: 2 / 1;
  }
}

/* "Mitmachen": fixed topics with images (pages/topics.py). */
.section-lead {
  margin-top: -0.5rem;
  color: var(--text-muted);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.5rem;
}

.topic {
  background: var(--bg);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.topic img {
  display: block;
  width: 100%;
  aspect-ratio: 7 / 4;
  object-fit: cover;
}

.topic-body {
  padding: 1rem 1.1rem 1.25rem;
}

.topic h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.15rem;
}

.topic p {
  margin: 0;
}

/* --- Documents -------------------------------------------------------- */

.document-category {
  margin-bottom: 2.5rem;
}

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

.document {
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--grey-light);
}

.document a {
  font-weight: 700;
}

.document-meta {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--grey-lighter);
  border-radius: 1rem;
}

.document p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

/* --- Messages ---------------------------------------------------------- */

.message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--grey-lighter);
  border-left: 5px solid var(--black);
}

.message-success {
  background: #eaf6ee;
  border-left-color: #1f7a3d;
}

.message-success::before {
  content: "✓ ";
  font-weight: 800;
  color: #1f7a3d;
}

/* --- Forms ------------------------------------------------------------- */

.contact-form {
  max-width: 36rem;
  margin-top: 2.5rem;
}

.form-field {
  margin-bottom: 1.1rem;
}

.form-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--grey);
  border-radius: var(--radius);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--black);
  outline: 3px solid var(--red);
  outline-offset: 1px;
}

/* Errors: icon and background, not colour alone (red is the brand colour). */
.form-errors,
.field-errors {
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: #8a0a0a;
  background: #fdecec;
  border-radius: var(--radius);
}

.form-errors::before,
.field-errors::before {
  content: "⚠ ";
}

.form-errors ul,
.field-errors ul {
  display: inline;
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-errors li,
.field-errors li {
  display: inline;
}

.form-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Honeypot field: hidden from humans, still in the DOM for bots. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Footer ------------------------------------------------------------ */

.site-footer {
  padding-top: 1.5rem;
  color: #d6d9dc;
  background: var(--black);
  font-size: 0.95rem;
}

.site-footer .circuit-line {
  margin-bottom: 2.5rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.site-footer h2 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}

.site-footer p {
  margin: 0.5rem 0 0;
}

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

.site-footer li {
  margin-bottom: 0.35rem;
}

.site-footer a {
  color: #fff;
}

.site-footer a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.footer-brand {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.footer-brand .v {
  color: var(--red);
}

.footer-bottom {
  padding-block: 1rem 1.5rem;
  border-top: 1px solid #333;
  font-size: 0.85rem;
  color: #aab0b6;
}

@media (max-width: 44rem) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}
