/* ==========================================================================
   Carla Srebot — personal site
   Hand-written stylesheet. No framework, no theme.
   ========================================================================== */

:root {
  --accent:        #4a7ab5;  /* signature blue, carried over from the old site */
  --accent-dark:   #2f5480;
  --meta-text:     #3d3d3d;  /* date / "Working Paper" line — darker than body muted */
  --meta-link:     #1c3a5e;  /* [Abstract] / [PDF] links — darker than accent-dark */
  --accent-soft:   #eef3f9;
  --text:          #1f1f1f;
  --muted:         #6b6b6b;
  --border:        #e4e4e4;
  --bg:            #ffffff;
  --nav-h:         3.5rem;
  --measure:       880px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Base size drives every rem in this file — bumped 16px -> 17px (~1pt). */
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--accent-dark);
  line-height: 1.25;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--accent);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.container {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: var(--nav-h);
  background-color: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: var(--nav-h);
}

.navbar-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--accent-dark);
}

.navbar-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  border: 0;
  background: none;
  padding: 0.4rem;
  cursor: pointer;
  margin-left: auto;
}

.nav-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text);
  border-radius: 1px;
}

.nav-toggle .icon-bar + .icon-bar {
  margin-top: 5px;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  margin-left: auto;
}

.nav-links li {
  margin-left: 1.6rem;
}

.nav-links a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
  border-bottom-color: var(--accent);
}

.nav-links .active a {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Page hero (subpages keep the mountain photo used across the old site)
   -------------------------------------------------------------------------- */

.page-hero {
  margin-top: var(--nav-h);
  min-height: 160px;
  display: flex;
  align-items: flex-end;
  /* Light at the top so the photo keeps its colour, darker at the base so the
     title stays legible over the mountains. */
  background-image: linear-gradient(rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0.52)),
                    url('/assets/images/P001.jpg');
  background-size: cover;
  background-position: center 60%;
  background-repeat: no-repeat;
}

.hero-title {
  color: #fff;
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 0.9rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   Page content
   -------------------------------------------------------------------------- */

.page-content {
  padding-top: 2.5rem;
  padding-bottom: 1rem;
}

.page-content.no-hero {
  padding-top: calc(var(--nav-h) + 2.5rem);
}

.post-header {
  margin-bottom: 1.75rem;
}

.post-title {
  font-size: 2.4rem;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* Surname stays light; only the first name is bold. */
.lead-name {
  font-weight: 700;
}

.desc {
  color: var(--muted);
  font-size: 1rem;
  font-style: italic;
  margin: 0.4rem 0 0;
}

/* --------------------------------------------------------------------------
   Profile block (home page)
   -------------------------------------------------------------------------- */

.profile {
  float: left;
  width: 330px;
  margin: 0.25rem 2.25rem 1.5rem 0;
  text-align: center;
}

.profile figure {
  margin: 0;
}

/* Rectangular portrait — kept from the previous site, not a circle. */
.profile img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
}

.contact-icons {
  margin-top: 0.9rem;
}

.contact-icons a {
  color: var(--accent-dark);
  font-size: 1.2rem;
  margin: 0 7px;
  transition: color 0.15s ease;
}

.contact-icons a:hover {
  color: var(--accent);
  text-decoration: none;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* --------------------------------------------------------------------------
   Article body
   -------------------------------------------------------------------------- */

article p {
  margin: 0 0 1rem;
  font-size: 0.97rem;
  line-height: 1.75;
}

/* Bio runs in a narrow column beside the portrait, so allow hyphenation —
   justified text that narrow otherwise opens rivers of white space. */
.bio p {
  /* One point below article p (0.97rem): 0.97rem - 1pt ~ 0.89rem. */
  font-size: 0.89rem;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.bio a {
  text-decoration: underline;
}

article h2 {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 2.25rem 0 0.9rem;
}

article h3 {
  font-size: 1.15rem;
  font-weight: 400;
  margin: 1.75rem 0 0.75rem;
}

article ul {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

article li {
  margin-bottom: 0.7rem;
  font-size: 0.97rem;
  line-height: 1.7;
}

.meta {
  font-size: 0.88rem;
  color: var(--meta-text);
}

.meta a {
  color: var(--meta-link);
  text-decoration: underline;
}

.meta a:hover {
  color: var(--accent);
}

.coauthors {
  /* One point down from the 0.97rem list text. */
  font-size: 0.89rem;
}

.coauthors a {
  color: var(--text);
  text-decoration: underline;
}

.coauthors a:hover {
  color: var(--accent);
}

/* Abstract disclosure */
details.abstract {
  margin: 0.35rem 0 0;
}

details.abstract > summary {
  display: none;
  list-style: none;
}

details.abstract > summary::-webkit-details-marker {
  display: none;
}

.abstract-body {
  padding: 0.15rem 0 0.15rem 0.9rem;
  border-left: 3px solid var(--border);
  margin: 0.4rem 0 0.2rem;
}

.abstract-body p {
  text-align: justify;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Two-column blocks (Interests / Education on home page)
   -------------------------------------------------------------------------- */

.col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3rem;
}

.col-2 h2 {
  font-size: 1.2rem;
  margin-top: 0;
}

.edu-list {
  list-style: none;
  padding-left: 0;
}

.edu-list li {
  margin-bottom: 0.9rem;
}

.edu-degree {
  display: flex;
  align-items: baseline;
  font-size: 0.95rem;
}

.edu-degree i {
  margin-right: 0.55rem;
  color: var(--accent);
}

.edu-school {
  padding-left: 1.55rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.school-icon {
  color: var(--accent);
  margin-right: 0.4rem;
}

/* --------------------------------------------------------------------------
   CV page
   -------------------------------------------------------------------------- */

.cv-note {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.cv-embed {
  width: 100%;
  height: 80vh;
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.cv-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
  padding: 0.9rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 700px) {
  .col-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Once the two columns stack, the second heading needs breathing room. */
  .col-2 > div + div h2 {
    margin-top: 1.5rem;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 0;
    padding-bottom: 0.75rem;
  }

  .navbar.is-open .nav-links {
    display: flex;
  }

  .nav-links li {
    margin: 0.35rem 0 0;
  }

  .profile {
    float: none;
    width: 270px;
    margin: 0 auto 1.5rem;
  }

  /* Full-width column on a phone: justification is no longer a problem,
     but keep hyphenation off so short lines do not break awkwardly. */
  .bio p {
    hyphens: none;
    -webkit-hyphens: none;
  }

  .post-title {
    font-size: 2rem;
  }

  .page-hero {
    min-height: 120px;
  }

  .hero-title {
    font-size: 1.7rem;
    margin-bottom: 0.7rem;
  }
}
