/*
Theme Name: Ulster Society Archive
Description: A quiet, text-led reference archive. Times New Roman, blue links, clear categories and native WordPress editing. Includes an Archive Desk, editable post outlines and automatic indexes. No page builder required.
Version: 1.2.0
Requires at least: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ulster-society-archive
Tags: blog, news, three-columns, left-sidebar, right-sidebar, custom-menu, editor-style, translation-ready
*/

:root {
    --paper: #fff;
    --ink: #171717;
    --navy: #081f35;
    --link: #0645ad;
    --visited: #59378a;
    --rule: #939da6;
    --soft-rule: #c6cbd0;
    --sidebar: #f3f3f3;
    --muted: #4d535a;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Times New Roman", Times, serif; font-size: 18px; line-height: 1.48; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:visited { color: var(--visited); }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
h1, h2, h3, h4 { color: #111; line-height: 1.15; font-weight: 700; }
h1 { font-size: 2.15rem; margin: 0 0 1.1rem; }
h2 { font-size: 1.75rem; margin: 0 0 1.1rem; }
h3 { font-size: 1.18rem; margin: 0 0 .55rem; }
h4 { font-size: 1.12rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
figure { max-width: 100%; margin: 1.5rem 0; }
figcaption, .wp-caption-text { color: var(--muted); font-size: 1rem; }
button, input, select, textarea { font: inherit; }
button, input[type="submit"] { color: #111; background: #ededed; border: 1px solid #7e7e7e; border-radius: 2px; padding: .15rem .65rem; cursor: pointer; line-height: 1.4; }
button:hover, input[type="submit"]:hover { background: #e1e1e1; }
input[type="search"], input[type="text"], input[type="email"], input[type="url"], input[type="password"], textarea { border: 1px solid #888; border-radius: 0; padding: .35rem .45rem; background: #fff; color: #111; max-width: 100%; }
input[type="search"] { -webkit-appearance: none; appearance: none; min-width: 0; }
[hidden] { display: none !important; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { clip: auto; width: auto; height: auto; display: block; padding: .8rem; top: .5rem; left: .5rem; background: #fff; z-index: 100000; }
.site-shell { width: calc(100% - 40px); max-width: 1380px; margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 18px 12px 26px; border-bottom: 3px double var(--navy); }
.site-branding { min-width: 0; }
.site-title { font-size: clamp(2.15rem,6.65vw,5.7rem); font-weight: 700; letter-spacing: -.045em; line-height: 1; margin: 0 0 .2rem; text-transform: uppercase; overflow-wrap: anywhere; }
.site-title a, .site-title a:visited { color: var(--navy); text-decoration: none; }
.site-tagline { margin: .35rem 0 0; font-size: .92rem; line-height: 1.4; letter-spacing: .19em; text-transform: uppercase; color: #171717; }
.header-note { font-style: italic; color: #333a43; text-align: right; flex: 0 0 225px; max-width: 225px; margin: 0; font-size: 1.1rem; }
.site-grid { display: grid; grid-template-columns: 212px minmax(0,1fr) 212px; align-items: stretch; }
.sidebar-left, .sidebar-right { background: var(--sidebar); padding: 26px 14px; min-width: 0; overflow-wrap: anywhere; }
.sidebar-left { border-right: 1px solid var(--rule); }
.sidebar-right { border-left: 1px solid var(--rule); }
.site-main { min-width: 0; padding: 28px 28px 40px; overflow-wrap: break-word; }
.archive-menu, .archive-menu ul, .reference-menu, .reference-menu ul, .footer-menu, .footer-menu ul { list-style: none; margin: 0; padding: 0; }
.archive-menu > li:first-child { border-top: 1px solid var(--rule); }
.archive-menu > li { border-bottom: 1px solid var(--rule); padding: .33rem 0; line-height: 1.33; }
.archive-menu a, .archive-menu a:visited { color: var(--link); display: inline-block; }
.archive-menu .current-menu-item > a, .archive-menu .current-menu-ancestor > a, .archive-menu .current-cat > a { font-weight: 700; }
.archive-menu .sub-menu, .archive-menu .children { margin: .45rem 0 .15rem .8rem; font-size: .97rem; }
.archive-menu .sub-menu li, .archive-menu .children li { margin: .35rem 0; }
.sidebar-note { border-top: 1px solid var(--navy); margin-top: 2rem; padding-top: 1rem; color: #383f47; font-size: 1.02rem; font-style: italic; }
.sidebar-title { font-size: 1.23rem; color: var(--navy); margin: 0 0 .55rem; }
.sidebar-section + .sidebar-section { margin-top: 1.7rem; }
.search-form { margin: 0; }
.search-form label { display: block; }
.search-field { display: block; width: 100%; height: 32px; margin: 0 0 .5rem; }
.search-submit { font-size: 1.04rem; }
.reference-menu li { margin: 0 0 .42rem; line-height: 1.34; }
.reference-menu a, .reference-menu a:visited { color: var(--link); }
.site-notice { border-top: 1px solid var(--navy); margin-top: 2.75rem !important; padding-top: 1.2rem; font-size: 1.05rem; }
.site-notice p:last-child, .sidebar-note p:last-child { margin-bottom: 0; }
.home-introduction { font-size: 1.16rem; line-height: 1.47; }
.home-introduction > :last-child { margin-bottom: 0; }
.home-section { border-top: 1px solid var(--rule); margin-top: 1.65rem; padding-top: 1rem; }
.featured-topics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.featured-topics.topic-count-1 { grid-template-columns: 1fr; }
.featured-topics.topic-count-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.featured-topics.topic-count-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.topic { padding: 0 12px; border-left: 1px solid var(--soft-rule); display: flex; flex-direction: column; }
.topic:first-child { border-left: 0; padding-left: 4px; }
.topic:last-child { padding-right: 0; }
.topic h3 { font-size: 1.12rem; }
.topic p { font-size: 1.035rem; line-height: 1.32; margin: 0 0 1rem; }
.topic .topic-link { margin-top: auto; margin-bottom: 0; font-size: 1rem; }
.home-lower { display: grid; grid-template-columns: minmax(0,1fr) 175px; gap: 20px; }
.home-lower.no-focus { grid-template-columns: 1fr; }
.latest-list { list-style: none; padding: 0; margin: 0; }
.latest-list li { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 8px; padding: .33rem 0; line-height: 1.4; font-size: 1rem; }
.latest-list time { color: #383f47; font-size: .95rem; white-space: nowrap; }
.more-link { margin-top: .9rem; font-size: 1rem; }
.in-focus { border-left: 1px solid var(--rule); padding-left: 14px; }
.in-focus h2 { font-size: 1.65rem; }
.focus-box { border: 1px solid var(--soft-rule); padding: .65rem; background: #f3f3f3; font-size: 1.035rem; line-height: 1.35; }
.focus-box h3 { font-size: 1.1rem; }
.focus-box p:last-child { margin-bottom: 0; }
.empty-state { color: var(--muted); font-size: 1.05rem; }
.site-footer { border-top: 2px solid var(--navy); padding: 20px 0 25px; text-align: center; font-size: .92rem; }
.footer-menu { display: flex; justify-content: center; flex-wrap: wrap; row-gap: .5rem; margin: 0 0 1rem; }
.footer-menu li { padding: 0 .6rem; border-right: 1px solid #93999f; line-height: 1; }
.footer-menu li:last-child { border: 0; }
.site-footer p { margin: .2rem 0; }
.footer-motto { font-style: italic; color: #383f47; }
.nav-toggle { display: none; }
.breadcrumbs { font-size: .94rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs span[aria-hidden] { margin: 0 .4rem; }
.entry-meta { font-size: .95rem; color: var(--muted); border-bottom: 1px solid var(--soft-rule); padding: 0 0 .9rem; margin-bottom: 1.25rem; }
.entry-meta .meta-separator { padding: 0 .4rem; }
.entry-content { font-size: 1.13rem; line-height: 1.6; }
.entry-content h2 { margin-top: 2rem; font-size: 1.6rem; }
.entry-content h3 { margin-top: 1.6rem; font-size: 1.28rem; }
.entry-content p, .entry-content ul, .entry-content ol { margin-bottom: 1.1rem; }
.entry-content li { margin-bottom: .45rem; }
.entry-content a { overflow-wrap: anywhere; }
.entry-content :where(h2,h3,h4,[id]) { scroll-margin-top: 1.5rem; }
.entry-content blockquote { border-left: 2px solid var(--rule); margin: 1.3rem 0; padding: .2rem 1.1rem; color: #333a43; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.entry-content th, .entry-content td { border: 1px solid var(--soft-rule); padding: .55rem; text-align: left; vertical-align: top; }
.entry-content th { background: #f3f3f3; }
.entry-content pre { overflow: auto; padding: 1rem; background: #f3f3f3; font-size: .85rem; }
.entry-content hr { border: 0; border-top: 1px solid var(--rule); margin: 1.8rem 0; }
.wp-block-table { overflow-x: auto; }
.wp-block-button__link { background: #ededed; color: var(--link); border: 1px solid #888; border-radius: 0; padding: .4rem .8rem; font-family: inherit; text-decoration: underline; }
.alignleft { float: left; margin: .5rem 1.2rem 1rem 0; }
.alignright { float: right; margin: .5rem 0 1rem 1.2rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content::after { content: ""; display: block; clear: both; }
.article-contents { margin: 0 0 1.4rem; padding: .75rem 1rem; border: 1px solid var(--soft-rule); background: #f7f7f7; font-size: 1rem; }
.article-contents summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.article-contents ol { margin-bottom: 0; }
.article-contents li { margin: .35rem 0; }
.article-contents .toc-subheading { margin-left: .9rem; font-size: .96rem; }
.article-footer { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 2rem; font-size: .98rem; }
.archive-introduction { font-size: 1.1rem; margin-bottom: 1.2rem; }
.archive-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: .65rem 0; margin: 1.2rem 0; font-size: 1rem; }
.archive-tools p { margin: 0; }
.sort-links a, .sort-links strong { margin-left: .6rem; }
.archive-entry { padding: 1.1rem 0; border-bottom: 1px solid var(--soft-rule); }
.archive-entry h2 { font-size: 1.4rem; margin: 0 0 .4rem; }
.archive-entry .entry-meta { border: 0; margin: 0 0 .5rem; padding: 0; }
.archive-entry .entry-summary { font-size: 1.06rem; }
.archive-entry p:last-child { margin-bottom: 0; }
.navigation.pagination { padding: 1.5rem 0 .2rem; font-size: 1rem; }
.page-numbers { display: inline-block; padding: .2rem .4rem; margin-right: .2rem; }
.page-numbers.current { background: #eee; font-weight: 700; }
.section-directory { list-style: none; padding: 0; }
.section-directory li { border-bottom: 1px solid var(--soft-rule); padding: .9rem 0; }
.section-directory h2 { font-size: 1.3rem; margin: 0 0 .3rem; }
.section-directory p { font-size: 1.04rem; margin: 0; }
.section-count { color: var(--muted); font-weight: 400; font-size: .9rem; margin-left: .3rem; }
.page-links { margin-top: 1rem; }
.reading-width { max-width: 75ch; }
.sticky { border-left: 2px solid var(--rule); padding-left: 1rem; }

@media (min-width: 1450px) {
    .site-grid { grid-template-columns: 224px minmax(0,1fr) 222px; }
    .site-main { padding-right: 32px; padding-left: 32px; }
}
@media (max-width: 1100px) {
    .site-grid { grid-template-columns: 180px minmax(0,1fr) 180px; }
    .site-main { padding: 24px 20px 32px; }
    .sidebar-left, .sidebar-right { padding: 23px 12px; font-size: 1.03rem; }
    .header-note { flex-basis: 190px; font-size: 1rem; }
    .site-tagline { font-size: .75rem; letter-spacing: .14em; }
    .featured-topics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.2rem 0; }
    .featured-topics:not(.topic-count-3) .topic:nth-child(3) { border-left: 0; padding-left: 4px; }
    .home-lower { grid-template-columns: 1fr; }
    .in-focus { border-left: 0; border-top: 1px solid var(--soft-rule); padding: 1rem 0 0; }
}
@media (max-width: 850px) {
    .site-grid { grid-template-columns: 180px minmax(0,1fr); }
    .sidebar-right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; }
    .sidebar-right .sidebar-section, .sidebar-right .site-notice { margin: 0 !important; }
    .site-notice { border-top: 0; padding-top: 0; }
    .header-note { display: none; }
    .site-title { font-size: clamp(2rem,8.5vw,5rem); }
    .site-tagline { font-size: .78rem; }
}
@media (max-width: 620px) {
    .site-shell { width: calc(100% - 24px); }
    .site-header { padding: 18px 0; }
    .site-title { font-size: clamp(1.9rem,9.1vw,3.5rem); letter-spacing: -.045em; }
    .site-tagline { font-size: .67rem; letter-spacing: .08em; line-height: 1.6; max-width: 360px; }
    .site-grid { display: block; }
    .sidebar-left { border-right: 0; border-bottom: 1px solid var(--rule); padding: .6rem .7rem; }
    .nav-toggle:not([hidden]) { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: .25rem 0; border: 0; background: transparent; color: var(--link); text-decoration: underline; text-align: left; font-weight: 700; }
    .archive-menu { padding-top: .7rem; }
    .archive-menu > li { padding: .5rem 0; }
    .sidebar-note { display: none; }
    .site-main { padding: 23px 8px 30px; }
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }
    .home-introduction, .entry-content { font-size: 1.08rem; }
    .featured-topics, .featured-topics.topic-count-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .featured-topics .topic:nth-child(3) { border-left: 0; padding-left: 4px; }
    .featured-topics.topic-count-1 { grid-template-columns: 1fr; }
    .topic { padding: 0 9px; }
    .topic h3 { font-size: 1.08rem; }
    .sidebar-right { display: block; padding: 20px 12px; }
    .sidebar-right .sidebar-section + .sidebar-section { margin-top: 1.5rem !important; }
    .sidebar-right .site-notice { border-top: 1px solid var(--rule); padding-top: 1.1rem; }
    .search-field { max-width: 360px; }
    .latest-list li { grid-template-columns: 80px minmax(0,1fr); }
    .latest-list time { font-size: .87rem; }
    .site-footer { font-size: .9rem; }
    .alignleft, .alignright { float: none; margin: 1rem 0; }
}
@media print {
    @page { margin: 18mm; }
    body { font-size: 11pt; color: #000; }
    .site-shell { width: 100%; max-width: none; }
    .site-header { padding: 0 0 12pt; }
    .site-title { font-size: 25pt; }
    .site-tagline { font-size: 8pt; }
    .site-grid { display: block; }
    .site-main { padding: 16pt 0; }
    .sidebar-left, .sidebar-right, .header-note, .nav-toggle, .screen-reader-text, .breadcrumbs, .article-contents, .pagination, .footer-menu, .sort-links, .search-form, .edit-link { display: none !important; }
    a, a:visited { color: #000; }
    .entry-content a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; overflow-wrap: anywhere; }
    h1, h2, h3 { break-after: avoid; }
    p, li { orphans: 3; widows: 3; }
    .site-footer { border-top: 1px solid #000; padding: 10pt 0; }
    .entry-content { font-size: 11pt; }
}

/* Ulster Society: everyday reading and editorial shortcuts. */
.home-entry-list { list-style: none; margin: 0; padding: 0; }
.home-entry-list > li { padding: .9rem 0; border-bottom: 1px solid var(--soft-rule); }
.home-entry-list > li:first-child { padding-top: .1rem; }
.home-entry-list h3 { font-size: 1.22rem; margin-bottom: .25rem; }
.home-entry-list p { margin: .3rem 0 0; font-size: 1.04rem; }
.home-entry-list .compact-meta, .section-note { font-size: .91rem; color: var(--muted); }
.edit-link { font-family: system-ui,sans-serif; font-size: .8rem; padding: .55rem .7rem; border: 1px dashed var(--rule); background: #fafafa; margin: .9rem 0; }
.edit-link span { color: var(--muted); }
.index-subjects { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: 1rem 0; font-size: 1rem; }
.site-notice { font-size: .97rem; line-height: 1.45; }
@media(max-width:620px) { .site-title { font-size: clamp(1.9rem,9.5vw,3.5rem); letter-spacing: -.035em; } }

/* v1.2: restrained publication imagery and slightly richer archival detailing. */
.archive-cover-single { float: right; width: min(31%, 230px); margin: .25rem 0 1.25rem 1.5rem; padding: .55rem; border: 1px solid #c8ced3; background: #faf9f6; box-shadow: 2px 3px 0 #e5e5e2; }
.archive-cover-image { display: block; width: 100%; height: auto; }
.archive-cover-single figcaption { margin-top: .4rem; text-align: center; color: #59636b; font-size: .76rem; font-style: italic; }
.archive-cover-link { display: block; float: left; width: 74px; margin: .1rem 1rem .45rem 0; }
.archive-cover-small { display: block; width: 74px; height: 94px; object-fit: contain; object-position: top; border: 1px solid #c8ced3; padding: 3px; background: #faf9f6; }
.archive-entry::after, .home-entry-item::after { content: ''; display: block; clear: both; }
.archive-entry h2 a, .home-entry-item h3 a { text-underline-offset: 2px; }
.archive-entry:hover, .home-entry-item:hover { background: #fbfaf7; }
.archive-entry, .home-entry-item { transition: background-color .15s ease; }
.reading-room > h1 { border-bottom: 1px solid #d7dce0; padding-bottom: .6rem; }
@media (max-width: 620px) { .archive-cover-single { float: none; width: min(75%, 220px); margin: 1rem auto; } .archive-cover-link { width: 58px; margin-right: .7rem; } .archive-cover-small { width: 58px; height: 76px; } }
@media print { .archive-cover-single { box-shadow: none; } .archive-entry:hover, .home-entry-item:hover { background: transparent; } }
