/**
 * HMS Custom Plugin Styles
 * 
 * @package HMS_Custom
 * @since 1.0.2
 */

/* =============================================================================
   Global Button Styles
   ========================================================================== */

.hms-button__pill {
    display: inline-block;
    padding: 0.85rem 3.5rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.2;
    background-color: var(--accent) !important;
    color: #ffffff;
    transition: background-color 0.28s ease, transform 0.28s ease;
}

.hms-button__pill:hover {
    background-color: var(--global-color-10);
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* =============================================================================
   Latest Posts Shortcode - Vertical Layout (Your Original Working Design)
   ========================================================================== */

.hms-latest-posts {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin: 40px 0;
}

/* Single post item (vertical card) */
.hms-post-item {
    display: grid;
    grid-template-columns: 400px 400px;
    width: 800px;
    max-width: 100%;
    gap: 0;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.hms-post-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Thumbnail wrapper */
.hms-post-thumbnail {
    position: relative;
    background: #1a1a1a;
    overflow: hidden;
    width: 400px;
    height: 100%;
    min-height: 300px;
}

/* Dark overlay on image */
.hms-post-thumbnail::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(
        circle at center,
        rgba(0,0,0,0) 35%,
        rgba(0,0,0,0.55) 70%,
        rgba(0,0,0,0.80) 100%
    );
}

.hms-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 0;
}

/* Read More button overlay on image */
.hms-post-link {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.hms-read-more {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hms-read-more:hover {
    background: #fff;
    color: #1a1a1a;
}

.hms-read-more::after {
    content: '\203A';
    font-size: 20px;
    font-weight: bold;
}

/* Hide screen reader text */
.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-width: 0;
}

/* Content area (red background) */
.hms-post-content {
    width: 400px;
    padding: 40px;
    background: #AE2024;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Categories above title */
.hms-post-categories {
    font-size: 14px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    opacity: 0.9;
    font-weight: 500;
}

/* Post title */
.hms-post-title {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff !important;
}

.hms-post-title,
.hms-post-title * {
    color: #fff !important;
}

.hms-post-title a {
    color: #fff !important;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.hms-post-title a:hover {
    color: #fff !important;
    opacity: 0.8;
}

.hms-post-title::after,
.hms-post-title::before {
    color: #fff !important;
}

/* Excerpt */
.hms-post-excerpt {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.95;
}

/* Meta information (author, date) - at bottom */
.hms-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    opacity: 0.9;
}

.hms-post-author {
    font-weight: 500;
}

.hms-post-author::after {
    content: ' \00B7 ';
    margin: 0 4px;
}

.hms-post-date {
    font-weight: 400;
}

/* No posts message */
.hms-no-posts {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* View All Button Wrapper */
.hms-view-all-wrapper {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

/* Vertical layout responsive */
@media (max-width: 820px) {
    .hms-post-item {
        grid-template-columns: 1fr;
        width: 100%;
    }
    
    .hms-post-thumbnail,
    .hms-post-content {
        width: 100%;
    }
    
    .hms-post-thumbnail {
        min-height: 250px;
    }
    
    .hms-post-content {
        padding: 30px 20px;
    }
    
    .hms-post-title {
        font-size: 28px;
    }
}

/* =============================================================================
   Horizontal/Grid Layout Styles
   ========================================================================== */

.hms-latest-posts--horizontal {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin: 40px 0;
}

/* Horizontal post card */
.hms-post-item-horizontal {
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.hms-post-item-horizontal:hover {
    /*box-shadow: 0 8px 24px rgba(0,0,0,0.15);*/
}

/* Thumbnail for horizontal layout */
.hms-post-thumbnail-horizontal {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #f5f5f5;
}

.hms-post-thumbnail-horizontal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.hms-post-item-horizontal:hover .hms-post-thumbnail-horizontal img {
    transform: scale(1.05);
}

/* Content area for horizontal layout */
.hms-post-content-horizontal {
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Top meta (category + reading time) */
.hms-post-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    text-transform: capitalize;
}

.hms-post-category-horizontal {
    font-weight: 500;
}

.hms-meta-separator-horizontal {
    color: #999;
}

.hms-post-reading-time {
    color: #666;
}

/* Title for horizontal layout */
.hms-post-title-horizontal {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hms-post-title-horizontal a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Alternative Because inline CSS Overrides it otherwise */
article .hms-post-title-horizontal a {
    color: #1a1a1a;
}

.hms-post-title-horizontal a:hover {
    color: #AE2024;
}

/* Excerpt for horizontal layout */
.hms-post-excerpt-horizontal {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom meta (author + date) */
.hms-post-meta-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin-top: auto;
}

.hms-post-author-horizontal {
    font-weight: 500;
}

.hms-post-author-horizontal::after {
    content: ' \00B7 ';
    margin: 0 4px;
    color: #999;
}

.hms-post-date-horizontal {
    color: #666;
}

/* Horizontal layout responsive */
@media (max-width: 1200px) {
    .hms-latest-posts--horizontal {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .hms-latest-posts--horizontal {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .hms-latest-posts--horizontal {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   Custom Pagination Styles
   ========================================================================== */

.hms-pagination {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.hms-pagination-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.hms-pagination-item {
    margin: 0;
    padding: 0;
}

.hms-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.hms-pagination-link:hover {
    background: #f5f5f5;
    border-color: #AE2024;
    color: #AE2024;
}

/* Current page */
.hms-pagination-current {
    background: #AE2024;
    border-color: #AE2024;
    color: #fff;
    cursor: default;
}

.hms-pagination-current:hover {
    background: #AE2024;
    border-color: #AE2024;
    color: #fff;
}

/* Chevron arrows in circles */
.hms-pagination-chevron {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.hms-pagination-chevron:hover {
    background: #AE2024;
    border-color: #AE2024;
    color: #fff;
}

.hms-chevron-left,
.hms-chevron-right {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

/* Responsive */
@media (max-width: 600px) {
    .hms-pagination-list {
        gap: 6px;
    }
    
    .hms-pagination-link {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 14px;
    }
    
    .hms-pagination-chevron {
        min-width: 40px;
        width: 40px;
        height: 40px;
    }
}

/* =============================================================================
   Custom Pagination Styles
   ========================================================================== */

.hms-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 80px auto 40px auto;
    padding: 40px 0 0 0;  /* Extra padding at top */
    width: 100%;
    clear: both;
}

.hms-pagination-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.hms-pagination-item {
    margin: 0;
    padding: 0;
}

.hms-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.hms-pagination-link:hover {
    background: #f5f5f5;
    border-color: #AE2024;
    color: #AE2024;
}

/* Current page */
.hms-pagination-current {
    background: #AE2024;
    border-color: #AE2024;
    color: #fff;
    cursor: default;
}

.hms-pagination-current:hover {
    background: #AE2024;
    border-color: #AE2024;
    color: #fff;
}

/* Chevron arrows in circles */
.hms-pagination-chevron {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hms-pagination-chevron:hover {
    background: #AE2024;
    border-color: #AE2024;
}

/* SVG chevrons */
.hms-chevron-left,
.hms-chevron-right {
    width: 20px;
    height: 20px;
    display: block;
}

.hms-chevron-left path,
.hms-chevron-right path {
    stroke: #333;
    transition: stroke 0.3s ease;
}

.hms-pagination-chevron:hover .hms-chevron-left path,
.hms-pagination-chevron:hover .hms-chevron-right path {
    stroke: #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .hms-pagination-list {
        gap: 6px;
    }
    
    .hms-pagination-link {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 14px;
    }
    
    .hms-pagination-chevron {
        min-width: 40px;
        width: 40px;
        height: 40px;
    }
    
    .hms-chevron-left,
    .hms-chevron-right {
        width: 18px;
        height: 18px;
    }
}