/* TMG Staff Portal. The look follows the TMG website: white header with the logo, uppercase
   navy menu text, a photo banner that fades to white on the left, a navy band, the Kanit
   typeface and TMG orange as the accent.

   Kanit, by Cadson Demak. Copyright 2020 The Kanit Project Authors
   (https://github.com/cadsondemak/kanit). Licensed under the SIL Open Font License, Version 1.1:
   https://openfontlicense.org. Copied from the TMG website, which serves the same files. */

@font-face {
  font-family: 'Kanit'; font-style: normal; font-weight: 300; font-display: swap;
  src: url(assets/kanit-300-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Kanit'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(assets/kanit-600-latin.woff2) format('woff2');
}

:root {
  --navy: #09163C;
  --orange: #F17C21;
  --orange-dark: #e06b10;
  --text: #09163C;
  --muted: #5a6275;
  --line: #e5e8ee;
  --bg: #f5f7fa;
  --surface: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 16px/1.6 'Kanit', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1110px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.bar { background: var(--surface); box-shadow: 0 1px 0 var(--line); position: sticky; top: 0; z-index: 10; }
.bar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 80px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; min-width: 0; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-name {
  font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--navy); padding-left: 16px; border-left: 1px solid var(--line); white-space: nowrap;
}
.bar-right { display: flex; align-items: center; gap: 20px; }
.who { color: var(--muted); font-size: 14px; }
.link-button {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: 600 13px/1 'Kanit', system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase;
  color: var(--navy);
}
.link-button:hover, .link-button:focus-visible { color: var(--orange); outline: none; }

/* ---------- banner ---------- */
.hero {
  background-color: #eef1f5;
  background-image:
    linear-gradient(90deg, #f3f4f6 0%, #f3f4f6 34%, rgba(243,244,246,.86) 50%, rgba(243,244,246,0) 74%),
    url(assets/team-roundtable.jpg);
  background-size: cover, cover;
  background-position: center, right 30%;
}
.hero-inner { padding: 64px 16px 56px; }
.eyebrow {
  margin: 0 0 8px; font-weight: 600; font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--orange-dark);
}
.hero h1 { margin: 0; font-weight: 600; font-size: 40px; line-height: 1.2; color: var(--navy); max-width: 560px; }
.lede { margin: 12px 0 0; font-size: 19px; color: var(--navy); max-width: 520px; }
.status { margin: 18px 0 0; color: var(--muted); }
.signin-button {
  margin-top: 20px; cursor: pointer;
  font: 600 14px/1 'Kanit', system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase;
  padding: 14px 28px; border-radius: 4px; border: 0;
  background: var(--orange); color: #fff;
}
.signin-button:hover, .signin-button:focus-visible { background: var(--orange-dark); outline: none; }

/* ---------- navy band: one link per section ---------- */
.band { background: var(--navy); }
.band-inner { display: flex; gap: 8px 32px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.band a {
  color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap;
  border-bottom: 2px solid transparent; padding-bottom: 2px;
}
.band a:hover, .band a:focus-visible { border-bottom-color: var(--orange); outline: none; }

/* ---------- sections and tiles ---------- */
.group { padding-top: 40px; scroll-margin-top: 96px; }
.group h2 { margin: 0 0 18px; font-weight: 600; font-size: 22px; color: var(--navy); }
.group h2::after { content: ""; display: block; width: 40px; height: 3px; margin-top: 8px; background: var(--orange); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 44px 20px 20px; min-height: 96px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tile:hover, .tile:focus-visible {
  border-color: var(--orange); box-shadow: 0 8px 24px rgba(9,22,60,.10);
  transform: translateY(-2px); outline: none;
}
.tile-name { font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--navy); }
.tile-desc { font-size: 14px; line-height: 1.45; color: var(--muted); }
.tile-arrow {
  position: absolute; top: 20px; right: 18px; width: 18px; height: 18px;
  color: var(--orange); transition: transform .15s ease;
}
.tile:hover .tile-arrow, .tile:focus-visible .tile-arrow { transform: translate(2px, -2px); }

/* ---------- footer ---------- */
.foot { background: var(--navy); color: #c9cfdb; margin-top: 56px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 28px; }
.foot-logo { height: 24px; width: auto; display: block; }
.foot p { margin: 0; font-size: 14px; }

/* ---------- header menu: Apps and Gallery, in the website's menu style ---------- */
.menu { display: flex; gap: 28px; margin-left: auto; margin-right: 28px; }
.menu a {
  font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--navy); text-decoration: none;
}
.menu a:hover, .menu a:focus-visible, .menu a.active { color: var(--orange); outline: none; }

/* ---------- the home page's gallery section: heading with its "All albums" link ---------- */
.group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.see-all { font-weight: 600; font-size: 14px; color: var(--orange-dark); text-decoration: none; white-space: nowrap; margin-top: 6px; }
.see-all:hover, .see-all:focus-visible { text-decoration: underline; outline: none; }

/* ---------- gallery: albums ---------- */
.albums { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.album {
  display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.album:hover, .album:focus-visible {
  border-color: var(--orange); box-shadow: 0 8px 24px rgba(9,22,60,.10); transform: translateY(-2px); outline: none;
}
.album-cover { display: block; aspect-ratio: 3 / 2; background: #e9ecf1; overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.album:hover .album-cover img { transform: scale(1.03); }
.album-title { padding: 14px 16px 2px; font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--navy); }
.album-meta { padding: 0 16px 16px; font-size: 14px; color: var(--muted); }

/* ---------- gallery: one album ---------- */
.album-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 32px; }
.back, .sp-link { font-weight: 600; font-size: 14px; color: var(--navy); text-decoration: none; }
.sp-link { color: var(--orange-dark); }
.back:hover, .sp-link:hover, .back:focus-visible, .sp-link:focus-visible { text-decoration: underline; outline: none; }
.photos { display: grid; gap: 8px; margin-top: 20px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.photo {
  display: block; padding: 0; border: 0; cursor: zoom-in; background: #e9ecf1;
  aspect-ratio: 1 / 1; overflow: hidden; border-radius: 4px;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease, opacity .2s ease; }
.photo:hover img, .photo:focus-visible img { transform: scale(1.04); }
.photo:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- gallery: the photo viewer ---------- */
.viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(9,22,60,.96);
}
.viewer[open] { display: flex; align-items: center; justify-content: center; }
.viewer::backdrop { background: rgba(9,22,60,.6); }
.viewer img { max-width: calc(100vw - 140px); max-height: calc(100vh - 100px); object-fit: contain; display: block; }
.viewer-close, .viewer-nav {
  position: absolute; background: none; border: 0; color: #fff; cursor: pointer;
  font: 300 44px/1 'Kanit', system-ui, sans-serif; padding: 8px 14px;
}
.viewer-close { top: 12px; right: 16px; font-size: 40px; }
.viewer-prev { left: 8px; top: 50%; transform: translateY(-50%); font-size: 64px; }
.viewer-next { right: 8px; top: 50%; transform: translateY(-50%); font-size: 64px; }
.viewer-close:hover, .viewer-nav:hover, .viewer-close:focus-visible, .viewer-nav:focus-visible { color: var(--orange); outline: none; }
.viewer-count { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; color: #c9cfdb; font-size: 14px; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .bar-inner { min-height: 64px; }
  .brand { gap: 10px; }
  .brand-logo { height: 24px; }
  .brand-name { font-size: 11px; padding-left: 10px; }
  .who { display: none; }
  .hero {
    background-image: linear-gradient(rgba(243,244,246,.9), rgba(243,244,246,.9)), url(assets/team-roundtable.jpg);
    background-position: center, center;
  }
  .hero-inner { padding: 40px 16px 36px; }
  .hero h1 { font-size: 30px; }
  .lede { font-size: 17px; }
  .band-inner { gap: 6px 22px; padding-top: 16px; padding-bottom: 16px; }
  .band a { font-size: 14px; }
  .bar-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .menu { order: 3; width: 100%; margin: 0; gap: 22px; padding-bottom: 4px; }
  .photos { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .viewer img { max-width: 100vw; max-height: calc(100vh - 120px); }
  .viewer-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile, .tile-arrow, .album, .album-cover img, .photo img { transition: none; }
  .tile:hover, .tile:focus-visible, .album:hover, .album:focus-visible { transform: none; }
  .album:hover .album-cover img, .photo:hover img, .photo:focus-visible img { transform: none; }
}
