/* Modern, minimal layout — Raluca Ada Popa homepage */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1d23;
  --text-muted: #5c6370;
  --link: #0b5d8c;
  --link-hover: #084a70;
  --accent: #003262;
  --border: #e8eaed;
  --nav-active-bg: #003262;
  --nav-active-fg: #ffffff;
  --radius: 8px;
  --font: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: min(52rem, 100%);
  margin-left: auto;
  margin-right: auto;
  padding: clamp(0.75rem, 3vw, 2rem);
  padding-top: max(clamp(0.75rem, 3vw, 2rem), env(safe-area-inset-top, 0px));
  padding-left: max(clamp(0.75rem, 3vw, 2rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(0.75rem, 3vw, 2rem), env(safe-area-inset-right, 0px));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  text-align: left;
  direction: ltr;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Images: never wider than the content column (inline width attrs still cap correctly) */
img,
video {
  max-width: 100%;
  height: auto;
}

/* Legacy layout tables: allow horizontal scroll only when needed */
.sectionData table {
  max-width: 100%;
}

.sectionData td,
.sectionData th {
  word-break: break-word;
  overflow-wrap: anywhere;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0.15em;
}

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

/* ----- Header: simple card + one accent ----- */

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-header__photo {
    justify-self: center;
  }

  .site-header__logos {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 0.65rem;
    width: 100%;
  }

  .site-header__logos img {
    max-width: min(72px, 22vw);
  }

  .site-header__logos .logo-sky {
    max-width: min(36px, 11vw);
  }

  .site-header__info {
    text-align: center;
  }
}

.headshot {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.site-header__info h1 {
  margin: 0 0 0.35rem 0;
  font-size: clamp(1.75rem, 4vw, 2.125rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--accent);
}

.site-header__info h1 a {
  color: inherit;
  text-decoration: none;
}

.site-header__info h1 a:hover {
  color: var(--link);
  text-decoration: none;
}

.site-tagline {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.site-header__meta {
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.7;
}

.site-header__email-line {
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.site-header__meta a {
  font-weight: 500;
}

.site-header__twitter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.site-header__twitter img {
  vertical-align: middle;
}

.site-header__logos {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.site-header__logos img {
  display: block;
  max-width: 140px;
  height: auto;
}

.site-header__logos .logo-sky {
  max-width: 60px;
}

/* ----- Navigation ----- */

#mainmenu {
  margin: 0 0 1.75rem 0;
  padding: 0;
}

#mainmenu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  height: auto;
  min-height: unset;
}

#mainmenu li {
  float: none;
  padding: 0;
  margin: 0;
}

#mainmenu li a {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

#mainmenu li a:hover {
  color: var(--nav-active-bg);
  background: rgba(0, 50, 98, 0.06);
  text-decoration: none;
}

#mainmenu li a.selected {
  background: var(--nav-active-bg);
  color: var(--nav-active-fg);
  box-shadow: none;
}

#mainmenu li a.selected:hover {
  color: var(--nav-active-fg);
  background: var(--nav-active-bg);
}

#mainmenu li a:focus-visible {
  outline: 2px solid var(--nav-active-bg);
  outline-offset: 2px;
}

#mainmenu p {
  clear: none;
}

/* ----- Sections ----- */

.sectionData {
  padding-top: 0.25rem;
  padding-bottom: 2rem;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

div.sectionData.hide {
  display: none;
}

h2 {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.35rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

h4 {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
  text-align: left;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.subtitle,
.smalltitle {
  font-weight: 500;
  font-size: 1rem;
  text-align: left;
  color: var(--text-muted);
  padding-bottom: 0.25rem;
}

.talk {
  font-weight: 400;
  text-align: left;
  color: var(--accent);
}

.workcategory {
  font-weight: 600;
  text-align: left;
  color: var(--accent);
}

.titleinfo {
  font-size: inherit;
}

.myinfo {
  font-size: 1.1rem;
}

.material {
  font-size: 1.2rem;
}

.licaption {
  font-weight: 600;
  font-size: 0.95rem;
}

li {
  margin-bottom: 0.5rem;
}

ul {
  padding-left: 1.25rem;
}

blockquote {
  max-width: 100%;
  width: auto;
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
}

#logo img {
  display: block;
  margin: 0 auto;
}

/* Announcement blocks (legacy) */
div.announce {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 36rem;
  margin: 1.25rem auto;
  padding: 1rem 1.25rem;
  background: var(--surface);
}

div.announce h1 {
  color: #c41e3a;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin-top: 0;
}

div.announce h2 {
  color: #b8860b;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

p.announce-important {
  font-weight: 600;
}

div.announce span {
  display: block;
}

div.indent {
  margin-left: 1.5rem;
}

a.no_underscore {
  text-decoration: none;
}

ul.NoIndentNoBullet {
  margin-left: 1rem;
  padding-left: 0;
  list-style: none;
}

table.black,
table.red {
  width: 100%;
  max-width: 100%;
  border: 0;
  border-collapse: collapse;
}

table.red,
table.red a {
  color: #b91c1c;
  font-size: 1.125rem;
  background-color: #f3f4f6;
}

table.spacing {
  border-spacing: 0.5rem;
}

tr.bordertr td {
  border-bottom: 1px dashed var(--border);
}

/* ----- Mobile: touch targets, readability ----- */

@media (max-width: 720px) {
  #mainmenu ul {
    justify-content: center;
    gap: 0.35rem 0.5rem;
  }

  #mainmenu li a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.85rem;
    touch-action: manipulation;
  }

  /* Prefer wrapping to horizontal scroll on very narrow screens */
  .site-header__email-line {
    white-space: normal;
    font-size: 0.95rem;
    line-height: 1.45;
    overflow-x: visible;
  }

  div.indent {
    margin-left: 0.75rem;
  }

  ul {
    padding-left: 1rem;
  }
}
