/* MECO52 - responsive, clean layout (black/white/gray)
   Designed to be compatible with existing page markup/classes. */

:root {
  --bg: #f3f3f3;
  --surface: #ffffff;
  --text: #111111;
  --muted: #555555;
  --border: #d7d7d7;
  --accent: #222222;
  --accent-soft: #e9e9e9;
  --link: #111111;
  --link-hover: #000000;
  --ok: #1f7a3a;
  --warn: #b00020;
  --info-border: #999999;
  --max-width: 1100px;
}

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* Page container */
#background {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  box-shadow: 0 0 0 1px #e0e0e0;
}

/* Header */
#header {
  width: auto;
  height: auto;
  margin: 0;
  padding: 28px 24px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  text-align: left;
  overflow: visible;
  background-image: url('images/header.jpg')
}

.site-title {
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 6px;
  color: #FFFFFF;
  text-shadow: -2px 0 red, 0 2px red, 2px 0 red, 0 -2px red;
}

.site-subtitle {
  font-size: 1.5rem;
  font-weight: 800;
  color: #000000;
  /*margin: 0 10px;*/
  line-height: 1.35;
}

.site-meta {
  font-size: 0.98rem;
  font-weight: 800;
  color: #000000;
  line-height: 1.4;
  width: fit-content;
}

/* Top navigation */
#navi_top {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0 12px;
  background: #f0f0f0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  overflow: visible;
}

#navi_top ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

#navi_top li {
  float: none;
  margin: 0;
  background: none;
  display: block;
  height: auto;
  line-height: 1.2;
}

.tab a, .tab a:link, .tab a:visited,
.active a, .active a:link, .active a:visited,
.login a, .login a:link, .login a:visited,
.login_active a, .login_active a:link, .login_active a:visited {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: #111;
  background: transparent;
}

.tab div, .active a div, .login div, .login_active a div {
  background: none;
  margin: 0;
  padding: 0;
}

.tab a:hover, .active a:hover, .login a:hover, .login_active a:hover {
  background: #dedede;
  color: #000;
  text-decoration: none;
}

.active a, .active a:link, .active a:visited,
.login_active a, .login_active a:link, .login_active a:visited {
  background: #d6d6d6;
  font-weight: 600;
}

.active a div, .active a:hover div,
.login_active a div, .login_active a:hover div {
  color: #000;
  font-weight: 600;
}

.login a, .login a:link, .login a:visited { color: #222; }
.login a:hover { background: #e0e0e0; }

/* Main content and side columns
   Sidebars (#navi_right, #images) typically appear before #content in markup and were float:right. */
#navi_right {
  float: right;
  width: 240px;
  max-width: 100%;
  margin: 20px 20px 16px 16px;
  padding: 8px 0 10px;
  background: #f4f4f4;
  border: 1px solid var(--border);
  position: static;
  left: auto;
  height: auto;
}

#navi_right ul {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.right, .right_act, .right_admin {
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: left;
  padding: 0;
  margin: 0;
  color: #000;
  background: none;
}

.right a, .right a:link, .right a:visited {
  display: block;
  padding: 6px 12px;
  color: #111;
  text-decoration: none;
  background: none;
}

.right a:hover {
  background: #e4e4e4;
  color: #000;
}

.right_act {
  display: block;
  padding: 6px 12px;
  font-weight: 700;
  background: #dddddd;
  color: #000;
}

#images {
  float: right;
  width: 240px;
  max-width: 20%;
  margin: 20px 20px 16px 16px;
  padding: 0 4px 8px;
  text-align: center;
  font-size: 0.9rem;
  background: transparent;
  position: static;
  left: auto;
  height: auto;
  overflow: visible;
}

#images h5 { text-align: left; }

#content {
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  vertical-align: top;
  text-align: left;
  font-size: 1rem;
  line-height: 1.55;
  overflow: visible;
}

#padding {
  width: auto;
  max-width: 760px;
  padding: 20px 24px 40px;
  margin: 0;
  text-align: left;
}

/* When a right column is present, limit content width on desktop via margin */
#navi_right + #content #padding,
#images + #content #padding {
  margin-right: 280px;
  max-width: none;
}

/* Clear floats before footer */
#content::after, #background::after {
  content: "";
  display: block;
  clear: both;
}

div.google { display: block; margin: 2em auto 1em; }
div.mainimage { margin: 1.5em 0; }
div.mainimage img { display: block; margin: 0 auto; }

/* Typography */
p, h1, h2, h3, h4, h5 {
  padding: 0;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

p { font-size: 1rem; padding-top: 10px; margin: 0; }
h1 { font-size: 1.8rem; font-weight: 700; color: #333; }
h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  color: #111;
  margin: 24px 0 6px;
  font-weight: 700;
}
h3 { font-size: 1.25rem; font-weight: 700; color: #333; }
h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #222;
  margin-top: 10px;
}
h5 {
  font-size: 1.1rem;
  line-height: 1.3;
  color: #111;
  font-weight: 700;
  margin-top: 20px;
}

#content ul {
  list-style: disc outside;
  margin: 10px 0;
  padding-left: 22px;
}

#content li {
  float: none;
  font-size: 1rem;
  padding-top: 0;
  margin-left: 0;
}

/* Boxes */
.bluebox, .greenbox, .redbox {
  padding: 12px 14px;
  margin: 20px 0;
  margin-right: 0;
  max-width: 100%;
}

.bluebox {
  border: 1px solid var(--info-border);
  background: #f7f7f7;
}

.greenbox {
  border: 1px solid var(--ok);
  background: #f3fbf5;
  color: #124a24;
}

.redbox {
  border: 1px solid var(--warn);
  background: #fff5f6;
  color: #8a0018;
}

.error_msg_list { margin: 8px 0 0; padding-left: 20px; }
.error_msg_list_item { list-style: disc; margin: 4px 0; }

/* Forms */
form, input, select, textarea, button {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
}

form { margin-top: 16px; }

input, select, textarea {
  border: 1px solid #888;
  margin: 4px 0;
  padding: 8px 10px;
  vertical-align: top;
  background: #fff;
  color: #111;
  max-width: 100%;
}

input[type="text"], input[type="password"], input[type="email"], input[type="file"] {
  width: 100%;
  max-width: 420px;
}

textarea {
  width: 100%;
  max-width: 700px;
  min-height: 120px;
}

select {
  width: auto;
  max-width: 100%;
}

input[type=checkbox] {
  width: auto;
  float: none;
  vertical-align: middle;
  margin-right: 6px;
}

input[type=radio] {
  margin: 0 6px 0 0;
  width: auto;
}

label { margin-left: 4px; }
.label { line-height: 1.8; margin-right: 2px; }
.label-top { width: auto; float: none; font-style: italic; }

.form-label, .form-highlight, .form-label-short, .form-label-long, .form-label-line, .form-label-right {
  width: auto;
  float: none;
  clear: both;
  line-height: 1.5;
  display: block;
  margin-top: 8px;
  font-weight: 600;
}

.form-highlight { color: var(--ok); }
.form-comment { font-size: 0.95rem; margin-bottom: 0; }
div.disabled { display: none; }

.submit {
  background: #e6e6e6;
  border: 1px solid #777;
  color: #111;
  margin: 16px 0 0;
  padding: 8px 14px;
  width: auto;
  cursor: pointer;
}
.submit:hover { background: #dcdcdc; }

.gray { border: 1px solid #888; }
.error { border: 1px solid var(--warn); }

/* Tables */
table {
  margin-top: 16px;
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
}

td, th {
  border: 1px solid #bdbdbd;
  padding: 8px 10px;
  font-size: 0.95rem;
  text-align: left;
  vertical-align: top;
}

th { background: #f0f0f0; }

#content .info { width: auto; margin: 8px 0 16px; }
#content .info td { border: 0; padding: 4px 10px 4px 0; }
.h5-info { float: none; clear: both; padding-left: 0; }

/* Images in content */
#content img {
  border: 0;
  margin: 0;
  display: inline-block;
}
#content .mainimage img, #content > div > img, #images img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
#images img { margin-bottom: 12px; }

/* Contribution/admin misc */
#contribution {
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 20px 24px;
  text-align: left;
  font-size: 1rem;
  line-height: 1.5;
  position: static;
}

/* Footer */
#footer {
  clear: both;
  width: auto;
  margin: 0;
  padding: 16px 24px 20px;
  text-align: center;
  background: #f0f0f0;
  border-top: 1px solid var(--border);
  color: #555;
  font-size: 0.9rem;
}

#shadow_bottom { display: none; }

.admin, .admin a, .admin a:link, .admin a:visited, .admin a:hover {
  color: #555;
  text-decoration: none;
}
.admin a:hover { text-decoration: underline; color: #222; }

table .red { color: #b00020; font-weight: 700; }
table .green { color: #1f7a3a; font-weight: 700; }

/* Sponsors */
table.sponsors { width: 100%; margin: 0 auto; border-collapse: separate; }
table.sponsors tr { width: auto; }
table.sponsors td { padding: 1em; vertical-align: bottom; border: 0; text-align: center; width: 33%; }
table.sponsors td img { padding: 0.5em; width: auto; max-width: 100%; max-height: 120px; }
.sponsor { width: 100%; margin: 1em auto; display: block; padding: 1em 0; }
.sponsor iframe { margin-top: 1em; margin-bottom: 1em; max-width: 100%; }

/* Schedule and other wide legacy blocks: make flexible */
table.schedule, .schedule-text, .back, .timezone-container, .complexity, .ysp2021 { width: 100%; max-width: 100%; }
table.schedule { min-height: 0; padding: 0.5em 0; border-spacing: 0 5px; }
table.schedule td { border: 0; }
table.schedule tr.day { background-color: #d9d9d9; font-weight: 700; }
table.schedule td.day { padding: 0.5ex; text-align: center; }
table.schedule tr.session { font-weight: 700; background-color: #cfcfcf; }
table.schedule td.session { padding: 0.8ex 1ex; }
table.schedule td.session-right { padding: 0.5ex; text-align: center; background-color: #e0e0e0; }
table.schedule td.time { width: auto; white-space: nowrap; }
table.schedule td.hyphen { width: auto; padding: 0 4px; }
table.schedule td.speaker { font-weight: 700; width: auto; }
table.schedule td.title { width: auto; }
table.schedule td.lunch { font-weight: 700; text-align: center; }
table.schedule td.space { padding: 0.5em; }

.timezone { float: none; }
.timezone form { float: none; }
.timezone-container { padding: 12px 0; }

table.payment { width: 100%; margin: 8px 0; }
table.payment td { border: 0; padding-left: 0; }
table.payment td.amount { text-align: right; }

#paypal-button-container { width: 100%; max-width: 420px; margin: 20px auto; }

.complexity_title { font-size: 1.5rem; font-weight: 700; text-align: center; margin: 1em 0; }
.complexity_speaker, .complexity_affiliation, .complexity_time, .complexity_location { text-align: center; }
.complexity_abstract { margin: 1.5em 0; text-align: justify; }

.ysp2021_call { font-size: 1.3rem; font-weight: 700; text-align: center; margin: 1em 0; }

/* Misc legacy */
.place { display: inline; font-weight: 700; }
.address { display: inline; font-style: italic; }
.description { display: block; font-size: 0.95rem; margin: 1em 0; }
.description table { border-collapse: collapse; }
.description table td { border: 0; }

.tooltip { position: relative; display: inline-block; border-bottom: 1px dotted #000; }
.tooltip .tooltiptext {
  visibility: hidden;
  width: 240px;
  max-width: 80vw;
  background: #111;
  color: #fff;
  text-align: center;
  padding: 6px 8px;
  border-radius: 4px;
  position: absolute;
  z-index: 1;
}
.tooltip:hover .tooltiptext { visibility: visible; }

/* Responsive adjustments */
@media (max-width: 900px) {
  #navi_right, #images {
    float: none;
    width: auto;
    margin: 16px 24px 8px;
  }
  #navi_right + #content #padding,
  #images + #content #padding {
    margin-right: 0;
  }
  #padding { max-width: none; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  #header { padding: 18px 16px 14px; }
  .site-title { font-size: 1.9rem; }
  .site-subtitle { font-size: 0.98rem; }
  .site-meta { font-size: 0.92rem; }
  #navi_top { padding: 0 6px; }
  #navi_top ul { gap: 0; }
  .tab a, .active a, .login a, .login_active a { padding: 9px 10px; }
  #padding { padding: 16px 16px 28px; }
  #navi_right, #images { margin: 12px 16px; }
  #footer { padding: 14px 16px; }
  table.sponsors td { display: block; width: 100%; }
  table, thead, tbody, th, td, tr { font-size: 0.92rem; }
  td, th { padding: 6px 8px; }
  input[type="text"], input[type="password"], input[type="email"], input[type="file"], textarea, select {
    width: 100%;
    max-width: 100%;
  }
}
