/* static/manual/css/layout.css */
.layout {
  display: flex;
  min-height: 100vh;
  padding-left: var(--sidebar-width);
}

/* ── Top nav ── */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
}

.topnav__logo {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topnav__logo span {
  color: var(--accent);
}

.topnav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Ad sidebar ── */
.ad-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - 56px);
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}

.ad-slot {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  min-height: 100px;
  max-height: 160px;
  display: flex;
  align-items: stretch;
  flex: 1;
}

.ad-slot--house {
  background: var(--accent-muted);
  border-color: transparent;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  text-align: center;
}

.ad-slot--house img {
  max-width: 80%;
  height: auto;
  object-fit: contain;
}

.ad-slot--house p {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

/* ── Main content ── */
.main-content {
  margin-top: 56px;
  flex: 1;
  padding: 2rem 2rem 4rem;
  min-height: calc(100vh - 56px);
  min-width: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    padding-left: 0;
  }

  .ad-sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-top: 1px solid var(--border);
    order: 10;
    padding: 1rem;
  }

  .ad-slot {
    flex: 1 1 calc(50% - 0.375rem);
    min-height: 90px;
  }

  .main-content {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .ad-slot {
    flex: 1 1 100%;
  }

  .main-content {
    padding: 1rem;
  }
}

/* ── Topnav links ── */
.topnav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.topnav__link {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  font-weight: 500;
}

.topnav__link:hover {
  color: var(--text);
  background: var(--bg);
}

.topnav__link--active {
  color: var(--text);
  background: var(--bg);
}

.topnav__username {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.topnav__pro {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}

.topnav__upgrade {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.3rem 0.75rem;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.topnav__upgrade:hover {
  background: var(--accent);
  color: white;
}

@media (max-width: 768px) {
  .topnav__links {
    display: none;
  }

  .topnav__username {
    display: none;
  }
}