/* 
   EPRIOS Custom Styles - "Engineering Precision v29" 
   Solid Dark Blue Masthead, Standardized 3-Column Grids.
*/

:root {
  --brand-navy: #0f172a;
  --brand-navy-soft: #475569; /* Further softened slate color */
  --brand-amber: #f59e0b;
  --brand-light: #fefce8;
  --text-main: #1e293b;
  --text-muted: #475569;
  --bg-site: #f8fafc;
  --border: #e2e8f0;
  --max-width: 1280px;
}

body {
  font-family: 'Inter', sans-serif !important;
  color: var(--text-main);
  background-color: var(--bg-site) !important;
  line-height: 1.2;
  font-size: 0.95rem;
  -webkit-font-smoothing: antialiased;
}

/* --- Solid Dark Blue Fixed Masthead (No white boxes) --- */
.masthead {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background-color: var(--brand-navy) !important;
  border-bottom: 2px solid var(--brand-amber) !important;
  padding: 0.5rem 0 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.masthead__inner-wrap, .masthead__menu, .greedy-nav, .masthead__menu-item {
  background-color: transparent !important;
}

.greedy-nav ul.visible-links {
  background-color: transparent !important;
}

/* --- Greedy Nav Mobile Fixes --- */
.greedy-nav .hidden-links {
  background-color: var(--brand-navy) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
  border: 1px solid var(--brand-amber) !important;
  padding: 0.5rem 0 !important;
  z-index: 2000 !important;
}

.greedy-nav .hidden-links li {
  margin: 0 !important;
  padding: 0 !important;
}

.greedy-nav .hidden-links li a {
  color: white !important;
  padding: 0.75rem 1.5rem !important;
  display: block !important;
  font-weight: 700 !important;
}

.greedy-nav .hidden-links li a:hover {
  background-color: var(--brand-navy-soft) !important;
  color: var(--brand-amber) !important;
}

/* Ensure the navicon is visible and clean */
.greedy-nav__toggle {
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  cursor: pointer !important;
}

.greedy-nav .navicon {
  background: white !important;
}

.greedy-nav .navicon::before, .greedy-nav .navicon::after {
  background: white !important;
}

.site-title, .site-title:visited { color: white !important; font-weight: 900 !important; font-size: 1.4rem !important; letter-spacing: -0.02em; text-decoration: none !important; }
.site-subtitle { 
  display: block;
  color: var(--brand-amber) !important; 
  opacity: 0.8 !important; 
  font-size: 0.85rem !important; 
  font-weight: 600 !important; 
  letter-spacing: 0;
  margin-top: 2px;
}
.masthead__menu-item a { color: rgba(255,255,255,0.85) !important; font-weight: 700 !important; text-decoration: none !important; font-size: 1.0rem; }
.masthead__menu-item a:hover { color: var(--brand-amber) !important; }

.page__footer {
  padding: 0 !important;
  margin-top: 0 !important;
}

.content-box {
  padding-bottom: 0 !important;
}

section {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* --- Container Alignment --- */
.container-aligned {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-box {
  padding: 0 !important;
  display: block !important;
}

/* --- Professional 3-Column Grid --- */
.grid-3-standard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem; /* Reduced from 1.0rem */
  margin: 0.75rem 0; /* Reduced from 1.0rem */
  width: 100%;
}

.box-eng {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1.0rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease-in-out;
  text-decoration: none !important;
  height: 100%;
}

.box-eng:hover {
  border-color: var(--brand-amber);
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
}

.box-eng .label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--brand-amber);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.box-eng h3, .box-eng h4 {
  font-size: 1.0rem !important;
  font-weight: 600 !important; /* Semi-bold */
  color: var(--brand-navy-soft) !important;
  margin-bottom: 0.25rem !important;
  line-height: 1.2 !important;
  border: none !important;
}

.box-eng p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin: 0;
  flex-grow: 1;
}

.box-eng .meta-link {
  margin-top: 1rem;
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--brand-navy);
}

/* --- Content Typography --- */
.page-title {
  font-size: 1.5rem !important;
  line-height: 1.2 !important;
  margin-bottom: 0.5rem !important; /* Reduced from 0.75rem */
  color: var(--brand-navy) !important;
  font-weight: 800 !important;
}

.page-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
  font-weight: 400;
  margin: 0;
}

.article-abstract {
  background: var(--brand-light);
  border-left: 4px solid var(--brand-amber);
  padding: 0.7rem 1rem; /* Slightly reduced */
  margin: 0.6rem 0; /* Reduced from 0.8rem */
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--brand-navy);
  font-weight: 500;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.article-container .page-title {
  font-size: 1.8rem !important;
  letter-spacing: -0.02em;
}

.session-content h2 {
  color: var(--brand-amber) !important;
  font-size: 1.25rem !important;
  margin-top: 1.0rem !important; /* Reduced from 1.2rem */
  margin-bottom: 0.4rem !important; /* Reduced from 0.6rem */
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

.article-content h2 {
  border-bottom: 2px solid var(--brand-light);
  padding-bottom: 0.2rem;
  margin-top: 1.2rem !important; /* Reduced from 1.5rem */
}

/* --- Print Styling --- */
@media print {
  .masthead, .page__footer, .no-print, .social-icons, #footer, .vlaio-banner-aligned {
    display: none !important;
  }
  
  body {
    background: white !important;
    font-size: 11pt;
    color: black;
  }
  
  .content-box, .article-container, section {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important; /* Performance: Justify is expensive for print engine */
  }

  .session-content, .article-content {
    text-align: left !important;
  }

  .article-abstract {
    background: #f8f8f8 !important; /* Lighter for print */
    border-left: 4px solid #f59e0b !important;
    padding: 1rem !important;
    font-style: italic;
  }

  h1, h2, h3 {
    page-break-after: avoid;
    color: black !important; /* Ensure readable black on white */
  }

  a {
    text-decoration: underline;
    color: black !important;
  }

  /* Add URL after links for reference */
  /* a[href]:after { content: " (" attr(href) ")"; font-size: 90%; } */
}

/* --- Reverted Member Pills --- */
.members-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.member-pill {
  padding: 0.75rem 0.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-weight: 600; /* Reduced from 700 */
  color: var(--brand-navy-soft) !important; /* Softer color */
  text-decoration: none !important;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.member-pill .affiliation {
  font-size: 0.65rem;
  color: var(--brand-amber);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.member-pill:hover { border-color: var(--brand-amber); background: var(--brand-light); }

/* --- VLAIO Banner --- */
.vlaio-banner-aligned {
  background: var(--brand-navy);
  color: white !important;
  padding: 1.5rem 2rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
}

/* --- Responsive Grid Helpers --- */
.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .grid-responsive {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Mission Header Mobile Fix */
  .mission-header {
    flex-direction: column !important;
    gap: 1.5rem !important;
    padding: 1rem !important;
  }
  
  .mission-header > div {
    min-width: 100% !important;
    width: 100% !important;
  }

  /* VLAIO Banner Mobile Fix */
  .vlaio-banner-aligned {
    flex-direction: column !important;
    text-align: center;
    gap: 1rem !important;
    padding: 1.25rem !important;
  }
  
  .vlaio-banner-aligned div {
    width: 100% !important;
    display: flex;
    justify-content: center;
  }

  /* Fix for materials banner */
  .materials-banner {
    flex-direction: column !important;
    gap: 1rem !important;
    text-align: center;
    padding: 1.25rem !important;
  }
  
  .materials-banner a {
    width: 100% !important;
    justify-content: center;
  }
}

@media (max-width: 992px) {
  .grid-3-standard, .members-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-3-standard, .members-grid { grid-template-columns: 1fr; }
}


/* --- Table styling in articles --- */
.article-content table, .center-table {
  margin: 2rem auto !important;
  display: table !important;
  width: auto !important;
  max-width: 100%;
  border-collapse: collapse;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.article-content table th, .article-content table td,
.center-table th, .center-table td {
  font-size: 0.75rem !important;
  padding: 0.8rem 1.5rem !important;
  border: 1px solid var(--border) !important;
  text-align: left;
}

.article-content table th, .center-table th {
  background-color: var(--brand-navy) !important;
  color: white !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem !important;
  letter-spacing: 0.05em;
}

.article-content table tr:nth-child(even) {
  background-color: #f8fafc;
}
