/**
 * @file
 * mcgill.css
 *
 * The McGill & Associates Engineering look, rebuilt on letsgo's markup.
 * Values (colours, sizes, graphics) follow the D7 "mcgill" Omega subtheme.
 *
 * -------------------------------------------------
 * Attached thru `.libraries.yml` (letsgo/mcgill)
 *
 ============================================================================ */

:root {
  --mcgill-bg: #f1eee7;
  --mcgill-text: #000;
  --mcgill-muted: #6a6866;
  --mcgill-footer-text: #6e6c6c;
  --mcgill-blue: #1281a5;
  --mcgill-link: #0062a0;
  --mcgill-rule: #e4e1da;
  --mcgill-width: 940px;
}

/**
 * Global
 ========================================*/

html {
  background: var(--mcgill-bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--mcgill-bg) url(../../images/mcgill/bkg-header.png) repeat-x top center;
  color: var(--mcgill-text);
  font: 13px/1.5 Arial, Helvetica, sans-serif;
}

h1, h2, h3, h4 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  letter-spacing: -0.05em;
  line-height: 1.3;
}

h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

p { margin: 0 0 1.5em; }

a {
  color: var(--mcgill-link);
  display: inline;
  vertical-align: baseline;
}

a:hover { opacity: 1; }

/* Links inside text are underlined, as on the D7 site. */
.field-name-body a,
.field__item a[href^="mailto:"],
.views-field-field-email a,
.views-more-link,
.layout-footer a {
  text-decoration: underline;
}

/* "Read more..." follows the trimmed text on the same line. */
.views-field-body .field-content > p:last-of-type {
  display: inline;
}

.field-name-body ul,
.field-name-body ol {
  margin: 0 0 1.5em 30px;
}

.field-name-body table { border-collapse: collapse; }

.layout-container {
  max-width: none;
  width: var(--mcgill-width);
  margin: 0 auto;
  padding: 0;
}

@media (min-width: 700px) {
  .layout-container { padding: 0; }
}

/**
 * Header
 ========================================*/

.header {
  height: 124px;
  position: relative;
  z-index: 2;
}

.header-inner {
  position: relative;
  height: 100%;
  flex-wrap: nowrap;
}

/* The logo hangs left of the content column and over the page edge. */
.header .site-branding {
  position: absolute;
  top: 0;
  left: -195px;
}

.header .site-logo {
  display: block;
  border: 0;
  max-width: none;
}

.header-second {
  margin-left: auto;
}

/* Main menu */
#block-letsgo-main-menu .menu {
  display: flex;
  margin: 27px -12px 0 0;
  padding: 0;
  list-style: none;
}

#block-letsgo-main-menu .menu__item {
  margin: 0;
  padding: 0;
  list-style: none;
}

#block-letsgo-main-menu .menu__item a {
  display: block;
  padding: 10px 12px;
  color: var(--mcgill-muted);
  font-size: 15px;
  line-height: 19px;
  text-transform: uppercase;
  text-decoration: none;
}

#block-letsgo-main-menu .menu__item a:hover,
#block-letsgo-main-menu .menu__item a.is-active {
  background: url(../../images/mcgill/bkg-menu-item.png) repeat-x center center;
  box-shadow: 3px 3px 3px #000;
  color: #fff;
}

/**
 * Highlighted (front page banner)
 ========================================*/

.highlighted {
  width: var(--mcgill-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/**
 * Content and sidebar
 ========================================*/

.main-content {
  padding: 20px 0;
  min-height: 500px;
  background: var(--mcgill-bg);
}

.main-inner {
  flex-wrap: nowrap;
  align-items: flex-start;
  
  /* Prevent logo from overlapping with main content links */
  z-index: 10;
  position: relative;
}

.layout-content {
  width: 680px;
  flex: 0 0 680px;
  padding-right: 20px;
}

/* D7 kept the 680px column on every page except the front page. */
.path-front .layout-content {
  width: var(--mcgill-width);
  flex-basis: var(--mcgill-width);
  padding-right: 0;
}

.layout-sidebar-second {
  width: 220px;
  min-width: 0;
  max-width: 220px;
  flex: 0 0 220px;
  margin-left: auto;
}

.layout-sidebar-second .block {
  max-width: 100%;
}

.layout-sidebar-second .block {
  border: 1px solid #999;
  border-radius: 10px;
  padding: 25px 8px;
}

.layout-sidebar-second .block + .block {
  margin-top: 20px;
}

.layout-sidebar-second .block__title,
.block-config-provider--views-block .block__title {
  font-size: 20px;
  letter-spacing: 0;
  margin: 0 0 5px;
}

.page-title,
#block-letsgo-page-title h1 {
  font-size: 26px;
  margin: 0 0 20px;
}

/* Images carry a thin black border, as on the D7 site. */
.layout-content img,
.layout-sidebar-second img {
  border: 1px solid #000;
}

/* Inline field labels read "Label: value". */
.field-label-inline {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
  font-size: 15px;
  line-height: 25px;
}

.field-label-inline .field__label {
  font-size: inherit;
  letter-spacing: 0;
  margin: 0;
}

.field-label-inline .field__label::after {
  content: ':';
}

/**
 * Front page
 ========================================*/

.path-front #block-letsgo-page-title { display: none; }

.path-front .node--type-page .field-name-body {
  margin: 50px 0 50px;
  padding: 30px 0 20px;
  border-top: 5px solid var(--mcgill-rule);
  border-bottom: 5px solid var(--mcgill-rule);
}

.path-front .field-name-body table { border: 0; margin: 0; width: 100%; }
.path-front .field-name-body tr,
.path-front .field-name-body td { border: 0; padding: 0 8px; vertical-align: top; }
.path-front .field-name-body td:first-of-type { width: 640px; }
.path-front .field-name-body td img { float: right; }

.path-front .field-name-body h2 {
  color: #6e6c6c;
  font-family: "Franklin Gothic Book", "Franklin Gothic", Arial, sans-serif;
  font-size: 26px;
  font-weight: normal;
  letter-spacing: 0.5px;
  line-height: 27px;
  text-transform: uppercase;
  margin-bottom: 25px;
}

.path-front .field-name-body p { color: #565454; }

.path-front .button {
  float: right;
  width: 150px;
  height: 105px;
  margin-top: -55px;
  padding: 10px;
  background: url(../../images/mcgill/button-1.png) repeat top center;
  color: #fefefe;
  font-family: "Franklin Gothic Book", "Franklin Gothic", Arial, sans-serif;
  font-size: 20px;
  line-height: 25px;
  text-align: center;
  text-transform: uppercase;
}

.path-front .button span {
  color: #049dcc;
  font-weight: bold;
  line-height: 32px;
}

/**
 * Nodes
 ========================================*/

.node__content::after {
  content: '';
  display: table;
  clear: both;
}

.node .field-name-field-image,
.node .field-name-field-img {
  float: left;
  max-width: 300px;
  margin: 0 20px 15px 0;
}

.node .field-name-field-project-date { margin-bottom: 10px; }

/* Project photo gallery */
.node .field-name-field-photo-gallery {
  clear: both;
  padding-top: 5px;
}

.node .field-name-field-photo-gallery .field__items {
  display: flex;
  flex-wrap: wrap;
}

.node .field-name-field-photo-gallery img {
  display: block;
  margin: 5px;
  box-shadow: 3px 3px 3px #333;
  transition: box-shadow 0.5s ease;
}

.node .field-name-field-photo-gallery img:hover { box-shadow: none; }

/* Staff */
.node--type-staff.node--view-mode-full .field-name-field-photo {
  float: left;
  margin: 0 20px 10px 0;
}

.node.node--type-staff .field-name-field-job-title {
  color: var(--mcgill-muted);
  font-size: 18px;
  margin-bottom: 10px;
}

.node.node--type-staff .field-name-field-phone { margin-bottom: 10px; }
.node.node--type-staff .field-name-body { margin-top: 10px; }

/* D7 hid the page title on staff pages. */
.node--type-staff #block-letsgo-page-title { display: none; }

/**
 * Views
 ========================================*/

/* Sidebar link lists: Services, Staff Directory */
.view-id-services.view-display-id-block_1 .views-field-title a,
.view-id-staff.view-display-id-block_1 .views-field-title a {
  display: block;
  padding: 5px 10px;
  color: var(--mcgill-muted);
  font-size: 15px;
  text-decoration: none;
  text-transform: capitalize;
}

.view-id-services.view-display-id-block_1 .views-field-title a { padding: 5px; }

.view-id-services.view-display-id-block_1 .views-field-title a:hover,
.view-id-services.view-display-id-block_1 .views-field-title a.is-active,
.view-id-staff.view-display-id-block_1 .views-field-title a:hover,
.view-id-staff.view-display-id-block_1 .views-field-title a.is-active {
  background: var(--mcgill-muted);
  color: var(--mcgill-bg);
  font-weight: bold;
}

/* Services page */
.view-id-services.view-display-id-page .views-row {
  clear: both;
  margin-bottom: 5px;
}

.view-id-services.view-display-id-page .views-field-field-image {
  float: left;
  margin: 0 20px 40px 0;
}

.view-id-services.view-display-id-page .views-field-title a {
  font-size: 25px;
  text-decoration: none;
}

.view-id-services.view-display-id-page .views-row::after {
  content: '';
  display: table;
  clear: both;
}

/* Staff page */
.view-id-staff.view-display-id-page > .view-content > h3 {
  color: #999;
  font-size: 22px;
  border-bottom: 1px solid #c0c0c0;
  margin: 0 0 20px;
}

.view-id-staff.view-display-id-page .views-row {
  clear: both;
  min-height: 200px;
  margin-bottom: 50px;
}

.view-id-staff .views-field-field-photo {
  float: left;
  margin: 0 20px 0 0;
}

.view-id-staff.view-display-id-page .views-field-title h3 {
  font-size: 20px;
  margin: 0;
}

.view-id-staff.view-display-id-page .views-field-title a { text-decoration: none; }
.view-id-staff .views-field-body { margin-top: 20px; }

/* Related projects (service pages): 3-column grid */
.view-id-projects.view-display-id-block .view-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.view-id-projects.view-display-id-block .views-row,
.view-id-projects.view-display-id-block .views-row--flex-spacers {
  text-align: center;
  flex: 1 1 200px;
}

.view-id-projects .views-field-title a {
  font-size: 15px;
  text-decoration: none;
}

/* Featured project (sidebar slideshow) */
.view-id-projects.view-display-id-block_1 .views-field-title {
  text-align: center;
  font-size: 13px;
}

.view-id-projects.view-display-id-block_1 img { display: block; }

/**
 * Footer
 ========================================*/

/* Keep the footer at the bottom of short pages, as D7 did. */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page > .main-content {
  flex: 1 0 auto;
}

/* Account menu (Log in / Log out) sits inline after "Developed by". */
.layout-footer .footer-second nav,
.layout-footer .footer-second .menu,
.layout-footer .footer-second .menu__item {
  display: inline;
  margin: 0;
  padding: 0;
  list-style: none;
}

.layout-footer .footer-second .menu a {
  text-transform: lowercase;
}

.layout-footer .footer-second > div {
  display: flex;
  gap: 0 0.3em;
  white-space: nowrap;
}

.layout-footer {
  background: url(../../images/mcgill/bkg-footer.png) repeat bottom center;
  min-height: 118px;
  padding: 15px 0;
}

.layout-footer .subfooter:empty,
.layout-footer .subfooter-inner:empty { display: none; }

.layout-footer .footer-inner { align-items: flex-start; }

.layout-footer,
.layout-footer p,
.layout-footer a {
  color: var(--mcgill-footer-text);
}

.layout-footer a { text-decoration: underline; }

.layout-footer .footer-first { width: 700px; }

.layout-footer .footer-second {
  min-width: 220px;
  white-space: nowrap;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0 0.3em;
}

.layout-footer .footer-second .block,
.layout-footer .footer-second .block__inner,
.layout-footer .footer-second .block__content,
.layout-footer .footer-second p {
  display: inline;
  margin: 0;
}

/**
 * Small screens: let the fixed-width layout collapse instead of
 * scrolling sideways.
 ========================================*/

@media (max-width: 980px) {
  :root { --mcgill-width: calc(100vw - 32px); }

  .header { height: auto; padding: 10px 0; }
  .header .site-branding { position: static; }
  /* Right margin compensates for the left margin intrinsic to the site logo */
  .header .site-logo { max-width: 260px; height: auto; margin-right: 40px; }
  .header-inner { flex-wrap: wrap; justify-content: center; }
  .header-second { margin-left: 0; width: 100%; }
  #block-letsgo-main-menu .menu { flex-wrap: wrap; margin: -20px 0 0; justify-content: center; }
  #block-letsgo-main-menu .menu__item a { padding: 8px 10px; font-size: 14px; }

  .main-inner { flex-wrap: wrap; }
  
  .layout-content,
  .layout-sidebar-second {
    width: 100%;
    flex: 1 1 100%;
    padding-right: 0;
  }
  
  .layout-sidebar-second {
    margin-top: 20px;
    margin-right: auto;
    max-width: 400px;
  }

  .layout-footer .footer-first,
  .layout-footer .footer-second { width: 100%; }
  .path-front .field-name-body td { display: block; width: auto !important; }

  .layout-content img { max-width: 100%; height: auto; }
  .node .field-name-field-image,
  .node .field-name-field-img,
  .node--type-staff.node--view-mode-full .field-name-field-photo {
    float: none;
    margin-right: 0;
  }
  .field-label-inline { flex-wrap: wrap; }
}
