/* Wikipedia Vector Theme CSS Clone */

/* ============================================= */
/* 1. VARIABLES AND CORE SETUP                   */
/* ============================================= */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap');

:root {
  /* Light Mode Color Scheme */
  --page-bg: #f8f9fa;
  --content-bg: #ffffff;
  --border-color: #a2a9b1;
  --border-color-light: #c8ccd1;
  --link-color: #3366cc;
  --link-visited-color: #884fbe;
  --text-color: #202122;
  --header-bg: #eaecf0;
  --sidebar-hover-bg: #eaf3ff;
  --tab-bg: #f0f3f5;
  --tab-hover-bg: #e4e8eb;
  --action-bg: #f8f9fa;
  --action-hover-bg: #eaecf0;
  --action-active-bg: #dde3ea;

  
  /* Typography */
  --font-body: "Liberation Sans", sans-serif;
  --font-heading: 'EB Garamond', serif;
}

/* Dark Mode */
[data-theme="dark"] {
  --page-bg: #1a1a1b;
  --content-bg: #1e1e1f;
  --border-color: #343536;
  --border-color-light: #3a3a3c;
  --link-color: #6b9bff;
  --link-visited-color: #b894ff;
  --text-color: #d7dadc;
  --header-bg: #272729;
  --sidebar-hover-bg: #2a3f5f;
  --tab-bg: #272729;
  --tab-hover-bg: #343536;
  --action-bg: #272729;
  --action-hover-bg: #343536;
  --action-active-bg: #3a3a3c;
}

/* Universal Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--page-bg);
  color: var(--text-color);
}

a {
  text-decoration: none;
  color: var(--link-color);
}

a:visited {
  color: var(--link-visited-color);
}

a:hover {
  text-decoration: underline;
}

/* ============================================= */
/* 2. OVERALL LAYOUT (Three-Column Structure)    */
/* ============================================= */
#app-container {
  display: flex;
  position: relative;
}

/* Left Sidebar Panel */
#mw-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 10rem;
  /* 160px */
  background-color: var(--page-bg);
  overflow-y: auto;
  border-right: 1px solid var(--border-color-light);
  z-index: 100;
}

/* Main content area */
#mw-content-container {
  margin-left: 10rem;
  /* Same as sidebar width */
  flex-grow: 1;
  padding: 0 1rem;
  /* Creates the "slim right margin" */
}

/* ============================================= */
/* 3. LEFT SIDEBAR (#mw-panel)                   */
/* ============================================= */
#mw-panel .logo {
  text-align: center;
  padding: 1rem 0.5rem;
  margin-bottom: 1rem;
}

#mw-panel .logo img {
  max-width: 120px;
  height: auto;
}

.post-content {
  max-width: 100vw;
}

.post-content blockquote {
  font-style: italic;
  border-left: 2px solid var(--border-color);
  padding-left: 20px;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1rem;
}

.post-content li {
  margin-left: 15px;
}

.post-content p {
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.post-content .image {
  display: flex;
  flex-direction: column;
  font-style: italic;
  font-size: 14px;
  border: 1px solid var(--border-color);
  background-color: var(--page-bg);
  font-size: 0.85em;
  padding: 10px;
  max-width: 30%;
  float: right;
  margin-left: 20px;
  margin-right: 10px;
  gap: 5px;
}

.post-content .image img {
  flex-grow: 0;
  flex-shrink: 0;
  object-fit: contain;
  height: 150px;
}

.post-content .map {
  display: block;
  float: none;
  max-width: 50%;
}

.post-content .map img {
  height: 230px;
}

@media (max-width: 768px) {
  .post-content .image {
    float: none;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;

  }

  .post-content .map {
    margin: auto;
  }
}



.portal {
  padding: 0 0.6rem;
  margin-bottom: 0.5rem;
}

.portal h3,
.portal summary {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-color);
  margin: 1rem 0 0.5rem;
  padding-left: 0.5rem;
  cursor: pointer;
  list-style: none;
  /* Hide arrow for summary */
}

.portal summary::-webkit-details-marker {
  display: none;
  /* Hide arrow for summary */
}

.portal ul {
  list-style: none;
}

.portal li a {
  display: block;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 2px;
}

.portal li a:hover {
  background-color: var(--sidebar-hover-bg);
  text-decoration: none;
}

/* ============================================= */
/* 3.5 THEME TOGGLE BUTTON                       */
/* ============================================= */
#theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  background-color: var(--content-bg);
  color: var(--text-color);
}

#theme-toggle:hover {
  background-color: var(--header-bg);
  border-color: var(--border-color-light);
}

#theme-toggle .theme-icon {
  display: inline-block;
  line-height: 1;
}

/* ============================================= */
/* 4. HEADER TABS (#mw-head)                     */
/* ============================================= */
#mw-head {
  padding-top: 1rem;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
}

#mw-head-tabs {
  list-style: none;
  display: flex;
  margin-bottom: -1px;
  /* Overlap border with content border */
  align-items: center;
  min-width: min-content;
  flex-wrap: nowrap;
}

#mw-head-tabs li a {
  display: block;
  padding: 0.75rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  background-color: var(--tab-bg);
  border: 1px solid transparent;
  border-bottom: none;
  white-space: nowrap;
}

#mw-head-tabs li.selected a {
  background-color: var(--content-bg);
  border-color: var(--border-color);
  border-bottom-color: var(--content-bg);
}

#mw-head-tabs li:not(.selected) a:hover {
  background-color: var(--tab-hover-bg);
  text-decoration: none;
}

/* Search tab styling */
#mw-head-tabs li.search-tab {
  margin-left: auto;
  padding: 0.5rem 1rem;
  flex-shrink: 0;
}

#mw-head-tabs li.search-tab form {
  margin: 0;
}

#mw-head-tabs li.search-tab input[type="search"] {
  width: 250px;
  min-width: 150px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 0.85rem;
  background-color: var(--content-bg);
  color: var(--text-color);
}

/* Theme toggle in header */
#mw-head-tabs li.theme-toggle-tab {
  padding: 0.5rem 0.5rem;
  flex-shrink: 0;
}

/* ============================================= */
/* 5. MAIN CONTENT & TYPOGRAPHY (#content)       */
/* ============================================= */
#content {
  position: relative;
  background-color: var(--content-bg);
  border: 1px solid var(--border-color);
  padding: 2rem 5rem 2rem 5rem;
  min-height: 100vh;
}

.copy-article-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  background: var(--action-bg);
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.copy-article-btn:hover {
  background: var(--action-hover-bg);
  border-color: var(--border-color-light);
}

.copy-article-btn:active {
  background: var(--action-active-bg);
}

.copy-article-btn:focus-visible {
  outline: 1px solid var(--link-color);
  outline-offset: 2px;
}

#siteSub {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-heading);
  font-weight: normal;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
}

h1.firstHeading {
  font-size: 1.8em;
  border-bottom: 1px solid var(--border-color-light);
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.5em;
  margin-top: 1.5rem;
  border-bottom: 1px solid var(--border-color-light);
}

h3 {
  font-size: 1.25em;
  margin-top: 1.2rem;
  font-weight: bold;
}

h4 {
  font-size: 1em;
  margin-top: 1.2rem;
  font-weight: bold;
  text-decoration: underline;
}



#catlinks {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color-light);
  font-size: 0.9rem;
}

/* ============================================= */
/* 6. COMPONENT STYLING                          */
/* ============================================= */

/* Infobox */
.infobox {
  float: right;
  width: 30%;
  min-width: 250px;
  margin: 0rem 0 1rem 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--page-bg);
  font-size: 0.85em;
}

.infobox .infobox-title {
  font-family: var(--font-heading);
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
  padding: 0.75rem;
  background-color: var(--header-bg);
}

.infobox .infobox-image {
  padding: 1rem;
  text-align: center;
}

.infobox .infobox-image img {
  max-width: 100%;
  max-height: 20vh;
}

.infobox .infobox-caption {
  font-size: 0.9em;
  padding: 0.5rem 1rem 0;
}

.infobox .infobox-data {
  width: 100%;
  border-collapse: collapse;
}

.infobox .infobox-data th,
.infobox .infobox-data td {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border-color-light);
  text-align: left;
  vertical-align: top;
}

.infobox .infobox-data th {
  font-weight: bold;
}

/* Party strength bars (Seats / Mayors / MPs) under infobox data */
.party-strength {
  padding: 0.55rem 0.75rem 0.75rem;
  border-top: 1px solid var(--border-color-light);
}

.party-strength-bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.party-strength-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.party-strength-label {
  flex: 0 0 3.6rem;
  font-size: 0.78rem;
  font-weight: bold;
  color: var(--text-color);
  text-align: right;
}

.party-strength-track {
  flex: 1;
  height: 18px;
  background-color: var(--header-bg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  min-width: 0;
}

.party-strength-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transition: width 0.45s ease-out;
}

.party-strength-fill:has(.inside) {
  padding-right: 5px;
}

.party-strength .election-bar-text {
  font-size: 10px;
}

/* ============================================= */
/* HORIZONTAL IMAGE GALLERY (Wiki Style)         */
/* ============================================= */

.wiki-gallery {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px 0 15px 0; /* Extra bottom padding for the scrollbar */
  margin: 1.5rem 0;
  width: 100%;
  
  /* Smooth scrolling on mobile */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Styling the horizontal scrollbar to match the theme */
.wiki-gallery::-webkit-scrollbar {
  height: 8px;
}
.wiki-gallery::-webkit-scrollbar-track {
  background: var(--page-bg);
  border: 1px solid var(--border-color-light);
  border-radius: 4px;
}
.wiki-gallery::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}
.wiki-gallery::-webkit-scrollbar-thumb:hover {
  background-color: var(--link-color);
}

.wiki-gallery-item {
  flex: 0 0 auto; /* Prevents items from shrinking */
  width: 220px;   /* Fixed width for each gallery card */
  border: 1px solid var(--border-color);
  background-color: var(--page-bg);
  display: flex;
  flex-direction: column;
}

.wiki-gallery-image {
  height: 180px; /* Forces all images to take up the same height */
  background-color: var(--content-bg); /* Usually white in light mode to contrast the frame */
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color-light);
}

.wiki-gallery-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Ensures images are letterboxed and never cropped/stretched */
}

.wiki-gallery-caption {
  font-size: 0.85em;
  padding: 8px 10px;
  font-style: italic;
  color: var(--text-color);
  text-align: left;
  line-height: 1.4;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .wiki-gallery-item {
    width: 180px; /* Slightly smaller boxes on mobile screens */
  }
  .wiki-gallery-image {
    height: 150px;
  }
}

/* Tables */
.wikitable {
  width: 75%;
  border-collapse: collapse;
  margin: 1rem 0;
  border: 1px solid var(--border-color);
}

.results-table {
  width: 74%;
}

.wikitable th,
.wikitable td {
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.4rem;
}

@media (max-width: 600px) {

  .wikitable td {
    font-size: 0.8rem;
  }
}

.wikitable th {
  background-color: var(--header-bg);
  font-family: var(--font-heading);
  text-align: left;
  font-weight: bold;
}

.wikitable img {
  height: 2rem;
}

.table-wrapper {
  overflow-x: auto;
}

/*Party Colours*/

.rpp {
  border-left: 6px solid #d52e5b !important;
}

.bpp,
.np {
  border-left: 6px solid #481b4a !important;
}

.vj {
  border-left: 6px solid #009b74 !important;
}

.sok {
  border-left: 6px solid #c58f2b !important;
}

.crf {
  border-left: 6px solid #80acc8 !important;
}

.bd {
  border-left: 6px solid #5831f5 !important;
}

.blf {
  border-left: 6px solid #eb4848 !important;
}

.bna {

  border-left: 6px solid #ff9c32 !important;
}
.lpp {

  border-left: 6px solid #6648eb !important;
}
.sdp {
 
  border-left: 6px solid #fe4141 !important;
}
.lcp {

  border-left: 6px solid #488ceb !important;
}
.cu {
  border-left: 6px solid #488ceb !important;
}
.conu {

  border-left: 6px solid #9f38fa !important;
}
.swl {
  border-left: 6px solid #eb6e48 !important;
}
.green {

  border-left: 6px solid #37b585 !important;
}
.lib {

  border-left: 6px solid #ffc107 !important;
}
.kca {

  border-left: 6px solid #29e89f !important;
}

.yes {
  background-color: #009b742f;
}

.no {
  background-color: #ce23233f;
}

.cancelled {
  background-color: #e0e0e0;
}



.pg {

  border-left: 6px solid #dfa53a !important;
}

.apf {

  border-left: 6px solid #51dadc !important;
}

.ku {
  border-left: 6px solid #003b80 !important;
}

.cnp {
  border-left: 6px solid #2c2c2c !important;
}

.nra {
  border-left: 6px solid #e45006 !important;
}

.rf {
  border-left: 6px solid #00a3e0 !important;
}

.al {
  border-left: 6px solid #5e35b1 !important;
}

.aton {
  border-left: 6px solid #8b0000 !important;
}

.nnv {
  border-left: 6px solid #00a3e0 !important;
}

.flame {
  border-left: 6px solid #2c2c2c !important;
}

.usp {
  border-left: 6px solid #c41e1e !important;
}

.rsp {
  border-left: 6px solid #ffb300 !important;
}

.wov,
.pp {
  border-left: 6px solid #e60000 !important;
}

.ihp {
  border-left: 6px solid #8b7355 !important;
}

.brc {
  border-left: 6px solid #6b1e1e !important;
}

.other {
  border-left: 6px solid #aaaaaa !important;
}


/* Table of Contents */
#toc {
  border: 1px solid var(--border-color);
  background-color: var(--page-bg);
  padding: 1rem;
  width: fit-content;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}


#district-map-controls {
  display: flex;
  align-items: center;
  gap: 1.2em;
  background: var(--page-bg);
  border: 1px solid var(--border-color-light);
  border-radius: 6px;
  padding: 0.7em 1.2em;
  margin: 1.5em 0 1em 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  font-size: 1em;
  width: auto;
}

#district-map-controls label {
  font-family: var(--font-heading);
  font-size: 1em;
  font-weight: 500;
  margin-right: 0.5em;
}

#district-map-controls #map-year-label {
  font-weight: bold;
  font-size: 1.1em;
  margin-left: 0.2em;
}

#district-map-controls input[type="range"] {
  accent-color: var(--link-color);
  width: 180px;
  margin: 0 1em;
  vertical-align: middle;
  background: none;
  height: 2.2em;
}

#district-map-controls button {
  font-family: var(--font-heading);
  font-size: 0.95em;
  background: var(--header-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.3em 1.1em;
  margin-left: 0.2em;
  margin-right: 0.2em;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
}

#district-map-controls button:hover {
  background: var(--tab-hover-bg);
  border-color: var(--link-color);
}

@media (max-width: 600px) {
  #district-map-controls {
    display: grid;
    grid-template-columns: 40% 60%;
    flex-direction: row;
    align-items: stretch;
    gap: 0.7em;
    padding: 0.7em 0.5em;
  }

  #district-map-controls input[type="range"] {
    width: 100%;
    margin: 0.5em 0;
  }

  #district-map-controls button {
    width: 100%;
    margin: 0.2em 0;
  }
}

#toc #toctitle {
  font-family: var(--font-heading);
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.75rem;
}

#toc ul {
  list-style: none;
}

#toc ul ul {
  margin-left: 2rem;
}

/* ============================================= */
/* 7. FOOTER                                     */
/* ============================================= */

#footer {
  margin-left: 10rem;
  padding: 2rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color-light);
}

#footer ul {
  list-style: none;
  display: inline-block;
  margin-right: 2rem;
}

#footer li {
  display: inline;
  margin-right: 1rem;
}


/* Main container for the election box */
.election-infobox {
  padding: 0;
  /* Override default infobox padding */
  font-size: 0.9em;
  width: 34%;
  min-width: 360px;
}

/* Subtitle for the election date */
.election-infobox .infobox-subtitle {
  text-align: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 0.9em;
  font-weight: bold;
}

/* Container for all the stacked parties */
.election-parties-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
}

/* Individual box for each party */
.election-party-box {
  padding-bottom: 1rem;
}

/* Add a separator line between parties */

/* The colored bar representing the party */
.party-color-bar {
  height: 7px;
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Leader's image */
.party-leader-image {
  text-align: center;
  padding: 0 1rem;
}

.party-leader-image img {
  height: 150px;
  max-width: 150px;
  object-fit: contain;
  border: 1px solid var(--border-color-light);
}

/* Party and Leader names */
.party-name,
.party-leader-name {
  text-align: center;
  padding: 0rem 1rem;
  font-family: var(--font-heading);
}

.party-name {
  font-size: 1.1em;
  font-weight: bold;
}

.party-leader-name {
  font-size: 1em;
}

/* Table for seats and change data */
.party-seats-table {
  width: 100%;
  margin-top: 0.75rem;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.party-seats-table th,
.party-seats-table td {
  padding: 0.1rem 0.5rem;
  text-align: left;
}

.party-seats-table td {
  text-align: right;
  font-weight: bold;
}

/* Specific styling for the seat change indicator */
.seat-change .gain {
  color: #00a65a;
  /* Brighter green for better contrast in both modes */
}

.seat-change .loss {
  color: #dd4b39;
  /* Brighter red for better contrast in both modes */
}

.seat-change .no-change {
  color: var(--text-color);
  opacity: 0.6;
}

/* Election Footer */
.election-footer {
  font-size: 0.9em;
  padding: 0.5rem 0.5rem;
}

.election-footer-chairs {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.election-footer-inc {
  text-align: left;
  flex: 1;
}

.election-footer-elec {
  text-align: right;
  flex: 1;
}

.election-footer-chancellor {
  text-align: center;
  margin-top: 0.5rem;
}

.election-divider {
  margin: 10px 1rem;
  border: 0;
  border-top: 1px solid var(--border-color-light);
}

/* ============================================= */
/* 8. RESPONSIVE DESIGN                          */
/* ============================================= */



@media (max-width: 1200px) {
  #mw-panel {
    display: none;
  }

  #mw-content-container,
  #footer {
    margin-left: 0;
    width: 100%;
    padding: 0;
  }

  .election-infobox {
    width: 100%;
    float: none;
    margin-left: 0;
    margin-right: 0;
  }

  .wikitable {
    width: 100%;
  }
}

@media (max-width: 1000px) {
  #content {
    padding: 1rem;
    border-left: none;
    border-right: none;

  }
}

@media (max-width: 600px) {
  #mw-panel {
    display: none;
    /* Hide sidebar on mobile */
  }

  #mw-head {
    padding-top: 0;
  }

  /* Make search input smaller on mobile */
  #mw-head-tabs li.search-tab input[type="search"] {
    width: 150px;
    min-width: 100px;
  }

  #mw-head-tabs li.search-tab {
    padding: 0.5rem 0.5rem;
  }

  #mw-head-tabs li.theme-toggle-tab {
    padding: 0.5rem 0.25rem;
  }

  #theme-toggle {
    padding: 0.3rem 0.6rem;
  }

  #content {
    padding: 1rem;
    border-left: none;
    border-right: none;
  }

  .infobox {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }


  .post-content {
    display: flex;
    flex-direction: column;
  }

  .post-content .infobox {
    order: 3;
  }

  .post-content .election-infobox {
    order: 1;
    /* Comes after first paragraph */
  }

  .post-content>p:first-of-type {
    order: 2;
    /* First paragraph stays at top */
  }


  .post-content>*:not(.infobox):not(.election-infobox):not(p:first-of-type) {
    order: 4;
    /* Everything else comes after */
  }

}

/* ============================================= */
/* 9. HOME PAGE STYLING                          */
/* ============================================= */

/* Hero Banner / Welcome Section */
.welcome-section {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.welcome-box {
  flex: 1;
  background-color: var(--page-bg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
}

.featured-article-box {
  flex: 2;
  background-color: var(--content-bg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--border-color);
  padding: 1.5rem;
}

.featured-article-content {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.featured-text {
  flex: 2;
  font-size: 0.95rem;
}

.featured-media {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: flex-start;
}

.featured-flag {
  width: 100%;
  max-width: 150px;
  border: 1px solid var(--border-color);
}

.featured-map {
  width: 100%;
  max-width: 200px;
  border: 1px solid var(--border-color);
}

.frontpage-hero .welcome-box {
  flex: 1;
}

.homepage-title {
  margin-top: 0;
  border-bottom: none;
  font-size: 2em;
}

.homepage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.project-link-box {
  margin-top: 1rem;
  padding: 0.8rem;
  background: var(--page-bg);
  border: 1px solid var(--border-color);
  text-align: center;
}

.wiki-action-btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-color);
  background: var(--content-bg);
  color: var(--link-color);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none;
}

.wiki-action-btn:hover {
  background: var(--header-bg);
  text-decoration: none;
}

.wiki-action-btn-secondary {
  background: var(--page-bg);
}

.sidebar-link-btn {
  display: block;
  width: 100%;
  padding: 0.2rem 0.5rem;
  border: none;
  background: none;
  color: var(--link-color);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  border-radius: 2px;
}

.sidebar-link-btn:hover {
  background-color: var(--sidebar-hover-bg);
  text-decoration: underline;
}

.dyk-box {
  flex: 0.9;
  min-width: 260px;
}

.dyk-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.dyk-header .box-header {
  flex: 1;
  margin-bottom: 0;
}

.dyk-refresh-btn {
  flex-shrink: 0;
  border: 1px solid var(--border-color, #a2a9b1);
  background: var(--content-bg, #fff);
  color: var(--link-color, #0645ad);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 2px;
  cursor: pointer;
}

.dyk-refresh-btn:hover {
  background: var(--sidebar-hover-bg, #eaecf0);
  text-decoration: underline;
}

.dyk-refresh-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.dyk-list {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.dyk-list li {
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.dyk-source {
  color: #72777d;
  font-size: 0.9em;
}

.section-see-all {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.subsection-header {
  margin-top: 0;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 1.1em;
}

.index-summary {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.category-float-icon {
  float: right;
  width: 60px;
  margin: 0 0 10px 10px;
}

.category-float-icon-lg {
  width: 80px;
  border: 1px solid var(--border-color);
  background: #fff;
}

.category-float-icon-sm {
  height: 40px;
  width: auto;
}

.category-float-icon-photo {
  height: 80px;
  width: auto;
}

.tools-links-box {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--content-bg);
}

.tools-links-box ul {
  list-style: square;
  padding-left: 1.25rem;
  margin-top: 0.75rem;
}

.election-index-panel,
.people-index-controls {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--page-bg);
}

.election-view-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.election-tab {
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-bottom: none;
  background: var(--tab-bg);
  color: var(--text-color);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: -1px;
}

.election-tab:hover {
  background: var(--tab-hover-bg);
}

.election-tab.selected {
  background: var(--content-bg);
  border-color: var(--border-color);
  border-bottom-color: var(--content-bg);
  font-weight: 600;
}

.election-country-section {
  margin: 2rem 0 1rem;
}

.election-country-section h2 {
  border-bottom: 1px solid var(--border-color-light);
  padding-bottom: 0.35rem;
}

.election-country-section h3,
.election-year-section h2 {
  margin-top: 1.25rem;
  font-size: 1.05em;
  color: #72777d;
  border-bottom: 1px solid var(--border-color-light);
  padding-bottom: 0.25rem;
}

.election-year-section {
  margin-top: 0.5rem;
}

.election-year-section h2:first-child {
  margin-top: 0;
}

.election-decade-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.election-decade-list li {
  padding: 0.45rem 0 0.45rem 0.75rem;
  margin-bottom: 0.35rem;
  background: var(--content-bg);
  border: 1px solid var(--border-color-light);
}

.election-list-country {
  display: inline-block;
  min-width: 5.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #72777d;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.election-list-winner {
  color: #72777d;
  font-size: 0.9em;
}

.people-jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.people-jump-links a {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-color-light);
  background: var(--content-bg);
  font-size: 0.85rem;
}

.people-index-section {
  margin: 1.5rem 0;
}

.people-index-section h2 {
  border-bottom: 1px solid var(--border-color-light);
  padding-bottom: 0.25rem;
}

.people-index-section ul {
  columns: 2;
  list-style: square;
  padding-left: 1.25rem;
  margin-top: 0.75rem;
}

@media (max-width: 800px) {
  .people-index-section ul {
    columns: 1;
  }
}

.quick-visits-box {
  flex: 1.3;
  background-color: var(--content-bg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--border-color);
  padding: 1.5rem;
}

.quick-visits-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  margin-top: 1rem;
}

.quick-visit-card {
  background: var(--page-bg);
  border: 1px solid var(--border-color);
  padding: 1rem;
}

.quick-visit-card h3 {
  margin-top: 0;
  border-bottom: 1px solid var(--border-color-light);
  padding-bottom: 0.4rem;
  font-size: 1.05em;
}

.quick-visit-preview {
  display: block;
  margin: 0.75rem 0;
}

.quick-visit-preview img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
}

.quick-visit-lists ul {
  list-style: square;
  padding-left: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.compact-featured-box {
  flex: 0.8;
}

.compact-featured-content {
  margin-top: 0.5rem;
}

.compact-featured-content .featured-text {
  font-size: 0.9rem;
}

/* Main Page Grid (Bento) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Category Boxes */
.category-box {
  background-color: var(--content-bg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--border-color);
  padding: 1.5rem;
}

.category-box .box-header {
  margin-top: 0;
  border-bottom: 1px solid var(--border-color-light);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  font-size: 1.3em;
  font-family: var(--font-heading);
  background-color: transparent;
}

/* Grid Spanning Classes */
.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

/* Dense Lists */
.category-content-dense ul {
  list-style: square;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.category-content-dense ul li {
  margin-bottom: 0.3rem;
}

.dense-list-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dense-list-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* Optional simple entry animation */
.main-page-box,
.welcome-section>div {
  animation: fadeUp 0.6s ease-out forwards;
}

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments for home page */
@media (max-width: 1000px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .span-2,
  .span-3 {
    grid-column: span 2;
  }

  .quick-visits-content {
    grid-template-columns: 1fr;
  }

  .frontpage-hero {
    flex-direction: column;
  }
}


/* 
ASSEMBLY CHART */
/* ============================================= */
/* ASSEMBLY CHART (Wikipedia Vector Style)       */
/* ============================================= */


.assembly-chart-container {
  margin: 0.5rem 0;
  font-family: sans-serif;
  /* Wiki uses standard sans-serif for UI/Charts */
  width: 53%;
}

aside .assembly-chart-container {
  width: 100%;
  padding: 0 1rem;
}

@media (max-width: 800px) {
  .assembly-chart-container {
    width: 100%;
  }
}

.assembly-bar {
  display: flex;
  height: 26px;
  /* Slightly thinner, more tabular */
  width: 100%;
  background-color: var(--header-bg);
  /* Uses your theme variable */
  border: 1px solid var(--border-color);
  /* Classic wiki bounding box */
  /* Removed border-radius and box-shadow for a flat, sharp look */
}

.assembly-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  /* Smaller, utilitarian font size */
  font-weight: bold;
  text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.6);
  /* Sharper shadow for legibility */
  transition: width 0.3s ease;
  cursor: help;
}

/* Adds a subtle separator line between party blocks, a staple of wiki charts */
.assembly-segment:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.4);
}

.assembly-segment:hover {
  filter: brightness(1.15);
}



.vote-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  /* Matches your infoboxes/headers */
  color: var(--text-color);
  border-bottom: 1px solid var(--border-color-light);
  /* Wiki style divider */
  padding-bottom: 4px;
}

/* Classic Wiki colors for Yes/No */
.vote-yes {
  color: #008000;
  font-weight: bold;
}

.vote-majority {
  color: var(--text-color);
  font-size: 0.8rem;
  opacity: 0.8;
}

.vote-no {
  color: #cc0000;
  font-weight: bold;
}

/* Dark mode adjustments for the green/red text so they remain readable */
[data-theme="dark"] .vote-yes {
  color: #2ecc71;
}

[data-theme="dark"] .vote-no {
  color: #ff6b6b;
}
/* 
MAYORALTY */







/* 
INTERACTIVE MAP */
.interactive-map {
  position: relative;
  max-width: 100%; 
  overflow: auto; 
  display: inline-block;
}
.interactive-map .wrapper {
  position: relative;
  width: 100%;
}
.interactive-map img {
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 850px) {
  .interactive-map .wrapper {
    width: 200%;
  }
}
/* ============================================= */
/* TRADITIONAL ELECTION BAR CHART (Wiki Style)   */
/* ============================================= */

.election-bar-container {
  margin: 1rem 0 1.5rem 0;
  width: 100%;
  max-width: 600px; /* Prevents the bars from stretching infinitely on widescreen */
}

.election-bar-row {
  display: flex;
  align-items: center;
  margin-top: 8px; /* Spacing between candidates */
}
.swing {
  margin-top: 0;
}
.election-bar-label {
  width: 35%; /* Dedicate the left third to names */
  padding-right: 12px;
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: bold;
  
  /* Keep long names from breaking the layout */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.election-bar-track {
  flex-grow: 1;
  height: 24px;
  background-color: var(--header-bg);
  border: 1px solid var(--border-color);
  display: flex;           /* Added to align the bar and the outside text */
  align-items: center;     /* Vertically centers the outside text */
}

.election-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end; 
  /* min-width: 30px; REMOVED! */
  transition: width 0.5s ease-out;
}

/* We only want padding if there is actually text inside */
.election-bar-fill:has(.inside) {
  padding-right: 6px;
}

.election-bar-fill:hover {
  filter: brightness(1.15);
  cursor: help;
}

/* Base styles for the text */
.election-bar-text {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap; /* Prevents the text from wrapping onto two lines */
}

/* When the text is inside the colored bar (>5%) */
.election-bar-text.inside {
  color: #ffffff;
  text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.6);
}

/* When the text is pushed outside the bar (<5%) */
.election-bar-text.outside {
  color: var(--text-color); /* Uses your theme's text color so it works in dark mode */
  margin-left: 6px;         /* Gives it a little breathing room from the end of the bar */
}


/* Mobile responsive tweak */
@media (max-width: 600px) {
  .election-bar-row {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
  }
  .swing {
    margin-top: 0;
  }
  .election-bar-label {
    width: 100%;
    text-align: left;
  }
  .election-bar-track {
    width: 100%;
  }
}



@media (max-width: 800px) {
  .welcome-section {
    flex-direction: column;
  }

  .featured-article-content {
    flex-direction: column;
  }

  .quick-visits-content {
    grid-template-columns: 1fr;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: span 1;
  }

  .dense-list-cols-2,
  .dense-list-cols-3 {
    grid-template-columns: 1fr;
  }
}




/* Basic Table Styling */
.senator-data-container {
  font-size: 0.95rem;
  margin: 0px 0px;
}

/* Filter Section */
.filters {
  background-color: var(--page-bg);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;

  font-family: var(--font-body);
}

.filters * {

  font-family: var(--font-body);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-weight: bold;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #555;
}

.filter-group select,
.filter-group input {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 120px;
}

/* Table Styling */
.senator-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
}

table.senator-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ddd;
}

table.senator-table th,
table.senator-table td {
  text-align: left;
  padding: 3px;
  border-bottom: 1px solid #ddd;
}

table.senator-table th {
  background-color: #333;
  color: white;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.senator-table thead th {
  position: sticky;
  top: 0px;
  z-index: 2;
  background: #333;
  color: white;
}

table.senator-table th:hover {
  background-color: #555;
}

table.senator-table th::after {
  content: ' \2195';
  /* Up/Down arrow */
  font-size: 0.85m;
  opacity: 0.5;
  float: right;
}

table.senator-table th.asc::after {
  content: ' \2191';
  /* Up arrow */
  opacity: 1;
}

table.senator-table th.desc::after {
  content: ' \2193';
  /* Down arrow */
  opacity: 1;
}

/* Status Badges */
.status-active {
  color: green;
  font-weight: bold;
}

.status-retired {
  color: #888;
}

.summary-count {
  margin-bottom: 10px;
  font-style: italic;
  color: #666;
}

@media (max-width: 600px) {
  .senator-data-container {
    font-size: 0.75rem;

  }

  table.senator-table th::after {
    display: none;
  }

  table.senator-table th.asc::after {
    display: none;
  }

  table.senator-table th.desc::after {
    display: none;
  }
}












/* 
     TEMPORARY NEW DROPDOWNS */

/* Styling for the Expandable Voting Rows */
table.senator-table tr.main-row {
  cursor: pointer;
  transition: background-color 0.2s;
  -webkit-transition: background-color 0.2s;
  -moz-transition: background-color 0.2s;
  -ms-transition: background-color 0.2s;
  -o-transition: background-color 0.2s;
}

table.senator-table tr.main-row:hover {
  background-color: var(--sidebar-hover-bg, #f0f3f5);
}


.vote-details-row {
  display: none;
  /* Hidden by default */
  background-color: var(--header-bg, #eaecf0);
}

.vote-details-cell {
  padding: 15px 20px !important;
  border-bottom: 2px solid var(--border-color, #a2a9b1) !important;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  list-style-type: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.vote-item {
  background: var(--content-bg, #ffffff);
  border: 1px solid var(--border-color-light, #c8ccd1);
  padding: 6px 10px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
}

.vote-yes-text {
  color: #008000;
  font-weight: bold;
}

.vote-no-text {
  color: #cc0000;
  font-weight: bold;
}

.vote-abstain-text {
  color: #888;
  font-style: italic;
}

/* Legislation / cases explorers (reuse senator table chrome) */
.explorer-row {
  cursor: pointer;
}

.explorer-row:hover {
  background-color: var(--sidebar-hover-bg, #f0f3f5);
}

.explorer-row.expanded {
  background-color: var(--header-bg, #eaecf0);
}

.explorer-summary,
.explorer-meta {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.explorer-empty {
  margin: 0;
  font-style: italic;
  color: #666;
}

.notable-mps-list {
  margin: 0 0 1.25rem 1.25rem;
}

.notable-mp-district {
  color: #666;
  font-size: 0.9em;
}








/* Wikipedia-style inline citations */
sup.reference {
  unicode-bidi: isolate;
  white-space: nowrap;
  font-weight: normal;
  font-style: normal;
  font-size: 80%;
  /* Make the number smaller */
  line-height: 1;
  /* Prevents the line from getting taller */
}

sup.reference a {
  color: #6b9bff;
  /* Wikipedia link blue */
  text-decoration: none;
}

sup.reference a:hover {
  text-decoration: underline;
}

/* ============================================= */
/* ARCHIVE LAYOUT (Constitutions, Laws, etc.)    */
/* ============================================= */

.archive-layout {
  max-width: 760px;
  margin: 2rem auto;
  padding: 2rem 3rem;
  background-color: var(--content-bg);
  border: 1px solid var(--border-color);
}

.archive-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.archive-seal {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.archive-title {
  font-family: var(--font-heading);
  font-size: 2em;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.archive-subtitle {
  font-family: var(--font-heading);
  font-size: 1.05em;
  font-style: italic;
  color: var(--text-color);
  opacity: 0.75;
}

.archive-intro {
  background-color: var(--page-bg);
  border: 1px solid var(--border-color-light);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  font-family: var(--font-heading);
  font-size: 1.05em;
  line-height: 1.7;
  text-align: justify;
}

.archive-intro p:last-child {
  margin-bottom: 0;
}

.archive-body {
  font-size: 1rem;
  line-height: 1.75;
  text-align: justify;
  word-wrap: break-word;
}

.archive-body p {
  margin-bottom: 1.25rem;
  text-indent: 0;
}

.archive-body h2 {
  font-size: 1.35em;
  font-weight: 700;
  text-align: left;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color-light);
  border-bottom: none;
}

.archive-body h3 {
  font-size: 1.15em;
  font-weight: 700;
  text-align: left;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.archive-body blockquote {
  font-style: normal;
  border-left: 3px solid var(--border-color);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.5rem 0;
  opacity: 1;
  color: var(--text-color);
}

.archive-body ol,
.archive-body ul {
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
}

.archive-body li {
  margin-bottom: 0.6rem;
  margin-left: 0;
}

.archive-body li > ol,
.archive-body li > ul {
  margin-top: 0.5rem;
}

@media (max-width: 800px) {
  .archive-layout {
    max-width: 100%;
    margin: 0;
    padding: 1.5rem;
    border-left: none;
    border-right: none;
  }

  .archive-intro {
    padding: 1rem 1.25rem;
  }
}

/* ============================================= */
/* ARTICLE DOWNLOAD SECTION                      */
/* ============================================= */

.download-box {
  margin-top: 1.5rem;
}

.download-content {
  padding: 0.5rem 0;
}

.download-content p {
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.download-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 1rem;
}

.download-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9em;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
}

.download-tag input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--link-color);
}

.download-tags-loading,
.download-tags-error {
  font-style: italic;
  color: var(--text-color);
  opacity: 0.7;
}

.download-tags-error {
  color: #d33;
}

.download-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.download-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--page-bg);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 0.95em;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}

.download-btn:hover:not(:disabled) {
  background: var(--header-bg);
}

.download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-btn-all {
  background: var(--tab-bg);
  font-weight: 500;
}

.download-status {
  margin-top: 0.75rem;
  font-size: 0.9em;
  color: var(--text-color);
  opacity: 0.8;
  min-height: 1.4em;
}

@media (max-width: 600px) {
  .download-tags {
    gap: 0.3rem 0.6rem;
  }

  .download-actions {
    flex-direction: column;
  }

  .download-btn {
    width: 100%;
  }
}

/* Article layout with connections rail */
.article-layout--connections {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11.5rem;
  gap: 1.5rem 2rem;
  align-items: start;
  margin-top: 0.5rem;
}

.article-layout--connections .connections-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: sticky;
  top: 1rem;
}

.article-main {
  min-width: 0;
}

/* Connections panel */
.connections-panel {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-color-light);
  background: var(--page-bg);
  font-size: 0.85rem;
  line-height: 1.45;
}

.connections-loading {
  color: #72777d;
  font-size: 0.85em;
  margin: 0;
}

.connections-heading {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #72777d;
  margin: 0 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color-light);
}

.connections-row {
  margin: 0 0 0.45rem;
}

.connections-label {
  color: #72777d;
  font-weight: 600;
}

.connections-section {
  margin-top: 0.75rem;
}

.connections-subheading {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #72777d;
  margin: 0 0 0.35rem;
}

.connections-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.connections-links li {
  margin-bottom: 0.2rem;
}

.connections-links a {
  font-size: 0.85rem;
}

.connections-more {
  margin-top: 0.25rem;
}

.connections-show-more {
  padding: 0;
  border: none;
  background: none;
  color: var(--link-color);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

.connections-overflow {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
}

@media (max-width: 1100px) {
  .article-layout--connections {
    grid-template-columns: 1fr;
  }

  .article-layout--connections .connections-panel {
    grid-column: 1;
    grid-row: auto;
    position: static;
    margin-top: 1.5rem;
  }
}
