/* GLE-TV TechTime - landing page + watch pages.
   Base rules = the dark "theater" theme (?theme=dark); .tt-light (the default,
   added by _lib.php tt_class()) re-skins it to match the site. Player stays dark. */

.tt {
  --tt-bg: #0e1116;
  --tt-panel: #161b22;
  --tt-line: #262d36;
  --tt-text: #e6edf3;
  --tt-muted: #9aa4b2;
  --tt-accent: #6ccff6;
  --tt-howto: #f5b301;
  --tt-new: #3fb950;
  --tt-sky: #6ccff6;        /* TechTime icon blue: active chips, webinar badge */
  --tt-on-sky: #04121a;
  --tt-on-accent: #04121a;  /* text on solid accent buttons */
  --tt-bar: rgba(14,17,22,.96);
  background: var(--tt-bg);
  color: var(--tt-text);
  padding: 1.25em 1.25em 2em !important;
  border-radius: 8px;
  margin-bottom: 1.5em;
}
.tt a { color: var(--tt-accent); }
.tt a:hover { text-decoration: none; }

/* ---------- hero ---------- */
.tt-hero {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 1.5em;
  align-items: center;
  margin-bottom: 1.25em;
}
.tt-brand img { width: 100%; max-width: 330px; height: auto; border-radius: 6px; display: block; }
.tt-brand p { color: var(--tt-muted); margin: .9em 0 0; line-height: 1.45; font-size: .95em; }
.tt-brand .tt-stats { color: var(--tt-text); font-weight: 700; margin-top: .6em; }
.tt-feature { display: block; position: relative; border-radius: 8px; overflow: hidden; background: #000; }
.tt-feature-img { display: block; position: relative; overflow: hidden; }
.tt-feature img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; opacity: .9; transition: opacity .2s, transform .3s; }
.tt-feature:hover img { opacity: 1; transform: scale(1.02); }
.tt-feature-cap { display: block; padding: .7em .9em .8em; background: var(--tt-panel); color: var(--tt-text); }
.tt-feature-cap small { display: block; color: var(--tt-accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .72em; }
.tt-feature-cap strong { display: block; font-size: 1.05em; line-height: 1.3; margin-top: .2em; }
.tt-feature:hover .tt-feature-cap strong { color: var(--tt-accent); }
.tt-feature .tt-play { width: 72px; height: 72px; margin: -36px 0 0 -36px; opacity: 1; }
.tt-feature .tt-play::after { border-width: 13px 0 13px 22px; }

/* ---------- sticky toolbar (search, type filter, category chips) ---------- */
.tt-bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--tt-bar);
  backdrop-filter: blur(6px);
  margin: 0 -1.25em 1em;
  padding: .7em 1.25em .55em;
  border-bottom: 1px solid var(--tt-line);
}
.tt-bar-row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.tt-search {
  flex: 1 1 220px;
  background: var(--tt-panel); color: var(--tt-text);
  border: 1px solid var(--tt-line); border-radius: 999px;
  padding: .5em 1em; font: inherit; font-size: .95em;
}
.tt-search:focus { outline: 2px solid var(--tt-accent); outline-offset: 1px; }
.tt-seg { display: inline-flex; background: var(--tt-panel); border: 1px solid var(--tt-line); border-radius: 999px; padding: 2px; }
.tt-seg button {
  background: none; border: 0; color: var(--tt-muted); font: inherit; font-size: .85em;
  padding: .38em .9em; border-radius: 999px; cursor: pointer;
}
.tt-seg button[aria-pressed="true"] { background: var(--tt-sky); color: var(--tt-on-sky); font-weight: 700; }
.tt-chips {
  display: flex; gap: .45em; overflow-x: auto; scrollbar-width: thin;
  margin-top: .6em; padding-bottom: .25em; -webkit-overflow-scrolling: touch;
}
.tt-chip {
  flex: 0 0 auto; white-space: nowrap;
  background: var(--tt-panel); color: var(--tt-text) !important;
  border: 1px solid var(--tt-line); border-radius: 999px;
  padding: .3em .8em; font-size: .8em; cursor: pointer;
}
.tt-chip:hover, .tt-chip.is-active { border-color: var(--tt-accent); color: var(--tt-accent) !important; }
.tt-chip .tt-n { color: var(--tt-muted); margin-left: .35em; }

/* ---------- shelves + tiles ---------- */
.tt-shelf { margin: 0 0 1.75em; scroll-margin-top: 130px; }
.tt-shelf[hidden] { display: none; }
.tt-shelf-h { font-size: 1.1em; margin: 0 0 .7em; display: flex; align-items: baseline; gap: .5em; flex-wrap: wrap; }
.tt-shelf-h a { color: var(--tt-text); }
.tt-shelf-h a:hover { color: var(--tt-accent); }
.tt-shelf-h .tt-n { color: var(--tt-muted); font-weight: 400; font-size: .8em; }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1em .9em; }
.tt-tile { display: block; color: var(--tt-text) !important; border-radius: 6px; outline-offset: 3px; }
.tt-tile[hidden] { display: none; }
.tt-thumb { display: block; position: relative; border-radius: 6px; overflow: hidden; background: #000; }
.tt-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; transition: transform .3s ease, opacity .2s; }
.tt-tile:hover .tt-thumb img, .tt-tile:focus-visible .tt-thumb img { transform: scale(1.05); opacity: .8; }
.tt-tile:focus-visible { outline: 2px solid var(--tt-accent); }
.tt-play {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; background: rgba(0,0,0,.6); border: 2px solid #fff;
  opacity: 0; transition: opacity .2s;
}
.tt-play::after {
  content: ""; position: absolute; left: 52%; top: 50%; transform: translate(-40%,-50%);
  border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff;
}
.tt-tile:hover .tt-play, .tt-tile:focus-visible .tt-play { opacity: 1; }
.tt-dur {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(0,0,0,.8); color: #fff; font-size: .72em; font-weight: 700;
  padding: .1em .45em; border-radius: 3px; font-variant-numeric: tabular-nums;
}
.tt-thumb .tt-badge { position: absolute; left: 6px; top: 6px; }
.tt-thumb .tt-badge + .tt-badge { left: auto; right: 6px; }
.tt-badge {
  display: inline-block; font-size: .66em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .2em .5em; border-radius: 3px; line-height: 1.3;
}
.tt-badge-howto { background: var(--tt-howto); color: #1d1500; }
.tt-badge-new { background: var(--tt-new); color: #04170a; }
.tt-badge-webinar { background: var(--tt-sky); color: var(--tt-on-sky); }
.tt-tile-title { display: block; margin-top: .5em; font-size: .88em; line-height: 1.35; }
.tt-tile:hover .tt-tile-title { color: var(--tt-accent); }
.tt-empty { color: var(--tt-muted); text-align: center; padding: 2em 0; }

/* ---------- theater (pop-up player) ---------- */
.tt-modal {
  border: 0; padding: 0; background: transparent;
  /* the theater stays dark in BOTH themes */
  --tt-text: #e6edf3; --tt-muted: #9aa4b2; --tt-panel: #161b22; --tt-line: #262d36;
  --tt-accent: #6ccff6; --tt-sky: #6ccff6; --tt-on-sky: #04121a;
  color: var(--tt-text);
  width: min(1100px, 94vw); max-width: 94vw;
}
.tt-modal::backdrop { background: rgba(0,0,0,.85); }
.tt-modal-box { background: #0e1116; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.tt-modal-body { padding: .9em 1.1em 1.1em; }
.tt-modal-title { font-size: 1.15em; margin: 0 0 .5em; color: #e6edf3; }
.tt-modal-meta { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; font-size: .85em; }
.tt-modal-meta a { color: #6ccff6; }
.tt-close {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,.65); color: #fff; font-size: 22px; line-height: 38px;
}
.tt-close:hover { background: #6ccff6; color: #04121a; }

/* ---------- player frame (modal + watch page) ---------- */
.tt-frame { position: relative; aspect-ratio: 16/9; background: #000; }
.tt-frame iframe, .tt-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tt-frame-missing { display: flex; align-items: center; justify-content: center; color: var(--tt-muted); }

/* ---------- watch page ---------- */
.tt-watch .tt-frame { border-radius: 8px; overflow: hidden; }
.tt-watch-meta { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; margin: 1em 0 .4em; }
.tt-meta-dur { color: var(--tt-muted); font-size: .85em; font-variant-numeric: tabular-nums; }
.tt-desc { color: var(--tt-text); line-height: 1.55; max-width: 75ch; }
.tt-actions { list-style: none; padding: 0; margin: 1em 0 1.75em; display: flex; gap: .6em; flex-wrap: wrap; }
.tt-btn {
  display: inline-block; padding: .55em 1.1em; border-radius: 999px; font-weight: 700; font-size: .9em;
  background: var(--tt-accent); color: var(--tt-on-accent) !important; border: 1px solid var(--tt-accent);
}
.tt-btn:hover { filter: brightness(1.1); }
.tt-btn-ghost { background: transparent; color: var(--tt-accent) !important; }
.tt-more-h { font-size: 1.05em; margin: 0 0 .8em; color: var(--tt-text); }

/* ---------- light theme (DEFAULT; ?theme=dark drops the tt-light class) ----------
   Library on white like the rest of the site; Glenair blue for links and
   headings, TechTime sky blue kept for chips/badges; the theater player stays dark. */
.tt.tt-light {
  --tt-bg: #ffffff;
  --tt-panel: #f3f5f8;
  --tt-line: #dde2e8;
  --tt-text: #1b1b32;
  --tt-muted: #5f6b7a;
  --tt-accent: #2656a7;
  --tt-on-accent: #ffffff;
  --tt-howto: #f5b301;
  --tt-new: #2ea043;
  --tt-bar: rgba(255,255,255,.96);
  border-radius: 0;
  padding-left: 1em !important;
  padding-right: 0 !important;
}
.tt-light .tt-bar { margin-left: -1em; margin-right: 0; padding-left: 1em; padding-right: 0; box-shadow: 0 6px 10px -10px rgba(0,0,0,.25); }
.tt-light .tt-hero { padding: 1em; background: var(--tt-panel); border: 1px solid var(--tt-line); border-radius: 8px; }
.tt-light .tt-feature { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.tt-light .tt-feature-cap { background: #fff; }
.tt-light .tt-chip { background: #fff; }
.tt-light .tt-modal .tt-chip { background: var(--tt-panel); }   /* theater stays dark */
.tt-light .tt-chip.is-active, .tt-light .tt-chip:hover { background: var(--tt-sky); border-color: var(--tt-sky); color: var(--tt-on-sky) !important; }
.tt-light .tt-chip.is-active .tt-n, .tt-light .tt-chip:hover .tt-n { color: var(--tt-on-sky); }
.tt-light .tt-search { background: #fff; }
.tt-light .tt-seg { background: #fff; }
.tt-light .tt-shelf-h a { color: var(--tt-accent); }
.tt-light .tt-thumb { box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.tt-light .tt-tile:hover .tt-thumb img { opacity: 1; }
.tt-light .tt-tile:hover .tt-thumb { box-shadow: 0 6px 16px rgba(0,0,0,.22); }
.tt-light .tt-tile-title { font-weight: 700; }
@media (max-width: 760px) {
  .tt.tt-light { padding-left: .8em !important; padding-right: .8em !important; }
  .tt-light .tt-bar { margin: 0 -.8em 1em; padding: .6em .8em .5em; }
}

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .tt { padding: 1em .8em 1.5em !important; border-radius: 0; }
  .tt-hero { grid-template-columns: 1fr; }
  .tt-brand { display: flex; gap: .9em; align-items: center; }
  .tt-brand img { max-width: 140px; }
  .tt-brand p { margin: 0; font-size: .85em; }
  .tt-bar { margin: 0 -.8em 1em; padding: .6em .8em .5em; }
  .tt-grid { grid-template-columns: repeat(2, 1fr); gap: .8em .6em; }
  .tt-tile-title { font-size: .8em; }
  .tt-modal { width: 100vw; max-width: 100vw; margin: auto 0; }
  .tt-modal-box { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tt * { transition: none !important; }
}
