/**
 * WAYSHIP Insights - CSS Principal
 */

body.wayship-dark-theme {
    background-color: #111111;
    color: #f2f2f2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wayship-dark-theme .site-content,
.wayship-dark-theme main {
    background-color: #111111;
}

/* ===== UTILITIES ===== */
.wayship-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 1024px) {
    .wayship-container {
        padding: 0 48px;
    }
}

.wayship-label {
    font-size: 12px;
    letter-spacing: 0.19em;
    text-transform: uppercase;
    color: #666666;
    font-weight: 400;
    line-height: 1.4;
}

/* ===== ARTICLE HERO ===== */
.wayship-article-hero {
    padding: 120px 0 24px;
}

@media (min-width: 1024px) {
    .wayship-article-hero {
        padding: 160px 0 32px;
    }
}

.wayship-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #999999;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 32px;
    transition: color 0.3s ease;
}

.wayship-back:hover {
    color: #f2f2f2;
}

.wayship-article-category {
    margin-bottom: 20px;
}

.wayship-hero-tax {
    display: inline-block;
    padding: 8px 16px;
    background: #181818;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #f2f2f2;
}

.wayship-article-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 700;
    line-height: 1.1;
    color: #f2f2f2;
    margin: 0 0 24px;
    max-width: 900px;
}

.wayship-article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wayship-article-meta-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.wayship-article-meta-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #f2f2f2;
}

.wayship-article-meta-date {
    display: block;
    font-size: 13px;
    color: #999999;
}

/* ===== ARTICLE IMAGE ===== */
.wayship-article-image {
    padding: 24px 0 48px;
}

.wayship-article-image-wrapper {
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 21/9;
    background: #181818;
}

.wayship-article-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== ARTICLE CONTENT ===== */
.wayship-article-content {
    padding: 48px 0 80px;
}

.wayship-article-grid {
    display: grid;
    gap: 48px;
}

/* Sidebar: fora do desktop fica oculta; em desktop vira flex para o sticky preencher a altura da linha do grid */
.wayship-article-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .wayship-article-grid {
        grid-template-columns: 1fr 240px;
        gap: 64px;
        /* stretch: célula da sidebar = altura do artigo → sticky acompanha até o fim do texto */
        align-items: stretch;
    }

    .wayship-article-body {
        min-width: 0;
    }

    .wayship-article-sidebar {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
}

/* Offset fluido (header / viewport); sobrescreva no tema: --wayship-article-sidebar-top */
.wayship-sidebar-sticky {
    position: sticky;
    top: var(--wayship-article-sidebar-top, clamp(1rem, 6vw, 7.5rem));
    align-self: flex-start;
    width: 100%;
}

.wayship-sidebar-sticky .wayship-label {
    display: block;
    margin-bottom: 16px;
}

.wayship-sidebar-info {
    font-size: 14px;
    color: #999999;
    margin: 0 0 8px;
}

.wayship-sidebar-tags {
    margin-top: 32px;
}

.wayship-sidebar-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #181818;
    border-radius: 9999px;
    font-size: 12px;
    color: #999999;
    margin: 0 6px 6px 0;
}

/* Article Body */
.wayship-article-lead {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 500;
    line-height: 1.6;
    color: #f2f2f2;
    margin: 0 0 40px;
}

.wayship-article-text {
    font-size: 18px;
    line-height: 1.8;
    color: #999999;
}

.wayship-article-text p {
    margin-bottom: 24px;
}

.wayship-article-text h2 {
    font-size: 28px;
    font-weight: 600;
    color: #f2f2f2;
    margin: 48px 0 20px;
}

.wayship-article-text h3 {
    font-size: 22px;
    font-weight: 600;
    color: #f2f2f2;
    margin: 36px 0 16px;
}

.wayship-article-text strong {
    color: #f2f2f2;
    font-weight: 600;
}

.wayship-article-text a {
    color: #f2f2f2;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wayship-article-text a:hover {
    color: #999999;
}

.wayship-article-text ul,
.wayship-article-text ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.wayship-article-text li {
    margin-bottom: 8px;
}

/* Quote */
.wayship-article-quote {
    margin: 48px 0;
    padding-left: 24px;
    border-left: 2px solid rgba(255,255,255,0.2);
    font-size: clamp(20px, 3vw, 32px);
    font-style: italic;
    color: #f2f2f2;
    line-height: 1.4;
}

/* ===== AUTHOR SECTION ===== */
.wayship-article-author-section {
    padding: 60px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.wayship-author-card {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.wayship-author-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
}

.wayship-author-card-name {
    font-size: 20px;
    font-weight: 600;
    color: #f2f2f2;
    margin: 0 0 4px;
}

.wayship-author-card-role {
    font-size: 14px;
    color: #999999;
    margin: 0 0 8px;
}

.wayship-author-card-meta {
    font-size: 14px;
    color: #666666;
    margin: 0;
}

/* ===== NEXT ARTICLES ===== */
.wayship-next-insights {
    padding: 80px 0;
}

@media (min-width: 1024px) {
    .wayship-next-insights {
        padding: 120px 0;
    }
}

.wayship-next-insights .wayship-label {
    display: block;
    margin-bottom: 48px;
}

.wayship-next-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 768px) {
    .wayship-next-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.wayship-next-card a {
    text-decoration: none;
    color: inherit;
}

.wayship-next-image {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #181818;
}

.wayship-next-image img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.wayship-next-card:hover .wayship-next-image img {
    transform: scale(1.05);
}

.wayship-next-tax {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999999;
    display: block;
    margin-bottom: 8px;
}

.wayship-next-title {
    font-size: 22px;
    font-weight: 600;
    color: #f2f2f2;
    line-height: 1.3;
    margin: 0 0 12px;
    transition: color 0.3s ease;
}

.wayship-next-card:hover .wayship-next-title {
    color: #999999;
}

.wayship-next-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #999999;
    transition: color 0.3s ease;
}

.wayship-next-card:hover .wayship-next-read {
    color: #f2f2f2;
}

/* ============================================
   SHORTCODE - INSIGHTS LISTING
   ============================================ */

/* Featured Article */
.wayship-featured-article {
    padding: 48px 0 32px;
}

.wayship-featured-grid {
    display: grid;
    gap: 32px;
}

@media (min-width: 1024px) {
    .wayship-featured-grid {
        grid-template-columns: 1fr 1fr;
        gap: 48px;
        align-items: center;
    }
}

.wayship-featured-image-link {
    display: block;
    text-decoration: none;
}

/* Destaque: mesma abordagem do Projetos — background cover + pseudo zoom */
.wayship-featured-image {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #181818;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.wayship-featured-image::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: inherit;
    background-size: cover;
    background-position: center center;
    transition: transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1);
    will-change: transform;
    z-index: 0;
}

.wayship-featured-image-link:hover .wayship-featured-image::before {
    transform: scale(1.07);
}

/* <img> só para SEO / leitores de tela — invisível */
.wayship-insight-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.wayship-featured-content {
    padding: 8px 0;
}

.wayship-featured-meta-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.wayship-featured-category {
    display: inline-block;
    padding: 6px 16px;
    background: #181818;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #f2f2f2;
}

.wayship-featured-label {
    font-size: 12px;
    letter-spacing: 0.19em;
    text-transform: uppercase;
    color: #666666;
}

.wayship-featured-title-link {
    text-decoration: none;
    color: inherit;
}

.wayship-featured-title {
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.2;
    color: #f2f2f2;
    margin: 0 0 20px;
    transition: color 0.3s ease;
}

.wayship-featured-title-link:hover .wayship-featured-title {
    color: #999999;
}

.wayship-featured-excerpt {
    font-size: 18px;
    line-height: 1.6;
    color: #999999;
    margin: 0 0 32px;
}

.wayship-featured-author-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    gap: 16px;
}

.wayship-featured-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wayship-featured-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.wayship-featured-author-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #f2f2f2;
}

.wayship-featured-date {
    display: block;
    font-size: 13px;
    color: #999999;
}

.wayship-featured-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #999999;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.wayship-featured-read-more:hover {
    color: #f2f2f2;
}

/* Insights Grid */
.wayship-insights-grid {
    display: grid;
    gap: 24px;
    padding: 32px 0 80px;
}

@media (min-width: 768px) {
    .wayship-insights-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

/* Insight Card */
.wayship-insight-card {
    background: #181818;
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wayship-insight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.wayship-insight-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.wayship-insight-image-wrapper {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #181818;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.wayship-insight-image-wrapper::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: inherit;
    background-size: cover;
    background-position: center center;
    transition: transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1);
    will-change: transform;
    z-index: 0;
}

.wayship-insight-link:hover .wayship-insight-image-wrapper::before {
    transform: scale(1.07);
}

.wayship-insight-body {
    padding: 28px;
}

.wayship-insight-category {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999999;
    margin-bottom: 16px;
}

.wayship-insight-title {
    font-size: 20px;
    font-weight: 600;
    color: #f2f2f2;
    line-height: 1.35;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.wayship-insight-card:hover .wayship-insight-title {
    color: #999999;
}

.wayship-insight-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #999999;
    margin: 0 0 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wayship-insight-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.wayship-insight-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.wayship-insight-author-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #f2f2f2;
}

.wayship-insight-meta {
    display: block;
    font-size: 12px;
    color: #666666;
}

/* No results */
.wayship-no-insights {
    text-align: center;
    padding: 80px 0;
    color: #999999;
    font-size: 18px;
}

/* ===== FILTROS (shortcode [wayship_insights_filtros]) ===== */
/* Bar — respeita o container mas também funciona quando inserida fora dele */
.wayship-insights-filtros-bar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    padding: 0 10px;
}

@media (min-width: 768px) {
    .wayship-insights-filtros-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0;
    }
}

.wayship-filter-insight-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Botões: reset forte — temas costumam aplicar cor de destaque (ex.: magenta) em `button` */
.wayship-insights-filtros-bar button.wayship-filter-insight-pill {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    box-sizing: border-box;
    padding: 9px 20px;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    background-color: transparent;
    color: #666666;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    box-shadow: none;
    text-decoration: none;
}

.wayship-insights-filtros-bar button.wayship-filter-insight-pill:focus {
    outline: none;
}

.wayship-insights-filtros-bar button.wayship-filter-insight-pill:focus-visible {
    outline: 2px solid rgba(255,255,255,0.35);
    outline-offset: 2px;
}

.wayship-insights-filtros-bar button.wayship-filter-insight-pill:hover {
    background: rgba(242,242,242,0.12);
    color: #f2f2f2;
    border-color: rgba(242,242,242,0.35);
}

.wayship-insights-filtros-bar button.wayship-filter-insight-pill.active {
    background: #f2f2f2;
    background-color: #f2f2f2;
    color: #111111;
    border-color: #f2f2f2;
    font-weight: 600;
}

.wayship-insights-filtros-bar button.wayship-filter-insight-pill.active:hover {
    background: #f2f2f2;
    background-color: #f2f2f2;
    color: #111111;
    border-color: #f2f2f2;
}

.wayship-filter-insight-count {
    font-size: 14px;
    color: #999999;
    margin: 0;
    white-space: nowrap;
}

.wayship-filter-insight-count strong {
    color: #f2f2f2;
}
