/* Remove space above the header in Manuscript theme */
body, 
.pkp_structure_page, 
.pkp_structure_head, 
header[role="banner"] {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Change navigation menu text from uppercase to normal text */
.pkp_structure_head .pkp_navigation_primary a,
.pkp_structure_head .pkp_navigation_user a {
    text-transform: none !important;
}

/* Bulletproof way to hide the OJS/PKP logo in the footer */
.pkp_brand_footer,
a[href*="aboutThisPublishingSystem"],
img[src*="ojs_brand.png"],
div[role="contentinfo"] div[role="complementary"] {
    display: none !important;
}

/* Remove space below the footer */
body, 
.pkp_structure_page, 
.pkp_structure_footer_wrapper, 
.pkp_structure_footer {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Change the default OJS footer background color */
.pkp_structure_footer_wrapper {
    background-color: #004400 !important;
}

/* Ensure the text inside the default footer is white */
.pkp_structure_footer_wrapper,
.pkp_structure_footer_wrapper a,
.pkp_structure_footer_wrapper p {
    color: #ffffff !important;
}

/* Style sidebar text links to look like buttons */
.pkp_structure_sidebar .pkp_block div > a:not(.pkp_button),
.pkp_structure_sidebar .pkp_block p > a:not(.pkp_button),
.pkp_structure_sidebar .pkp_block li > a:not(.pkp_button) {
    display: flex;
    align-items: center;
    background-color: #004400; /* Dark green */
    color: #ffffff !important;
    padding: 10px 15px;
    margin-bottom: 8px;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
    line-height: 1.3;
}

/* Hover effect for the new buttons */
.pkp_structure_sidebar .pkp_block div > a:not(.pkp_button):hover,
.pkp_structure_sidebar .pkp_block p > a:not(.pkp_button):hover,
.pkp_structure_sidebar .pkp_block li > a:not(.pkp_button):hover {
    background-color: #1e2e40; /* Turns dark blue on hover */
}

/* Add the small icon before the text */
.pkp_structure_sidebar .pkp_block div > a:not(.pkp_button):::before,
.pkp_structure_sidebar .pkp_block p > a:not(.pkp_button):::before,
.pkp_structure_sidebar .pkp_block li > a:not(.pkp_button):::before {
    content: "\27A4"; /* Unicode for a solid right arrow (➤) */
    margin-right: 10px;
    font-size: 12px;
}

/* Style sidebar block titles: normal text and new background */
.pkp_structure_sidebar .pkp_block .title,
.pkp_structure_sidebar .pkp_block h2 {
    text-transform: none !important; /* Changes ALL CAPS back to normal */
    background-color: #e2e8f0 !important; /* Soft slate-gray background */
    color: #1e2e40 !important; /* Dark blue text */
    padding: 10px 15px !important;
    margin-bottom: 15px !important;
    border-radius: 4px;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-left: 5px solid #004400 !important; /* Dark green accent line */
    display: block; /* Ensures the background covers the full width */
}

/* 1. Hide the issue description */
.obj_issue_summary .description {
    display: none !important;
}

/* 2. Convert the archive list to a grid */
.issues_archive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    padding: 0;
    list-style: none;
}

/* 3. Style the individual items */
.issues_archive > li {
    margin-bottom: 0 !important;
}

.obj_issue_summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 4. Ensure the cover image looks good with a fixed height */
.obj_issue_summary .cover {
    display: block;
    margin-bottom: 10px;
    width: 100%;
}

.obj_issue_summary .cover img {
    width: 100%;
    height: 300px; /* Adjust this value (e.g., 250px, 300px) to your preference */
    object-fit: cover; /* Prevents the image from distorting */
    object-position: top; /* Ensures the top part of the cover is prioritized if cropped */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 4px; /* Optional: adds a slight curve to the corners */
}

/* 5. Adjust title and series text */
.obj_issue_summary h2 {
    font-size: 1rem;
    margin: 0;
}

.obj_issue_summary .series {
    font-size: 0.9rem;
    color: #666;
}

/* Compact & Clean 3-Metric Layout with Tooltip */
.ojs-metrics-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 18px 0;
}

/* Header Flex Layout */
.ojs-metrics-header {
  display: flex;
  align-items: center; /* Aligns title and tooltip vertically */
  margin-bottom: 14px;
}

.ojs-metrics-title {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0; /* Margin removed since Flexbox handles spacing */
}

/* Tooltip Trigger Icon */
.ojs-tooltip {
  position: relative;
  display: inline-flex;
  margin-left: 8px; /* Space between title and icon */
  cursor: help;
}

.ojs-tooltip-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #e1e4e8;
  color: #555;
  font-size: 11px;
  font-weight: 600;
  font-family: serif;
  font-style: italic;
  transition: background-color 0.2s;
}

.ojs-tooltip:hover .ojs-tooltip-icon {
  background-color: #1a5b8c;
  color: #ffffff;
}

/* Tooltip Popup Bubble */
.ojs-tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: max-content;
  background-color: #2c3e50;
  color: #ffffff;
  text-align: center;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  
  /* Position above the icon */
  position: absolute;
  z-index: 10;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%); /* Centers the bubble directly over the icon */
  
  transition: opacity 0.2s ease, visibility 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Tooltip small arrow pointing down */
.ojs-tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #2c3e50 transparent transparent transparent;
}

/* Show Tooltip on Hover */
.ojs-tooltip:hover .ojs-tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Box Layout */
.ojs-metrics-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.ojs-metric-box {
  flex: 1 1 calc(33.333% - 10px);
  min-width: 120px;
  max-width: 200px;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 12px 14px;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.ojs-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: #1a5b8c;
  line-height: 1.1;
  margin-bottom: 4px;
}

.ojs-metric-value.status-review {
  font-size: 15px;
  font-weight: 600;
  color: #c0392b;
  letter-spacing: 0.2px;
}

.ojs-metric-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.25;
}

/* Tablet & Mobile */
@media (max-width: 600px) {
  .ojs-metrics-title {
    font-size: 15px;
  }
  .ojs-metric-box {
    flex: 1 1 calc(50% - 10px);
    max-width: 100%;
    padding: 10px 12px;
  }
  .ojs-metric-value {
    font-size: 18px;
  }
  .ojs-metric-value.status-review {
    font-size: 14px;
  }
}