/* ==========================================================================
   Health Innovation Reports - Professional Academic Journal Stylesheet
   Enhanced version with technical fixes and improved accessibility
   ========================================================================== */

/* Font Imports - Must be at the top */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Playfair+Display:wght@400;700&display=swap');

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
  /* Primary Colors */
  --primary: #00305A;         /* Deep navy blue - main color */
  --primary-dark: #001F3F;    /* Darker blue for hover states */
  --secondary: #B07C1F;       /* Rich gold accent */
  
  /* Neutral Colors */
  --accent: #E8F1F8;          /* Light blue accent */
  --text-dark: #333333;       /* Near-black for main text */
  --text-medium: #555555;     /* Dark gray for secondary text */
  --text-light: #777777;      /* Medium gray for tertiary text */
  --bg-light: #F5F7FA;        /* Very light blue-gray background */
  --bg-white: #FFFFFF;        /* White background */
  --nav-gray: #707070;        /* Gray for navigation */
  --footer-gray: #707070;     /* Gray for footer */
  --border-light: #E2E8F0;    /* Light gray borders */
  
  /* Status Colors */
  --success: #2E7D32;         /* Green for success messages */
  --warning: #F9A825;         /* Amber for warnings */
  --error: #C62828;           /* Red for errors */
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  
  /* Shadows */
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 3px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Base Typography and Layout
   ========================================================================== */

* {
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dark);
  background-color: var(--bg-white);
  margin: 0;
  padding: 0;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Libre Baskerville', 'Georgia', serif;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.3;
  color: var(--primary);
  font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1.5em;
  text-align: justify;
}

strong, b {
  font-weight: 700;
}

/* ==========================================================================
   Header and Journal Branding
   ========================================================================== */

.site-header,
.pkp_structure_head {
  background-color: white;
  color: var(--primary);
  padding: 1.5rem 0;
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid #e0e0e0;
}

.journal-title, 
.site-name,
.pkp_site_name,
.pkp_site_name .is_text {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 2.7rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.05);
}

.pkp_site_name a {
  color: var(--primary) !important;
  text-decoration: none !important;
  transition: opacity var(--transition-fast);
}

.pkp_site_name a:hover,
.pkp_site_name a:focus {
  opacity: 0.8;
}

.journal-subtitle,
.site-description {
  font-family: 'Georgia', serif;
  font-size: 1.1rem;
  color: var(--text-medium);
  font-style: italic;
  text-align: center;
  margin-top: 0.7rem;
  letter-spacing: 0.5px;
}

.journal-name,
.journal_name {
  font-family: 'Libre Baskerville', 'Georgia', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Navigation - User Menu
   ========================================================================== */

.pkp_navigation_user_wrapper,
.pkp_navigation_user,
.navbar-right {
  background-color: var(--primary);
  padding: 5px 10px;
  border-radius: 4px;
}

.pkp_navigation_user > li > a,
.navbar-right > li > a {
  color: white !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  transition: background-color var(--transition-fast);
}

.pkp_navigation_user > li > a:hover,
.pkp_navigation_user > li > a:focus,
.navbar-right > li > a:hover,
.navbar-right > li > a:focus {
  background-color: rgba(255, 255, 255, 0.2);
  color: white !important;
  text-decoration: none;
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.pkp_navigation_user .dropdown-menu,
.navbar-right .dropdown-menu {
  background-color: white;
  border: 1px solid #ddd;
  box-shadow: var(--shadow-md);
}

.pkp_navigation_user .dropdown-menu a,
.navbar-right .dropdown-menu a {
  color: var(--text-dark) !important;
  padding: 8px 15px;
  display: block;
  transition: background-color var(--transition-fast);
}

.pkp_navigation_user .dropdown-menu a:hover,
.pkp_navigation_user .dropdown-menu a:focus,
.navbar-right .dropdown-menu a:hover,
.navbar-right .dropdown-menu a:focus {
  background-color: var(--accent);
  color: var(--primary) !important;
}

/* ==========================================================================
   Navigation - Primary Menu
   ========================================================================== */

.navbar,
.pkp_navigation_primary_wrapper,
#navigationPrimary,
.pkp_navigation_primary {
  background-color: var(--nav-gray) !important;
  border-bottom: 1px solid #606060;
  box-shadow: var(--shadow-sm);
  padding: 0;
}

.navbar a,
.pkp_navigation_primary > li > a {
  color: white !important;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  transition: all var(--transition-medium);
  display: inline-block;
}

.navbar a:hover,
.navbar a:focus,
.pkp_navigation_primary > li > a:hover,
.pkp_navigation_primary > li > a:focus {
  background-color: rgba(255, 255, 255, 0.15);
  color: white !important;
  text-decoration: none;
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: -2px;
}

.navbar .active,
.pkp_navigation_primary > .current {
  border-bottom: 3px solid var(--secondary);
  background-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Mobile Navigation - Hamburger Menu (Checkbox Toggle)
   ========================================================================== */

.nav-toggle {
  display: none;
}

.pkp_site_nav_toggle,
.navbar-toggle {
  display: none;
  background-color: var(--primary);
  border: none;
  padding: 10px;
  margin: 10px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 100;
}

.pkp_site_nav_toggle span,
.navbar-toggle span {
  background-color: white;
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px 0;
  transition: all var(--transition-fast);
}

.pkp_site_nav_toggle:hover,
.navbar-toggle:hover {
  background-color: var(--primary-dark);
}

@media (max-width: 768px) {
  .pkp_site_nav_toggle,
  .navbar-toggle {
    display: block;
  }
  
  .pkp_navigation_primary_wrapper {
    position: relative;
  }
  
  .pkp_navigation_primary {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: var(--nav-gray);
  }
  
  .pkp_navigation_primary li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .pkp_navigation_primary > li > a {
    display: block;
    width: 100%;
  }
  
  .nav-toggle:checked ~ .pkp_navigation_primary {
    display: flex !important;
  }
  
  .nav-toggle:checked ~ .pkp_site_nav_toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle:checked ~ .pkp_site_nav_toggle span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle:checked ~ .pkp_site_nav_toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
}

/* ==========================================================================
   Main Content Areas
   ========================================================================== */

.main-content,
.pkp_structure_main,
.page_index_journal {
  background-color: var(--bg-white);
  padding: 2rem;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.page-header {
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

/* ==========================================================================
   Links and Buttons
   ========================================================================== */

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn,
.button {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  padding: 0.75rem 1.25rem;
  border-radius: 0.25rem;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 2px solid transparent;
}

.btn:focus,
.button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary,
.button.primary {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus,
.button.primary:hover,
.button.primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  text-decoration: none;
}

.btn-secondary,
.button.secondary {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover,
.btn-secondary:focus,
.button.secondary:hover,
.button.secondary:focus {
  background-color: var(--primary);
  color: white;
  text-decoration: none;
}

/* ==========================================================================
   Journal Components
   ========================================================================== */

.issue-cover {
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  max-width: 100%;
  height: auto;
}

.journal-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-medium);
  margin-bottom: 2rem;
  border-left: 4px solid var(--secondary);
  padding-left: 1.5rem;
}

/* ==========================================================================
   Editorial Team Styling
   ========================================================================== */

.editorial-team h3 {
  color: var(--primary);
  font-size: 1.5rem;
  text-align: center;
  border-bottom: 3px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 30px;
}

.editorial-team .section-title {
  background-color: var(--bg-light);
  padding: 10px;
  margin-top: 30px;
  margin-bottom: 20px;
  border-left: 5px solid var(--primary);
}

.editorial-team .section-title strong {
  font-size: 1.125rem;
  color: var(--primary);
}

.editorial-team .member-card {
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}

.editorial-team .member-card:hover {
  box-shadow: var(--shadow-md);
}

.editorial-team img {
  border: 3px solid #f0f0f0;
  border-radius: 8px;
  margin-bottom: 15px;
  max-width: 100%;
  height: auto;
}

.editorial-team .member-name {
  font-weight: 900 !important;
  font-size: 1.125rem;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
}

.editorial-team .member-info {
  line-height: 1.6;
}

/* ==========================================================================
   Article Styles
   ========================================================================== */

.article-summary {
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  border-radius: 0.25rem;
  margin-bottom: 1.5rem;
  background-color: var(--bg-white);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.article-summary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.article-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.article-title a {
  color: var(--primary);
  transition: color var(--transition-fast);
}

.article-title a:hover,
.article-title a:focus {
  color: var(--secondary);
}

.article-authors {
  font-size: 1rem;
  color: var(--text-medium);
  margin-bottom: 0.75rem;
}

.article-metadata {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-abstract {
  font-size: 1rem;
  color: var(--text-dark);
  line-height: 1.7;
  text-align: justify;
}

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

/* ==========================================================================
   Tables
   ========================================================================== */

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5rem;
  background-color: var(--bg-white);
  border: 1px solid var(--border-light);
}

thead {
  background-color: var(--primary);
  color: white;
}

th {
  text-align: left;
  padding: 1rem;
  font-weight: 600;
}

td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
}

tr:nth-child(even) {
  background-color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */

#footer,
.site-footer,
.pkp_structure_footer_wrapper,
.pkp_structure_footer {
  background-color: var(--footer-gray);
  color: white;
  padding: 3rem 0;
  margin-top: 3rem;
  border-top: 1px solid #606060;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-section h4 {
  color: white;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary);
}

.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu li {
  margin-bottom: 0.75rem;
}

.footer-menu a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition-fast);
}

.footer-menu a:hover,
.footer-menu a:focus {
  color: white;
  text-decoration: none;
}

.footer-content a,
.site-footer a,
.pkp_structure_footer a,
a[href^="mailto:"],
a[href*="creativecommons.org"] {
  color: var(--secondary) !important;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.footer-content a:hover,
.footer-content a:focus,
.site-footer a:hover,
.site-footer a:focus,
.pkp_structure_footer a:hover,
.pkp_structure_footer a:focus,
a[href^="mailto:"]:hover,
a[href^="mailto:"]:focus,
a[href*="creativecommons.org"]:hover,
a[href*="creativecommons.org"]:focus {
  color: white !important;
  text-decoration: underline;
}

a[href^="mailto:"] {
  font-weight: 900;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Hide only OJS branding link - more specific selector */
#pkp-brand-footer,
.pkp_brand_footer,
a[href="https://pkp.sfu.ca/ojs/"],
a[href="https://openjournalsystems.com"],
.footer-brand {
  display: none !important;
  visibility: hidden !important;
}

/* ==========================================================================
   Responsive Design - Tablet
   ========================================================================== */

@media (max-width: 991px) {
  .journal-title, 
  .site-name,
  .pkp_site_name {
    font-size: 2rem;
  }
  
  .journal-subtitle,
  .site-description {
    font-size: 1rem;
  }
  
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .main-content {
    padding: 1.5rem;
  }
}

/* ==========================================================================
   Responsive Design - Mobile
   ========================================================================== */

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }
  
  .journal-title, 
  .site-name,
  .pkp_site_name {
    font-size: 1.75rem;
  }
  
  .navbar a,
  .pkp_navigation_primary > li > a {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.35rem; }
  
  .article-title {
    font-size: 1.2rem;
  }
  
  .sidebar {
    margin-top: 1.5rem;
  }
  
  .btn, .button {
    padding: 0.6rem 1rem;
  }
  
  .article-full-metadata {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 14px;
  }
  
  .journal-title, 
  .site-name,
  .pkp_site_name {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
  }
  
  .journal-subtitle,
  .site-description {
    font-size: 0.9rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.2rem; }
  
  .main-content {
    padding: 1rem;
  }
  
  .page-header {
    margin-bottom: 1.5rem;
  }
  
  .btn, .button {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .article-actions {
    flex-direction: column;
  }
  
  table {
    font-size: 0.875rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  body {
    font-size: 12pt;
    line-height: 1.6;
    background: white;
    color: black;
  }
  
  .navbar, 
  .pkp_navigation_primary_wrapper,
  .pkp_navigation_user_wrapper,
  .sidebar, 
  #footer,
  .site-footer,
  .pkp_structure_footer,
  .article-actions,
  .btn,
  .button {
    display: none !important;
  }
  
  a {
    color: #000000 !important;
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
  
  .article-main {
    font-size: 12pt;
    margin: 0;
    padding: 0;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  p {
    orphans: 3;
    widows: 3;
  }
  
  img, table, figure {
    page-break-inside: avoid;
    max-width: 100% !important;
  }
  
  .article-summary {
    border: 1px solid #000;
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Focus visible for better keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Ensure sufficient color contrast */
::selection {
  background-color: var(--primary);
  color: white;
}

::-moz-selection {
  background-color: var(--primary);
  color: white;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}