/* News / Blog listing + single post. Loaded only on those views. */

/* ---- cards ---- */
.tis-post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}
.tis-post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 36px rgba(30, 73, 111, 0.16);
}
.tis-post-card-img {
    display: block;
    aspect-ratio: 16 / 10;
    background: #eef3f8;
    overflow: hidden;
}
.tis-post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.tis-post-card:hover .tis-post-card-img img { transform: scale(1.05); }
.tis-post-card-img img.tis-post-card-placeholder {
    object-fit: contain;
    padding: 18%;
    opacity: 0.5;
}
.tis-post-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 24px 24px;
}
.tis-post-card-title {
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 10px 0 10px;
}
.tis-post-card-title a { color: #23275c; text-decoration: none; }
.tis-post-card-title a:hover { color: var(--brand-blue); }
.tis-post-card-excerpt {
    color: #5d666e;
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 14px;
}

/* ---- shared meta / links ---- */
.tis-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #7a838b;
}
.tis-post-meta i { margin-right: 6px; color: var(--brand-blue); }
.tis-post-cat {
    background: #ebf5fb;
    color: var(--brand-blue);
    border-radius: 50px;
    padding: 3px 12px;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.tis-post-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    color: var(--brand-blue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: gap 0.2s ease;
}
.tis-post-read-more:hover { gap: 10px; color: var(--brand-blue-dark); }

/* ---- pagination ---- */
.tis-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 48px;
}
.tis-pagination .page-numbers {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    border: 1px solid #e2e5ee;
    color: #23275c;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.tis-pagination .page-numbers:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.tis-pagination .page-numbers.current { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.tis-pagination .page-numbers.dots { border: none; }

/* ---- single ---- */
.tis-single-title { max-width: 960px; margin-left: auto; margin-right: auto; }
.tis-single-featured {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}
.tis-single-featured img { width: 100%; height: auto; display: block; }
.tis-single-content {
    color: #3d4550;
    font-size: 1.05rem;
    line-height: 1.8;
}
.tis-single-content h2,
.tis-single-content h3,
.tis-single-content h4 { color: #23275c; font-weight: 600; margin: 1.8em 0 0.6em; }
.tis-single-content h2 { font-size: 1.6rem; }
.tis-single-content h3 { font-size: 1.3rem; }
.tis-single-content a { color: var(--brand-blue); }
.tis-single-content img { max-width: 100%; height: auto; border-radius: 12px; }
.tis-single-content figure { margin: 1.5em 0; }
.tis-single-content figcaption { font-size: 0.85rem; color: #7a838b; text-align: center; margin-top: 8px; }
.tis-single-content blockquote {
    border-left: 4px solid var(--brand-blue);
    background: #f5f9fc;
    padding: 16px 22px;
    border-radius: 0 12px 12px 0;
    margin: 1.5em 0;
}
.tis-single-content iframe { max-width: 100%; }

/* ---- post image gallery (built by inc/post-gallery.php) ---- */
.tis-gallery {
    display: grid;
    /* minmax(0, …): let columns shrink below the photos' intrinsic 1024px width */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 1.8em 0;
}
.tis-gallery-2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* first photo widens so every row is full (class set per image count) */
.tis-gallery-lead-2 .tis-gallery-item:first-child { grid-column: span 2; }
.tis-gallery-lead-3 .tis-gallery-item:first-child { grid-column: 1 / -1; }
/* 2-column lead matches the height of the 4:3 photo beside it */
.tis-gallery-lead-2 .tis-gallery-item:first-child a { aspect-ratio: auto; height: 100%; }
.tis-single-content .tis-gallery-lead-2 .tis-gallery-item:first-child img { position: absolute; inset: 0; }
.tis-gallery-lead-3 .tis-gallery-item:first-child a { aspect-ratio: 16 / 7; }
.tis-gallery-item { position: relative; min-width: 0; }
.tis-gallery-item a,
.tis-single-image a,
.tis-single-featured a {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    cursor: zoom-in;
}
.tis-gallery-item a { aspect-ratio: 4 / 3; }
.tis-single-content .tis-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.5s ease;
}
.tis-single-content .tis-single-image img { display: block; width: 100%; border-radius: 0; transition: transform 0.5s ease; }
.tis-single-featured img { transition: transform 0.5s ease; }
.tis-gallery-item a::after,
.tis-single-image a::after,
.tis-single-featured a::after {
    content: "\f00e"; /* Font Awesome magnifying-glass-plus */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: rgba(30, 73, 111, 0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.tis-gallery-item a:hover::after,
.tis-single-image a:hover::after,
.tis-single-featured a:hover::after { opacity: 1; }
.tis-gallery-item a:hover img,
.tis-single-image a:hover img,
.tis-single-featured a:hover img { transform: scale(1.05); }
.tis-single-image { margin: 1.8em 0; }
.tis-image-caption { font-size: 0.85rem; color: #7a838b; text-align: center; margin-top: 8px; }

@media (max-width: 575px) {
    .tis-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tis-gallery-lead-2 .tis-gallery-item:first-child,
    .tis-gallery-lead-3 .tis-gallery-item:first-child { grid-column: 1 / -1; }
}
.tis-single-tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--brand-blue); }
.tis-single-tags a {
    background: #f1f4f8;
    color: #23275c;
    border-radius: 50px;
    padding: 4px 14px;
    font-size: 0.8rem;
    text-decoration: none;
}
.tis-single-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e8ecf1;
}
.tis-single-share span { font-weight: 600; color: #23275c; margin-right: 6px; }
.tis-single-share a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ebf5fb;
    color: var(--brand-blue);
    text-decoration: none;
    transition: all 0.2s;
}
.tis-single-share a:hover { background: var(--brand-blue); color: #fff; }
.tis-single-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 28px;
    font-size: 0.92rem;
}
.tis-single-nav a { color: #23275c; font-weight: 600; text-decoration: none; }
.tis-single-nav a:hover { color: var(--brand-blue); }

/* ---- sidebar ---- */
.tis-sidebar-box {
    background: #fff;
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}
.tis-sidebar-title { font-size: 1.15rem; font-weight: 600; color: #23275c; margin-bottom: 18px; }
.tis-sidebar-post {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eef1f5;
    text-decoration: none;
}
.tis-sidebar-post:last-of-type { border-bottom: none; }
.tis-sidebar-post img {
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    object-fit: cover;
    border-radius: 12px;
}
.tis-sidebar-post strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #23275c;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}
.tis-sidebar-post small { color: #7a838b; font-size: 0.78rem; }
.tis-sidebar-post:hover strong { color: var(--brand-blue); }
.tis-sidebar-cta { background: linear-gradient(145deg, var(--brand-blue), var(--brand-blue-dark)); color: #fff; }
.tis-sidebar-cta .tis-sidebar-title { color: #fff; }
.tis-sidebar-cta p { color: rgba(255, 255, 255, 0.85); font-size: 0.92rem; }
@media (max-width: 575px) {
    .tis-single-nav { grid-template-columns: 1fr; }
    .tis-single-nav .text-end { text-align: left !important; }
}
