/* ============================================================
   TNS Blog — Base Styles
   Loaded only on blog pages (single, category, tag, author, index).
   Override via TNS Blog → Additional CSS in the admin.
   ============================================================ */

/* ── Screen reader utility ─────────────────────────────────── */
.screen-reader-text {
    clip: rect(1px,1px,1px,1px);
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}

/* ── Category filter bar ───────────────────────────────────── */
.tns-cat-filter {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 14px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.tns-cat-filter::-webkit-scrollbar { display: none; }

.tns-cat-btn {
    display: inline-block;
    padding: 8px 22px;
    border-radius: 999px;
    font-family: 'Work Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    border: 2px solid rgba(59,59,59,0.2);
    background: #fff;
    color: #3B3B3B;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.tns-cat-btn:hover,
.tns-cat-btn.is-active {
    background: #F58A21;
    border-color: #F58A21;
    color: #fff;
}

/* ── Post grid ─────────────────────────────────────────────── */
.tns-posts-grid {
    display: grid;
    gap: 32px;
}
.tns-posts-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.tns-posts-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.tns-posts-grid--cols-1 { grid-template-columns: 1fr; }

@media (max-width: 1024px) {
    .tns-posts-grid--cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .tns-posts-grid--cols-3,
    .tns-posts-grid--cols-2 { grid-template-columns: 1fr; }
    .tns-posts-grid { gap: 24px; }
}

/* Loading state */
.tns-posts-grid.tns-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tns-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(59,59,59,0.6);
    font-family: 'Work Sans', sans-serif;
    padding: 60px 0;
}

/* ── Post card ─────────────────────────────────────────────── */
.tns-post-card {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.tns-post-card:hover {
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

/* Image */
.tns-post-card__image-wrap {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(41,163,189,0.08);
    flex-shrink: 0;
}
.tns-post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.tns-post-card:hover .tns-post-card__image {
    transform: scale(1.05);
}
.tns-post-card__image-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(41,163,189,0.1);
}

/* Content */
.tns-post-card__content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

/* Category badge + date row */
.tns-post-card__meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tns-post-card__badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(115,191,69,0.1);
    color: #73BF45;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}
.tns-post-card__badge:hover {
    background: rgba(115,191,69,0.2);
    color: #73BF45;
}
.tns-post-card__date {
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    color: rgba(59,59,59,0.55);
}

/* Title */
.tns-post-card__title {
    font-family: 'Work Sans', sans-serif;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.3;
    color: #3B3B3B;
    margin: 0;
}
.tns-post-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.tns-post-card__title a:hover { color: #F58A21; }

/* Excerpt */
.tns-post-card__excerpt {
    font-family: 'Work Sans', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: rgba(59,59,59,0.7);
    margin: 0;
    flex: 1;
}

/* Footer */
.tns-post-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(59,59,59,0.1);
    gap: 12px;
    margin-top: auto;
}

.tns-post-card__author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.tns-post-card__avatar-link { flex-shrink: 0; }
.tns-post-card__avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.tns-post-card__author-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.tns-post-card__author-name {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #3B3B3B;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tns-post-card__author-name:hover { color: #F58A21; }
.tns-post-card__author-role {
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    color: rgba(59,59,59,0.55);
    white-space: nowrap;
}

.tns-post-card__meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}
.tns-post-card__read-time {
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    color: rgba(59,59,59,0.55);
    white-space: nowrap;
}
.tns-post-card__read-more {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #F58A21;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}
.tns-post-card__read-more:hover { color: #FAB51C; }
