body {
  background-color: #ffe;
  color: #000;
  margin: 0;
  padding: 0;
}

#header {
  background-color: #000;
  position: static;
  /* height: 65px; */
  height: 0px;
  margin: 0;
  left: 0;
  top: 0;
}

#headerleft {
  position: relative;
  float: left;
  /* height: 65px; */
  height: 0px;
  width: 679px;
  margin: 0;
  background-image: url("/~magi/common/darkbg/crackbl.jpg");
}

#headerright {
  position: relative;
  float: right;
  /* height: 65px; */
  height: 0px;
  width: 73px;
  margin: 0;
  /* background-image: url("/~magi/common/darkbg/crackbl.jpg"); */
}

#centerbox {
  position: absolute;
  top: 0px;  /* 65px; */
  left: 0px;
  width: 500px;
  height: 500px;
  background-color: #ffe;
  margin: 0;
}

/*******************************************************************************
* Menu
*******************************************************************************/
#sidemenu {
  position: absolute;
  left: 0px;
  top: 0px;  /* 65px; */
  height: 100%;
  width: 200px;
  background-color: black;
  background-image: url("/common/darkbg/crackbl.jpg");
}

/* When opened from the hamburger on small screens, make it double width */
body.sidemenu-visible #sidemenu .menu {
  font-size: 36pt; /* Increase font size */
}
body.sidemenu-visible .menu-top-image {
  width: 96px; /* Double the width of the image */
  height: 96px; /* Double the height of the image */
}

body.sidemenu-visible #sidemenu {
  width: 520px !important; /* Ensure the menu width is doubled */
  max-width: 100% !important; /* Prevent overflow */
}
@media (max-width: 1000px) {
  /* small-screen base width is 260px (defined later); when the menu is opened,
     double that size. Use !important to override the later rule. */
  body.sidemenu-visible #sidemenu {
    width: 520px !important;
    max-width: 100% !important;
  }
}

.menu-container {
  width: 100%;
}

.menu-header {
  margin-top: 10px;
  margin-bottom: 10px;
  text-align: center;
}

/* Basic reset for the menu fragment */
.menu {
  width: 100%;
  font-size: 12pt;
  font-weight: bold;
  color: #ffffff;
  list-style: none;
  margin:0;
  padding:0;
  font-family: sans-serif;
}

.menu li {
  position: relative;
  margin-left: 5px;
  border-bottom: 1px solid #333;
  padding: 0 0 0 0;
  color:#e0e0e0;
}

.menu li.current > a, .menu li.current {
  color: lightyellow;
  font-weight: bold;
}

.menu a {
  color: inherit;
  text-decoration: none;
}

.menu a:hover {
  color:#aaa;
}

.menu .toggle {
  position: absolute;
  right: 8px;
  <!-- Rolling disabled.
  transform: translateY(-20%);
  transform-origin: center;
  transition: transform 300ms ease, color 150ms ease;
  will-change: transform;
  background: transparent;
  border: none;
  color: #aaf;
  -->
  cursor: pointer;
  font-size: 0.9em;
}

/* rotate toggle when its parent list is opened */
.menu li.open .toggle {
  <!-- transform: rotate(-90deg); -->
}

/* animate submenu open/close: use max-height instead of display so it can be animated */
.menu ul {
  display: block;         /* override the display:none so we can animate height */
  max-height: 0;
  overflow: hidden;
  transition: max-height 250ms ease;
  will-change: max-height;
}

/* when the li is opened, expand the submenu */
.menu li.open > ul {
  max-height: 1000px;     /* large enough to contain the submenu */
}

.menu .toggle:focus {
  outline: 1px dashed #88a;
}

.menu .toggle:hover {
  outline: 1px dashed rgb(73, 73, 92);
}

.menu ul {
  list-style: none;
  margin: 0 0 0 0;
  padding: 0 0 0 12px;
  display: none; 
}

.menu li.open > ul {
  display: block;
}

.menu li.has-children > a {
  padding-right: 28px; /* leave room for toggle */
}

.menu .caret {
  font-family: monospace;
  display:inline-block;
  width:1em;
}

#menulinks a {
  color: #e0f0ff !important;
  text-decoration: none;
}

#menulinks a:hover {
  color: #fff;
  text-decoration: underline;
}

<!--***************************************************************************
* Main content
*************************************************************************** -->

#content {
  background-color: #ffe;
  margin: 5px 5px 5px 5px;
}

#narrowcontent {
  background-color: #ffe;
  margin: 5px 50px 5px 250px;
}

#contentborder {
  margin: 0px 170px 0px 152px;
  background-color: #d0d0d0;
}

#rawcontentborder {
  margin: 0px 170px 0px 152px;
  background-color: #d0d0d0;
}

a:hover {
	color: #1b5687;
	text-decoration: none;
}

a {
	color: #213851;
}

h1 {
  text-align: center;
}

h2 {
  font-weight: bold;
  font-size: 16pt;
  margin-left: 0px;
  border-bottom: 4px solid #b9f;
  text-align: left;
}

h3 {
  font-weight: bold;
  font-size: 14pt;
  margin-left: 0px;
  border-bottom: 2px solid #b9f;
  text-align: left;
}

h4 {
  margin: 0;
  font-weight: bold;
  font-size: 12pt;
  padding-left: 50px;
  text-align: left;
}

.quotetext {
	padding: 4px;
	margin: 1em;
	background-color: #eee;
	border: dashed 1px #000;
	overflow: auto;
}

.newsheader {
	font-weight: bold;
	padding-left: 1em;
}

.newstext {
	font-weight: normal;
	font-size: 90%;
	padding-left: 6em;
}

.bodytext_top {
	margin-top: 3em;
	font-size: 90%;
	font-weight: bold;
}

.bodytext {
	margin-top: 1em;
	font-size: 90%;
}

p {
   	margin-left: 0px;
	margin-top: 1em;
}

pre {
	padding: 4px;
	margin: 1em;
	background-color: #eee;
	border: dashed 1px #000;
	overflow: auto;
    white-space: pre;
   	margin-left: 70px;
	margin-top: 1em;
}

pre.table {
	padding: 1px;
	margin: 0em;
	background-color: #eee;
	border: dashed 1px #000;
/*	overflow: auto; */
    white-space: pre;
   	margin-left: 0px;
	margin-top: 0em;
}

pre.tablecode {
	padding: 1px;
	margin: 0em;
	background-color: #f0f0ff;
	border: solid 1px #000;
/*	overflow: auto; */
    white-space: pre;
   	margin-left: 0px;
	margin-top: 0em;
}

li {
   	margin-left: 0px;
}

li.table {
   	margin-left: 10px;
}

ul.table {
   	margin-top: 0.2em;
   	margin-bottom: 0.2em;
}

table.main {
	margin-left: 70px;
}

dl {
   	margin-left: 50px;
}

dl.box {
	background-color: #ffffe0;
   	margin-top: 0px;
   	margin-left: 50px;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 1px;
    padding-bottom: 1px;
}

dt {
	margin-top: 0.7em;
   	margin-left: 0px;
}

dt.title {
	font-weight: bold;
	margin-top: 0.7em;
   	margin-left: 0px;
}

dd {
	margin-top: 5px;
	margin-bottom: 10px;
   	margin-left: 20px;
}

dt.main {
	margin-top: 1em;
	font-size: 90%
}

dd.main {
	margin-top: 0em;
	font-size: 80%
}

#rightmenu {
  position: absolute;
  top: 0px;
  right: 0px;	
/*	position: relative;
   float: right;
   clear: right; */
  margin: 0;
  width: 170px;
  min-height: 609px;
  color: #fff;
  font-size: 70%;
  font-weight: bold;
  text-align: center;
  padding-top: 50px;
}

.rightmenubox {
	position: relative;
	float: none;
	clear: both;
	font-size: 70%;
	font-weight: bold;
	text-align: left;
	margin: 5px 5px 0px 5px;
	padding: 2px;
	background-color: #eee;
	color: #444;
}

#footer {
	position: static;
	background-color: #213851;
	bottom: 0px;
	left: 0px;
	width: 100%;
/*	float: none;
	clear: both; */
	height: 2em;
	color: #fff;
	margin-top: 50px;
	text-align: center;
	font-size: 80%;
}

#footer a {
	color: #fff;
	text-decoration: none;
}

#footer a:hover {
	color: #fff;
	text-decoration: underline;
}

/******************************************************************************
* For the gallery.
******************************************************************************/

td.gallery-section {
	background: lightgreen;
}

/******************************************************************************
*
******************************************************************************/

ADDRESS { font-size: large; color: red}
BLOCKQUOTE {padding-top: 10px; padding-bottom: 10px;}
BLOCKQUOTE.normal {padding-top: 0px; padding-bottom: 0px;}
BLOCKQUOTE.quote {color: #008000; padding-top: 10px; padding-bottom: 10px; font-style: italic;}
BLOCKQUOTE.abstract {color: black;}
BLOCKQUOTE.references {color: #008000; padding-top: 0px; padding-bottom: 0px;}
HR {clear: both}
TABLE.main {width: 400px}
TD.title {background: #efefd0;}
TD.main {background: #ffffe0}
PRE {	font-size: 100%;
	margin: 30px 30px 10px 10px;
	padding: 5px 5px 5px 5px;
}
PRE.code {border: solid; border-width: thin; background: white}
PRE.command {background: #f0f0ff}

/*******************************************************************************
* Kieliopinnot
*******************************************************************************/

.occluded-on-hover:hover {
  color: white;
  background: white;
}

.revealed-on-hover { 
  color: white;
  background: white;
}

.revealed-on-hover:hover { 
  color: inherit;
  background: inherit;
}

/* Responsive side-menu: hamburger on small screens */
#sidemenu-toggle {
  display: none;
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 1101;
  width: 88px;
  height: 72px;
  background: rgba(0,0,0,0.7);
  color: #e0e0e0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-size: 36px;
}

/* overlay that darkens the page when menu is open */
#sidemenu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1099;
}

/* small-screen behaviour */
@media (max-width: 1000px) {
  /* hide the old absolute sidemenu layout */
  #sidemenu {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    max-width: 80%;
    transform: translateX(-100%);
    transition: transform 280ms ease;
    z-index: 1100;
    box-shadow: 2px 0 12px rgba(0,0,0,0.5);
    background-color: black; /* ensure background for overlay look */
    overflow-y: auto;
  }

  /* show hamburger button */
  #sidemenu-toggle { display: flex; }

  /* show overlay when opened (JS will toggle .sidemenu-visible on body) */
  body.sidemenu-visible #sidemenu {
    transform: translateX(0);
  }
  body.sidemenu-visible #sidemenu-overlay {
    display: block;
  }

  /* keep main content readable while menu is off-canvas */
  #content, #narrowcontent, #contentborder, #rawcontentborder {
    /* prevent layout jumps; allow main area to fill */
    margin-left: 50px !important;
    margin-right: 50px !important;
    font-size: 24pt;
  }

  /* optional: slightly dim page scroll when menu open */
  body.sidemenu-visible {
    overflow: hidden;
  }
}

/* Ensure hamburger doesn't collide on very small screens */
@media (max-width: 1020px) {
  #sidemenu-toggle {
    left: 8px;
    top: 8px;
    width: 100px;
    height: 100px;
    font-size: 16px;
  }
}
