/* ==========================================================================
   WM Single Post Widgets
   ========================================================================== */

/* ── Post Title ──────────────────────────────────────────────────────────── */
.wm-post-title {
    margin: 0;
    line-height: 1.2;
}

.wm-post-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* ── Post Content ────────────────────────────────────────────────────────── */
.wm-post-content {
    line-height: 1.7;
}

/* Basic content typography normalisation */
.wm-post-content h1,
.wm-post-content h2,
.wm-post-content h3,
.wm-post-content h4,
.wm-post-content h5,
.wm-post-content h6 {
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.wm-post-content p  { margin-bottom: 1em; }
.wm-post-content ul,
.wm-post-content ol { padding-left: 1.5em; margin-bottom: 1em; }
.wm-post-content li { margin-bottom: 0.4em; }

.wm-post-content img {
    max-width: 100%;
    height: auto;
}

.wm-post-content blockquote {
    border-left: 4px solid currentColor;
    opacity: 0.8;
    margin: 1.5em 0;
    padding: 0.5em 0 0.5em 1.2em;
}

/* ── Post Meta ───────────────────────────────────────────────────────────── */
.wm-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.85em;
}

.wm-post-meta--vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.wm-post-meta a {
    text-decoration: none;
    color: inherit;
}

.wm-post-meta a:hover {
    text-decoration: underline;
}

.wm-post-meta__sep {
    opacity: 0.4;
    margin: 0 2px;
}

.wm-post-meta--vertical .wm-post-meta__sep {
    display: none;
}

.wm-post-meta__row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Post Custom Field ───────────────────────────────────────────────────── */
.wm-post-field {
    display: block;
}

/* Layout: inline — before · value · after in a flex row */
.wm-post-field--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px; /* overridden by Elementor Parts Gap control */
}

/* Layout: stacked — before, value, after each on its own line */
.wm-post-field--stacked {
    display: flex;
    flex-direction: column;
    gap: 2px; /* overridden by Elementor Parts Gap control */
}

/* Individual parts — inherit color/typography from Elementor style controls */
.wm-post-field__before,
.wm-post-field__value,
.wm-post-field__after {
    /* display: inline by default — layout modifier above controls positioning */
}

.wm-post-field a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.wm-post-field a:hover {
    text-decoration: underline;
}

.wm-post-field--image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.wm-post-field__download::before {
    content: '↓ ';
}

/* ── Post Taxonomy ───────────────────────────────────────────────────────── */

/* Base: flex row (inline default) */
.wm-post-tax {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0; /* set via Elementor Gap control; separator text provides inline spacing */
}

/* Stacked: each part on its own line */
.wm-post-tax--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px; /* overridden by Elementor Gap control */
}

/* Separator — hidden in stacked mode (gap provides the spacing) */
.wm-post-tax--stacked .wm-post-tax__sep {
    display: none;
}

.wm-post-tax a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.wm-post-tax a:hover {
    text-decoration: underline;
}

/* ── Featured Image ─────────────────────────────────────────────────────── */
.wm-post-thumbnail {
    display: block;
}

.wm-post-thumbnail img {
    display: block;
    max-width: 100%;
    height: auto;
}

.wm-post-thumbnail a {
    display: inline-block;
    line-height: 0;
}

/* ── Post Navigation ─────────────────────────────────────────────────────── */
.wm-post-nav {
    display: flex;
    align-items: stretch;
    /* gap set via Elementor Gap control */
}

.wm-post-nav--column {
    flex-direction: column;
}

/* Prev/next links */
.wm-post-nav__link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex: 1;
    transition: color 0.2s ease, background-color 0.2s ease;
    /* gap (thumb/text), padding, border, border-radius via Elementor controls */
}

.wm-post-nav__link--next {
    justify-content: flex-end;
    text-align: right;
    /* For next: thumbnail appears after text — flex-direction stays row */
}

/* Text block inside each link */
.wm-post-nav__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wm-post-nav__text--next {
    align-items: flex-end;
}

/* Label ("← Previous" / "Next →") */
.wm-post-nav__label {
    font-size: 0.8em;
    opacity: 0.6;
    line-height: 1.2;
}

/* Adjacent post title */
.wm-post-nav__post-title {
    line-height: 1.3;
    /* color + typography via Elementor controls */
}

/* Thumbnail */
.wm-post-nav__thumb {
    flex-shrink: 0;
    overflow: hidden;
    /* size + border-radius via Elementor controls; default 60×60 */
    width: 60px;
    height: 60px;
    border-radius: 4px;
}

.wm-post-nav__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Invisible placeholder when one direction has no post (keeps layout symmetrical) */
.wm-post-nav__placeholder {
    flex: 1;
}

/* ── Related Posts ────────────────────────────────────────────────────────── */
.wm-related-posts__heading {
    margin: 0 0 1em;
    line-height: 1.3;
    /* color + typography via Elementor controls */
}

.wm-related-posts__grid {
    display: grid;
    /* grid-template-columns + gap overridden by inline <style> in render() */
    grid-template-columns: repeat( 3, 1fr );
    gap: 24px;
}

.wm-related-posts__item {
    display: flex;
    flex-direction: column;
    /* background, border-radius, box-shadow via Elementor controls */
}

/* Thumbnail link */
.wm-related-posts__thumb-wrap {
    display: block;
    overflow: hidden;
    line-height: 0;
    /* margin via Elementor Image Margin control */
}

.wm-related-posts__thumb-wrap img,
.wm-related-posts__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Zoom hover effect (applied via PHP when img_hover = zoom) */
.wm-related-posts__thumb-wrap--zoom:hover img {
    transform: scale( 1.04 );
}

/* Body */
.wm-related-posts__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* padding via Elementor Card Padding control */
}

/* Card title */
.wm-related-posts__title {
    margin: 0;
    line-height: 1.3;
}

.wm-related-posts__title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.wm-related-posts__title a:hover {
    text-decoration: underline;
}

/* Date */
.wm-related-posts__date {
    display: block;
    font-size: 0.85em;
    opacity: 0.65;
    /* color + typography via Elementor controls */
}

/* Excerpt */
.wm-related-posts__excerpt {
    margin: 0;
    line-height: 1.6;
    font-size: 0.9em;
}

/* ── Comments ────────────────────────────────────────────────────────────── */
.wm-comments {
    /* background, padding, border, border-radius via Elementor controls */
}

.wm-comments__heading {
    margin: 0 0 1em;
    line-height: 1.3;
}

/* ── Editor placeholders ─────────────────────────────────────────────────── */
.wm-editor-placeholder {
    display: block;
    padding: 16px;
    border: 2px dashed #b4bfd0;
    border-radius: 4px;
    color: #9aa3af;
    font-style: italic;
    text-align: center;
    background: #f6f8fb;
    font-size: 0.9em;
}
