/*
 * Single Post Title Styling
 * BEM-style classes for high specificity and to avoid conflicts.
 */

/* Main container for the entire header block */
.article-header {
    background: hsla(var(--xf-contentBg));
    padding: 1rem 1.2rem;
    border: 1px solid var(--xf-borderColor, #e5e5e5);
    border-radius: var(--xf-borderRadiusMedium, 4px);
    margin-bottom: 1.5rem;
}

/* Flex container for the top row (badge + title) */
.article-header__title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Remove custom label styling to avoid conflicts with XenForo styles */
/* We'll let XenForo's CSS handle the styling of labels */

/* H1 title styling */
.article-header__title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--xf-textColor, #1a1a1a);
    margin: 0;
    line-height: 1.3;
}

/* Flex container for the bottom row (metadata) */
.article-header__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--xf-textColorMuted, #6c757d);
}

/* Individual metadata item (e.g., author, date) */
.article-header__meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Styling for Font Awesome icons */
.article-header__icon {
    font-size: 1.1em;
    color: var(--xf-textColorMuted, #999);
    opacity: 0.6;
}

.article-header__meta-separator {
     color: var(--xf-textColorMuted, #6c757d);
}

.p-body-header {
    display: none !important;
}

/* Featured (lead) image + credit/attribution caption */
figure.article-image {
    margin: 0 0 1.2rem;
}
figure.article-image img {
    display: block;
    width: auto;
    max-width: 100%;
    /* Cap height so tall portraits (e.g. the Chase painting) don't dominate;
       wide landscapes stay full-width since their height is well under the cap. */
    max-height: 500px;
    height: auto;
    margin: 0 auto;
}
.article-image__credit {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    font-style: italic;
    color: var(--xf-textColorMuted, #777);
}

/* Add padding to message expand wrapper */
.message-expandWrapper.js-expandWatch.is-expanded {
    padding: 12px;
}

/* Message footer styling */
.message-footer {
    margin-top: 12px;
    border-top: 1px solid var(--xf-borderColor, #e0e0e0);
    padding-top: 12px;
}

/* Action bar styling */
.actionBar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.actionBar-set {
    display: flex;
    align-items: center;
    gap: 8px;
}

.actionBar-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--xf-borderRadius, 3px);
    color: var(--xf-textColorMuted, #6c757d);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.actionBar-action:hover {
    color: var(--xf-textColor, #222);
    background-color: var(--xf-paletteNeutral1, #f8f9fa);
    text-decoration: none;
}

.actionBar-action i {
    font-size: 14px;
}

.actionBar-action span {
    font-weight: 500;
}

/* Specific action button styling */
.actionBar-action--reply {
    color: var(--xf-linkColor, #2196f3);
}

.actionBar-action--reply:hover {
    color: var(--xf-linkHoverColor, #1976d2);
}

.actionBar-action--edit {
    color: var(--xf-textColorMuted, #6c757d);
}

.actionBar-action--edit:hover {
    color: var(--xf-textColor, #222);
}

.actionBar-action--delete {
    color: #dc3545;
}

.actionBar-action--delete:hover {
    color: #c82333;
    background-color: rgba(220, 53, 69, 0.1);
}

.actionBar-action--report {
    color: var(--xf-textColorMuted, #6c757d);
}

.actionBar-action--report:hover {
    color: var(--xf-textColor, #222);
}

.message-footer .actionBar {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.actionBar-set--left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.actionBar-set--right {
    display: flex;
}

.actionBar-action--report i {
    font-family: "Font Awesome 5 Free";
    font-weight: 400;
}

.actionBar-action--reply i {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.actionBar-set--left .actionBar-action:hover {
    background-color: transparent;
    color: var(--xf-linkHoverColor, #1976d2);
}

/* ==========================================================================
 * Single-post article rail (sidebar) + full-width related strip.
 * Reuses the front-page card primitives (.fp-item / .fp-card / .fp-cat-label
 * from frontpage.css); the rules below add the single-post chrome around them.
 * ========================================================================== */

/* --- Category-scoped sidebar widgets ------------------------------------ */
.article-sidebar .widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Colored accent square that ties the widget to its category. */
.article-sidebar .widget-title__accent {
    flex: 0 0 auto;
    width: 4px;
    align-self: stretch;
    min-height: 1em;
    margin: -2px 0;
    background: var(--cat-color, #c0392b);
    border-radius: 2px;
}

/* The list of latest-in-category items sits in the padded .widget-body. */
.article-sidebar .fp-module-list .fp-item:first-child {
    padding-top: 0;
}
.article-sidebar .fp-item-title {
    font-size: 14px;
    line-height: 1.35;
}
.article-sidebar .fp-item-thumb {
    flex: 0 0 60px;
}
.article-sidebar .fp-item-thumb img {
    width: 60px;
    height: 60px;
}

/* "More in {Category}" footer link. */
.article-sidebar .widget-more {
    display: inline-block;
    margin-top: 14px;
    font: 700 12px/1.4 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--xf-linkColor, #2f78c4);
}
.article-sidebar .widget-more:hover {
    text-decoration: underline;
}

/* --- "Popular in {Category}" ranked list -------------------------------- */
.article-sidebar .community-popular {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: none;
}
.article-sidebar .fp-item--rank {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.article-sidebar .fp-rank {
    flex: 0 0 auto;
    width: 26px;
    font: 800 20px/1 Georgia, "Times New Roman", serif;
    color: var(--cat-color, #c0392b);
    text-align: center;
    opacity: .85;
}

/* --- Community profile widget (XenWord login/profile) -------------------
 * The widget renders native XenForo block markup (block-container / visitorText
 * / xenforo-btn …), styled by XF's own CSS. Only the rail-fit tweak is needed. */
.article-sidebar .widget_xenword_login_widget .block-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* --- Full-width "Related articles" strip -------------------------------- */
/* Boxless titled section, matching the front-page modules + the live site's
 * "Related news": a colored category label sitting on a 2px header rule. */
.article-related {
    margin-top: 36px;
}
.article-related__head {
    margin: 0 0 18px;
    border-bottom: 2px solid #1a1a1a;
    line-height: 1;
}
.article-related__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
/* Keep every card's media box the same height so the titles line up, whether
 * or not the post has a featured image. */
.article-related .fp-card-thumb img,
.article-related .fp-noimg {
    height: 150px;
    min-height: 150px;
}

@media (max-width: 900px) {
    .article-related__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .article-related__grid { grid-template-columns: 1fr; }
}
