/* =========================================================
   IVY Workbench — layout CSS for your NEW HTML structure
   (header + sections), but visually close to the old page.
   ========================================================= */

/* ---- Base ---- */
:root{
  --maxw: 1200px;
  --leftcol: 180px;     /* left label column (About/Downloads/Related Publications) */
  --gap: 0px;
  --body-pad: 10px;
  --border: thin solid #8b8b8b;
  --text: #333;
  --link: #660000;
  --visited: #0066CC;
  --shadow: #6374AB -3px 2px 3px;
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: Helvetica, Arial, sans-serif;
}

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

img{ border: 0; padding: 0; margin: 0; vertical-align: middle; }

address{
  max-width: var(--maxw);
  margin: 30px auto 0;
  padding: 0 10px 20px;
  text-align: right;
}

/* ---- Overall page width ---- */
.page-header,
.page-main{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 10px;
}

/* ---- Header (left column empty for possible logos, right column for title+affiliations) ---- */
.page-header{
  display: grid;
  grid-template-columns: var(--leftcol) 1fr;
  gap: var(--gap);
  padding-top: 0px;
  padding-bottom: 0px;
  margin-bottom: 16px;
  transition: padding 200ms ease, margin 200ms ease;
}

.header-empty{
  /* reserved for future logo placement */
  justify-self: end;
}

.header-empty img{
  display: block;
  max-height: 60px;
  width: auto;
}

.header-content{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-left: var(--body-pad);
  transition: padding 200ms ease;
}

.page-title{
  margin: 0;
  padding: 0;
  font-size: 1em; /* reset h1 default size; use spans for visual sizing */
  font-weight: normal;
}

.page-affiliations{
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.page-affiliations a{
  display: inline-block;
  margin-right: 10px;
}

.page-affiliations a:nth-child(2),
.page-affiliations a:last-child{
  margin-right: 0;
}

.page-affiliations img{
  height: 50px;
}

.page-affiliations a:first-child img{
  height: 40px;
}

/* Old title styling */
.title1{ text-shadow: var(--shadow); font-size: 3.2em; letter-spacing: 0.02em; }
.title2{ text-shadow: var(--shadow); font-size: 1.6em; margin-left: 0.12em; }

/* each block becomes a 2-column grid:
   left = section title (with rule)
   right = content (with vertical rule) */
.block{
  display: grid;
  grid-template-columns: var(--leftcol) 1fr;
  grid-template-areas:
    "block-header empty"
    "block-aside block-body";
  column-gap: var(--gap);
  margin: 5px 0 0px;
  transition: margin 200ms ease;
}

/* Left column section title */
.block-header{
  grid-area: block-header;
}

.block-header > h2{
  align-self: start;
  margin: 2px 0 0;
  text-align: right;
  font-weight: 400;
  font-size: 1.1em;
  text-shadow: #6374AB -2px 1px 2px;
  padding: 0;
  padding-bottom: 2px;
}

.block-aside{
  grid-area: block-aside;
  border-top: var(--border);
  border-right: var(--border);
}

/* Right column content area */
.block-body{
  grid-area: block-body;
  padding-left: var(--body-pad);
  min-width: 0; /* allow wrapping inside */
  transition: padding 200ms ease, margin 200ms ease;
}

/* Make the body feel like the old one (tight, compact) */
.block-body p{ margin: 0.5em 0; }
.block-body dl{ margin: 0; }
.block-body dt{ margin-top: 10px; }
.block-body dd{ margin: 0 0 8px 0; }

/* The mini “Watch presentation” dl: stop it from looking weird */
#screen_ctl { display: inline-block; margin-top: 6px; }

/* ---- Downloads dl: square bullets on dd like old CSS ---- */
.block-body > dl > dd{
  display: list-item;
  list-style-type: square;
  margin-left: 1.2em;
}

/* ---- Bibliography include (pubs.html) ----
   Your generator uses <dl> with lots of <dt style="font-size:0.9em">.
   We keep it readable and close to the old look.
*/
.block-body dl{
  margin: 0;
}

.block-body dl dt{
  margin: 10px 0 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;   /* avoid layout explosions */
}

.block-body dl dt b a{
  font-weight: 700;
}

/* Make the “icon row” (publisher/pdf icons) line up nicer */
.block-body dl dt img{
  margin-right: 6px;
}

/* Optional: slightly reduce bibliography density without destroying it */
.block-body dl dt{
  font-size: 0.92em;
  }

/* ---- Responsive: collapse to single column on narrow screens ---- */
@media (max-width: 820px){
  .page-header{
    grid-template-columns: 1fr;
  }
  .header-empty{
    display: none;
  }
  .header-content{
    padding-left: 0;
    justify-content: space-between;
  }
  .block{
    grid-template-columns: 1fr;
    grid-template-areas:
      "block-header"
      "block-body";
  }
  .block-header > h2{
    text-align: left;
  }
  .block-aside{
    display: none;
  }
  .block-body{
    grid-column: 1;
    padding-left: 0;
    border-top: var(--border);
    padding-top: 10px;
    margin-top: 10px;
  }
}
