/* Author Posts Widget Styles */

.xeo-author-posts-wrapper {
  width: 100%;
}

.xeo-author-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Post card */
.xeo-post-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Featured image with fixed aspect ratio 768/394 */
.xeo-post-image {
  width: 100%;
  line-height: 0;
  position: relative;
  aspect-ratio: 768 / 394;
  overflow: hidden;
}

.xeo-post-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.xeo-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease-in-out;
}

.xeo-post-item:hover .xeo-post-image img,
.xeo-post-item:focus-within .xeo-post-image img{
  transform: scale(1.05);
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
  .xeo-post-image {
    padding-top: 51.302083%; /* 394 / 768 * 100% */
  }
  .xeo-post-image a,
  .xeo-post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* Content area */
.xeo-post-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

/* Categories as orange pills with blue text */
.xeo-post-categories {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.xeo-post-categories a {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  background: #E4863C;
  color: #0F263D !important;
  border: none;
  border-radius: 999px;
  position: relative;
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease, text-decoration-color .25s ease;
}

.xeo-post-categories a:hover,
.xeo-post-categories a:focus {
  text-decoration: underline !important;
  outline: 2px solid #E4863C !important;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
  .xeo-post-categories a:focus,
  .xeo-post-categories a:hover {
    outline: 2px solid CanvasText;
    outline-offset: 2px;
  }
}

/* Title */
.xeo-post-title {
  margin: 0 0 auto;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.xeo-post-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease-in-out;
}

.xeo-post-title a:hover,
.xeo-post-title a:focus {
  text-decoration: underline !important;
  color: inherit !important;
}

.xeo-post-title a:focus {
  outline: 2px solid !important;
  outline-offset: 2px !important;
}

/* Meta row */
.xeo-post-meta-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.xeo-author-avatar {
  flex-shrink: 0;
}

.xeo-author-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
}

.xeo-post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: #646464;
}

.xeo-post-author {
  font-weight: 600;
  color: #0F263D;
}

.xeo-post-date {
  font-size: 13px;
  color: #646464;
}

/* Pagination (nav > ul > li > a) */
.xeo-author-pagination {
  display: block;
  margin-top: 35px;
}

.xeo-author-pagination ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.xeo-author-pagination li {
  margin: 0;
  padding: 0;
}

.xeo-author-pagination a,
.xeo-author-pagination .xeo-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  color: #0F263D;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  line-height: 1;
}

.xeo-author-pagination a:hover,
.xeo-author-pagination a:focus {
  border-color: #E4863C;
  color: #E4863C;
}

.xeo-author-pagination .xeo-page-num {
  border-radius: 4px;
}

.xeo-author-pagination .xeo-page-num.current {
  pointer-events: none;
  background-color: #E4863C;
  color: #fff;
  border-color: #E4863C;
}

.xeo-author-pagination .xeo-page-num.current:hover,
.xeo-author-pagination .xeo-page-num.current:focus {
  background-color: #E4863C;
}

.xeo-author-pagination .xeo-page-prev,
.xeo-author-pagination .xeo-page-next {
  font-weight: 600;
}

.xeo-author-pagination .xeo-page-prev:hover,
.xeo-author-pagination .xeo-page-prev:focus,
.xeo-author-pagination .xeo-page-next:hover,
.xeo-author-pagination .xeo-page-next:focus {
  background: #0F263D;
  color: #fff;
  border-color: #0F263D;
}

.xeo-author-pagination .xeo-page-ellipsis {
  pointer-events: none;
  color: #646464;
  border: none;
  background: transparent;
}

/* Responsive */
@media (max-width: 1024px) {
  .xeo-author-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .xeo-author-posts-grid {
    grid-template-columns: 1fr;
  }
}
