/**
 * bw-common: shared styles for Bill Ward's WordPress themes.
 *
 * Enqueue from child theme:
 *   wp_enqueue_style('bw-common', get_theme_root_uri() . '/bw-common/common.css', array('generatepress'));
 */

/* ── Base ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.65;
}

/* ── Override GP padding on articles ── */
.separate-containers .inside-article,
.inside-article {
    padding: 20px !important;
    margin-bottom: 0;
}

/* ── Hide GP default sidebars ── */
#right-sidebar, #left-sidebar, .sidebar {
    display: none !important;
}

/* ── Grid card layout ── */
.site-main {
    width: 100% !important;
    display: grid;
    gap: 20px;
}
.site-main .paging-navigation,
.site-main nav.navigation {
    grid-column: 1 / -1;
}

/* ── Single post: centered column ── */
.single .site-main {
    display: block;
    max-width: none;
}
.single .inside-article {
    padding: 24px 28px !important;
}
.page .site-main {
    display: block;
    max-width: 720px;
    margin: 0 auto;
}

/* ── Headings ── */
h1, h2, h3, h4 {
    line-height: 1.3;
}
.entry-title {
    font-size: 1.4em;
    margin-bottom: 4px;
}
.entry-title a {
    text-decoration: none;
}

/* ── Post meta (date) ── */
header.entry-meta {
    font-size: 0.82em;
    margin-bottom: 4px !important;
}
.byline {
    display: none;
}

/* ── Featured image in stream ── */
.post-image {
    margin-bottom: 8px;
}
.post-image {
    margin-bottom: 8px;
    container-type: inline-size;
}
.post-image img {
    max-width: 100%;
    max-height: 100cqi;
    height: auto;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* ── Content ── */
.entry-content,
.entry-summary {
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 6px;
}

/* ── Read more: inline with last text line, floated right ── */
.entry-content p:has(+ p.read-more-container),
.entry-summary p:has(+ p.read-more-container) {
    display: inline !important;
    margin: 0 !important;
}
.entry-content p.read-more-container,
.entry-summary p.read-more-container {
    display: inline !important;
    margin: 0 !important;
    padding: 0;
}
.read-more {
    float: right;
    font-size: 0.9em;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 0.5em;
}
/* Clear float + consistent gap before footer meta */
.entry-content::after,
.entry-summary::after {
    content: '';
    display: block;
    clear: both;
    margin-bottom: 8px;
}

/* ── Footer meta: cats/tags row, then actions row ── */
footer.entry-meta {
    display: block;
}
footer.entry-meta .cat-links {
    padding: 2px 6px 2px 0;
}
footer.entry-meta .tags-links {
    padding: 2px 0;
}
/* Actions row below the table */
footer.entry-meta .bp-actions {
    display: block;
    clear: both;
    text-align: center;
    margin-top: 4px;
}
footer.entry-meta > .comments-link { display: none; }
footer.entry-meta .cat-links,
footer.entry-meta .tags-links { font-size: 0; }
footer.entry-meta .cat-links a,
footer.entry-meta .tags-links a,
footer.entry-meta .comments-link { font-size: 0.82rem; }

/* ── Tag pills (outlined, # prefix) ── */
.entry-meta .tags-links a {
    display: inline-block;
    background: transparent;
    padding: 1px 8px;
    border-radius: 2px;
    border: 1px solid;
    text-decoration: none;
    margin: 2px 2px;
}

/* ── Category pills (filled) ── */
.entry-meta .cat-links a {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 2px;
    text-decoration: none;
    margin: 2px 2px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Hide redundant icons/labels ── */
.cat-links .screen-reader-text,
.tags-links .screen-reader-text,
.cat-links .gp-icon,
.tags-links .gp-icon,
.comments-link .gp-icon { display: none; }
footer.entry-meta > .comments-link { display: none; }

/* ── Hide GP default edit link ── */
.post-edit-link, footer.entry-meta .edit-link { display: none; }

/* ── Action buttons (Comment/Edit) ── */
.bw-actions, .pmtg-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 4px;
    margin-bottom: 0;
    text-align: center;
}

/* ── Post navigation ── */
.post-navigation, .paging-navigation { grid-column: 1 / -1; }
.single .post-navigation {
    margin-top: 16px;
    padding-top: 12px;
}
.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}
.post-navigation .nav-next { text-align: right; }

/* ── Single post featured image ── */
.single .post-image { margin: -24px -28px 20px -28px; }
.single .post-image img { border-radius: 2px 2px 0 0; max-height: none; }

/* ── Fixed header (when shrink JS is active) ── */
body[data-shrink-dist] .site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 60;
}

/* ── #more anchor: no longer needed, stripped from links via PHP ── */

/* ── Form tweaks ── */
.required-field-message { display: none; }

/* ── Lightstrip + migration note ── */
.ls-viewer { margin: 8px 0; }
.migration-note { font-size: 0.8em; font-style: italic; }

/* ── Archive/category/tag headers ── */
.page-header,
.separate-containers .page-header {
    grid-column: 1 / -1;
    padding: 10px 20px 10px 20px !important;
    border-radius: 2px;
    margin-bottom: 0;
}
.page-header .page-title, .page-header h1 { font-size: 1.3em; margin: 0; }
.page-header .archive-label {
    font-weight: normal;
    font-size: 0.75em;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Override GP container constraints ── */
.grid-container,
.site-content .grid-container,
body .grid-container {
    max-width: 100% !important;
}

/* ── Responsive base ── */
@media (max-width: 768px) {
    .site-main {
        grid-template-columns: 1fr !important;
    }
    .inside-article { padding: 16px !important; }
    .entry-title { font-size: 1.25em; }
    .single .post-image { margin: -16px -16px 14px -16px; }
}
