/*
 * Mystic Adventure: make Joomla 6's Cassiopeia template look like the old
 * Joomla 3 Protostar site. Values were measured from the live old site.
 * Installed as media/templates/site/cassiopeia/css/user.css (Cassiopeia loads
 * it automatically and Joomla updates leave it alone).
 */
@import url("https://fonts.googleapis.com/css?family=Open+Sans&display=swap");

:root {
  --ma-text: #333;
  --ma-link: #005e8d;
  --ma-link-hover: #002b41;
  --ma-title: #001a27;
  --ma-box-border: rgba(0, 0, 0, .15);
}

/* Page: light grey background with a blue line along the top */
body.site {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: var(--ma-text);
  background: #f4f6f7;
  border-top: 3px solid #0088cc;
  padding: 20px;
}

/* Header + content form one centred white 980px box, like Protostar's .container */
.container-header,
.site-grid {
  width: 100%;          /* body is a flex column, which would shrink these */
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  border: 1px solid var(--ma-box-border);
  box-shadow: 0 0 6px rgba(0, 0, 0, .05);
}
.container-header {
  background-image: none;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  box-shadow: none;
}
.container-header .grid-child {
  padding: 20px 20px 0;
  max-width: none;
}
.site-grid {
  border-top: 0;
  border-radius: 0 0 4px 4px;
  /* 20px gutters; 4 equal columns: article takes 3 (700px), menu takes 1 (220px) */
  grid-template-columns: [full-start] 0 [main-start] repeat(4, minmax(0, 1fr)) [main-end] 0 [full-end];
  column-gap: 20px;
  padding-bottom: 20px;
}

/* Site title as text */
.container-header .navbar-brand {
  padding: 0;
  margin: 0;
  font-size: 40px;
  line-height: 48px;
}
.container-header .navbar-brand .brand-logo,
.container-header .navbar-brand .brand-logo:hover {
  font-family: "Open Sans", sans-serif;
  font-size: 40px;
  line-height: 48px;
  font-weight: 700;
  color: var(--ma-title);
  text-decoration: none;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  color: var(--ma-text);
  margin: 12px 0;
}
h1 { font-size: 26px; line-height: 28px; }
h2 { font-size: 22px; line-height: 24px; }
h3 { font-size: 18px; line-height: 20px; }
h4 { font-size: 14px; line-height: 16px; }
h5 { font-size: 13px; line-height: 15px; }

/* Article title with the thin rule underneath */
.item-page .page-header {
  padding-bottom: 5px;
  margin: 2px 0 10px;
  border-bottom: 1px solid #eee;
}
.item-page .page-header h1,
.item-page .page-header h2 {
  font-size: 22px;
  line-height: 24px;
  margin: 12px 0;
}

/* Body text and links */
p {
  margin: 0 0 9px;
}
a,
a:not([class]),
.mod-menu a {
  color: var(--ma-link);
  text-decoration: none;
}
a:hover,
a:focus,
a:not([class]):hover,
.mod-menu a:hover {
  color: var(--ma-link-hover);
  text-decoration: underline;
}

/* Tables that use the old border="1" attribute */
.com-content-article__body table {
  border-collapse: collapse;
  border-spacing: 0;
}
.com-content-article__body table[border="1"] {
  border: 1px outset #333;
}
.com-content-article__body table[border="1"] td,
.com-content-article__body table[border="1"] th {
  border: 1px inset #333;
  padding: 1px;
}

/* Main Menu: Protostar's grey "well" panel */
.sidebar-right.card {
  background: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
  padding: 19px;
  margin-bottom: 20px;
}
.sidebar-right .card-header {
  background: none;
  font-size: 18px;
  line-height: 20px;
  padding: 0 0 5px;
  margin: 0 0 5px;
  border-bottom: 1px solid #eee;
}
.sidebar-right .card-body {
  padding: 0;
}
.sidebar-right .mod-menu {
  padding: 0;
  margin: 0 0 18px;
  list-style: none;
}
.sidebar-right .mod-menu > li {
  padding: 0;
  margin: 0;
  line-height: 18px;
}
.sidebar-right .mod-menu a {
  font-size: 13px;
  line-height: 18px;
  padding: 0;
}
.sidebar-right .mod-menu .active > a,
.sidebar-right .mod-menu a[aria-current] {
  text-decoration: none;
}

/* Space between the header and the article/menu (Protostar: 10px header margin) */
.site-grid main,
.sidebar-right.card {
  margin-top: 9px;
}

/* Footer: "(c) year site" on the left, "Back to Top" on the right, under the box */
.container-footer {
  background: none;
  color: var(--ma-text);
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}
.container-footer .grid-child {
  padding: 20px;
  max-width: none;
}
.container-footer .mod-footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.container-footer .mod-footer,
.container-footer .mod-footer a {
  font-size: 13px;
  line-height: 18px;
}
.container-footer .mod-footer a {
  color: var(--ma-link);
}

/* Preformatted text (the ASCII maps): Bootstrap 2's grey box */
pre {
  display: block;
  padding: 8.5px;
  margin: 0 0 9px;
  font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 18px;
  color: var(--ma-text);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
  background: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 4px;
}
