/* Linköpings Suzukiförening — shared styles */
/*
Version number in filename is a cache-busting mechanism.
See README.md for details.
*/

:root {
  --accent: #82403e;
  --text: #222;
  --muted: #555;
  --extra-muted: #aaa;
  --surface: #fff;
  --border: rgba(60, 60, 60, 0.55);
  --max-width: 830px;
  --tag-pill-text: #9b9b9b;
}

/* Global reset and box-sizing for easier layout. */

* {
  box-sizing: border-box;
}

/* Header, navigation and footer styles. */

.hero,
footer {
  background:
    repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 8px),
    linear-gradient(160deg, #9c5250 0%, #82403e 55%, #6a3230 100%);
  color: #fff;
}

footer {
  padding: 36px 0 22px;
}

footer a {
  color: #fff;
  text-decoration: underline;
}

footer a:hover {
  color: #aaa;
}

.hero {
  padding: 14px 0 0;
}

.hero-image,
.footer-image {
  width: 100%;
  object-fit: cover;
}

.navigation {
  margin: 12px 0 0;
}

.navigation ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 0;
}

.navigation a {
  display: block;
  padding: 12px 22px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

a[aria-current="page"] {
  background-color: #fff4;
}

.navigation a:hover,
.navigation a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .navigation ul {
    flex-wrap: wrap;
  }

  .navigation a {
    padding: 10px 14px;
    font-size: 0.97rem;
  }
}

/* Main layout elements. container for centering content and setting max width. */

.container,
section {
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.container {
  padding: 0px 12px;
}

section {
  border: 1px solid rgba(60, 60, 60, 0.12);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  padding: 20px;
  padding-bottom: 40px;
  margin: 20px auto;
}

/* Typography and spacing for content */

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  padding: 20px 0;
}

img {
  display: block;
  width: min(100%, var(--max-width));
  height: auto;
  /* Center images by default. */
  margin: auto;
}

a {
  color: #64A49D;
  text-decoration: none;
}

h1 {
  margin: 2.4rem 0 1.0rem;
  font-size: clamp(2rem, 3.6vw, 2.3rem);
  text-align: center;
}

h2 {
  margin: 2.4rem 0 0.0rem;
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
}

h3 {
  margin: 2.0rem 0 0.0rem;
  font-weight: 600;
  color: #444;
}

p,
li,
h3 {
  font-size: clamp(1.0rem, 2.0vw, 1.2rem);
}

p,
ul,
ol {
  margin: 0.5rem 0 1rem;
}

ul {
  padding-left: 1.5rem;
}

ul.tags {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

ul.tags li {
  margin: 0;
  padding: 0.22rem 0.68rem;
  border: 1px solid color-mix(in srgb, var(--tag-pill-text) 42%, #fff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-pill-text) 12%, #fff);
  color: var(--tag-pill-text);
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

ol {
  padding-left: 1.8rem;
}

/* Event list styles */

dl.event-list {
  margin: 0;
  padding: 0;
}

dl.event-list dt {
  font-weight: bold;
  margin-top: 1.5rem;
  font-size: 1.15rem;
  color: var(--extra-muted);
}

dl.event-list dd {
  margin: 0 0 1rem 2rem;
}

/* Flexbox layout for columns */
.columns {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Sizes for images in content, based on 6 columns with 2rem total gap */
.size-2,
.size-3,
.size-4,
.size-5 {
  display: block;
  height: auto;
}

.size-1 {
  width: min(100%, calc(var(--max-width) / 6 * 1 - 2rem));
}

.size-2 {
  width: min(100%, calc(var(--max-width) / 6 * 2 - 2rem));
}

.size-3 {
  width: min(100%, calc(var(--max-width) / 6 * 3 - 2rem));
}

.size-4 {
  width: min(100%, calc(var(--max-width) / 6 * 4 - 2rem));
}

.size-5 {
  width: min(100%, calc(var(--max-width) / 6 * 5 - 2rem));
}

/* Crop box for images. Use img style "margin" to adjust the visible area. */

div.crop-box {
  overflow: hidden;
}

/* Notes, author credits and other details. */

.note {
  font-style: italic;
  text-align: center;
}

.author {
  font-style: italic;
  color: var(--extra-muted);
}

.image-text {
  font-size: 0.9rem;
  font-style: italic;
  margin: 0 0 0;
}

.callout {
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #ffffff);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, #ffffff);
}

/* Styles for archive filter section */

.archive-filter {
  padding-top: 22px;
  padding-bottom: 18px;
}

.archive-filter p {
  font-size: 0.95rem;
}

#archive-filter-status {
  color: var(--muted);
}

#archive-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag-filter-button {
  margin: 0;
  padding: 0.32rem 0.82rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #ffffff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, #ffffff);
  color: color-mix(in srgb, var(--accent) 80%, #111111);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-filter-button:hover {
  background: color-mix(in srgb, var(--accent) 20%, #ffffff);
}

.tag-filter-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, #ffffff);
  outline-offset: 2px;
}

.tag-filter-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.tag-filter-clear {
  margin: 0;
  padding: 0.32rem 0.82rem;
  border: 1px solid color-mix(in srgb, var(--muted) 40%, #ffffff);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-filter-clear:hover {
  background: color-mix(in srgb, var(--muted) 12%, #ffffff);
}

.tag-filter-clear:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--muted) 60%, #ffffff);
  outline-offset: 2px;
}

.is-hidden-by-filter {
  display: none;
}

/* Photo gallery thumbnails */

.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.5rem 0;
}

.photo-gallery img.gallery-thumb {
  height: 150px;
  width: auto;
  margin: 0;
  object-fit: cover;
  border-radius: 3px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.photo-gallery img.gallery-thumb:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

/* Lightbox overlay */

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#lightbox[hidden] {
  display: none;
}

#lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0 56px;
  max-width: 100vw;
}

#lb-img {
  width: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 2px;
  margin: 0;
}

#lb-caption {
  color: #ddd;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
  margin-top: 0.6rem;
  max-width: 700px;
}

/* Lightbox buttons */

#lb-close,
#lb-prev,
#lb-next {
  position: fixed;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: opacity 0.15s ease;
  opacity: 0.7;
}

#lb-close:hover,
#lb-prev:hover,
#lb-next:hover {
  opacity: 1;
}

#lb-close {
  top: 16px;
  right: 20px;
  font-size: 1.6rem;
}

#lb-prev,
#lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.5rem;
}

#lb-prev {
  left: 8px;
}

#lb-next {
  right: 8px;
}

#lb-prev:disabled,
#lb-next:disabled {
  opacity: 0.2;
  cursor: default;
}

/* Lightbox download icon */

#lb-download {
  position: fixed;
  bottom: 16px;
  right: 20px;
  color: #fff;
  opacity: 0.35;
  transition: opacity 0.15s ease;
  line-height: 0;
}

#lb-download:hover {
  opacity: 0.85;
}

#lb-download svg {
  width: 22px;
  height: 22px;
  display: block;
}