/* ============================================================
   WordPress integration + blog templates
   ============================================================ */

/* Admin bar offsets for the sticky header */
body.admin-bar .site-header {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* wp_nav_menu outputs a list; the design expects direct flex links */
.main-nav ul,
.main-nav li {
  display: contents;
}

/* Core screen reader utility */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: auto;
  height: auto;
  padding: 12px 24px;
  margin: 0;
  overflow: visible;
  clip: auto;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* Archive and blog page heads */
.page-head {
  max-width: 720px;
  margin-bottom: 32px;
}
.page-head h1 {
  margin-top: 12px;
}
.page-head .section-lead {
  margin-top: 12px;
}

.page-archive {
  padding-block: 48px 96px;
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 32px;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-thumb {
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  overflow: hidden;
}
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}
.post-card:hover .post-thumb img {
  transform: scale(1.03);
}

.post-card-body {
  padding-top: 16px;
}
.post-card h2 {
  margin-top: 8px;
  font-size: 1.25rem;
  line-height: 1.25;
}
.post-card h2 a:hover {
  color: var(--brand);
}
.post-card p {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.post-card .ghost-link {
  margin-top: 16px;
}
.post-meta {
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

/* Single post and page */
.single-post {
  padding-block: 48px 96px;
}
.post-hero {
  max-width: 760px;
}
.post-hero h1 {
  margin-top: 16px;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3rem);
}
.post-hero-media {
  max-width: 960px;
  margin: 32px auto 0;
}
.post-hero-media img {
  width: 100%;
  border-radius: var(--r-lg);
}
.post-content {
  max-width: 68ch;
  margin: 40px auto 0;
}
.post-content > * + * {
  margin-top: 20px;
}
.post-content h2 {
  margin-top: 40px;
  font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2rem);
}
.post-content h3 {
  margin-top: 32px;
  font-size: clamp(1.125rem, 1rem + 0.55vw, 1.375rem);
}
.post-content ul,
.post-content ol {
  margin: 16px 0;
  padding-left: 1.4em;
}
.post-content ul {
  list-style: disc;
}
.post-content ol {
  list-style: decimal;
}
.post-content li + li {
  margin-top: 6px;
}
.post-content a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-content blockquote {
  margin: 24px 0;
  padding-left: 20px;
  border-left: 3px solid var(--brand);
  color: var(--ink-muted);
}
.post-content img,
.post-content figure img {
  border-radius: var(--r-md);
}
.post-content figure {
  margin: 24px 0;
}
.post-content figcaption {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  text-align: center;
}

/* Pagination */
.navigation.pagination,
.page-links {
  margin-top: 48px;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.nav-links .page-numbers:hover {
  background: var(--brand-tint);
  color: var(--brand);
}
.nav-links .page-numbers.current {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

/* WordPress editor alignment helpers */
.entry-content .alignwide {
  width: min(960px, 100%);
  margin-inline: auto;
}
.entry-content .alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}
.entry-content .alignleft {
  float: left;
  margin: 8px 24px 16px 0;
}
.entry-content .alignright {
  float: right;
  margin: 8px 0 16px 24px;
}

/* Ensure tour archive links keep the design nav layout on tablets */
@media (max-width: 767px) {
  .post-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .page-archive {
    padding-block: 32px 64px;
  }
}
