/*
* Site CSS for Howard Ho's Website
* Shared components used by the home page and every subpage, so that the
* subpages match the look of the home page.
* Loaded after main.css and responsive.css.
*/

/* ==========================================================================
   0. Scrolling
   The browser does the smooth scrolling now; js/smoothscroll.js used to, and
   it swallowed the Home key doing it. scroll-padding-top keeps an anchored
   section clear of the fixed navbar - 60px reproduces the offset the old
   jQuery handler in js/scrolling-nav.js applied by hand.
   ========================================================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

/* Honour the "reduce motion" accessibility setting: jump instead of gliding. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   1. Inner page hero
   Subpages reuse #hero-area from main.css but need a shorter banner, since
   they have no full-height landing content.
   ========================================================================== */
.inner-hero .contents {
  padding: 190px 0 90px;
}

.inner-hero .contents h1 {
  margin-bottom: 15px;
}

.inner-hero .contents .hero-subtitle {
  max-width: 780px;
  margin: 0 auto;
}

.inner-hero .breadcrumb-links {
  margin-top: 25px;
  list-style: none;
  padding: 0;
}

.inner-hero .breadcrumb-links li {
  display: inline-block;
  margin: 0 6px 8px;
}

.inner-hero .breadcrumb-links li a {
  display: inline-block;
  padding: 7px 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 30px;
  color: #fff;
  font-size: 13px;
}

.inner-hero .breadcrumb-links li a:hover {
  background: #fff;
  color: #2E9F81;
}

@media (max-width: 767px) {
  .inner-hero .contents {
    padding: 130px 0 60px;
  }
}

/* ==========================================================================
   2. Content blocks
   A titled block of prose, lists or images inside a .section.
   ========================================================================== */
.content-block {
  margin-bottom: 50px;
}

.content-block:last-child {
  margin-bottom: 0;
}

.content-block h3 {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.content-block h4 {
  font-size: 17px;
  font-weight: 700;
  color: #333;
  margin: 25px 0 10px;
}

.content-block .block-line {
  width: 50px;
  border-top: 2px solid #2E9F81;
  margin: 0 0 20px;
}

.content-block p {
  color: #333;
}

.content-block .note {
  padding: 15px 20px;
  background: #f8f9fa;
  border-left: 3px solid #2E9F81;
  border-radius: 0 4px 4px 0;
  margin-bottom: 25px;
}

.content-block .note p:last-child {
  margin-bottom: 0;
}

.content-block .caption {
  color: #666;
  font-style: italic;
  margin-bottom: 25px;
}

.content-block ul.link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.content-block ul.link-list li {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.content-block ul.link-list li:last-child {
  border-bottom: none;
}

.content-block ul.link-list li a {
  font-weight: 700;
  color: #333;
}

.content-block ul.link-list li a:hover {
  color: #2E9F81;
}

.content-block ul.link-list li span {
  display: block;
  color: #666;
  font-size: 13px;
  margin-top: 4px;
}

/* ==========================================================================
   3. Bulleted lists
   ul/li are reset to zero padding in main.css, so anything that wants real
   bullets has to ask for them back.
   ========================================================================== */
.item-boxes ul,
.content-block ul.bullets {
  list-style: disc outside;
  padding-left: 20px;
  margin-bottom: 15px;
}

.item-boxes ul li,
.content-block ul.bullets li {
  margin-bottom: 10px;
  line-height: 26px;
}

/* ==========================================================================
   4. Experience / role list
   Job and project entries: a heading line, a date line, then sub-bullets.
   ========================================================================== */
.role-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.role-list > li {
  position: relative;
  padding: 0 0 5px 25px;
  margin-bottom: 35px;
  border-left: 2px solid #e6e9ec;
}

.role-list > li:last-child {
  margin-bottom: 0;
}

.role-list > li:before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2E9F81;
}

.role-list .role-title {
  font-size: 17px;
  font-weight: 700;
  color: #333;
  margin: 0 0 2px;
  line-height: 24px;
}

.role-list .role-org {
  color: #1F7A63;
}

.role-list .role-meta {
  font-size: 13px;
  color: #666;
  margin: 0 0 10px;
}

.role-list .role-summary {
  margin-bottom: 10px;
}

.role-list ul {
  list-style: disc outside;
  padding-left: 20px;
  margin: 0;
}

.role-list ul li {
  margin-bottom: 8px;
  line-height: 26px;
}

.role-list ul li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   5. Image galleries
   Uniform thumbnails that open in a lightbox. object-fit: contain keeps
   portrait and landscape shots un-cropped inside the same size tile.
   ========================================================================== */
.gallery {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.gallery .gallery-item {
  margin: 0 15px 15px 0;
}

.gallery .gallery-item a {
  display: block;
  width: 220px;
  height: 165px;
  padding: 7px;
  background: #fff;
  border: 1px solid #e6e9ec;
  border-radius: 6px;
  -webkit-transition: all 0.2s linear;
  -moz-transition: all 0.2s linear;
  transition: all 0.2s linear;
}

.gallery .gallery-item a:hover {
  border-color: #2E9F81;
  box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.12);
  -webkit-transform: translateY(-3px);
  transform: translateY(-3px);
}

.gallery .gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 767px) {
  .gallery .gallery-item {
    margin: 0 10px 10px 0;
  }
  .gallery .gallery-item a {
    width: 140px;
    height: 110px;
    padding: 5px;
  }
}

/* Single feature image, e.g. the portrait on the home page. */
.feature-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* ==========================================================================
   6. Data table
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}

.table-modern {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.table-modern th {
  background: #2E9F81;
  color: #fff;
  text-align: left;
  padding: 12px 15px;
  font-weight: 700;
  white-space: nowrap;
}

.table-modern td {
  padding: 12px 15px;
  border-bottom: 1px solid #e6e9ec;
  line-height: 22px;
  vertical-align: top;
}

.table-modern tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.table-modern tbody tr:hover {
  background: #eef7f4;
}

.table-filter {
  margin-bottom: 20px;
}

.table-filter input {
  width: 100%;
  max-width: 420px;
  padding: 10px 15px;
  border: 1px solid #e6e9ec;
  border-radius: 30px;
  font-size: 14px;
  color: #333;
}

.table-filter input:focus {
  outline: none;
  border-color: #2E9F81;
}

.table-filter .filter-count {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: #666;
}

/* ==========================================================================
   7. Error page
   ========================================================================== */
.error-code {
  font-size: 90px;
  line-height: 1;
  font-weight: 700;
  color: #2E9F81;
  margin-bottom: 10px;
}

@media (max-width: 767px) {
  .error-code {
    font-size: 60px;
  }
}

/* ==========================================================================
   8. Footer
   The copyright line is the only footer content, so let it use the full row
   instead of floating right against nothing.
   ========================================================================== */
footer .copyright {
  float: none;
  text-align: center;
}

footer .copyright p {
  margin-bottom: 5px;
}

footer .copyright .site-version {
  font-size: 12px;
  color: #9aa1a8;
}

/* ==========================================================================
   9. Contrast
   The brand green (#2E9F81) only reaches 3.3:1 against white, so anywhere it
   carries text it is darkened to #238067 (4.8:1). It is still used as-is for
   rules, dots and borders, which carry no text.
   ========================================================================== */
a {
  color: #1F7A63;
}

.btn-common {
  background: #238067;
  border-color: #238067;
}

.btn-common:hover {
  background: #2E9F81;
  border-color: #2E9F81;
}

.navbar .nav-link.active {
  background: #238067;
}

/* The mobile (SlickNav) menu marks the current section too, and unlike a hover
   that highlight is on screen the whole time the visitor is on the page, so it
   has to clear AA rather than lean on the brand green. */
.slicknav_nav .active,
.slicknav_nav .active a {
  background: #238067;
  color: #fff;
}

.table-modern th {
  background: #238067;
}

/* ==========================================================================
   10. Dark mode
   Follows the operating system via prefers-color-scheme. Only the light
   surfaces are overridden - the photographic banners and the footer are dark
   already, so they are left alone.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }

  body {
    background: #14181d;
    color: #c7cdd4;
  }

  p,
  .content-block p,
  .section-header .section-subtitle {
    color: #c7cdd4;
  }

  h1, h2, h3, h4, h5,
  .content-block h3,
  .content-block h4,
  .item-boxes h4,
  .role-list .role-title,
  .section-header .section-title,
  .content-block ul.link-list li a {
    color: #eef1f4;
  }

  a {
    color: #4ecfab;
  }

  a:hover,
  a:focus,
  .content-block ul.link-list li a:hover {
    color: #6fe0c1;
  }

  .role-list .role-org {
    color: #4ecfab;
  }

  /* Muted text: 5.9:1 on the page background. */
  .content-block .caption,
  .content-block ul.link-list li span,
  .role-list .role-meta,
  .table-filter .filter-count,
  footer .copyright .site-version {
    color: #98a1aa;
  }

  /* Elevated surfaces */
  .content-block .note,
  .gallery .gallery-item a {
    background: #1c2128;
  }

  .gallery .gallery-item a {
    border-color: #2b323b;
  }

  .content-block ul.link-list li,
  .table-modern td {
    border-bottom-color: #2b323b;
  }

  .role-list > li {
    border-left-color: #2b323b;
  }

  .item-boxes .icon {
    border-color: #2b323b;
  }

  .table-modern tbody tr:nth-child(even) {
    background: #1a1f25;
  }

  .table-modern tbody tr:hover {
    background: #223029;
  }

  .table-filter input {
    background: #1c2128;
    border-color: #2b323b;
    color: #eef1f4;
  }

  .table-filter input::placeholder {
    color: #98a1aa;
  }

  /* Sticky navbar once it gains a solid background on scroll. */
  .top-nav-collapse {
    background: #14181d !important;
    box-shadow: 0px 3px 6px 3px rgba(0, 0, 0, 0.35);
  }

  .top-nav-collapse .navbar-nav .nav-link {
    color: #c7cdd4 !important;
  }

  .top-nav-collapse .navbar-nav .nav-link:hover {
    color: #4ecfab !important;
  }

  /* Mobile (SlickNav) menu */
  .slicknav_menu ul {
    background: #1c2128;
  }

  .slicknav_nav a {
    color: #c7cdd4;
  }

  .slicknav_nav a:hover,
  .slicknav_nav .active {
    color: #4ecfab;
    background: #232932;
  }

  footer {
    background: #0f1216;
  }
}
