/* ── Variables ─────────────────────────────────────────────── */
:root {
  --color-nav-bg:      #7a98cc;
  --color-nav-hover:   #5673a2;
  --color-nav-active:  #235787;
  --color-link:        #df6e01;
  --color-link-hover:  #1e73be;
  /* Headings match the "Latest News" sidebar blue (--color-nav-hover);
     orange (--color-link) stays the accent for links */
  --color-heading:     #5673a2;
  --color-body:        #848484;
  --color-muted:       #6d6d6d;
  --color-border:      #eaecee;
  --color-bg:          #ffffff;
  --color-box-bg:      #EFF3FC;
  --color-box-text:    #5673a2;
  --color-button:      #235787;
  --color-widget-title:#848484;
  --max-width:         1240px;
  /* Original site used plain Arial via its "Simple Custom CSS" override */
  --font-sans: Arial, Helvetica, sans-serif;
}

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

/* ── Body / Page ───────────────────────────────────────────── */

html { font-size: 15px; }

body {
  font-family: var(--font-sans);
  color: var(--color-body);
  background-color: #d6e4f0;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  margin: 0;
  line-height: 1.618;
  min-height: 100vh;
}

/* ── Typography ────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  line-height: 1.3;
  margin-top: 0;
}

/* Original global heading sizes (from the theme + custom CSS) */
h1 { font-size: 20px; }
h2 { font-size: 1.2em; line-height: 1.216; font-weight: bold; text-align: left; }

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover, a:focus {
  color: var(--color-link-hover);
  text-decoration: underline;
}

p { margin: 0 0 1rem; }

/* ── Header ────────────────────────────────────────────────── */

.site-header { width: 100%; }

.header-top {
  background-color: rgba(30, 115, 190, 0.01);
}

.header-top .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 1.5rem 4px;
}

.site-brand { display: flex; align-items: center; text-decoration: none; }

.site-logo {
  width: 213px;
  display: block;
}

.header-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--color-nav-hover);
  color: #fff;
  transition: background-color 0.15s;
}

.header-social a:hover {
  background-color: var(--color-nav-active);
  text-decoration: none;
}

/* ── Nav bar ────────────────────────────────────────────────── */

.header-nav {
  background-color: var(--color-nav-bg);
  padding: 0 1.5rem;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.primary-nav { width: 100%; }

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-item a {
  display: block;
  padding: 18px 16px;
  /* Original dark-mode menu: dimmed white that reads as a slight grey */
  color: rgba(255, 255, 255, 0.79);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: color 0.14s ease-out;
}

/* Label wrapper carries the sliding underline (matches the word, not the padding) */
.nav-item a .link-before {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-item a .link-before::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 1px;
  height: 1px;
  background-color: transparent;
  transition: all 0.3s ease;
}

.nav-item a:hover,
.nav-item a:focus {
  color: rgba(255, 255, 255, 0.99);
  text-decoration: none;
}

/* Underline slides from a 1px sliver out to the full word width on hover/active */
.nav-item a:hover .link-before::before,
.nav-item a:focus .link-before::before,
.nav-item.current-menu-item a .link-before::before {
  width: 100%;
  background-color: currentColor;
}

.nav-item.current-menu-item a {
  color: rgba(255, 255, 255, 0.99);
}

/* ── Site frame ─────────────────────────────────────────────── */

.site-frame {
  max-width: var(--max-width);
  margin: 0.25rem auto 2rem;
  background-color: var(--color-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
}

/* ── Main content area ─────────────────────────────────────── */

#main {
  min-width: 0; /* let content shrink inside the grid instead of overflowing */
}

/* ── Content layout: main + news sidebar on every page ─────── */

.content-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3.75rem;
  align-items: start;
  padding: 1.75rem 3.75rem 3.25rem;
}

.content-layout.content-only {
  grid-template-columns: 1fr;
}

@media (max-width: 720px) {
  .content-layout { grid-template-columns: 1fr; }
}

/* ── Box ────────────────────────────────────────────────────── */

.home-content .box {
  background-color: var(--color-box-bg);
  color: var(--color-box-text);
  border: 2px double #ddd;
  border-radius: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0.8rem;
  margin: 1.5rem 0 20px;
}

.home-content .box h2 {
  font-size: 1rem;
  color: var(--color-box-text);
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.home-content .box a { color: var(--color-link); }

.home-content .centered-text {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 0;
}

/* .bigger-text was a no-op on the original site; keep it neutral */
.home-content .bigger-text { margin: 0; }

/* ── Sidebar ────────────────────────────────────────────────── */

.site-sidebar {
  /* Thin vertical rule separating the main content from the News section */
  border-left: 1px solid var(--color-border);
  padding: 0.25rem 0 0.25rem 2.75rem;
}

.site-sidebar h2 {
  font-size: 1rem;
  color: var(--color-nav-hover);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

/* Post list matching original cat-post-widget structure */
.cat-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cat-post-item {
  padding: 0.45rem 0;
}

.cat-post-title {
  font-size: 0.87rem;
  color: var(--color-link);
  display: block;
  line-height: 1.35;
}

.cat-post-title:hover { color: var(--color-link-hover); text-decoration: underline; }

.cat-post-date {
  font-size: 0.76rem;
  color: var(--color-muted);
}

/* ── Static page layout (Infrastructure, Publications, Jobs, etc.) ── */

.page-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 1.5rem;
  padding-top: 1rem;
}

.page-sidebar {
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  border-left: 3px solid var(--color-border);
}

@media (max-width: 720px) {
  .page-layout { grid-template-columns: 1fr; }
}

/* ── Single post ────────────────────────────────────────────── */

.post-single {
  max-width: 1084px;
}

.post-title {
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}

.post-meta {
  color: var(--color-muted);
  font-size: 0.87rem;
  margin-bottom: 0.4rem;
}

.post-single .post-meta {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.post-featured-image {
  margin-bottom: 1.5rem;
  text-align: center;
}

.post-featured-image img {
  max-width: 100%;
  max-height: 300px;
  height: auto;
  display: inline-block;
  border-radius: 4px;
}

.post-content { line-height: 1.8; }
.post-content p { margin: 0 0 1rem; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.post-content li { margin-bottom: 0.4rem; }

.post-content h2 {
  font-size: 1.3rem;
  margin-top: 1.75rem;
}

.post-content h3 { font-size: 1.1rem; margin-top: 1.4rem; }

/* ── News listing ────────────────────────────────────────────── */

.news-listing { padding-top: 0; }

.page-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.post-list { display: flex; flex-direction: column; }

/* Post item: side-by-side thumbnail + content, matching original.
   Items are separated by whitespace rather than rules. */
.entry-inner {
  display: flex;
  gap: 0;
  align-items: flex-start;
  padding: 1.4rem 0;
}

.entry-media {
  flex: 0 0 170px;
  max-width: 170px;
}

.entry-media img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  display: block;
  border-radius: 7px;
}

.entry-media img.post-default-thumb {
  object-fit: contain;
  padding: 10px;
  background: var(--color-nav-active);
}

/* Full-width news listing: larger thumbnail (≈20% of content width) */
.content-only .entry-inner {
  gap: 1.25rem;
}

.content-only .entry-media {
  flex: 0 0 22%;
  max-width: 22%;
}

.content-only .entry-media img {
  width: 100%;
  max-height: 170px;
  object-fit: cover;
}


.entry-content-data {
  flex: 1;
  min-width: 0;
  padding-left: 1rem;
}

.entry-title {
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.entry-title a { color: var(--color-link); }
.entry-title a:hover { color: var(--color-link-hover); text-decoration: underline; }

.entry-excerpt {
  font-size: 0.92rem;
  margin: 0.4rem 0 0.6rem;
  color: var(--color-body);
  line-height: 1.6;
}

.entry-excerpt p { margin: 0; display: inline; }

.readmore-button {
  display: inline-block;
  color: var(--color-button);
  border: 1px solid var(--color-button);
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.readmore-button:hover {
  background: var(--color-button);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 520px) {
  .entry-inner { flex-direction: column; }
  .entry-media { max-width: 100%; flex: none; }
  .entry-media img { width: 100%; height: auto; border-radius: 4px; }
  .entry-content-data { padding-left: 0; padding-top: 0.75rem; }
}

/* ── Pagination ─────────────────────────────────────────────── */

.pagination {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.pagination a {
  display: inline-block;
  background: var(--color-button);
  color: #fff;
  padding: 3px 12px;
  border: 1px solid var(--color-button);
  text-decoration: none;
  font-size: 0.9rem;
}

.pagination a:hover { background: var(--color-nav-active); text-decoration: none; }

.page-indicator { color: var(--color-muted); font-size: 0.9rem; }

/* ── Team page ──────────────────────────────────────────────── */

.members-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.25rem 0;
}

.member { text-align: center; max-width: 155px; }

.member img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.member h3 {
  font-size: 18px;
  margin: 0.5rem 0 0.2rem;
  color: var(--color-heading);
}

.member h3 a { color: var(--color-link); }

.member p {
  font-size: 12px;
  color: var(--color-muted);
  margin: 10px 0;
}

.alumni-header { text-align: center; margin-top: 1.25rem; }

.alumni-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 0.75rem 0;
}

.alumni { text-align: center; max-width: 140px; }

.alumni img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.alumni h3 { font-size: 15px; margin: 0.4rem 0 0; color: var(--color-heading); }

/* Gallery */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.gallery-grid figure { margin: 0; max-width: 190px; }

.gallery-grid img {
  width: 190px;
  height: 135px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  display: block;
}

.gallery-grid figcaption {
  font-size: 0.77rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
  line-height: 1.3;
  max-width: 190px;
}

/* ── Projects page ──────────────────────────────────────────── */

.projects-section { padding-top: 1.25rem; }

.projects-section h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.projects-section h2:first-child {
  margin-top: 0;
}

.project-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 24px;
}

.project-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  padding: 4px;
  background: #fff;
}

.project-info h3 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
  color: var(--color-heading);
}

.project-info p { margin: 0 0 0.5rem; font-size: 0.93rem; }

.project-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.project-links a {
  font-size: 0.83rem;
  color: var(--color-button);
  border: 1px solid var(--color-button);
  padding: 2px 10px;
  border-radius: 2px;
  text-decoration: none;
}

.project-links a:hover {
  background: var(--color-button);
  color: #fff;
  text-decoration: none;
}

/* ── Publications ────────────────────────────────────────────── */

.publications-list { padding-top: 0.5rem; }

.pub-toc {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-muted, #666);
  margin: 0 0 1.25rem;
}
.pub-toc a { white-space: nowrap; }

.publications-list h3 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  scroll-margin-top: 1rem;
}

.publications-list h4 {
  font-size: 1rem;
  margin: 1.5rem 0 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-heading);
}

.publications-list ul { padding-left: 1.2rem; margin: 0; }

.publications-list li {
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ── Jobs page ───────────────────────────────────────────────── */

.apply-button {
  display: inline-block;
  background: var(--color-button);
  color: #fff;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 0.93rem;
  text-decoration: none;
  margin: 0.6rem 0 1.25rem;
  border: 1px solid var(--color-button);
}

.apply-button:hover {
  background: var(--color-nav-active);
  color: #fff;
  text-decoration: none;
}

/* ── Footer ──────────────────────────────────────────────────── */

.site-footer {
  background: #5673a2;
  color: rgba(255,255,255,0.85);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.87rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer p { margin: 0; color: rgba(255,255,255,0.85); }
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* ── Box / card styles from old site content ─────────────────── */

.box.double-border {
  background-color: var(--color-box-bg);
  color: var(--color-box-text);
  border: 2px double #ddd;
  border-radius: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0.8rem;
  margin: 1.5rem 0 20px;
}

/* ── WordPress utility classes (from migrated content) ──────── */

.has-text-align-center { text-align: center; }
.has-text-align-left   { text-align: left; }
.has-text-align-right  { text-align: right; }

.wp-block-list { padding-left: 1.2rem; margin-bottom: 1rem; }
.wp-block-list li { margin-bottom: 0.7rem; font-size: 0.93rem; line-height: 1.6; }

/* ── Page padding ────────────────────────────────────────────── */

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .site-frame { margin: 0; }
  .content-layout { padding: 1.5rem 1rem; }
  .header-top .header-container { padding: 6px 1rem; }
  .site-logo { width: 180px; }
  .nav-item a { padding: 10px 10px; font-size: 0.85rem; }

  .post-title, .page-title { font-size: 1.4rem; }

  .content-layout { grid-template-columns: 1fr; }

  .gallery-grid figure { max-width: 100%; }
  .gallery-grid img { width: 100%; height: auto; }
}

@media (max-width: 480px) {
  .nav-menu { justify-content: flex-start; }
  .nav-item a { padding: 8px 8px; font-size: 0.8rem; }
}
