/* Personal web site of Daniel Fernández-Kranz.
   Layout modelled on libertadgonzalez.com (Astra theme): centered site title,
   centered horizontal menu, light grey page background, white boxed content,
   small footer with circular social icons. The Working Papers page follows the
   accordion format of mattiafracchia.com/research. */

:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #3a3a3a;
  --heading: #222222;
  --muted: #6b6b6b;
  --link: #0274be;
  --link-hover: #3a3a3a;
  --border: #e6e6e6;
  --news: #d0021b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --font-wp: "Poppins", var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.75;
}
a { color: var(--link); text-decoration: none; }
a:hover, a:focus { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { color: var(--heading); line-height: 1.3; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.55rem; margin-top: 2em; }
h3 { font-size: 1.2rem; }
h6 { font-size: 1.05rem; margin-bottom: .3em; }
p { margin: 0 0 1.2em; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; background: #fff; padding: 6px 10px; z-index: 50; }

/* ---------- header ---------- */
.site-header {
  text-align: center;
  padding: 28px 16px 0;
  position: relative;
}
.site-title {
  margin: 0;
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.2;
}
.site-title a { color: var(--heading); }
.site-title a:hover { color: var(--heading); text-decoration: none; }
.main-nav { margin-top: 14px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2px; }
.main-nav li a { display: inline-block; padding: 8px 14px; color: var(--text); font-size: 17px; }
.main-nav li a:hover { color: var(--link); text-decoration: none; }
.main-nav li.current a { color: var(--link); }
.nav-toggle { display: none; }

/* ---------- content box ---------- */
.container {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 16px;
}
main {
  background: var(--card);
  padding: 48px 60px 56px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.page-title { font-size: 2rem; margin-bottom: 1em; }
.lead { font-size: 1.05rem; }
.button {
  display: inline-block;
  background: var(--link);
  color: #fff !important;
  padding: 9px 20px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
}
.button:hover { background: var(--link-hover); text-decoration: none; }
ul.plain { padding-left: 1.2em; }
ul.plain li { margin-bottom: .45em; }

/* ---------- about page ---------- */
.about h2 { font-size: 2rem; margin-top: 0; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.about-text p { font-size: 18px; }
.news-label { color: var(--news); font-weight: 700; margin-top: 1.6em; margin-bottom: .4em; }
ul.news { list-style: none; margin: 0; padding: 0; }
ul.news li { font-size: 18px; margin-bottom: 1em; padding-left: 0; }
.news-date { display: block; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.about-photo img { width: 100%; }
.contact-card { margin-top: 20px; font-size: 16.5px; }
.contact-card p { margin-bottom: .4em; }
.contact-card .button { margin-top: 10px; }

/* ---------- research page ---------- */
.pub { margin-bottom: 1.1em; }
.pub p { margin-bottom: .25em; }
.pub .journal { font-weight: 600; color: var(--heading); }
.pub .doi { font-size: 16px; color: var(--muted); word-break: break-all; }
.pub-extra { font-size: 17px; color: var(--muted); margin-left: 1.2em; }
.other-pubs { padding-left: 1.2em; }
.other-pubs li { margin-bottom: .7em; font-size: 18px; }

/* ---------- working papers page (format of mattiafracchia.com/research) ---------- */
.wp-page main { padding-top: 40px; }
.mf-title {
  font-family: var(--font-wp);
  font-weight: 700;
  font-size: 2.4rem;
  text-align: center;
  color: var(--heading);
  margin-bottom: 1.2em;
}
.mf-subtitle {
  font-family: var(--font-wp);
  font-weight: 600;
  font-size: 1.5rem;
  text-align: center;
  color: var(--heading);
  margin: 2.5em 0 1.2em;
}
.mf-paper { margin-bottom: 2.1em; }
.mf-paper h3 {
  font-family: var(--font-wp);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--heading);
  margin-bottom: .15em;
}
.mf-paper h3 a { color: var(--link); }
.mf-paper h3 a:hover { color: var(--link-hover); text-decoration: underline; }
.wp-status { font-weight: 400; color: var(--heading); }
.wp-status strong { font-weight: 600; color: var(--heading); }
.wp-authors { font-size: 17px; color: var(--heading); margin-bottom: .35em; }
.wp-authors a { color: var(--heading); text-decoration: underline; }
.mf-paper details.abstract {
  margin-top: .35rem;
  border-left: 3px solid #eee;
  padding: .5rem .75rem;
  background: #fafafa;
}
.mf-paper details.abstract[open] { background: #f5f5f5; }
.mf-paper details.abstract > summary {
  list-style: none; cursor: pointer; outline: none;
  text-transform: lowercase; font-variant: small-caps; letter-spacing: .08em;
  color: var(--heading); font-weight: 600; user-select: none; font-size: 17px;
}
.mf-paper details.abstract > summary::-webkit-details-marker { display: none; }
.mf-paper details.abstract > summary::after { content: " \25B8"; transition: transform .15s ease; display: inline-block; }
.mf-paper details.abstract[open] > summary::after { transform: rotate(90deg); }
.mf-paper details.abstract p { margin: .5rem 0 0; font-size: 18px; line-height: 1.7; color: var(--heading); }
.mf-paper details.abstract > summary:focus { box-shadow: 0 0 0 2px #cce; border-radius: 4px; }
.wp-links { margin: .6em 0 .2em; font-size: 17px; }
.wp-links a { color: var(--heading); text-decoration: underline; }
.wp-note { font-size: 17px; color: var(--heading); margin: 0; }
.wp-note a { color: var(--heading); text-decoration: underline; }

/* ---------- cv page ---------- */
.cv-table { width: 100%; border-collapse: collapse; margin-bottom: 1.2em; font-size: 17.5px; }
.cv-table td { padding: 5px 0; vertical-align: top; border-bottom: 1px solid var(--border); }
.cv-table td.cv-date { text-align: right; white-space: nowrap; padding-left: 20px; color: var(--muted); width: 1%; }
.cv-text { font-size: 17.5px; font-style: italic; }
.pdf-embed { margin-top: 1em; border: 1px solid var(--border); }
.pdf-embed iframe { width: 100%; height: 900px; border: 0; }

/* ---------- media page ---------- */
.media-item { margin-bottom: 1.4em; padding-bottom: 1em; border-bottom: 1px solid var(--border); }
.media-item:last-child { border-bottom: 0; }
.media-meta { margin-bottom: .1em; font-size: 16px; }
.media-date { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 14px; }
.media-title { margin-bottom: .2em; font-size: 1.05em; }
.media-paper { margin: 0; font-size: 16px; color: var(--muted); }

/* ---------- contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
ul.social.contact-social { flex-direction: column; align-items: flex-start; gap: 8px; }
ul.social.contact-social li a { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
ul.social.contact-social li a:hover { color: var(--link); text-decoration: none; }
ul.social.contact-social .label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }

/* ---------- social icons ---------- */
ul.social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
ul.social .icon { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: var(--link); align-items: center; justify-content: center; transition: background .15s; }
ul.social .icon svg { width: 18px; height: 18px; fill: #fff; }
ul.social a:hover .icon { background: var(--link-hover); }
ul.social .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- footer ---------- */
.site-footer { margin-top: 20px; padding: 26px 16px 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 15px; color: var(--muted); flex-wrap: wrap; }
.footer-social { justify-content: flex-end; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  main { padding: 32px 28px 40px; }
  .about-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
}
@media (max-width: 720px) {
  .site-header { padding-top: 20px; }
  .site-title { font-size: 1.7rem; }
  .nav-toggle {
    display: inline-block; background: none; border: 1px solid #ccc; border-radius: 4px;
    padding: 8px 10px; margin-top: 12px; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; }
  .main-nav { display: none; margin-top: 8px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav li a { display: block; padding: 10px 0; border-top: 1px solid var(--border); }
  .container { padding: 0 12px; }
  main { padding: 24px 16px 32px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-photo { order: -1; max-width: 320px; }
  .page-title, .about h2 { font-size: 1.6rem; }
  .mf-title { font-size: 1.8rem; }
  .pdf-embed iframe { height: 600px; }
  .footer-inner { justify-content: center; text-align: center; }
  .footer-social { justify-content: center; }
}
