/* ==========================================================================
   THRYVE Blog — listing cards, single post and related posts
   Uses the theme palette from tailwind.config.js:
   dark #3F2A1E · primary #AC8D78 · secondary #F5F0E6 · light #FDF9F2 · sand #E5DED4
   ========================================================================== */

:root {
    --thryve-dark: #3F2A1E;
    --thryve-primary: #AC8D78;
    --thryve-secondary: #F5F0E6;
    --thryve-light: #FDF9F2;
    --thryve-sand: #E5DED4;
    --thryve-serif: Cormorant, Georgia, serif;
    --thryve-sans: "Gill Sans Custom", system-ui, Arial, sans-serif;
    --thryve-line: rgba(63, 42, 30, 0.1);
    --thryve-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.thryve-blog-listing {
    background: var(--thryve-light);
    padding: clamp(3rem, 7vw, 6rem) 0;
}

.thryve-blog-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .thryve-blog-container {
        padding: 0 2rem;
    }
}

.thryve-blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .thryve-blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .thryve-blog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2rem;
    }
}

.thryve-blog-eyebrow {
    margin: 0 0 0.9rem;
    font-family: var(--thryve-sans);
    font-size: 10px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(63, 42, 30, 0.5);
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.thryve-post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--thryve-line);
    transition: border-color 300ms ease, box-shadow 300ms ease, transform 300ms var(--thryve-ease);
}

.thryve-post-card:hover,
.thryve-post-card:focus-within {
    border-color: rgba(63, 42, 30, 0.22);
    box-shadow: 0 22px 48px -28px rgba(63, 42, 30, 0.35);
    transform: translateY(-3px);
}

.thryve-post-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: var(--thryve-sand);
}

.thryve-post-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 900ms var(--thryve-ease);
}

.thryve-post-card:hover .thryve-post-card__image,
.thryve-post-card:focus-within .thryve-post-card__image {
    transform: scale(1.04);
}

.thryve-post-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: var(--thryve-dark);
    background-size: cover;
    background-blend-mode: multiply;
}

.thryve-post-card__placeholder span {
    font-family: var(--thryve-serif);
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.45em;
    color: rgba(255, 255, 255, 0.55);
}

.thryve-post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.6rem 1.5rem 1.75rem;
}

@media (min-width: 1024px) {
    .thryve-post-card__body {
        padding: 1.9rem 2rem 2rem;
    }
}

.thryve-post-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.9rem;
    font-family: var(--thryve-sans);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(63, 42, 30, 0.55);
}

.thryve-post-card__dot {
    color: var(--thryve-primary);
}

.thryve-post-card__title {
    margin: 0 0 0.85rem;
    font-family: var(--thryve-serif);
    font-weight: 300;
    font-size: clamp(1.45rem, 2.1vw, 1.75rem);
    line-height: 1.15;
    color: var(--thryve-dark);
}

.thryve-post-card__link {
    color: inherit;
    text-decoration: none;
    transition: font-style 200ms ease;
}

/* Whole card is clickable via the title link */
.thryve-post-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.thryve-post-card__link:focus-visible {
    outline: none;
}

.thryve-post-card:has(.thryve-post-card__link:focus-visible) {
    outline: 2px solid rgba(63, 42, 30, 0.45);
    outline-offset: 4px;
}

.thryve-post-card:hover .thryve-post-card__link,
.thryve-post-card:focus-within .thryve-post-card__link {
    font-style: italic;
}

.thryve-post-card__excerpt {
    margin: 0 0 1.5rem;
    font-family: var(--thryve-sans);
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(63, 42, 30, 0.75);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thryve-post-card__more {
    margin-top: auto;
    font-family: var(--thryve-sans);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(63, 42, 30, 0.6);
    transition: color 200ms ease;
}

.thryve-post-card__arrow {
    display: inline-block;
    margin-left: 0.35rem;
    transition: transform 300ms var(--thryve-ease);
}

.thryve-post-card:hover .thryve-post-card__more,
.thryve-post-card:focus-within .thryve-post-card__more {
    color: var(--thryve-dark);
}

.thryve-post-card:hover .thryve-post-card__arrow,
.thryve-post-card:focus-within .thryve-post-card__arrow {
    transform: translateX(4px);
}

/* Featured (first post on page one) */
.thryve-post-card--featured {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 900px) {
    .thryve-post-card--featured {
        display: grid;
        grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    }

    .thryve-post-card--featured .thryve-post-card__media {
        aspect-ratio: auto;
        min-height: 440px;
    }

    .thryve-post-card--featured .thryve-post-card__body {
        justify-content: center;
        padding: clamp(2.5rem, 4vw, 4rem);
    }

    .thryve-post-card--featured .thryve-post-card__excerpt {
        -webkit-line-clamp: 5;
        font-size: 0.98rem;
    }
}

.thryve-post-card--featured .thryve-post-card__title {
    font-size: clamp(1.8rem, 3.2vw, 2.75rem);
    line-height: 1.08;
}

/* --------------------------------------------------------------------------
   Empty state and pagination
   -------------------------------------------------------------------------- */
.thryve-blog-empty {
    max-width: 36rem;
    margin: 0 auto;
    text-align: center;
}

.thryve-blog-empty__text {
    margin: 0 0 1.5rem;
    font-family: var(--thryve-serif);
    font-weight: 300;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    line-height: 1.35;
    color: var(--thryve-dark);
}

.thryve-blog-pagination {
    margin-top: clamp(2.5rem, 5vw, 4rem);
}

.thryve-blog-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.thryve-blog-pagination a,
.thryve-blog-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid var(--thryve-line);
    font-family: var(--thryve-sans);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--thryve-dark);
    text-decoration: none;
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.thryve-blog-pagination a:hover {
    border-color: var(--thryve-dark);
}

.thryve-blog-pagination .current {
    background: var(--thryve-dark);
    border-color: var(--thryve-dark);
    color: #fff;
}

.thryve-blog-pagination .dots {
    border-color: transparent;
}

/* --------------------------------------------------------------------------
   Single post
   -------------------------------------------------------------------------- */
.thryve-single-hero__crumb {
    color: inherit;
    text-decoration: none;
    transition: color 200ms ease;
}

.thryve-single-hero__crumb:hover {
    color: #fff;
}

.thryve-single-hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin: 0;
    font-family: var(--thryve-sans);
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.thryve-single {
    background: var(--thryve-light);
    padding: clamp(2rem, 5vw, 4rem) 1rem clamp(3rem, 6vw, 5rem);
}

.thryve-single__figure {
    max-width: 1040px;
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}

.thryve-single__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 620px;
    object-fit: cover;
    background: var(--thryve-sand);
}

.thryve-single__figure figcaption {
    margin-top: 0.75rem;
    font-family: var(--thryve-sans);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: rgba(63, 42, 30, 0.55);
    text-align: center;
}

.thryve-single__footer {
    max-width: 720px;
    margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--thryve-line);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.thryve-single__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.thryve-single__tags a {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--thryve-line);
    font-family: var(--thryve-sans);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(63, 42, 30, 0.7);
    text-decoration: none;
    transition: border-color 200ms ease, color 200ms ease;
}

.thryve-single__tags a:hover {
    border-color: var(--thryve-dark);
    color: var(--thryve-dark);
}

.thryve-single__back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    font-family: var(--thryve-sans);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--thryve-dark);
    text-decoration: none;
}

.thryve-single__back:hover {
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Post content typography (anything written in the editor)
   -------------------------------------------------------------------------- */
.thryve-prose {
    max-width: 720px;
    margin: 0 auto;
    font-family: var(--thryve-sans);
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.85;
    color: rgba(63, 42, 30, 0.85);
    overflow-wrap: break-word;
}

.thryve-prose > * + * {
    margin-top: 1.4em;
}

.thryve-prose > :first-child {
    margin-top: 0;
}

/* Elegant opening paragraph */
.thryve-prose > p:first-of-type {
    font-family: var(--thryve-serif);
    font-size: clamp(1.3rem, 2.2vw, 1.55rem);
    line-height: 1.55;
    color: var(--thryve-dark);
}

.thryve-prose h2,
.thryve-prose h3,
.thryve-prose h4 {
    font-family: var(--thryve-serif);
    font-weight: 400;
    line-height: 1.2;
    color: var(--thryve-dark);
    margin-top: 2.2em;
    margin-bottom: 0;
}

.thryve-prose h2 { font-size: clamp(1.75rem, 3vw, 2.2rem); font-weight: 300; }
.thryve-prose h3 { font-size: clamp(1.4rem, 2.4vw, 1.7rem); }
.thryve-prose h4 { font-size: 1.25rem; }

.thryve-prose h2 + *,
.thryve-prose h3 + *,
.thryve-prose h4 + * {
    margin-top: 0.8em;
}

.thryve-prose a {
    color: var(--thryve-dark);
    text-decoration: underline;
    text-decoration-color: var(--thryve-primary);
    text-underline-offset: 3px;
    transition: text-decoration-color 200ms ease;
}

.thryve-prose a:hover {
    text-decoration-color: var(--thryve-dark);
}

.thryve-prose strong { font-weight: 500; color: var(--thryve-dark); }

.thryve-prose ul,
.thryve-prose ol {
    padding-left: 1.4em;
}

.thryve-prose ul { list-style: disc; }
.thryve-prose ol { list-style: decimal; }

.thryve-prose li + li { margin-top: 0.45em; }

.thryve-prose li::marker { color: var(--thryve-primary); }

.thryve-prose blockquote,
.thryve-prose .wp-block-quote,
.thryve-prose .wp-block-pullquote {
    margin: 2.2em 0;
    padding: 0.25em 0 0.25em 1.5em;
    border-left: 2px solid var(--thryve-primary);
    font-family: var(--thryve-serif);
    font-style: italic;
    font-size: clamp(1.35rem, 2.4vw, 1.65rem);
    line-height: 1.45;
    color: var(--thryve-dark);
}

.thryve-prose .wp-block-pullquote {
    border-left: 0;
    border-top: 1px solid var(--thryve-line);
    border-bottom: 1px solid var(--thryve-line);
    padding: 1.5em 0;
    text-align: center;
}

.thryve-prose blockquote cite,
.thryve-prose .wp-block-quote cite {
    display: block;
    margin-top: 0.75em;
    font-family: var(--thryve-sans);
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(63, 42, 30, 0.55);
}

.thryve-prose img,
.thryve-prose video,
.thryve-prose iframe {
    max-width: 100%;
    height: auto;
}

.thryve-prose figure {
    margin-left: 0;
    margin-right: 0;
}

.thryve-prose figcaption,
.thryve-prose .wp-element-caption {
    margin-top: 0.6rem;
    font-size: 12px;
    color: rgba(63, 42, 30, 0.55);
    text-align: center;
}

/* Wide / full images from the block editor break out of the text column */
.thryve-prose .alignwide {
    width: min(1040px, calc(100vw - 2rem));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.thryve-prose .alignfull {
    width: 100vw;
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.thryve-prose .alignleft,
.thryve-prose .alignright {
    max-width: 50%;
}

@media (min-width: 768px) {
    .thryve-prose .alignleft { float: left; margin: 0.4em 1.75em 1em 0; }
    .thryve-prose .alignright { float: right; margin: 0.4em 0 1em 1.75em; }
}

@media (max-width: 767px) {
    .thryve-prose .alignleft,
    .thryve-prose .alignright { max-width: 100%; }
}

.thryve-prose .aligncenter {
    margin-left: auto;
    margin-right: auto;
}

.thryve-prose hr,
.thryve-prose .wp-block-separator {
    border: 0;
    border-top: 1px solid var(--thryve-line);
    margin: 2.5em auto;
    max-width: 120px;
}

.thryve-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.thryve-prose th,
.thryve-prose td {
    padding: 0.75em 0.9em;
    border-bottom: 1px solid var(--thryve-line);
    text-align: left;
}

.thryve-prose th {
    font-weight: 500;
    color: var(--thryve-dark);
}

.thryve-prose .wp-block-button__link {
    display: inline-block;
    padding: 0.9rem 1.8rem;
    background: var(--thryve-dark);
    border-radius: 0;
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 200ms ease;
}

.thryve-prose .wp-block-button__link:hover {
    background: var(--thryve-primary);
}

.thryve-prose::after {
    content: "";
    display: table;
    clear: both;
}

.thryve-page-links {
    margin-top: 2em;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Related posts
   -------------------------------------------------------------------------- */
.thryve-related {
    background: var(--thryve-secondary);
    padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.thryve-related__head {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.thryve-related__title {
    margin: 0;
    font-family: var(--thryve-serif);
    font-weight: 300;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.1;
    color: var(--thryve-dark);
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .thryve-post-card,
    .thryve-post-card__image,
    .thryve-post-card__arrow {
        transition: none;
    }

    .thryve-post-card:hover,
    .thryve-post-card:focus-within {
        transform: none;
    }

    .thryve-post-card:hover .thryve-post-card__image,
    .thryve-post-card:focus-within .thryve-post-card__image {
        transform: none;
    }
}
