/* Creative Hub — /creatives */

:root {
  --hub-accent: #ea580c;
  --hub-accent-strong: #d9532c;
  --hub-text: #111827;
  --hub-muted: #6b7280;
  --hub-line: #eceef1;
  --hub-panel: #ffffff;
  --hub-bg: #faf8f6;
  --hub-soft: #fbf1ea;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", 'Poppins Fallback', sans-serif;
}

body {
  background: var(--hub-bg);
  color: var(--hub-text);
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hub-wrapper {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 60px 0 56px;
}

.hub {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

/* Side panels */

.hub-panel {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 22px 20px;
  border: 1px solid var(--hub-line);
  border-radius: 6px;
  background: var(--hub-panel);
  scrollbar-width: thin;
}

.hub-panel-title {
  margin-bottom: 22px;
  color: var(--hub-text);
  font-size: 1.15rem;
  font-weight: 500;
}

/* Category accordion */

.hub-cat-toggle {
  display: none;
}

.hub-cat-list {
  display: grid;
  gap: 2px;
}

.hub-cat-group {
  margin: 14px 10px 4px;
  color: #9ca3af;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.hub-cat-group:first-child {
  margin-top: 0;
}

.hub-detail-value strong {
  color: var(--hub-text);
  font-weight: 500;
}

.hub-cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--hub-text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hub-cat-btn:hover {
  background: #f7f7f8;
}

.hub-cat-btn > .fa-solid:first-child {
  width: 20px;
  flex: 0 0 auto;
  color: #374151;
  text-align: center;
}

.hub-cat-name {
  flex: 1 1 auto;
}

.hub-cat-count,
.hub-cat-soon {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 500;
}

.hub-cat-count {
  background: #f3f4f6;
  color: var(--hub-muted);
}

.hub-cat-soon {
  background: var(--hub-soft);
  color: var(--hub-accent);
}

.hub-cat-chevron {
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 0.78rem;
  transition: transform 0.25s ease;
}

.hub-cat.is-open .hub-cat-chevron {
  transform: rotate(180deg);
}

.hub-cat-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.hub-cat.is-open .hub-cat-items {
  grid-template-rows: 1fr;
}

.hub-cat-items-inner {
  display: grid;
  gap: 4px;
  overflow: hidden;
  padding-left: 10px;
}

.hub-cat.is-open .hub-cat-items-inner {
  padding-top: 4px;
  padding-bottom: 8px;
}

.hub-creative-btn {
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.hub-creative-btn:hover {
  background: var(--hub-soft);
}

.hub-creative-btn.is-active {
  background: var(--hub-accent-strong);
  color: #fff;
  box-shadow: 0 8px 18px rgba(217, 83, 44, 0.25);
}

.hub-creative-btn small {
  display: block;
  margin-top: 1px;
  opacity: 0.7;
  font-size: 0.72rem;
}

.hub-cat-empty {
  padding: 8px 16px;
  color: var(--hub-muted);
  font-size: 0.8rem;
}

/* Preview */

.hub-preview {
  min-width: 0;
}

.hub-titlebar {
  width: min(560px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 28px;
  padding: 16px 20px;
  border-radius: 10px;
  background: #f3f3f3;
}

.hub-titlebar strong {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-titlebar i {
  color: var(--hub-accent);
  font-size: 1.2rem;
}

.hub-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 5vw, 72px);
}

.hub-arrow {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b7280;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.hub-arrow:hover {
  background: #fff;
  color: var(--hub-accent);
}

/* Phone mockup */

.hub-phone {
  flex: 0 1 auto;
  width: 330px;
  max-width: 100%;
  padding: 10px;
  border-radius: 38px;
  background: #eef0f3;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.10);
}

.hub-phone-screen {
  position: relative;
  height: 660px;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 28px;
  background: #fff;
  scrollbar-width: none;
}

.hub-phone-screen::-webkit-scrollbar {
  display: none;
}

.pub-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.pub-logo {
  display: block;
  height: 30px;
  width: auto;
}

.pub-article {
  padding: 14px 10px 4px;
}

.pub-article h3 {
  margin-bottom: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
}

.pub-article p {
  margin-bottom: 12px;
  color: #4b5563;
  font-size: 0.7rem;
  line-height: 1.75;
}

.pub-slot {
  display: none;
  justify-content: center;
  padding: 6px 0;
}

.pub-slot.has-ad {
  display: flex;
}

.pub-slot-top.has-ad {
  padding-top: 10px;
}

.pub-ad {
  position: relative;
  overflow: hidden;
  transition: height 0.35s ease;
}

.pub-ad iframe {
  display: block;
  border: 0;
  background: transparent;
  transform-origin: left top;
  transition: height 0.35s ease;
}

/* Details */

.hub-detail {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  min-width: 0;
}

.hub-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hub-detail-label {
  color: var(--hub-text);
  font-size: 0.92rem;
  font-weight: 500;
}

.hub-detail-value {
  color: var(--hub-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.hub-detail-value a {
  color: var(--hub-accent);
  font-weight: 500;
  text-decoration: none;
}

.hub-detail-value a:hover {
  text-decoration: underline;
}

.hub-link {
  color: #1d4ed8;
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.hub-link:hover {
  text-decoration: underline;
}

.hub-copy-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #374151;
  font-size: 1rem;
  cursor: pointer;
}

.hub-copy-btn:hover {
  color: var(--hub-accent);
}

.hub-copy-btn.is-copied {
  color: #15803d;
}

.hub-qr-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 20px;
  padding: 14px;
  border-radius: 8px;
  background: var(--hub-soft);
}

.hub-qr {
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 4px;
  background: #fff;
}

.hub-qr img,
.hub-qr canvas {
  display: block;
  width: 120px !important;
  height: 120px !important;
}

.hub-qr-card p {
  color: var(--hub-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.hub-cta {
  margin-bottom: 0;
  padding-top: 16px;
  border-top: 1px solid var(--hub-line);
}

.hub-cta a {
  color: #c2410c;
}

/* Responsive */

@media (max-width: 1200px) {
  .hub {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .hub-details {
    position: static;
    grid-column: 1 / -1;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .hub-details .hub-panel-title,
  .hub-details .hub-cta {
    grid-column: 1 / -1;
  }

  .hub-qr-card {
    grid-row: 2 / span 3;
    grid-column: 2;
    align-self: start;
    margin-top: 0;
  }
}

@media (max-width: 860px) {
  .hub-wrapper {
    width: calc(100% - 32px);
    padding-top: 40px;
  }

  .hub {
    grid-template-columns: minmax(0, 1fr);
  }

  .hub-panel {
    position: static;
    max-height: none;
  }

  .hub-categories {
    padding: 14px;
  }

  .hub-categories .hub-panel-title {
    display: none;
  }

  .hub-cat-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--hub-line);
    border-radius: 6px;
    background: #fff;
    color: var(--hub-text);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
  }

  .hub-cat-toggle i {
    transition: transform 0.25s ease;
  }

  .hub-categories.is-open .hub-cat-toggle i {
    transform: rotate(180deg);
  }

  .hub-categories:not(.is-open) .hub-cat-list {
    display: none;
  }

  .hub-categories.is-open .hub-cat-list {
    margin-top: 10px;
  }

  .hub-titlebar {
    margin-bottom: 18px;
  }

  .hub-stage {
    gap: 4px;
  }

  .hub-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }

  .hub-details {
    display: block;
  }

  /* Already on a phone: the QR adds nothing, the link opens directly. */
  .hub-qr-card {
    display: none;
  }
}

@media (max-width: 420px) {
  .hub-wrapper {
    width: calc(100% - 20px);
  }

  .hub-arrow {
    display: none;
  }

  .hub-phone-screen {
    height: 600px;
  }
}
