/* ==========================================================================
   SATLab UET — Research Evidence Hub Design System
   Specification: SATLAB_RESEARCH_GROUP_WEBSITE_SYSTEM_DESIGN.md
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700&family=Plus+Jakarta+Sans:wght@500;600;700;800;900&family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,600&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Core Color Palette */
  --color-ink-950: #102536;
  --color-ink-900: #0f172a;
  --color-ink-800: #294455;
  --color-ink-650: #496273;
  --color-ink-500: #64748b;
  
  --color-paper: #f8fafc;
  --color-surface: #ffffff;
  
  --color-blue-700: #125b93;
  --color-blue-800: #0b4777;
  --color-brand-50: #eff6ff;
  --color-brand-100: #dbeafe;
  --color-brand-200: #bfdbfe;
  --color-brand-500: #3b82f6;
  --color-brand-600: #2563eb;
  --color-brand-700: #1d4ed8;

  --color-teal-650: #197278;
  --color-emerald-700: #237a46;
  --color-gold-600: #a86f11;
  --color-red-700: #b42318;
  
  --color-border: #d5dee5;
  --color-border-light: #e2e8f0;
  
  --gradient-brand: linear-gradient(135deg, #102536 0%, #125b93 50%, #2563eb 100%);
  --gradient-banner: linear-gradient(90deg, #102536 0%, #125b93 100%);

  --bg-page: var(--color-paper);
  --bg-surface: var(--color-surface);
  
  /* Typography Tokens */
  --font-sans: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Be Vietnam Pro', 'Inter', sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  
  /* Layout & Spacing */
  --container-max: 1200px;
  --prose-max: 840px;
  --header-height: 64px;
  
  --shadow-xs: 0 1px 3px rgba(16, 37, 54, 0.04);
  --shadow-sm: 0 4px 6px -1px rgba(16, 37, 54, 0.06), 0 2px 4px -1px rgba(16, 37, 54, 0.03);
  --shadow-md: 0 12px 24px -6px rgba(16, 37, 54, 0.1), 0 4px 8px -2px rgba(16, 37, 54, 0.04);

  --radius-sm: 6px;
  --radius-card: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  height: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--color-ink-800);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
  min-height: calc(100vh - 300px);
}

p {
  margin-top: 0;
  line-height: 1.65;
  word-break: normal;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

em, i {
  font-style: italic;
  padding-right: 0.06em;
}

a {
  color: var(--color-blue-700);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--color-blue-800);
}

.shell {
  width: min(calc(100% - 40px), var(--container-max));
  margin-inline: auto;
}

/* Announcement Banner */
.top-banner {
  background: var(--gradient-banner);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 16px;
  text-align: center;
}

.top-banner a {
  color: #ffffff;
  text-decoration: underline;
  margin-left: 6px;
  font-weight: 700;
}

/* ==========================================================================
   Header Navbar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.header-inner {
  display: flex;
  height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-ink-950);
  letter-spacing: -0.02em;
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav a {
  color: var(--color-ink-800);
  position: relative;
  padding: 4px 0;
}

.nav a.active {
  color: var(--color-blue-700);
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: var(--color-blue-700);
  border-radius: 2px;
}

.nav a:hover {
  color: var(--color-blue-700);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid var(--color-border);
  padding-left: 16px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  padding: 2px 4px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.lang-switch a {
  color: var(--color-ink-650);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.lang-switch a.active {
  color: #ffffff;
  background: var(--color-blue-700);
}

.search-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink-800);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-paper);
  border: 1px solid var(--color-border);
}

.search-link:hover {
  border-color: var(--color-blue-700);
  color: var(--color-blue-700);
}

/* Breadcrumbs */
.breadcrumbs-nav {
  padding: 10px 0;
  font-size: 0.82rem;
  color: var(--color-ink-650);
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.breadcrumbs-list li::after {
  content: '/';
  margin-left: 8px;
  color: var(--color-border);
}

.breadcrumbs-list li:last-child::after {
  content: '';
}

.breadcrumbs-list a {
  color: var(--color-ink-650);
}

.breadcrumbs-list a:hover {
  color: var(--color-blue-700);
}

/* ==========================================================================
   Search Input & Search Page Styling
   ========================================================================== */
.search-input-wrapper {
  width: 100%;
  max-width: 680px;
  margin-bottom: 24px;
}

.search-box {
  width: 100%;
  max-width: 680px;
  padding: 12px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--color-ink-950);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.search-box:focus {
  outline: none;
  border-color: var(--color-blue-700);
  box-shadow: 0 0 0 3px rgba(18, 91, 147, 0.12);
}

/* ==========================================================================
   Hero Section & Clean Book Cover Layout
   ========================================================================== */
.hero {
  position: relative;
  padding: 40px 0 36px;
  background: #ffffff;
  background-image: 
    radial-gradient(at 0% 0%, rgba(18, 91, 147, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(25, 114, 120, 0.02) 0px, transparent 50%);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 36px;
  align-items: center;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--color-brand-50);
  border: 1px solid var(--color-brand-200);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--color-blue-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  width: fit-content;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-blue-700);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  color: var(--color-ink-950);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--color-ink-800);
  margin: 0 0 18px;
  line-height: 1.6;
}

.hero-meta-card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Book Cover Wrapper */
.cover-wrapper {
  max-width: 200px;
  width: 100%;
  justify-self: center;
  align-self: center;
}

.book-cover-img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  display: block;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-cover-img:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Buttons & Status Badges (Strict Fit-Content Sizing)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: fit-content;
  max-width: max-content;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-card);
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-blue-700);
  color: #ffffff !important;
}

.btn-primary:hover {
  background: var(--color-blue-800);
}

.btn-primary-html {
  background: var(--color-teal-650);
  color: #ffffff !important;
}

.btn-primary-html:hover {
  background: var(--color-emerald-700);
}

.btn-outline {
  background: #ffffff;
  color: var(--color-ink-800);
  border-color: var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-blue-700);
  color: var(--color-blue-700);
}

/* Status Badge - Compact Inline Pill */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: fit-content;
  max-width: max-content;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-sizing: border-box;
}

.status-badge.open, .status-badge.active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.status-badge.rolling {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.status-badge.archived, .status-badge.closed, .status-badge.completed {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Cards & Feature Grids */
.features-section {
  padding: 44px 0;
}

.section-header {
  margin-bottom: 28px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-blue-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-ink-950);
  margin: 0 0 6px;
}

.section-desc {
  font-size: 0.98rem;
  color: var(--color-ink-650);
  max-width: var(--prose-max);
  margin: 0;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-brand-200);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-ink-950);
  margin: 8px 0 6px;
  line-height: 1.4;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--color-ink-650);
  margin: 0 0 16px;
  line-height: 1.6;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  margin-bottom: 8px;
}

/* Resource Card */
.resource-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.resource-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.resource-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-ink-950);
  margin: 0;
}

.resource-desc {
  font-size: 0.9rem;
  color: var(--color-ink-650);
  margin-bottom: 12px;
  line-height: 1.6;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--color-ink-500);
}

/* Footer (Sticky Bottom via Flex Layout) */
.site-footer {
  padding: 40px 0 24px;
  background: var(--color-ink-950);
  color: #94a3b8;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: auto;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-logo {
  height: 32px;
  width: auto;
  margin-bottom: 6px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.site-footer p {
  margin: 0;
  color: #64748b;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .nav-container {
    flex-wrap: wrap;
    gap: 12px;
  }
  .nav-actions {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cover-wrapper {
    max-width: 170px;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: auto;
    padding: 10px 0;
  }
  .header-inner {
    flex-direction: column;
    height: auto;
    align-items: flex-start;
    gap: 10px;
  }
  .nav-container {
    width: 100%;
    justify-content: space-between;
  }
  .nav {
    gap: 12px;
    font-size: 0.85rem;
    flex-wrap: wrap;
  }
  .hero h1 {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(calc(100% - 24px), var(--container-max));
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .btn {
    width: 100%;
  }
}
