/* ══════════════════════════════════════════════════════════════
   Knowtecq v19G-AD — temporary campaign layer
   2026 Taiwan Design Expo · FLOW CHECK (Sept 24 – Oct 11, 2026)
   All campaign styles live in this file. style.css is untouched.
   ══════════════════════════════════════════════════════════════ */
:root {
  --kq-bar-h: 40px;
  --kq-pink: #FF00B3;
  --kq-navy: #001B57;
  --kq-surface: 247, 249, 252;
}

/* ── Live dot ─────────────────────────────────────────────────── */
.kq-live { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.kq-live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--kq-pink);
  animation: kqPulse 1.8s ease-in-out infinite;
}
@keyframes kqPulse {
  0%, 100% { opacity: 1;    box-shadow: 0 0 0 0   rgba(255, 0, 179, 0.55); }
  50%      { opacity: 0.55; box-shadow: 0 0 0 6px rgba(255, 0, 179, 0); }
}
.is-ended .kq-live::before { animation: none; background: #9aa5b1; }

/* ── Campaign bar (all pages except home) ─────────────────────── */
body.has-campaign-bar { padding-top: var(--kq-bar-h); }
body.has-campaign-bar .navbar { top: var(--kq-bar-h); }
body.has-campaign-bar .nav-menu.open { top: calc(var(--nav-height) + var(--kq-bar-h)); }
body.has-campaign-bar .service-sticky { top: calc(var(--nav-height) + 24px + var(--kq-bar-h)); }
body.has-campaign-bar .press-sidebar { top: calc(var(--nav-height) + 40px + var(--kq-bar-h)); }

.kq-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1001;
  height: var(--kq-bar-h);
  background: var(--kq-navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 56px;
  font-size: 0.82rem; letter-spacing: 0.3px;
}
.kq-bar[hidden] { display: none; }
.kq-bar-link { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; min-width: 0; }
.kq-bar-link:hover .kq-bar-cta { text-decoration: underline; text-underline-offset: 3px; }
.kq-bar .kq-live { color: #fff; }
.kq-bar-sep  { opacity: 0.35; }
.kq-bar-text { opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kq-bar-cta  { font-weight: 600; white-space: nowrap; }
.kq-bar-short { display: none; }
.kq-bar-close {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: none; cursor: pointer;
  color: rgba(255, 255, 255, 0.6); font-size: 0.95rem; line-height: 1;
}
.kq-bar-close:hover, .kq-bar-close:focus-visible { color: #fff; }

@media (max-width: 900px) {
  .kq-bar { justify-content: flex-start; padding: 0 52px 0 20px; font-size: 0.78rem; }
  .kq-bar-long  { display: none; }
  .kq-bar-short { display: inline; }
}

/* ── Home hero: footer row (stats + campaign card) ────────────── */
.kq-hero-footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 40px;
  border-top: 1px solid var(--border-light);
  padding-top: 32px;
}
.kq-hero-footer .hero-stats { border-top: 0; padding-top: 0; }

/* Soft surface under the footer row so decorative icons recede */
.hero.kq-hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 300px;
  z-index: 0; pointer-events: none;
  background: linear-gradient(to top,
    rgba(var(--kq-surface), 0.92) 0%,
    rgba(var(--kq-surface), 0.75) 45%,
    rgba(var(--kq-surface), 0) 100%);
}

/* Campaign card */
.kq-dock {
  flex: 0 0 auto; width: 620px;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 20px 14px 14px;
  text-decoration: none; color: inherit;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 27, 87, 0.14);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  /* one-time entrance */
  animation: kqEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.8s backwards;
}
@keyframes kqEnter { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.kq-dock:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0, 27, 87, 0.2); }
.kq-dock:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
/* dot starts breathing after the card has landed */
.kq-dock .kq-live::before { animation-delay: 1.6s; }

.kq-dock-img { flex: 0 0 216px; height: 132px; border-radius: 8px; overflow: hidden; }
.kq-dock-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kq-dock-body { flex: 1; min-width: 0; }
.kq-dock-meta { display: flex; align-items: center; gap: 10px; font-size: 0.76rem; margin-bottom: 6px; white-space: nowrap; }
.kq-dock .kq-live { color: var(--kq-pink); letter-spacing: 1px; }
.kq-dock.is-ended .kq-live { color: var(--text-muted); }
.kq-dock-date { color: var(--text-muted); letter-spacing: 0.5px; }
.kq-dock-title { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; line-height: 1.3; color: var(--text-dark); }
.kq-dock-desc  { font-size: 0.86rem; line-height: 1.55; color: var(--text-medium); margin-top: 4px; }
.kq-dock-arrow {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--scarlet); color: var(--scarlet); background: transparent;
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.kq-dock:hover .kq-dock-arrow { background: var(--scarlet); color: #fff; transform: translateX(3px); }

/* Wide screens: keep hero artwork at its 1440 scale (temporary — see backlog) */
@media (min-width: 1500px) {
  .hero.kq-hero .img-hero-bg {
    background-size: 1440px auto; background-position: center center;
    -webkit-mask-image: linear-gradient(to right, transparent calc(50% - 720px), #000 calc(50% - 560px), #000 calc(50% + 520px), transparent calc(50% + 720px));
            mask-image: linear-gradient(to right, transparent calc(50% - 720px), #000 calc(50% - 560px), #000 calc(50% + 520px), transparent calc(50% + 720px));
  }
}
@media (max-width: 1240px) {
  .kq-dock { width: 500px; }
  .kq-dock-img { flex-basis: 160px; height: 100px; }
  .kq-dock-title { font-size: 1.1rem; }
}
@media (max-width: 1024px) {
  .kq-hero-footer { flex-direction: column; gap: 32px; }
  .kq-hero-footer .kq-dock { order: -1; width: 100%; max-width: 620px; }
}
@media (max-width: 768px) {
  .kq-dock { gap: 14px; padding: 10px 14px 10px 10px; }
  .kq-dock-img { flex-basis: 108px; height: 72px; }
  .kq-dock-title { font-size: 0.98rem; }
  .kq-dock-desc { font-size: 0.78rem; }
  .kq-dock-date { display: none; }
  .kq-dock-arrow { width: 32px; height: 32px; }
}

/* Short desktop viewports — keep the card fully visible above the fold.
   Tier A (≤ 880px tall): trim card height only; card top and river stay put.
   Tier B (≤ 820px tall): also tighten the space above the headline, and anchor
   the artwork to the bottom so the card keeps the same spot over the river. */
@media (min-width: 1025px) and (max-height: 880px) {
  .kq-dock { padding-top: 10px; padding-bottom: 10px; }
  .kq-dock-img { height: 112px; }
}
@media (min-width: 1025px) and (max-width: 1240px) and (max-height: 880px) {
  .kq-dock-img { height: 84px; }
}
@media (min-width: 1025px) and (max-height: 820px) {
  .hero.kq-hero { padding-top: calc(var(--nav-height) + 24px); }
  .hero.kq-hero .img-hero-bg { background-position: center bottom; }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .kq-live::before, .kq-dock { animation: none !important; }
  .kq-dock, .kq-dock-arrow { transition: none; }
}
