/* Landing page only. Out of the theme: a theme edit re-renders every page. */

#title-block-header .title {
  text-align: center;
  font-size: 2.75rem;
}

/* Hero banner on the landing page, in the navy of the card art */
.hero {
  background:
    radial-gradient(circle at 85% 0%, rgba(47, 146, 210, 0.35), transparent 55%),
    linear-gradient(135deg, #0a2846, #15558d);
  color: #e8f0f8;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(10, 40, 70, 0.18);
  padding: 1.75rem 2rem;
  margin: 0 auto 0.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: center;
}
.hero p {
  margin: 0 auto 1rem;
}
.hero a {
  color: #ffd24a;
  text-decoration-color: rgba(255, 210, 74, 0.5);
}

/* The interfaces read as a list of three, not as three links buried in a */
/* sentence, so they get the same pill shape as the page switcher. */
.hero .hero-ifaces p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto;
}
.hero .hero-ifaces a {
  white-space: nowrap;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.hero .hero-ifaces a:hover {
  background: #fff;
  border-color: #fff;
  color: var(--bs-primary);
}
@media (max-width: 575.98px) {
  .hero {
    padding: 1.25rem 1rem;
    font-size: 1rem;
  }
}

/* ---- Gallery tag filters ---- */
/* One row per tag key. Nothing is selected initially (everything shows), and a */
/* second click on a button clears it, so there is no "All". */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.gallery-filters + .gallery-filters {
  margin-top: 0.5rem;
}
.gallery-filters .filter-label {
  min-width: 5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
}
.gallery-empty {
  margin-top: 1.5rem;
  color: var(--bs-secondary-color);
  font-style: italic;
}
.tag-btn {
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  background: var(--bs-body-bg);
  padding: 0.3rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--bs-secondary-color);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tag-btn:hover {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}
.tag-btn.active {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

/* ---- Gallery grid ---- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.gallery .card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.6rem;
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.gallery .card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.gallery .card .thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a3352, #2c6090, #4a88b8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  text-decoration: none;
}

/* ---- Card images ---- */
/* Out of flow, or the artwork's own ratio overrides the thumb's 16/9. */
.gallery .card .thumb {
  position: relative;
  overflow: hidden;
}
.gallery .card .thumb svg,
.gallery .card .thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.gallery .card .thumb img {
  object-fit: cover;
}

/* Runs only while hovered or focused, and from the start each time: dropping the
   name ends the animation, so every element falls back to its base style — the
   unsolved one. Pausing instead left the card frozen mid-solve. Scoped to
   devices that can hover, since otherwise nothing would ever start it. */
@media (hover: hover) {
  .gallery .card:not(:hover):not(:focus-within) .thumb svg * {
    animation-name: none;
  }
}

/* Eases the way back rather than snapping to it. A running animation outranks a
   transition, so this only applies once the animation is dropped. */
.gallery .card .thumb svg * {
  transition-property: transform, opacity, fill, stroke-dasharray, stroke-dashoffset;
  transition-duration: 1.1s;
  transition-timing-function: ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .gallery .card .thumb svg * {
    animation: none;
  }
}

.gallery .card .body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.gallery .card .body h3 {
  margin: 0;
  font-size: 1.15rem;
}
.gallery .card .body h3 a {
  color: inherit;
  text-decoration: none;
}
.gallery .card .body h3 a:hover {
  text-decoration: underline;
}
.gallery .card .body p {
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: 0.92rem;
  flex: 1;
}
.gallery .card .langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.gallery .card .lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.7rem 0.15rem 0.5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  text-decoration: none;
}
/* The mark carries its own colours, so it stays legible on the pale badge. */
.gallery .card .lang-badge .lang-icon {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
}


/* Large-card mode: the toolbar switch toggles `.is-large` on the gallery, */
/* widening the grid tracks so fewer, bigger cards show per row. */
.gallery.is-large {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.75rem;
}
.gallery.is-large .card .thumb {
  font-size: 3.5rem;
}
.gallery.is-large .card .body {
  padding: 1.3rem 1.5rem 1.5rem;
}
.gallery.is-large .card .body h3 {
  font-size: 1.4rem;
}
.gallery.is-large .card .body p {
  font-size: 1rem;
}

/* ---- Gallery card-size switch ---- */
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: -0.5rem;
}
.gallery-size-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
  user-select: none;
}
.gallery-size-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.gallery-size-switch .size-icon {
  display: inline-flex;
  align-items: center;
}
.gallery-size-switch .track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--bs-border-color);
  transition: background 0.15s ease;
}
.gallery-size-switch .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.gallery-size-switch input:checked + .track {
  background: #4682b4;
}
.gallery-size-switch input:checked + .track .thumb {
  transform: translateX(18px);
}
