:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1f1b16;
  --muted: #5c554c;
  --accent: #8b7355;
  --border: #e6e0d8;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(31, 27, 22, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #6d5a43;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 8px;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px;
}

.site-header .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.nav-toggle {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.site-nav {
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.site-nav.is-open {
  display: flex;
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: auto;
    flex: 1;
    margin-left: 24px;
  }
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
}

.nav-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.filter-form label {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-form select {
  min-width: 8rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
}

.filter-form button {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.filter-form button:hover {
  filter: brightness(1.05);
}

.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: grid;
  gap: 24px;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.content {
  min-width: 0;
}

/* Avoid scroll jumping when large images load inside the article */
.content--article {
  overflow-anchor: none;
}

.page-head h1,
.article-head h1 {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  line-height: 1.2;
  margin: 0 0 8px;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 16px;
}

.article-meta__by {
  font-weight: 500;
}

.article-author {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-author__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.article-author__text {
  min-width: 0;
}

.article-author__line {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.article-author__cred {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
}

.article-author__bio {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: var(--muted);
}

.card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-media {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 14px 16px 18px;
}

.card-meta {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
}

.card-excerpt {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.pagination a {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.pagination a.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.sidebar .widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.widget-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mini-card {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.mini-list li:first-child .mini-card {
  border-top: none;
  padding-top: 0;
}

.mini-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li {
  margin-bottom: 6px;
}

.link-list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.article-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 8px;
}

.hero-figure {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.prose {
  font-size: 1.05rem;
}

.prose p {
  margin: 0 0 1em;
}

.gallery {
  margin-top: 32px;
}

.gallery-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.gallery-item {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.gallery-item figcaption {
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.gallery-slider {
  margin: 20px 0 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 20px;
  overflow-anchor: none;
  scroll-margin-top: 88px;
}

.gallery-slider__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.gallery-slider__arrow {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.gallery-slider__arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gallery-slider__arrow.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.gallery-slider__counter {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}

.gallery-slider__viewport {
  overflow: hidden;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  touch-action: pan-y;
}

.gallery-slider__track {
  --slide-count: 1;
  --slide-index: 0;
  display: flex;
  flex-direction: row;
  width: calc(var(--slide-count) * 100%);
  transform: translateX(calc(-1 * var(--slide-index) * 100% / var(--slide-count)));
  transition: transform 0.38s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.gallery-slider__slide {
  flex: 0 0 calc(100% / var(--slide-count));
  box-sizing: border-box;
}

.gallery-slider__figure {
  margin: 0;
  text-align: center;
}

.gallery-slider__figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.gallery-slider__caption-live {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-pagenavi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.gallery-pagenavi__link {
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.gallery-pagenavi__link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gallery-pagenavi__link.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 16px 32px;
  margin-top: 24px;
}

.site-footer .inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer nav {
  display: flex;
  gap: 16px;
}

.site-footer a {
  color: var(--muted);
}
