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

:root {
  --space-bg-top: #02050a;
  --space-bg-bottom: #081220;
  --page-bg: #d5dde6;
  --card-bg: #f1f5f9;
  --pub-bg: #f8fafc;
  --pub-border: #cbd5e1;
  --text-main: #0f172a;
  --text-body: #1e293b;
  --text-muted: #475569;
  --link-color: #0369a1;
  --link-hover: #0c4a6e;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--page-bg);
  color: var(--text-body);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

/* 1. Static EUMETSAT Hero Stage */
.eumetsat-hero-stage {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 460px;
  background:
    radial-gradient(circle at 60% 62%, rgba(14, 42, 74, 0.45) 0%, rgba(5, 13, 26, 0.92) 56%, #02050a 100%),
    linear-gradient(180deg, var(--space-bg-top) 0%, var(--space-bg-bottom) 100%);
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.hero-orbital-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-horizon-edge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(56,189,248,0.05) 0%, rgba(56,189,248,0.35) 55%, rgba(56,189,248,0.08) 100%);
}

/* 2. Frosted Glass Header Over Space */
#header, .site-header {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 48px auto 32px calc(50% - 460px);
  padding: 24px 30px;
  background: rgba(8, 18, 34, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  box-shadow: 0 22px 48px -12px rgba(0, 0, 0, 0.7);
}

#header h1 {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #f8fafc;
  line-height: 1.08;
}

#header h1 a {
  color: inherit;
  text-decoration: none;
}

#header .subtitle {
  margin: 6px 0 0 0;
  font-size: 0.92rem;
  color: #94a3b8;
  font-weight: 400;
}

#header ul {
  margin: 18px 0 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

#header nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#header nav a:hover {
  color: #38bdf8;
}

/* 3. Main Page Wrapper & Content Sections (Matches your Jekyll <section><div class="inner">) */
.page-wrapper {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto 64px auto;
}

.page-wrapper > section:not(.foot) {
  background: var(--card-bg);
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 12px;
  padding: 32px 40px;
  margin-bottom: 28px;
  box-shadow: 0 18px 40px -15px rgba(15, 23, 42, 0.22);
}

/* Clear floats inside sections so your floated portrait stays inside the card */
.page-wrapper > section .inner::after,
.page-wrapper > section .inner > div::after {
  content: "";
  display: table;
  clear: both;
}

/* Remove extra top margin on first bio paragraph */
.page-wrapper > section:first-of-type p:first-of-type {
  margin-top: 0 !important;
}

/* Replace your existing .page-wrapper > section:first-of-type img rule with this: */
.page-wrapper > section:first-of-type:not(.features) img[style*="float: right"] {
  width: 210px !important;
  max-width: 32% !important;
  height: auto;
  margin: 4px 0 18px 28px !important;
  border-radius: 8px;
  border: 3px solid #ffffff;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.24);
}


/* 4. Typography & Links inside Sections */
.page-wrapper h1,
.page-wrapper h2 {
  font-family: 'Newsreader', Georgia, serif;
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.25;
  margin-top: 0;
}

.page-wrapper h1 {
  font-size: 1.95rem;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pub-border);
}

.page-wrapper h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.page-wrapper a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-color: rgba(3, 105, 161, 0.35);
  text-underline-offset: 3px;
  font-weight: 500;
}

.page-wrapper a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

/* 5. Recent Publications Cards (Targets .block-copy p in your index.html) */
.block-copy p {
  background: var(--pub-bg);
  border: 1px solid var(--pub-border);
  border-left: 3.5px solid #0284c7;
  border-radius: 6px;
  padding: 13px 18px;
  margin: 0 0 11px 0;
  font-size: 0.94rem;
  line-height: 1.58;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.block-copy p:nth-of-type(3n+2) {
  border-left-color: #0d9488; /* Boreal Teal */
}

.block-copy p:nth-of-type(3n+3) {
  border-left-color: #15803d; /* Biosphere Green */
}

/* Keep "Also, visit my Scholar page." and "View list of publications." unboxed */
.block-copy h1 + p,
.block-copy p:last-of-type {
  background: transparent;
  border: none;
  padding: 4px 0 12px 0;
  box-shadow: none;
}

/* 6. Footer (Targets <section class="foot">) */
section.foot {
  text-align: center;
  padding: 28px 20px 44px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

section.foot::after {
  content: "Header Earth imagery © EUMETSAT";
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: #64748b;
}

/* 7. Responsive Mobile & Tablet Layout */
@media (max-width: 960px) {
  #header, .site-header {
    margin: 28px 16px 24px 16px;
    max-width: none;
  }
  .page-wrapper {
    margin: 0 16px 48px 16px;
  }
  .page-wrapper > section:not(.foot) {
    padding: 24px 22px;
  }
  .page-wrapper > section:first-of-type img {
    float: none !important;
    display: block;
    max-width: 200px !important;
    margin: 0 auto 20px auto !important;
  }
}

/* 8. Academic Editorial Card Grid for Talks, Publications & Theses */
.feature-grid .table-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}

.feature-grid .feature {
  display: flex;
  min-width: 0;
}

a.media-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--pub-bg);
  border: 1px solid var(--pub-border);
  border-top: 3px solid #0284c7;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none !important;
  color: var(--text-body);
  box-shadow: 0 4px 14px -4px rgba(15, 23, 42, 0.08);
}

/* Alternating Nordic Earth top-border accents matching your publications */
.feature-grid .feature:nth-child(3n+2) a.media-card {
  border-top-color: #0d9488; /* Boreal Teal */
}

.feature-grid .feature:nth-child(3n+3) a.media-card {
  border-top-color: #15803d; /* Biosphere Green */
}

a.media-card:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

/* 16:9 Slide / Figure Thumbnail Frame */
.media-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  border-bottom: 1px solid var(--pub-border);
  overflow: hidden;
}

.media-card-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  object-fit: cover;
  display: block;
}

/* Card Text Body */
.media-card-body {
  padding: 16px 18px 20px 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.media-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.media-card-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.media-card-venue {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.media-card-title {
  margin: 0 0 8px 0 !important;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.2rem !important;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
}

a.media-card:hover .media-card-title {
  color: var(--link-color);
}

.media-card-authors {
  margin: 0 0 8px 0 !important;
  font-size: 0.84rem;
  font-style: italic;
  color: var(--text-muted);
}

.media-card-excerpt {
  margin: 0 !important;
  font-size: 0.86rem;
  line-height: 1.54;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive Grid for Tablet & Mobile */
@media (max-width: 860px) {
  .feature-grid .table-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .feature-grid .table-row {
    grid-template-columns: 1fr;
  }
}
