/* ==========================================================================
   6.0 Custom HTML Components for Blog Posts (Audited BDLD Auto-Styles)
   For editor-posted custom div classes (.bdld-article-wrap, .bdld-highlight-box, etc.)
   ========================================================================== */
:root {
    --bdld-bg-white: #ffffff;
    --bdld-ink: #1a1a1a;
    --bdld-accent-red: #991B1F;        /* Penn Red */
    --bdld-navy: #011F5B;              /* Penn Blue */
    --bdld-font-main: 'Source Sans 3', system-ui, -apple-system, sans-serif;
    --bdld-font-heading: 'Source Sans 3', system-ui, -apple-system, sans-serif;
}

.bdld-article-wrap {
    background-color: var(--bdld-bg-white);
    color: var(--bdld-ink);
    font-family: var(--bdld-font-main);
    line-height: 1.8;
    font-size: 18px;
    max-width: 56rem;
    margin: 0 auto;
    padding: 10px 20px 40px;
    overflow-wrap: break-word;
}

/* ==========================================================================
   Separated Typography Rules for Articles vs Blog Posts
   ========================================================================== */


/* Adjacent article navigation */

.bdld-article-wrap a,
.entry-content a {
    color: var(--bdld-accent-red);
    text-decoration: none;
    border-bottom: 1px dotted var(--bdld-accent-red);
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.bdld-article-wrap a:hover,
.entry-content a:hover {
    background-color: var(--bdld-accent-red);
    color: #fff;
    border-bottom: 1px solid var(--bdld-accent-red);
}
.bdld-subhead {
    font-family: var(--bdld-font-main);
    font-weight: 700;
    font-size: clamp(1.6rem, 2vw, 2rem);
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #011F5B;
    border-left: 5px solid var(--bdld-accent-red, #991B1F);
    padding-left: 18px;
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
}
.bdld-highlight-box,
.is-style-bdld-highlight-box,
.wp-block-group.is-style-bdld-highlight-box {
    background: #EEF4FB;
    border: 2px solid var(--bdld-navy);
    padding: 25px;
    margin: 30px 0;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.1);
    position: relative;
}
.bdld-highlight-title {
    background: var(--bdld-navy);
    color: #fff;
    font-family: var(--bdld-font-main);
    text-transform: uppercase;
    font-weight: bold;
    font-size: 14px;
    padding: 5px 15px;
    display: inline-block;
    position: absolute;
    top: -15px;
    left: 20px;
}
.bdld-highlight-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}
.bdld-highlight-list li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    font-family: var(--bdld-font-main);
    font-size: 15px;
}
.bdld-highlight-list li::before {
    content: "\27A4"; /* âž¤ */
    color: var(--bdld-accent-red);
    position: absolute;
    left: 0;
    font-size: 12px;
    top: 3px;
}
.bdld-pull-quote,
.single-post .entry-content blockquote,
.single-post .bdld-article-wrap blockquote {
    background: #EEF4FB;
    font-size: 1.25rem; /* 20px instead of 24px */
    font-style: italic;
    color: var(--bdld-accent-red);
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    padding: 20px 40px;
    margin: 40px 0;
    text-align: center;
    font-family: var(--bdld-font-main);
    font-weight: 500;
}
.bdld-drop-cap::first-letter {
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    padding-right: 8px;
    padding-top: 4px;
    color: var(--bdld-ink);
    font-weight: bold;
}

/* --- Footnotes --- */
.bdld-footnotes {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px solid var(--bdld-ink); /* Mapped to existing root var */
    font-size: 14px;
    line-height: 1.6;
}
.bdld-footnotes h4 {
    font-family: var(--bdld-font-main);
    text-transform: uppercase;
    font-size: 16px;
    margin-bottom: 10px;
}
.bdld-footnotes ol:not(.sidenotes-list) {
    padding-left: 0;
    margin: 0;
    list-style-type: none;
    counter-reset: bdld-footnote;
}
.bdld-footnotes li:not(.sidenote-item) {
    margin-bottom: 12px;
    position: relative;
    counter-increment: bdld-footnote;
    padding-left: 36px;
}
.bdld-footnotes li:not(.sidenote-item)::before {
    content: counter(bdld-footnote) ". ";
    position: absolute;
    left: 6px;
    top: 0;
    font-weight: bold;
    color: #31BFF0; /* Penn Cyan */
}
.bdld-footnotes li:not(.sidenote-item):target {
    background-color: #EEF4FB;
    padding: 2px 5px;
    border-radius: 4px;
}

/* --- Footnotes: sidebar sidenote mode (desktop only) --- */
@media (min-width: 1140px) {
    /* Wrap: relative anchor + right padding for sidebar space (ONLY if footnotes exist) */
    .bdld-article-wrap:has(> .bdld-footnotes) {
        max-width: 75rem !important;
        position: relative !important;
        padding-right: 230px !important;
        overflow: visible !important;
    }
    /* Sidebar panel: absolute, pinned to top-right of wrap, moved further left */
    .bdld-article-wrap > .bdld-footnotes {
        position: absolute !important;
        top: 0 !important;
        right: 25px !important;
        width: 190px !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
        padding-left: 14px !important;
        box-sizing: border-box !important;
        visibility: hidden;
    }
    /* Hide heading in sidebar mode */
    .bdld-article-wrap > .bdld-footnotes > h4 {
        display: none !important;
    }
    /* ol: clean reset */
    .bdld-article-wrap > .bdld-footnotes ol:not(.sidenotes-list) {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    /* li: compact (â‰ˆ3 lines with ...), YLJ typography â€” JS owns positioning */
    .bdld-article-wrap > .bdld-footnotes li:not(.sidenote-item) {
        margin-bottom: 0 !important;
        padding: 3px 0 !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
        color: #888888 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        cursor: pointer !important;
        transition: top 0.25s ease-out, color 0.15s ease !important;
    }
    .bdld-article-wrap > .bdld-footnotes li:not(.sidenote-item):hover {
        color: #333 !important;
    }
    /* Number via ::before counter */
    .bdld-article-wrap > .bdld-footnotes li:not(.sidenote-item)::before {
        content: counter(bdld-footnote) ". " !important;
        position: static !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        margin-right: 8px !important;
        display: inline-block !important;
        color: #888888 !important;
    }
    /* Hide â†© back-link */
    .bdld-article-wrap > .bdld-footnotes li a[title="Jump back to text"],
    .bdld-article-wrap > .bdld-footnotes li a[href^="#ref"] {
        display: none !important;
    }
    /* Links inside sidebar footnotes: muted */
    .bdld-article-wrap > .bdld-footnotes li a {
        color: #888888 !important;
        border-bottom: 1px solid #ccc !important;
        text-decoration: none !important;
    }
    .td-post-content {
        position: static !important;
        padding-right: 0 !important;
    }
}
/* ==========================================================================
   Pagination Styling (Matches Underscores the_posts_pagination() output)
   ========================================================================== */
.pagination {
	margin: 10px 0 60px 0; /* Near the cards, with space below */
	text-align: center;
	clear: both;
}
.pagination .nav-links {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}
.pagination .page-numbers {
	display: inline-block;
	padding: 8px 16px;
	font-family: 'Source Sans 3', ui-sans-serif, system-ui, sans-serif; /* Clean system UI */
	font-size: 1rem;
	font-weight: 600;
	color: #011F5B; /* Penn Navy */
	background: #f2f2f2; /* Penn Grey */
	border-radius: 4px;
	text-decoration: none !important;
	border: 1px solid transparent;
	transition: background-color 0.2s ease, color 0.2s ease, border-bottom-color 0.2s ease;
}
.pagination .page-numbers:hover,
.pagination .page-numbers:focus {
	background: #e8e8e8;
	color: #991B1F !important; /* Penn Red hover */
	border-bottom: 1px solid transparent !important;
}
.pagination .page-numbers.current {
	background: #011F5B;
	color: #ffffff !important;
	pointer-events: none;
}
.pagination .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* ==========================================================================
   Journal Article Global Components & Layout
   ========================================================================== */


/* 1. Title and Headings */

/* =====================================================================
   BDLD Heading Hierarchy & Typography Standard
   Applies to article bodies only (blog posts, legal analysis, journal
   articles). Author boxes, related posts, footer/sidebar widgets,
   search modals, navigation and comment areas are excluded.
   ===================================================================== */


/* Override highlight box typography to prevent inheriting massive blog body sizes */
.bdld-highlight-box,
.bdld-highlight-box p,
.bdld-highlight-box ul,
.bdld-highlight-box ol,
.bdld-highlight-box li {
    font-size: 16px !important;
    line-height: 1.6 !important;
}


/* BDLD Academic Search Overlay */
@keyframes bdld_slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close-search-overlay:hover { background: #fee2e2 !important; color: #ef4444 !important; }


.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	background: #011F5B;
	color: #ffffff;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	padding: 12px 20px;
	border-radius: 0 0 4px 0;
	text-decoration: none;
}

.skip-link:focus {
	left: 0;
	clip: auto;
	width: auto;
	height: auto;
	overflow: visible;
}