/* index.php — builds on site.css, about.css (.tq-facts, .tq-cta) and projects.css */

/* Hero with optional background video */
.tq-home-hero {
  position: relative;
  overflow: hidden;
  min-height: min(78vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 150px;
  background: linear-gradient(135deg, var(--tq-dark) 0%, #3a4049 100%);
  color: #fff;
  text-align: center;
}
.tq-hero-video {
  position: absolute;
  inset: 0;
  pointer-events: none;
  container-type: size;
}
.tq-hero-video iframe {
  /* Cover the section with a 16:9 video, enlarged 1.3x so YouTube's title bar and
     logo fall outside it. Sized and centred with calc() instead of transform:
     a transformed YouTube iframe leaves an uncovered strip on phones. */
  --vw: max(100cqw, calc(100cqh * 16 / 9));
  --w: calc(var(--vw) * 1.3);
  --h: calc(var(--w) * 9 / 16);
  position: absolute;
  width: var(--w);
  height: var(--h);
  left: calc(50% - var(--w) / 2);
  top: calc(50% - var(--h) / 2);
  border: 0;
}
.tq-home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(41, 45, 51, .55) 0%, rgba(41, 45, 51, .78) 100%);
}
.tq-home-hero-content { position: relative; z-index: 1; max-width: 820px; }
.tq-home-hero h1 {
  font: 700 clamp(34px, 6vw, 64px)/1.1 "Montserrat", sans-serif;
  color: #fff;
  margin: 0 0 20px;
  letter-spacing: -.01em;
}
.tq-home-hero p {
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.6;
  color: rgba(255, 255, 255, .85);
  margin: 0 auto 32px;
  max-width: 640px;
}
.tq-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.tq-hero-actions .tq-btn { padding: 15px 28px; font-size: 15px; }
.tq-btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .7); }
.tq-btn-outline:hover { background: #fff; color: var(--tq-dark); border-color: #fff; }

/* Sections */
.tq-home-section { padding: 80px 20px; }
.tq-home-section .tq-section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.tq-home-section .tq-section-head h2 {
  font: 700 clamp(24px, 3.5vw, 32px)/1.2 "Montserrat", sans-serif;
  color: var(--tq-text);
  margin: 0 0 12px;
}
.tq-home-section .tq-section-head p { color: var(--tq-muted); margin: 0; }
.tq-home-alt { background: #fff; }
.tq-home-inner { max-width: 1240px; margin: 0 auto; }
.tq-home-inner .tq-results-head { align-items: flex-end; margin-bottom: 28px; }
.tq-home-inner .tq-results-head h2 { margin-top: 4px; }

/* Main departments: a strip overlapping the bottom of the hero */
.tq-dept-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, .9fr) repeat(4, minmax(0, 1fr));
  max-width: 1200px;
  margin: -90px auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(16, 24, 40, .12);
  overflow: hidden;
}
.tq-dept-strip-head {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 26px;
  background: var(--tq-accent);
  color: #fff;
}
.tq-dept-strip-head h2 {
  font: 700 26px/1.15 "Montserrat", sans-serif;
  color: #fff;
  margin: 0;
}
.tq-dept-strip-head a {
  color: #fff;
  font: 600 14px/1 "Montserrat", sans-serif;
  text-decoration: none;
  opacity: .9;
}
.tq-dept-strip-head a:hover { opacity: 1; text-decoration: underline; }
.tq-dept-strip-head a { white-space: nowrap; }

.tq-dept-item {
  display: flex;
  flex-direction: column;
  padding: 26px 22px;
  text-decoration: none;
  color: inherit;
  border-left: 1px solid #eef0f3;
  transition: background-color .2s ease;
}
.tq-dept-item:hover,
.tq-dept-item:focus-visible { background: var(--tq-bg); outline: none; }
.tq-dept-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--tq-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: transform .25s ease;
}
.tq-dept-item:hover .tq-dept-icon { transform: translateY(-3px); }
.tq-dept-icon img { width: 28px; height: 28px; object-fit: contain; }
.tq-dept-item h3 { font: 700 17px/1.3 "Montserrat", sans-serif; color: var(--tq-text); margin: 0 0 8px; }
.tq-dept-item p { color: var(--tq-muted); font-size: 13px; line-height: 1.55; margin: 0; }

/* Projects: 4 across on the home page */
.tq-project-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }

/* Partners */
.tq-partners {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}
.tq-partners li {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  aspect-ratio: 3 / 2;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .06);
}
.tq-partners a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.tq-partners img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .75;
  transition: filter .3s ease, opacity .3s ease;
}
.tq-partners li:hover img { filter: none; opacity: 1; }

/* Call to action with social icons */
.tq-home-cta { margin-top: 10px; }

@media (max-width: 1024px) {
  .tq-dept-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: -70px 20px 0; }
  .tq-dept-strip-head { grid-column: 1 / -1; flex-direction: row; align-items: center; padding: 20px 24px; }
  .tq-dept-strip-head h2 br { display: none; }
  .tq-dept-item { border-top: 1px solid #eef0f3; }
  .tq-dept-item:nth-child(even) { border-left: 0; }
  .tq-project-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .tq-home-hero { min-height: 0; padding: 72px 20px 110px; }
  .tq-home-section { padding: 56px 16px; }
}
@media (max-width: 600px) {
  /* no enlargement on phones: an oversized YouTube iframe leaves an uncovered strip there */
  .tq-hero-video iframe { --w: calc(var(--vw) + 2px); }
}
@media (max-width: 560px) {
  .tq-dept-strip { grid-template-columns: 1fr; margin: -60px 16px 0; }
  .tq-dept-strip-head { padding: 18px 20px; }
  .tq-dept-strip-head h2 { font-size: 20px; }
  .tq-dept-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
    padding: 16px 20px;
    border-left: 0;
  }
  .tq-dept-icon { grid-row: span 2; width: 44px; height: 44px; margin: 2px 0 0; }
  .tq-dept-icon img { width: 24px; height: 24px; }
  .tq-dept-item h3 { font-size: 16px; margin-bottom: 4px; }
  .tq-project-grid-4 { grid-template-columns: 1fr; }
  .tq-hero-actions .tq-btn { flex: 1 1 100%; }
  .tq-partners { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .tq-hero-video { display: none; }
  .tq-dept-item, .tq-dept-icon, .tq-partners img { transition: none; }
}
