/*
 * WordPress-required styles.
 *
 * The Tailwind build (main.css) only contains the classes used by the theme's
 * own markup. Everything WordPress itself outputs — alignments, captions,
 * galleries, comments, widgets, pagination, accessibility helpers — lives here.
 */

/* ---------------------------------------------------------------- a11y --- */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--vpf-surface, #fff);
  border-radius: 6px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, .12);
  clip: auto !important;
  clip-path: none;
  color: var(--vpf-ink, #0b1020);
  display: block;
  font-size: 14px;
  font-weight: 700;
  height: auto;
  left: 8px;
  line-height: normal;
  padding: 14px 20px;
  text-decoration: none;
  top: 8px;
  width: auto;
  z-index: 100000;
}

/* Skip link target should not be hidden behind the sticky header. */
:target {
  scroll-margin-top: 96px;
}

/* --------------------------------------------------------- alignments --- */

.alignnone {
  margin: 1.5em 0;
}

.aligncenter,
div.aligncenter {
  display: block;
  margin: 1.5em auto;
}

.alignleft {
  float: left;
  margin: .5em 1.5em 1em 0;
}

.alignright {
  float: right;
  margin: .5em 0 1em 1.5em;
}

/*
 * No negative margins here, on purpose.
 *
 * These rules used to pull .alignwide / .alignfull outwards with
 * `calc(50% - 50vw)`. That formula is only correct when the parent is centred
 * in the viewport — inside a left-aligned reading column it pushed the block
 * hundreds of pixels off the left edge of the screen. It also used 100vw,
 * which includes the vertical scrollbar and so overflowed by ~15px.
 *
 * Width is granted by the container instead (see the prose rules in
 * input.css), and WordPress's own layout CSS handles alignment inside block
 * layouts.
 */
.alignwide,
.alignfull {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
}

@media (max-width: 640px) {
  .alignleft,
  .alignright {
    float: none;
    display: block;
    margin: 1.5em auto;
  }
}

/* ------------------------------------------------- captions & gallery --- */

.wp-caption {
  margin-bottom: 1.5em;
  max-width: 100%;
}

.wp-caption img[class*="wp-image-"] {
  display: block;
  margin: 0 auto;
}

.wp-caption-text,
.gallery-caption,
figcaption {
  color: var(--vpf-muted, #69778a);
  font-size: 14px;
  line-height: 1.5;
  margin: .6em 0 0;
  text-align: center;
}

.gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--vpf-gallery-cols, 3), minmax(0, 1fr));
  margin: 0 0 1.5em;
}

.gallery-columns-1 { --vpf-gallery-cols: 1; }
.gallery-columns-2 { --vpf-gallery-cols: 2; }
.gallery-columns-4 { --vpf-gallery-cols: 4; }
.gallery-columns-5 { --vpf-gallery-cols: 5; }
.gallery-columns-6 { --vpf-gallery-cols: 6; }

.gallery-item img {
  border-radius: 10px;
  display: block;
  height: auto;
  width: 100%;
}

/* --------------------------------------------------------- post state --- */

.sticky .vpf-card-title::before {
  content: "\2605";
  color: var(--vpf-primary, #635bff);
  margin-right: .4em;
}

.bypostauthor > .vpf-comment-body {
  border-color: var(--vpf-primary, #635bff);
}

.post-password-form input[type="password"] {
  border: 1px solid var(--vpf-line, #e6eaf2);
  border-radius: 10px;
  padding: 10px 12px;
}

/* ---------------------------------------------------------- searchform --- */

.vpf-searchform {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vpf-searchform-input {
  flex: 1 1 240px;
  border: 1px solid var(--vpf-line, #e6eaf2);
  border-radius: 10px;
  background: var(--vpf-surface, #fff);
  color: var(--vpf-ink, #0b1020);
  font: inherit;
  padding: 11px 14px;
}

.vpf-searchform-input:focus-visible,
.vpf-comments input:focus-visible,
.vpf-comments textarea:focus-visible {
  outline: 2px solid var(--vpf-primary, #635bff);
  outline-offset: 2px;
}

.vpf-searchform-wrap {
  margin: 0 0 32px;
  max-width: 560px;
}

.vpf-search-empty-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ---------------------------------------------------------- pagination --- */

.pagination,
.comments-pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 40px 0 0;
}

.pagination .page-numbers,
.comments-pagination a,
.comments-pagination span {
  border: 1px solid var(--vpf-line, #e6eaf2);
  border-radius: 8px;
  color: var(--vpf-ink, #0b1020);
  display: inline-block;
  font-weight: 600;
  line-height: 1;
  padding: 10px 14px;
  text-decoration: none;
}

.pagination .page-numbers.current {
  background: var(--vpf-primary, #635bff);
  border-color: var(--vpf-primary, #635bff);
  color: #fff;
}

.pagination .page-numbers:hover:not(.current) {
  border-color: var(--vpf-primary, #635bff);
}

/* ----------------------------------------------------------- comments --- */

.vpf-comments {
  border-top: 1px solid var(--vpf-line, #e6eaf2);
  margin-top: 56px;
  padding-top: 40px;
}

.vpf-comments-title {
  font-size: 24px;
  letter-spacing: -.02em;
  margin: 0 0 24px;
}

.vpf-comment-list,
.vpf-comment-list .children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vpf-comment-list .children {
  margin-left: 28px;
  padding-left: 20px;
  border-left: 2px solid var(--vpf-line, #e6eaf2);
}

.vpf-comment-list li {
  margin: 0 0 20px;
}

.vpf-comment-list .comment-body {
  background: var(--vpf-cloud, #f7f9fc);
  border: 1px solid var(--vpf-line, #e6eaf2);
  border-radius: 14px;
  padding: 20px;
}

.vpf-comment-list .comment-author img {
  border-radius: 999px;
  margin-right: 10px;
  vertical-align: middle;
}

.vpf-comment-list .comment-meta {
  color: var(--vpf-muted, #69778a);
  font-size: 14px;
  margin-bottom: 10px;
}

.vpf-comments-closed {
  color: var(--vpf-muted, #69778a);
  font-style: italic;
}

.comment-form {
  display: grid;
  gap: 14px;
  margin-top: 32px;
  max-width: 720px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  border: 1px solid var(--vpf-line, #e6eaf2);
  border-radius: 10px;
  font: inherit;
  padding: 11px 14px;
  width: 100%;
}

.comment-form textarea {
  min-height: 150px;
  resize: vertical;
}

/* ------------------------------------------------------------ widgets --- */

.vpf-widget {
  margin: 0 0 32px;
}

.vpf-widget-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.vpf-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vpf-widget li + li {
  margin-top: 8px;
}

.vpf-widget a {
  color: inherit;
  text-decoration: none;
}

.vpf-widget a:hover {
  text-decoration: underline;
}

.vpf-sidebar {
  flex: 0 0 300px;
  max-width: 100%;
}

/* --------------------------------------------------------- embeds/img --- */

.wp-block-embed iframe,
.wp-block-embed video,
embed,
iframe,
object,
video {
  max-width: 100%;
}

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